function ShowDowns() { global $xoopsDB, $xoopsModuleConfig; $limit = 20; $pag = $_GET['pag']; if ($pag > 0) { $pag -= 1; } $start = $pag * $limit; if ($pactual > $tpages) { $rest = $pactual - $tpages; $pactual = $pactual - $rest + 1; $start = ($pactual - 1) * $limit; } $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix('rmdp_software') . " ORDER BY nombre LIMIT {$start},{$limit}"); list($num) = $xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix('rmdp_software'))); $rtotal = $num; // Numero total de resultados $tpages = (int) ($num / $limit); if ($num % $limit > 0) { $tpages++; } $pactual = $pag + 1; xoops_cp_header(); include 'functions.php'; DP_ShowNav(); $catego = DP_CategoName($idc); echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n\t\t <tr><td><a href='downs.php?op=new'>" . _AM_RMDP_NEWDOWN . "</a></td>\n\t\t <td align='right'>"; echo _AM_RMDP_GOPAGE; for ($i = 1; $i <= $tpages; $i++) { echo "<a href='downs.php?pag={$i}&sort={$order}'>{$i}</a> "; } echo "</td></tr></table>\n\t\t <table width='100%' class='outer' cellspacing='1'>\n\t\t\t<tr><th colspan='3'>" . _AM_RMDP_DOWNSLIST . "</th></tr>\n\t\t\t<tr align='center' class='head'><td>" . _AM_RMDP_LISTNAME . "</td>\n\t\t\t<td>" . _AM_RMDP_LISTACCESS . "</td>\n\t\t\t<td>" . _AM_RMDP_OPTIONS . "</td></tr>"; while ($row = $xoopsDB->fetchArray($result)) { if ($class == 'even') { $class = 'odd'; } else { $class = 'even'; } echo "<tr class='{$class}'><td align='left'>\n\t\t\t<a href='../down.php?id={$row['id_soft']}'>{$row['nombre']}</a><br>\n\t\t\t</td>\n\t\t\t<td align='center'>"; if ($row['anonimo']) { echo _AM_RMDP_EVERYBODY; } else { echo _AM_RMDP_REGISTERED; } echo "</td><td align='center' style='font-size: 10px;'>\n\t\t\t<a href='downs.php?op=os&ids={$row['id_soft']}'>" . _AM_RMDP_SOFTOS . "</a> |\n\t\t\t<a href='downs.php?op=shots&ids={$row['id_soft']}'>" . _AM_RMDP_SOFTSHOTS . "</a> |\n\t\t\t<a href='downs.php?op=mod&ids={$row['id_soft']}'>" . _AM_RMDP_MODIFY . "</a> |\n\t\t\t<a href='downs.php?op=del&ids={$row['id_soft']}'>" . _AM_RMDP_DELETE . "</a>\n\t\t\t</td></tr>"; } echo "</table>"; xoops_cp_footer(); }
/** * Mostramos una lista de las descargas que * pertenecen a esta categoría */ function View() { global $xoopsDB; $idc = $_GET['idc']; if ($idc <= 0) { header('location: categos.php'); die; } $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix('rmdp_software') . " WHERE id_cat='{$idc}' ORDER BY nombre"); xoops_cp_header(); include 'functions.php'; DP_ShowNav(); $catego = DP_CategoName($idc); echo "<a href='downs.php?op=new'>" . _AM_RMDP_NEWDOWN . "</a><br>\n\t\t <table width='100%' class='outer' cellspacing='1'>\n\t\t\t<tr><th colspan='2'>" . sprintf(_AM_RMDP_DOWNSLIST, $catego) . "</th></tr>"; while ($row = $xoopsDB->fetchArray($result)) { if ($class == 'even') { $class = 'odd'; } else { $class = 'even'; } echo "<tr class='{$class}'><td align='left'>\n\t\t\t<a href='../down.php?id={$row['id_soft']}'>{$row['nombre']}</a>\n\t\t\t</td>\n\t\t\t<td align='center' style='font-size: 10px;'>\n\t\t\t<a href='downs.php?op=os&ids={$row['id_soft']}'>" . _AM_RMDP_SOFTOS . "</a> |\n\t\t\t<a href='downs.php?op=shots&ids={$row['id_soft']}'>" . _AM_RMDP_SOFTSHOTS . "</a> |\n\t\t\t<a href='downs.php?op=mod&ids={$row['id_soft']}'>" . _AM_RMDP_MODIFY . "</a> |\n\t\t\t<a href='downs.php?op=del&ids={$row['id_soft']}'>" . _AM_RMDP_DELETE . "</a>\n\t\t\t</td></tr>"; } echo "</table>"; xoops_cp_footer(); }