STOP; $idx++; if ($idx > $half-1) { $idx = 0; $ab++; } } print "
Legend of the Red Dragon - Town Square
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The marketplace has many outlets. Which way do you go from here?

Current Versions
Lord 4.07 Lord2 1.02 Planets: TEOS 2.01b

Return to Downloads Main || Return to Lord Main

$query"); $rows = mysql_num_rows($res); $half = intval($rows / 2) + 1; if (($rows % 2) > ($half+$half)) { $half++; } $html = array(); $idx = 0; $ab = 0; while (list($id,$name) = mysql_fetch_row($res)) { $query = "Select count(*) from files where cid=$id"; $res2 = mysql_query($query); list($count) = mysql_fetch_row($res2); mysql_free_result($res2); if (! isset($html[$idx])) { $html[$idx] = array(); } $html[$idx][$ab] = <<$name $count files
\n"; for ($count=0; $count < count($html); $count++) { print "\n"; for ($i=0; $i < count($html[$count]); $i++) { print $html[$count][$i]; if ($i < count($html[$count])-1) { print ""; } } print "\n"; } print "
 
"; } function list_files () { $num_per_page = 20; $catid = intval($_REQUEST['cat']); $start = 0; if (isset($_REQUEST['s'])) { $start = intval($_REQUEST['s']); } $where = ""; $text = ""; if (isset($_REQUEST['text'])) { $_REQUEST['text'] = str_replace('%','\%',$_REQUEST['text']); $text = $_REQUEST['text']; $a = explode(' ',$_REQUEST['text']); foreach ($a as $term) { $where .= " and descr like '%$term%'"; } } $query = "select count(*) from files where cid=$catid $where"; $res = mysql_query($query); $row = mysql_fetch_row($res); mysql_free_result($res); $totalcount = $row[0]; $next = ''; if ($start + $num_per_page < $totalcount) { $nextstart = $start + $num_per_page; $next = "Next Page"; } $prev = ''; if ($start > 0) { $prevstart = $start - $num_per_page; if ($prevstart < 1) { $prevstart = 0; } $prev = "Previous Page"; } $pages = ''; $count = intval($totalcount / $num_per_page); if ($totalcount % $num_per_page > 0) { $count++; } $c = 0; for ($i=0; $i < $count; $i++) { $pages .= "\n"; $c += $num_per_page; } $navigation = << $next $prev>
Jump to page:
Search descr for:
STOP; print $navigation; $query = "select id,filename,descr,filesize,downcount from files where cid=$catid $where order by filename limit $start, $num_per_page"; $res = mysql_query($query); while ($row = mysql_fetch_row($res)) { $id = $row[0]; $fn = $row[1]; $descr = $row[2]; $fs = $row[3]; $dcount = $row[4]; $descr = str_replace("\n","\n
",$descr); print <<
$fn
Size: $fs
Downloads: $dcount
$descr

STOP; } mysql_free_result($res); print $navigation; } if (! isset($_REQUEST['cat'])) { list_cats(); } elseif (isset($_REQUEST['cat'])) { list_files(); } mysql_close(); ?> Your command, ? _ -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-