In my file is error.
The list 5-th last added sites www is show in wrong order.
If i add more than 5 url, than i can't see next url's(unless, in $num_new_sites=5; i enlarge number for something else).
I paste here my function, if everything is all right, then i please someone, to send me two files(php.directory.inc & dir_manager.php) on my mail mailto:
[email protected] in subject please write"WROX",cause i may mistake it with spam.
function list_sites($mode='top', $category_id='') {
global $directory_tablename, $root_category_id, $PHP_SELF, $num_top_sites, $num_new_sites;
if(!$link_id) $link_id = db_connect($default_dbname);
if($mode=='top') {
$order_by_str = 'ORDER BY hit DESC';
$limit_str = "LIMIT $num_top_sites";
}
else {
$order_by_str = 'ORDER BY registerdate DESC';
$limit_str = "LIMIT $num_new_sites";
}
if($category_id == $root_category_id) $category_str = '1';
else $category_str = "category_id LIKE '$category_id%'";
$query = "SELECT url_id, title, url FROM $directory_tablename WHERE $category_str AND approved = 1 $order_by_str $limit_str";
$result = mysql_query($query);
if(!$result) echo sql_error();
if(mysql_num_rows($result) > 0) {
if($mode=='top') echo "<STRONG>$num_top_sites NAJLEPSZYCH!</STRONG><BR>";
else if($mode=='new') echo "<STRONG>$num_new_sites NOWYCH!</STRONG><BR>";
}
$i = 1;
while($query_data = mysql_fetch_array($result)) {
$url_id = $query_data["url_id"];
$url = "http://" . $query_data["url"];
$title = $query_data["title"];
echo "<STRONG> - <A HREF=\"$PHP_SELF?action=go_url&url=$url&url_id=$ur l_id\">$i. $title</A></STRONG><BR>\n";
$i++;
}
}