Merci à vous,mais il faudrait que j'arrive a integrer tout (je n'ai pas q'un seul champ a afficher et il faut que je l'affiche dans une page voici le bout de code ou il faudrait que j'insere le script et aussi j'ai plusieurs catégories (cid) et quand j'ai recherché avec le script que vous avez fait il ma affiché tout les fichiers de ma base de donnée commencant par A,désolé si j'ai du mal a comprendre,mais j'ai du mal pourtant j'ai cherché...
voici le bout de code :
function viewdownload($cid, $min, $orderby, $show) {
global $prefix, $db, $admin, $perpage, $module_name, $user;
include("header.php");
if (!isset($min)) $min=0;
if (!isset($max)) $max=$min+$perpage;
if(isset($orderby)) {
$orderby = convertorderbyin($orderby);
} else {
$orderby = "title ASC";
}
if ($show!="") {
$perpage = $show;
} else {
$show=$perpage;
}
menu(1);
echo "<br>";
OpenTable();
$cid = intval($cid);
$result = $db->sql_query("SELECT title,parentid FROM ".$prefix."_downloads_categories WHERE cid='$cid'");
list($title,$parentid)=$db->sql_fetchrow($result);
$title = stripslashes(check_html($title, "nohtml"));
$parentid = intval($parentid);
$title=getparentlink($parentid,$title);
$title="<a href=modules.php?name=$module_name>"._MAIN."</a>/$title";
echo "<center><font class=\"option\"><b>"._CATEGORY.": $title</b></font></center><br>";
echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>";
$cid = intval($cid);
$result2 = $db->sql_query("SELECT cid, title, cdescription FROM ".$prefix."_downloads_categories WHERE parentid='$cid' order by title");
$count = 0;
while(list($cid2, $title2, $cdescription2) = $db->sql_fetchrow($result2)) {
$cid2 = intval($cid2);
$title2 = stripslashes(check_html($title2, "nohtml"));
$cdescription2 = stripslashes($cdescription2);
$cresult = $db->sql_query("SELECT * FROM ".$prefix."_downloads_downloads WHERE cid='$cid2'");
$cnumrows = $db->sql_numrows($cresult);
echo "<td><font class=\"option\"><strong><big>·</big></strong> <a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid2\"><b>$title2</b></a></font> ($cnumrows)";
categorynewdownloadgraphic($cid2);
if ($cdescription2) {
echo "<font class=\"content\">$cdescription2</font><br>";
} else {
echo "<br>";
}
$result3 = $db->sql_query("SELECT cid, title FROM ".$prefix."_downloads_categories WHERE parentid='$cid2' order by title limit 0,3");
$space = 0;
while(list($cid3, $title3) = $db->sql_fetchrow($result3)) {
$cid3 = intval($cid3);
$title3 = stripslashes(check_html($title3, "nohtml"));
if ($space>0) {
echo ", ";
}
$cresult2 = $db->sql_query("SELECT * FROM ".$prefix."_downloads_downloads WHERE cid='$cid3'");
$cnumrows2 = $db->sql_numrows($cresult2);
echo "<font class=\"content\"><a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid3\">$title3</a> ($cnumrows2)</font>";
$space++;
}
if ($count<1) {
echo "</td><td> </td>";
$dum = 1;
}
$count++;
if ($count==2) {
echo "</td></tr><tr>";
$count = 0;
$dum = 0;
}
}
if ($dum == 1) {
echo "</tr></table>";
} elseif ($dum == 0) {
echo "<td></td></tr></table>";
}
echo "<hr noshade size=\"1\">";
$orderbyTrans = convertorderbytrans($orderby);
echo "<center><font class=\"content\">"._SORTDOWNLOADSBY.": "
.""._TITLE." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=titleA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=titleD\">D</a>) "
.""._DATE." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=dateA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=dateD\">D</a>) "
.""._RATING." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=ratingA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=ratingD\">D</a>) "
.""._POPULARITY." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=hitsA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=hitsD\">D</a>)"
."<br><b>"._RESSORTED.": $orderbyTrans</b></font></center><br><br>";
$result=$db->sql_query("SELECT lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM ".$prefix."_downloads_downloads WHERE cid='$cid' order by $orderby limit $min,$perpage ");
$fullcountresult=$db->sql_query("SELECT lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments FROM ".$prefix."_downloads_downloads WHERE cid='$cid'");
$totalselecteddownloads = $db->sql_numrows($fullcountresult);
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">";
$x=0;
while(list($lid, $title, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage)=$db->sql_fetchrow($result)) {
$lid = intval($lid);
$hits = intval($hits);
$totalvotes = intval($totalvotes);
$totalcomments = intval($totalcomments);
$downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
$title = stripslashes(check_html($title, "nohtml"));
$description = stripslashes($description);
global $prefix, $db, $admin;
if (is_admin($admin)) {
echo "<a href=\"admin.php?op=DownloadsModDownload&lid=$lid\"><img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\""._EDIT."\"></a> ";
} else {
echo "<img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\"\"> ";
}
echo "<a href=\"modules.php?name=$module_name&d_op=getit&lid=$lid\">$title</a>";
newdownloadgraphic($datetime, $time);
popgraphic($hits);
/* INSERT code for *editor review* here */
detecteditorial($lid, $transfertitle, 1);
echo "<br>";
echo "<b>"._DESCRIPTION.":</b> $description<br>";
setlocale (LC_TIME, $locale);
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
$datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
$datetime = ucfirst($datetime);
echo "<b>"._VERSION.":</b> $version <b>"._FILESIZE.":</b> ".CoolSize($filesize)."<br>";
echo "<b>"._ADDEDON.":</b> $datetime <b>"._UDOWNLOADS.":</b> $hits";
$transfertitle = str_replace (" ", "_", $title);
/* voting & comments stats */
if ($totalvotes == 1) {
$votestring = _VOTE;
} else {
$votestring = _VOTES;
}
if ($downloadratingsummary!="0" || $downloadratingsummary!="0.0") {
echo " <b>"._RATING.":</b> $downloadratingsummary ($totalvotes $votestring)";
}
if ($homepage == "") {
echo "<br>";
} else {
echo "<br><a href=\"$homepage\" target=\"new\">"._HOMEPAGE."</a> | ";
}
Si quelqun arrive a le lire,ou juste me faire le script que vous avez fait en ajoutant des champs (car j'ai essayé et il y avait toujours une erreur de syntaxe)
Il faudrait que lon voit ces champs :
| lid |
cid |
sid |
title |
url |
description |
date |
name |
email |
hits |
submitter |
downloadratingsummary |
totalvotes |
totalcomments |
filesize |
version |
homepage |
lid est le numéro du fichier,il redirige vers l'url,cid est la categoris,title le titre qui s'affiche quand on clique il va sur lid et ensuite sur l'url,la description s'affiche ainsi que tout les autres
Pour voir tout le contenu du fichier index :
http://www.emulation-roms.com/index.zip
Merci d'avance
