1
|
<?include('admin/config.php');include("skins/$skin/header.php");include("language/$language");?><table width="586" border="0" cellspacing="3" cellpadding="0"> <tr> <td width="379" valign="top"><table width="100%" border="0" cellspacing="3" cellpadding="0"> <tr> <td width="96%" valign="top"> <?/* Written by Gerben Schmidt, http://scripts.zomp.nl */include("topmenu.php");?> <script language="javascript" type="text/javascript">function OpenLarge (c) { window.open(c, 'large', 'width=500,height=370,scrollbars=yes,status=yes');}</script> <!-- startprint --><?echo "<div class='zomplog'>";// this part is for the next/previous links to be generated dynamically$limit = $max; // How many results should be shown at a time// Get the total number of rows in Zomplog databaseif($_GET[catid]){$query1 = mysql_query ("SELECT * FROM $table WHERE catid = $_GET[catid]");}elseif($_GET[userid]){$query1 = mysql_query ("SELECT * FROM $table WHERE userid = $_GET[userid]");}else{$query1 = mysql_query ("SELECT * FROM $table");}$numrows = mysql_num_rows ($query1);if (!isset ($_GET[show])) { $display = 1;} else { $display = $_GET[show];}$start = (($display * $limit) - $limit);if($_GET[catid]){$query2 = mysql_query ("SELECT * FROM $table WHERE catid = $_GET[catid] ORDER BY id DESC LIMIT $start,$limit");}elseif($_GET[userid]){$query2 = mysql_query ("SELECT * FROM $table WHERE userid = $_GET[userid] ORDER BY id DESC LIMIT $start,$limit");}else{$query2 = mysql_query ("SELECT * FROM $table ORDER BY id DESC LIMIT $start,$limit");}while ($myrow = mysql_fetch_array ($query2)) {$title = $myrow['title'];$text = $myrow['text'];$extended = $myrow['extended'];$file = $myrow['image'];$date = $myrow['date'];$username = $myrow['username'];$userid = $myrow['userid'];$id = $myrow['id'];echo "<div class='title'>$title</div><br />";?> <table width='100%' border='0' cellspacing='0'> <tr> <td> <?if($file){echo "<table width='130' border='0' align='left' cellspacing='0'><tr><td width='83' height='63'><a href='image.php?file=$file'onclick='OpenLarge(this.href); return false'><img src='upload/thumbnail.php?gd=2&src=$file&maxw=130'></a></td><td width='13'> </td></tr></table>";}else{echo " ";}echo "<div class='zomplog'>";echo nl2br($text);if($extended){echo " <a href='detail.php?id=$id'>$lang_readmore</a>";}echo "<br /><br />";$query = mysql_query("SELECT * FROM $table_users WHERE id = $userid"); while ($row = mysql_fetch_array ($query)) {$admin = $row['permissions'];$username = $row['login'];}echo "Posted by: <a href='get.php?userid=$userid'>$username</a> on $date";if(!$use_comments){echo "";}else{$query3 = mysql_query ("SELECT ID FROM $table_comments WHERE entry_id = '$id'");$numcomments = mysql_num_rows ($query3);echo " | <a href='detail.php?id=$id#comments'>$numcomments comments</a><br /><br />";}?> </td> </tr> </table> <?echo "<br />";}?><!-- stopprint --><?$paging = ceil ($numrows / $limit);if ($display > 1) { $previous = $display - 1; echo "<a href=\"$_SERVER[PHP_SELF]?catid=$_GET[catid]&userid=$_GET[userid]&show=1\"><< First</a> | "; echo "<a href=\"$_SERVER[PHP_SELF]?catid=$_GET[catid]&userid=$_GET[userid]&show=$previous\">< Previous</a> | ";}if ($numrows != $limit) { if ($paging > $scroll) { $first = $_GET[show]; $last = ($scroll - 1) + $_GET[show]; } else { $first = 1; $last = $paging; } if ($last > $paging ) { $first = $paging - ($scroll - 1); $last = $paging; } for ($i = $first;$i <= $last;$i++){ if ($display == $i) { echo "<b>$i</b> "; } else { echo "<a href=\"$_SERVER[PHP_SELF]?catid=$_GET[catid]&userid=$_GET[userid]&show=$i\">$i</a> "; } }}if ($display < $paging) { $next = $display + 1; echo "| <a href=\"$_SERVER[PHP_SELF]?catid=$_GET[catid]&userid=$_GET[userid]&show=$next\">Next ></a>";}echo "</div>";?> </td> </tr> </table></td> <td width="19"> </td> <td width="174" valign="top"><?php include("menu.php"); ?></td> </tr> </table> <?include("skins/$skin/footer.php");?>
|