示例#1
0
                while ($data2 = dbarray($result2)) {
                    if (!empty($data2['download_file']) && file_exists(DOWNLOADS . $data2['download_file'])) {
                        $download_url = DOWNLOADS . $data2['download_file'];
                    } elseif (!strstr($data2['download_url'], "http://") && !strstr($data2['download_url'], "../")) {
                        $download_url = BASEDIR . $data2['download_url'];
                    } else {
                        $download_url = $data2['download_url'];
                    }
                    echo "<tr>\n<td class='tbl1'><a href='" . $download_url . "' target='_blank'>" . $data2['download_title'] . "</a></td>\n";
                    echo "<td class='tbl1' style='text-align:right;width:100px;'><a href='" . FUSION_SELF . $aidlink . "&amp;action=edit&amp;download_cat_id=" . $data['download_cat_id'] . "&amp;download_id=" . $data2['download_id'] . "'>" . $locale['442'] . "</a> -\n";
                    echo "<a href='" . FUSION_SELF . $aidlink . "&amp;action=delete&amp;download_cat_id=" . $data['download_cat_id'] . "&amp;download_id=" . $data2['download_id'] . "' onclick=\"return confirm('" . $locale['460'] . "');\">" . $locale['443'] . "</a></td>\n";
                    echo "</tr>\n";
                }
                echo "</table>\n</div>\n</td>\n</tr>\n";
            }
            echo download_admin_subcats($data['download_cat_id']);
            //subdownloads
        }
        echo "</table>\n";
    } else {
        echo "<tr>\n<td style='text-align:center;'><br />\n";
        echo $locale['450'] . "<br /><br /></td>\n";
        echo "</tr>\n</table>\n";
    }
    closetable();
} else {
    opentable($locale['402']);
    echo "<div style='text-align:center'>" . $locale['451'] . "<br />\n" . $locale['452'] . "<br /><br />\n";
    echo "<a href='download_cats.php" . $aidlink . "'>" . $locale['453'] . "</a>" . $locale['454'] . "</div>\n";
    closetable();
}
function download_admin_sublist($id)
{
    global $aidlink, $locale, $i;
    $sublist = "";
    $result = dbquery("SELECT download_cat_id, download_cat_name, download_cat_description, download_cat_access FROM " . DB_DOWNLOAD_CATS . " WHERE download_cat_parent='" . (int) $id . "' ORDER BY download_cat_name");
    if (dbrows($result) != 0) {
        while ($data = dbarray($result)) {
            $cell_color = $i % 2 == 0 ? "tbl1" : "tbl2";
            $sublist .= "<tr>\n";
            $sublist .= "<td class='" . $cell_color . "'>-" . $data['download_cat_name'] . "\n";
            if ($data['download_cat_description']) {
                $sublist .= "<br /><span class='small'>" . trimlink($data['download_cat_description'], 45) . "</span>";
            }
            $sublist .= "</td>\n<td align='center' width='1%' class='{$cell_color}' style='white-space:nowrap'>" . getgroupname($data['download_cat_access']) . "</td>\n";
            $sublist .= "<td align='center' width='1%' class='{$cell_color}' style='white-space:nowrap'><a href='" . FUSION_SELF . $aidlink . "&amp;action=edit&amp;cat_id=" . $data['download_cat_id'] . "'>" . $locale['443'] . "</a> -\n";
            $sublist .= "<a href='" . FUSION_SELF . $aidlink . "&amp;action=delete&amp;cat_id=" . $data['download_cat_id'] . "' onclick=\"return confirm('" . $locale['450'] . "');\">" . $locale['444'] . "</a></td>\n";
            $sublist .= "</tr>\n";
            echo download_admin_subcats($data['download_cat_id']);
            // subdownloads
        }
    }
    return $sublist;
}