Location: PHPKode > projects > JBB Board > jbb/backend2.php
<?php
include("mysqlvar.php");
if(!($db = mysql_connect($dbserver,$dbuser,$dbpass))) { die("Sorry keine DB Verbindung !"); }
if (!isset($zeit)) { $zeit = time()-24*60*60; }
$datum = date ("Y-m-d",$zeit);
$uhrzeit = date ("H:i:s",$zeit);
mysql_select_db($dbname,$db);
echo"<jbb \"Joel's Bulletin Board\">\n".
	"title \"".$boardname."\"\n";
	echo "time ".time()."\n";
	echo"model \"$backendtyp\"\n";
	echo"interval $backendinterval\n";
	
if ($backendtyp == "mini")
	{	
		if ($datum == date("Y-m-d"))
			{
				$query= "SELECT topics.hits, topics.tid, topics.topicname, foren.forenname, kategorie.katname, user.pseudonym FROM topicbeitraege, topics, foren, kategorie, user WHERE user.erstellerid = topics.erstellerid AND foren.kategorie = kategorie.kategorie AND foren.fid = topics.fid AND topics.tid = topicbeitraege.tid AND (topicbeitraege.datum = \"".$datum."\" AND topicbeitraege.uhrzeit >= \"".$uhrzeit."\") GROUP BY topics.tid ORDER BY datum DESC, uhrzeit DESC";			
				
			}
		else
			{
				$query= "SELECT topics.hits, user.pseudonym, topics.tid, topics.topicname, foren.forenname, kategorie.katname FROM topicbeitraege, topics, foren, kategorie, user WHERE user.erstellerid = topics.erstellerid AND foren.kategorie = kategorie.kategorie AND foren.fid = topics.fid AND topics.tid = topicbeitraege.tid AND ((topicbeitraege.datum = \"".$datum."\" AND topicbeitraege.uhrzeit >= \"".$uhrzeit."\") OR (topicbeitraege.datum > \"".$datum."\")) GROUP BY topics.tid ORDER BY datum DESC, uhrzeit DESC";			
						
			}		
		$result = mysql_query($query,$db);
		while($zeileholen = mysql_fetch_array($result,MYSQL_ASSOC))
 			{
 				echo "<category \"".$zeileholen["katname"]."\">\n";
				echo "<forum \"".$zeileholen["forenname"]."\">\n";
				echo "<topic \"".$zeileholen["topicname"]."\" \"".$zeileholen["tid"]."\">\n";
				echo "Ersteller : ".$zeileholen["pseudonym"]."\n";
				echo "Hits : ".$zeileholen["hits"]."\n";
				$aktquery = "SELECT user.pseudonym, topicbeitraege.datum, topicbeitraege.uhrzeit FROM user, topicbeitraege WHERE user.erstellerid = topicbeitraege.erstellerid AND topicbeitraege.tid = ".$zeileholen["tid"]." ORDER BY datum DESC, uhrzeit DESC";
				$aktresult = mysql_query($aktquery,$db);
				$zeileaktuell = mysql_fetch_array($aktresult,MYSQL_ASSOC);
				echo "Last : ".$zeileaktuell["pseudonym"]."\n";
				echo "Datum : ".$zeileaktuell["datum"]." ".$zeileaktuell["uhrzeit"]."\n";
				echo "</topic>\n";
				echo "</forum>\n";
				echo "</category>\n";
 			}
 		mysql_close($db);
	}
echo "</jbb>\n";
?>
Return current item: JBB Board