Ik zou graag in de standaard downloads.php een knop hebben waarmee de downloads op naam, datum en hits te sorteren zijn. Ik heb hier een begin in gemaakt maar ben vast gelopen. Ik heb op www.phpfusion-mods.com hulp gevraagd en op phpfusion-mods.net, hier ben ik alleen niets mee op geschoten doordat er gewoon niemand reageert. Ik hoop dat ik hier wel geholpen wordt.
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: downloads.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or >
".$locale['401']."
".$locale['402']."
\n\n";
echo "\n\n";
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) { echo "
\n\n"; }
$num = dbcount("(download_cat)", DB_DOWNLOADS, "download_cat='".$data['download_cat_id']."'");
echo " ".$data['download_cat_name']." ($num)";
if ($data['download_cat_description'] != "") { echo " \n".$data['download_cat_description'].""; }
echo " | \n" ;
$counter++;
}
echo "
\nRSS 
\n";
} else {
echo "
\n".$locale['430']."
\n
\n";
}
closetable();
} else {
$res = 0;
$result = dbquery("SELECT * FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_id='".$_GET['cat_id']."'");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['download_cat_access'])) {
$res = 1;
add_to_title($locale['global_201'].$cdata['download_cat_name']);
[color=#ff0033] echo "\n";
if ($cat_id > 0) { $where = " WHERE download_cat='".$cat_id."'";} else { $where = "";}
if ($type_id == 2) { $order = " download_count DESC";}
elseif ($type_id == 3) { $order = " download_datestamp DESC";}
else { $order = " download_title ASC";}
opentable($locale['400'].": ".$cdata['download_cat_name']);
echo" ";
$rows = dbcount("(*)", DB_DOWNLOADS, "download_cat='".$_GET['cat_id']."'");
if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
if ($rows != 0) {
if ($cat_id > 0) { $where2 = " AND download_cat ='".$cat_id."'";} else { $where2 = "";}
$myquery =" SELECT tu.*, tn.*, download_cat_id, download_cat_name FROM ".$db_prefix."download_cats tn
LEFT JOIN ".$db_prefix."downloads tu ON tn.download_cat_id=tu.download_cat
WHERE download_id!=''".$where2." ORDER BY download_title ASC,".$order." LIMIT ".$_GET['rowstart'].",15";
$result = dbquery($myquery);[/color]
//$result = dbquery("SELECT * FROM ".DB_DOWNLOADS." WHERE download_cat='".$_GET['cat_id']."' ORDER BY ".$order." LIMIT ".$_GET['rowstart'].",15");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['download_datestamp'] + 604800 > time() + ($settings['timeoffset'] * 3600)) {
$new = " ".$locale['410']."";
} else {
$new = "";
}
echo "\n";
echo "\n".$data['download_title']." $new | \n
\n";
if ($data['download_description']) { echo "\n".nl2br(stripslashes($data['download_description']))." | \n
\n"; }
echo "\n".$locale['411']." ".$data['download_license']." | \n".$locale['412']." ".$data['download_os']." | \n";
echo "".$locale['413']." ".$data['download_version']." | \n
\n\n".$locale['414']." ".showdate("shortdate", $data['download_datestamp'])." | \n";
echo "".$locale['415']." ".$data['download_count']." | \n";
if (iMEMBER){
echo "".$locale['416']." (".$data['download_filesize'].")";
}else{
echo "".$locale['417']."";
}
echo" | \n
\n";
echo "
\n";
if ($i != $numrows) { echo "\n"; $i++; }
}
echo" ";
closetable();
if ($rows > 15) { echo "\n".makepagenav($_GET['rowstart'], 15, $rows, 3, FUSION_SELF."?cat_id=".$_GET['cat_id']."&")."\n
\n"; }
} else {
echo $locale['431']."\n";
closetable();
}
}
}
if ($res == 0) { redirect(FUSION_SELF); }
}
require_once THEMES."templates/footer.php";
?>
De code in rood gekleurd is wat toegevoegd of aangepast is. Kan iemand hier de fout uit halen of mij vertellen hoe het moet??
Posted by
Thijs on 24 June 2009, 17:54
#2
Als bijlage zit nog even een screenshot van hoe het eruit ziet. Om het plaatje af te maken

Posted by
Thijs on 01 July 2009, 15:56
#3
heb het zelf al voor elkaar gekregen.. lukte in het begin van geen kant maar ben maar gewoon doorgegaan met van alles en nog wat proberen en zo ben ik toch verder gekomen. Duurde wel erg lang, beetje support van jullie was fijn geweest.
Edited by
Thijs on 01 July 2009, 15:57