Execute("SELECT count(*) FROM ".$pntable['downloads_downloads']); list($numcats) = $dresult->fields; if ($numcats == 0) { echo _DOWNLOADSNOCATS; include 'footer.php'; } else { OpenTable(); $a = 0; $count = 0; $mycolor = 0; echo "
"._DWNALLTITLE."


"; echo "" ."\n" ."\n" ."\n" ."\n"; //Possibilité d'une autre cellule séparant les catégories et les fichiers. // ."\n"; echo "\n"; //Possibilité d'une autre cellule séparant les catégories et les fichiers. echo "\n"; $column = &$pntable['downloads_downloads_column']; $sql="SELECT $column[lid], $column[cid], $column[sid], $column[title], $column[date], $column[hits] FROM $pntable[downloads_downloads] ORDER BY $column[title], $column[cid], $column[sid]"; $result=$dbconn->SelectLimit($sql,$perpage,$min); while(list($lid, $cid, $sid, $title, $time, $hits) = $result->fields) { $result->MoveNext(); $ViewOk = "Yes"; $myclink = "Vide"; $myslink = "Vide"; $mydlink = "$title"; if ($cid!=0) { $column = &$pntable['downloads_categories_column']; $catresult=$dbconn->Execute("SELECT $column[cid], $column[title] FROM $pntable[downloads_categories] WHERE $column[cid]=$cid"); list($ccid, $ctitle) = $catresult->fields; if (pnSecAuthAction(0, 'Downloads::Category', "$ctitle::$ccid", ACCESS_READ)) { //$title1 = $ctitle; $myclink = "$ctitle"; if ($sid!=0) { $column = &$pntable['downloads_subcategories_column']; $scatresult=$dbconn->Execute("SELECT $column[cid], $column[sid], $column[title] FROM $pntable[downloads_subcategories] WHERE $column[cid]=".pnVarPrepForStore($cid)." AND $column[sid]=$sid"); list($sccid, $ssid, $stitle) = $scatresult->fields; if (pnSecAuthAction(0, 'Downloads::Category', "$stitle::$ssid", ACCESS_READ)) { //$title2 = $stitle; $myslink = "$stitle"; } else { $ViewOk = "No"; } } } else { $ViewOk = "No"; } } if ($ViewOk == "Yes") { $dcolor = ($a == 0 ? $bgcolor3 : $bgcolor2); $ldetails1 = "\""._RATERESOURCE."\""; $ldetails2 = "\"Details\""; setlocale (LC_TIME, pnConfigGetVar('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 = ml_ftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); $datetime = ucfirst($datetime); echo ""; echo "" ."" ."" .""; //Possibilité d'une autre cellule séparant les catégories et les fichiers. echo ""; $a = ($dcolor == $bgcolor3 ? 1 : 0); $count++; } } echo "
"._ACTIONS.""._NUMHITS.""._POSTED.""._DWNALLCATS.""._DWNFILES.""._DWNFILES."
$ldetails1 $ldetails2".pnVarPrepForDisplay($hits)."$datetime"; if ($mclink != "Vide") { if ($myslink != "Vide") { //$lelien = "$myclink / $myslink / $title"; $mycat = "$myclink / $myslink"; } else { //$lelien = "$myclink / $title"; $mycat = "$myclink"; } // } else { //Mettre en commentaire pour une autre cellule //$lelien = "$title"; //Mettre en commentaire pour une autre cellule } //echo "$lelien"; echo "$mycat"; echo "$title"; //Possibilité d'une autre cellule séparant les catégories et les fichiers. newdownloadgraphic($datetime, $time); popgraphic($hits); echo "
"; echo "
"; /* Calculates how many pages exist. Which page one should be on, etc... */ $downloadpagesint = ($numcats / $perpage); $downloadpageremainder = ($numcats % $perpage); if ($downloadpageremainder != 0) { $downloadpages = ceil($downloadpagesint); if ($numcats < $perpage) { $downloadpageremainder = 0; } } else { $downloadpages = $downloadpagesint; } /* Page Numbering */ if ($downloadpages > 1) { echo "

"; //echo ""._SELECTPAGE.": "; $prev=$min-$perpage; echo ""; if ($prev>=0) { echo ""; } else { echo ""; } $counter = 1; $currentpage = ($max / $perpage); echo ""; $next=$min+$perpage; if ($currentpage < $downloadpages) { echo ""; } else { echo ""; } echo "
" ."      "; while ($counter<=$downloadpages ) { $cpage = $counter; $mintemp = ($perpage * $counter) - $perpage; if ($counter == $currentpage) { echo "".(int)$counter." "; } else { //echo "".(int)$counter." "; echo "".(int)$counter."  "; } $counter++; } echo " " ." 
"; } echo "

"; // Number of current categories and subcategories $result=$dbconn->Execute("SELECT count(*) FROM $pntable[downloads_downloads]"); list($numrows) = $result->fields; /* * hootbah: FIXME * This can be done in one database hit. */ $result=$dbconn->Execute("SELECT count(*) FROM $pntable[downloads_categories]"); list($catnum1) = $result->fields; $result=$dbconn->Execute("SELECT count(*) FROM $pntable[downloads_subcategories]"); list($catnum2) = $result->fields; $catnum = $catnum1+$catnum2; echo "

"._THEREARE." ".pnVarPrepForDisplay($numrows)." "._DOWNLOADS." "._AND." ".pnVarPrepForDisplay($catnum)." "._CATEGORIES." "._INDB."
"; CloseTable(); include("footer.php"); CloseTable(); } } ?>