Ejemplo n.º 1
0
function viewdownloadeditorial()
{
    global $downloadsprefix, $db;
    $lid = intval($_GET['lid']);
    include "header.php";
    downl_menu_tpl(1);
    $result = $db->sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $downloadsprefix . "_editorials WHERE downloadid = {$lid}");
    $recordexist = $db->sql_numrows($result);
    $displaytitle = ereg_replace("_", " ", $ttitle);
    echo '<br />';
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br />";
    downl_infomenu_tpl($lid, $ttitle);
    if ($recordexist != 0) {
        while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = $db->sql_fetchrow($result)) {
            ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime);
            $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1]));
            $date_array = explode("-", $editorialtime);
            $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
            $formatted_date = date("F j, Y", $timestamp);
            echo "<br /><br />";
            OpenTable2();
            echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br /><br />" . "{$editorialtext}";
            CloseTable2();
        }
    } else {
        echo "<br /><br /><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>";
    }
    echo "<br /><br /><center>";
    downloadfooter($lid);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Ejemplo n.º 2
0
function viewdownloadeditorial($lid, $ttitle)
{
    global $prefix, $dbi, $admin, $module_name;
    include "header.php";
    include "modules/{$module_name}/d_config.php";
    menu(1);
    $result = sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $prefix . "_downloads_editorials WHERE downloadid = {$lid}", $dbi);
    $recordexist = sql_num_rows($result, $dbi);
    $transfertitle = ereg_replace("_", " ", $ttitle);
    $transfertitle = stripslashes($transfertitle);
    $displaytitle = $transfertitle;
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br>";
    downloadinfomenu($lid, $ttitle);
    if ($recordexist != 0) {
        while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = sql_fetch_row($result, $dbi)) {
            $editorialtitle = stripslashes($editorialtitle);
            $editorialtext = stripslashes($editorialtext);
            ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime);
            $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1]));
            $date_array = explode("-", $editorialtime);
            $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
            $formatted_date = date("F j, Y", $timestamp);
            echo "<br><br>";
            OpenTable2();
            echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br><br>" . "{$editorialtext}";
            CloseTable2();
        }
    } else {
        echo "<br><br><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>";
    }
    echo "<br><br><center>";
    downloadfooter($lid, $ttitle);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Ejemplo n.º 3
0
function index()
{
    global $downloadsprefix, $db, $show_links_num, $show_links_info, $show_links_inum, $module_name, $bgcolor1, $bgcolor3;
    require_once 'header.php';
    downl_menu_tpl(0);
    echo '<br />';
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _DOWNLOADSMAINCAT . "</b></font></center><br />";
    echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>";
    $sql = "SELECT cid, title, cdescription FROM " . $downloadsprefix . "_categories WHERE parentid='0' ORDER BY title";
    $result = $db->sql_query($sql);
    $count = $dum = 0;
    while ($row = $db->sql_fetchrow($result)) {
        $cid = $row['cid'];
        $title = $row['title'];
        $cdescription = $row['cdescription'];
        if ($show_links_num == 1) {
            list($cnumrows) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads WHERE cid='{$cid}'", SQL_NUM);
            $cnumm = " ({$cnumrows})";
        } else {
            $cnumm = '';
        }
        if ($cnumrows > 0) {
            $folder = "modules/Downloads/images/openfolder.gif";
        } else {
            $folder = "modules/Downloads/images/closedfolder.gif";
        }
        if (can_admin('downloads')) {
            $folderImg = "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModCat&amp;cat={$cid}") . "\"><img src=\"{$folder}\" border=\"0\" alt=\"" . _EDIT . "\" /></a>";
        } else {
            $folderImg = "<img src=\"{$folder}\" border=\"0\" alt=\"{$title}\" />";
        }
        echo "<td valign=\"top\"><font class=\"title\">{$folderImg} <a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}") . "\"><b>{$title}</b></a></font>{$cnumm}";
        categorynewdownloadgraphic($cid);
        if ($cdescription) {
            echo "<br /><font class=\"content\">{$cdescription}</font><br />";
        } else {
            echo '<br />';
        }
        $result2 = $db->sql_query("SELECT cid, title FROM " . $downloadsprefix . "_categories WHERE parentid='{$cid}' ORDER BY title LIMIT 0,3");
        $space = 0;
        while ($row2 = $db->sql_fetchrow($result2)) {
            $cid = $row2['cid'];
            $stitle = $row2['title'];
            if ($space > 0) {
                echo ',&nbsp;';
            }
            if ($show_links_num == 1) {
                list($cnumrows2) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads WHERE cid='{$cid}'", SQL_NUM);
                $cnum = " ({$cnumrows2})";
            } else {
                $cnum = "";
            }
            echo "<font class=\"content\"><a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}") . "\">{$stitle}</a>{$cnum}</font>";
            $space++;
        }
        if ($count < 1) {
            echo "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</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>';
    }
    list($numrows) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads", SQL_NUM);
    list($catnum) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_categories", SQL_NUM);
    echo "<center><font class=\"content\">" . _THEREARE . " <b>{$numrows}</b> " . _DOWNLOADS . " " . _AND . " <b>{$catnum}</b> " . _CATEGORIES . " " . _INDB . "</font></center>";
    CloseTable();
    if ($show_links_info == 1) {
        echo '<br />';
        OpenTable();
        echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"3\" width=\"100%\">" . "<tr><td width=\"50%\" valign=\"top\" align=\"center\">";
        echo "<div align=\"center\" class=\"title\">" . _NEWDOWNLOADS . "</div>";
        echo "</td><td width=\"50%\" valign=\"top\" align=\"center\">";
        echo "<div align=\"center\" class=\"title\">" . _MOSTPOPULAR . " {$show_links_inum}</div>";
        echo "</td></tr>" . "<tr><td width=\"50%\" valign=\"top\" align=\"center\">";
        OpenTable2();
        $content = '<table border="0" width="100%">';
        $color = $bgcolor3;
        $result = $db->sql_query("SELECT lid, title, hits FROM " . $downloadsprefix . "_downloads ORDER BY date DESC LIMIT 0, {$show_links_inum}");
        while ($row = $db->sql_fetchrow($result)) {
            $title2 = ereg_replace("_", " ", $row['title']);
            $color = $color == $bgcolor3 ? $bgcolor1 : $bgcolor3;
            $content .= "<tr><td bgcolor=\"{$color}\" align=\"left\"><a href=\"" . getlink("&amp;d_op=viewdownloaddetails&amp;lid={$row['lid']}") . "\">{$title2}</a></td>" . "<td bgcolor=\"{$color}\" align=\"center\" width=\"20\">{$row['hits']}</td></tr>";
        }
        echo "{$content}</table>";
        CloseTable2();
        echo "|[ <a href=\"" . getlink("&amp;d_op=NewDownloads") . "\">" . _NEWDOWNLOADS . "</a> ]|";
        echo "</td><td width=\"50%\" valign=\"top\" align=\"center\">";
        OpenTable2();
        $content = "<table border=\"0\" width=\"100%\">";
        $color = $bgcolor3;
        $result = $db->sql_query("SELECT lid, title, hits FROM " . $downloadsprefix . "_downloads ORDER BY hits DESC LIMIT 0, {$show_links_inum}");
        while ($row = $db->sql_fetchrow($result)) {
            $title2 = ereg_replace("_", " ", $row['title']);
            $color = $color == $bgcolor3 ? $bgcolor1 : $bgcolor3;
            $content .= "<tr><td bgcolor=\"{$color}\" align=\"left\"><a href=\"" . getlink("&amp;d_op=viewdownloaddetails&amp;lid={$row['lid']}") . "\">{$title2}</a></td>" . "<td bgcolor=\"{$color}\" align=\"center\" width=\"20\">{$row['hits']}</td></tr>";
        }
        echo "{$content}</table>";
        CloseTable2();
        echo "|[ <a href=\"" . getlink("&amp;d_op=MostPopular") . "\">" . _MOSTPOPULAR . " " . _DOWNLOADS . "</a> ]|";
        echo "</td></tr></table>";
        CloseTable();
    }
    include "footer.php";
}
Ejemplo n.º 4
0
function viewlinkeditorial($lid, $ttitle)
{
    global $prefix, $db, $admin, $module_name;
    include "header.php";
    include "modules/{$module_name}/l_config.php";
    menu(1);
    $lid = intval(trim($lid));
    $result = $db->sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $prefix . "_links_editorials WHERE linkid = '{$lid}'");
    $recordexist = $db->sql_numrows($result);
    $transfertitle = ereg_replace("_", " ", $ttitle);
    $displaytitle = $transfertitle;
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _LINKPROFILE . ": {$displaytitle}</b></font><br>";
    linkinfomenu($lid, $ttitle);
    if ($recordexist != 0) {
        while ($row = $db->sql_fetchrow($result)) {
            $adminid = intval($row['adminid']);
            $editorialtimestamp = $row['editorialtimestamp'];
            $editorialtext = stripslashes($row['editorialtext']);
            $editorialtitle = stripslashes(check_html($row['editorialtitle'], "nohtml"));
            ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $editorialtimestamp, $editorialtime);
            $editorialtime = strftime("%F", mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1]));
            $date_array = explode("-", $editorialtime);
            $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
            $formatted_date = date("F j, Y", $timestamp);
            echo "<br><br>";
            OpenTable2();
            echo "<center><font class=\"option\"><b>'{$editorialtitle}'</b></font></center>" . "<center><font class=\"tiny\">" . _EDITORIALBY . " {$adminid} - {$formatted_date}</font></center><br><br>" . "{$editorialtext}";
            CloseTable2();
        }
    } else {
        echo "<br><br><center><font class=\"option\"><b>" . _NOEDITORIAL . "</b></font></center>";
    }
    echo "<br><br><center>";
    linkfooter($lid, $ttitle);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Ejemplo n.º 5
0
        $send = "no";
    }
    if ($message == "") {
        $message_err = "<center><font class=\"option\"><b><i>" . _FBENTERMESSAGE . "</i></b></font></center><br>";
        $send = "no";
    }
    if ($send != "no") {
        $sender_name = removecrlf($sender_name);
        $sender_email = removecrlf($sender_email);
        $msg = "{$sitename}\n\n";
        $msg .= "" . _SENDERNAME . ": {$sender_name}\n";
        $msg .= "" . _SENDEREMAIL . ": {$sender_email}\n";
        $msg .= "" . _MESSAGE . ": {$message}\n\n";
        $to = $adminmail;
        $mailheaders = "From: {$sender_name} <{$sender_email}>\n";
        $mailheaders .= "Reply-To: {$sender_email}\n\n";
        mail($to, $subject, $msg, $mailheaders);
        echo "<P><center>" . _FBMAILSENT . "</center></p>";
        echo "<P><center>" . _FBTHANKSFORCONTACT . "</center></p>";
    } elseif ($send == "no") {
        OpenTable2();
        echo "{$name_err}";
        echo "{$email_err}";
        echo "{$message_err}";
        CloseTable2();
        echo "<br><br>";
        echo "{$form_block}";
    }
}
CloseTable();
include "footer.php";
Ejemplo n.º 6
0
function avatarlist($avatarcategory)
{
    global $user, $userinfo, $cookie, $module_name;
    cookiedecode($user);
    getusrinfo($user);
    include "header.php";
    if (is_user($user) and strtolower($userinfo['username']) == strtolower($cookie[1]) and $userinfo['user_password'] == $cookie[2]) {
        // SecurityReason Fix 2005 - sp3x -> check if we are user if not then Access Denied
        $avatarcatname = ereg_replace("_", "&nbsp;", $avatarcategory);
        $avatarcategory = htmlspecialchars($avatarcategory);
        //SecurityReason Fix 2005 - sp3x
        title("" . $avatarcategory . " Avatar Gallery");
        Opentable();
        nav();
        CloseTable();
        echo "<br>";
        Opentable();
        echo "<center><font class=\"title\"><b>" . _AVAILABLEAVATARS . " on category " . $avatarcatname . "</b></font><br><br>";
        echo "<b>To Select Your Avatar Click On It</b><br><br></center>";
        Opentable2();
        echo "<center>";
        $d = dir("modules/Forums/images/avatars/{$avatarcategory}");
        $temcount = 1;
        while (false !== ($entry = $d->read())) {
            if (preg_match('/(\\.gif$|\\.png$|\\.jpg|\\.jpeg)$/is', $entry)) {
                if ($entry != '.' && $entry != '..') {
                    $patterns[0] = "/\\.gif/";
                    $patterns[1] = "/\\.png/";
                    $patterns[2] = "/\\.jpg/";
                    $patterns[3] = "/\\.jpeg/";
                    $patterns[4] = "/-/";
                    $patterns[5] = "/_/";
                    $replacements[5] = "";
                    $replacements[4] = "&nbsp;";
                    $replacements[3] = "";
                    $replacements[2] = "";
                    $replacements[1] = "";
                    $replacements[0] = "";
                    ksort($patterns);
                    ksort($replacements);
                    $entryname = preg_replace($patterns, $replacements, $entry);
                    $a = 1;
                    echo "<a href=\"modules.php?name={$module_name}&op=avatarsave&category={$avatarcategory}&avatar={$entry}\"><img src=\"modules/Forums/images/avatars/{$avatarcategory}/{$entry}\" border=\"0\" alt=\"{$entryname}\" title=\"{$entryname}\" hspace=\"10\" vspace=\"10\"></a>";
                }
                if ($temcount == 10) {
                    echo "<br>";
                    $temcount -= 10;
                }
                $temcount++;
            }
        }
        echo "</center>";
        CloseTable2();
        echo "<center><br>" . "" . _GOBACK . "" . "<br></center>";
        $d->close();
        CloseTable();
        include "footer.php";
    } else {
        die("Access Denied");
    }
}
Ejemplo n.º 7
0
function Stats_Main()
{
    global $prefix, $db, $startdate, $sitename, $ThemeSel, $user_prefix, $Version_Num, $module_name, $textcolor2;
    include "header.php";
    $result = $db->sql_query("SELECT type, var, count from " . $prefix . "_counter order by type desc");
    while ($row = $db->sql_fetchrow($result)) {
        $type = stripslashes(check_html($row['type'], "nohtml"));
        $var = stripslashes(check_html($row['var'], "nohtml"));
        $count = intval($row['count']);
        if ($type == "total" && $var == "hits") {
            $total = $count;
        } elseif ($type == "browser") {
            if ($var == "FireFox") {
                $firefox[] = $count;
                $firefox[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Netscape") {
                $netscape[] = $count;
                $netscape[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "MSIE") {
                $msie[] = $count;
                $msie[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Konqueror") {
                $konqueror[] = $count;
                $konqueror[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Opera") {
                $opera[] = $count;
                $opera[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Lynx") {
                $lynx[] = $count;
                $lynx[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Bot") {
                $bot[] = $count;
                $bot[] = substr(100 * $count / $total, 0, 5);
            } elseif ($type == "browser" && $var == "Other") {
                $b_other[] = $count;
                $b_other[] = substr(100 * $count / $total, 0, 5);
            }
        } elseif ($type == "os") {
            if ($var == "Windows") {
                $windows[] = $count;
                $windows[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Mac") {
                $mac[] = $count;
                $mac[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "Linux") {
                $linux[] = $count;
                $linux[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "FreeBSD") {
                $freebsd[] = $count;
                $freebsd[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "SunOS") {
                $sunos[] = $count;
                $sunos[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "IRIX") {
                $irix[] = $count;
                $irix[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "BeOS") {
                $beos[] = $count;
                $beos[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "OS/2") {
                $os2[] = $count;
                $os2[] = substr(100 * $count / $total, 0, 5);
            } elseif ($var == "AIX") {
                $aix[] = $count;
                $aix[] = substr(100 * $count / $total, 0, 5);
            } elseif ($type == "os" && $var == "Other") {
                $os_other[] = $count;
                $os_other[] = substr(100 * $count / $total, 0, 5);
            }
        }
    }
    title("{$sitename} " . _STATS . "");
    OpenTable();
    OpenTable();
    echo "<center><font class=\"option\"><b>{$sitename} " . _STATS . "</b></font><br><br>" . _WERECEIVED . " <b>{$total}</b> " . _PAGESVIEWS . " {$startdate}<br><br>" . "[ <a href=\"modules.php?name={$module_name}&op=Stats\">" . _VIEWDETAILED . "</a> ]</center>";
    CloseTable();
    echo "<br><br>";
    $l_size = getimagesize("themes/{$ThemeSel}/images/leftbar.gif");
    $m_size = getimagesize("themes/{$ThemeSel}/images/mainbar.gif");
    $r_size = getimagesize("themes/{$ThemeSel}/images/rightbar.gif");
    OpenTable2();
    echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n";
    echo "<center><font color=\"{$textcolor2}\"><b>" . _BROWSERS . "</b></font></center><br></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/explorer.gif\" border=\"0\" alt=\"\">&nbsp;MSIE: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Internet Explorer\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Internet Explorer\" height=\"{$m_size['1']}\" width=", $msie[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Internet Explorer\"> {$msie['1']} % ({$msie['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/firefox.gif\" border=\"0\" alt=\"\">&nbsp;FireFox: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"FireFox\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"FireFox\" height=\"{$m_size['1']}\" width=", $firefox[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"FireFox\"> {$firefox['1']} % ({$firefox['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/netscape.gif\" border=\"0\" alt=\"\">&nbsp;Netscape: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Netscape\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Netscape\" height=\"{$m_size['1']}\" width=", $netscape[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Netscape\"> {$netscape['1']} % ({$netscape['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/opera.gif\" border=\"0\" alt=\"\">&nbsp;Opera: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Opera\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Opera\" height=\"{$m_size['1']}\" width=", $opera[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Opera\"> {$opera['1']} % ({$opera['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/konqueror.gif\" border=\"0\" alt=\"\">&nbsp;Konqueror: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Konqueror\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Konqueror (KDE)\" height=\"{$m_size['1']}\" width=", $konqueror[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Konqueror\"> {$konqueror['1']} % ({$konqueror['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/lynx.gif\" border=\"0\" alt=\"\">&nbsp;Lynx: </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Lynx\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Lynx\" height=\"{$m_size['1']}\" width=", $lynx[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Lynx\"> {$lynx['1']} % ({$lynx['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/altavista.gif\" border=\"0\" alt=\"\">&nbsp;" . _SEARCHENGINES . ": </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Robots - Spiders - Buscadores\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Robots - Spiders - Buscadores\" height=\"{$m_size['1']}\" width=", $bot[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _BOTS . "\"> {$bot['1']} % ({$bot['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/question.gif\" border=\"0\" alt=\"\">&nbsp;" . _UNKNOWN . ": </td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Otros - Desconocidos\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Otros - Desconocidos\" height=\"{$m_size['1']}\" width=", $b_other[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _OTHER . "\"> {$b_other['1']} % ({$b_other['0']})\n";
    echo "</td></tr></table>";
    CloseTable2();
    echo "<br><br>\n";
    OpenTable2();
    echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n";
    echo "<center><font color=\"{$textcolor2}\"><b>" . _OPERATINGSYS . "</b></font></center><br></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/windows.gif\" border=\"0\" alt=\"\">&nbsp;Windows:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Windows\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Windows\" height=\"{$m_size['1']}\" width=", $windows[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Windows\"> {$windows['1']} % ({$windows['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/linux.gif\" border=\"0\" alt=\"\">&nbsp;Linux:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Linux\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Linux\" height=\"{$m_size['1']}\" width=", $linux[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Linux\"> {$linux['1']} % ({$linux['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/mac.gif\" border=\"0\" alt=\"\">&nbsp;Mac/PPC:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Mac/PPC\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"Mac - PPC\" height=\"{$m_size['1']}\" width=", $mac[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"Mac/PPC\"> {$mac['1']} % ({$mac['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/bsd.gif\" border=\"0\" alt=\"\">&nbsp;FreeBSD:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"FreeBSD\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"FreeBSD\" height=\"{$m_size['1']}\" width=", $freebsd[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"FreeBSD\"> {$freebsd['1']} % ({$freebsd['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/sun.gif\" border=\"0\" alt=\"\">&nbsp;SunOS:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"SunOS\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"SunOS\" height=\"{$m_size['1']}\" width=", $sunos[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"SunOS\"> {$sunos['1']} % ({$sunos['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/irix.gif\" border=\"0\" alt=\"\">&nbsp;IRIX:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"SGI Irix\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"SGI Irix\" height=\"{$m_size['1']}\" width=", $irix[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"SGI Irix\"> {$irix['1']} % ({$irix['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/be.gif\" border=\"0\" alt=\"\">&nbsp;BeOS:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"BeOS\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"BeOS\" height=\"{$m_size['1']}\" width=", $beos[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"BeOS\"> {$beos['1']} % ({$beos['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/os2.gif\" border=\"0\" alt=\"\">&nbsp;OS/2:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"OS/2\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"OS/2\" height=\"{$m_size['1']}\" width=", $os2[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"OS/2\"> {$os2['1']} % ({$os2['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/aix.gif\" border=\"0\" alt=\"\">&nbsp;AIX:</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"AIX\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" Alt=\"AIX\" height=\"{$m_size['1']}\" width=", $aix[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"AIX\"> {$aix['1']} % ({$aix['0']})</td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/question.gif\" border=\"0\" alt=\"\">&nbsp;" . _UNKNOWN . ":</td><td><img src=\"themes/{$ThemeSel}/images/leftbar.gif\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" Alt=\"Otros - Desconocidos\"><img src=\"themes/{$ThemeSel}/images/mainbar.gif\" ALt=\"Otros - Desconocidos\" height=\"{$m_size['1']}\" width=", $os_other[1] * 2, "><img src=\"themes/{$ThemeSel}/images/rightbar.gif\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" Alt=\"" . _OTHER . "\"> {$os_other['1']} % ({$os_other['0']})\n";
    echo "</td></tr></table>\n";
    CloseTable2();
    echo "<br><br>\n";
    $unum = $db->sql_numrows($db->sql_query("select user_id from " . $user_prefix . "_users"));
    $anum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_authors"));
    $snum = $db->sql_numrows($db->sql_query("select sid from " . $prefix . "_stories"));
    $cnum = $db->sql_numrows($db->sql_query("select tid from " . $prefix . "_comments"));
    $subnum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_queue"));
    if (is_active("Topics")) {
        $tnum = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_topics"));
    }
    if (is_active("Web_Links")) {
        $links = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_links_links"));
        $cat = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_links_categories"));
    }
    OpenTable2();
    echo "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" align=\"center\"><tr><td colspan=\"2\">\n";
    echo "<center><font color=\"{$textcolor2}\"><b>" . _MISCSTATS . "</b></font></center><br></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/users.gif\" border=\"0\" alt=\"\">&nbsp;" . _REGUSERS . "</td><td><b>{$unum}</b></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/authors.gif\" border=\"0\" alt=\"\">&nbsp;" . _ACTIVEAUTHORS . "</td><td><b>{$anum}</b></td></tr>\n";
    echo "<tr><td><img src=\"modules/{$module_name}/images/news.gif\" border=\"0\" alt=\"\">&nbsp;" . _STORIESPUBLISHED . "</td><td><b>{$snum}</b></td></tr>\n";
    if (is_active("Topics")) {
        echo "<tr><td><img src=\"modules/{$module_name}/images/topics.gif\" border=\"0\" alt=\"\">&nbsp;" . _SACTIVETOPICS . "</td><td><b>{$tnum}</b></td></tr>\n";
    }
    echo "<tr><td><img src=\"modules/{$module_name}/images/comments.gif\" border=\"0\" alt=\"\">&nbsp;" . _COMMENTSPOSTED . "</td><td><b>{$cnum}</b></td></tr>\n";
    if (is_active("Web_Links")) {
        echo "<tr><td><img src=\"modules/{$module_name}/images/topics.gif\" border=\"0\" alt=\"\">&nbsp;" . _LINKSINLINKS . "</td><td><b>{$links}</b></td></tr>\n";
        echo "<tr><td><img src=\"modules/{$module_name}/images/sections.gif\" border=\"0\" alt=\"\">&nbsp;" . _LINKSCAT . "</td><td><b>{$cat}</b></td></tr>\n";
    }
    echo "</table>\n";
    CloseTable2();
    CloseTable();
    include "footer.php";
}
Ejemplo n.º 8
0
function viewdownload($cid, $min, $orderby, $show)
{
    global $prefix, $dbi, $admin, $perpage, $module_name, $user, $bgcolor1, $bgcolor3, $show_links_num;
    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;
    }
    $result = sql_query("SELECT title,cdescription,ldescription,parentid FROM " . $prefix . "_downloads_categories WHERE cid={$cid}", $dbi);
    list($title, $cdescription, $ldescription, $parentid) = sql_fetch_row($result, $dbi);
    $title = getparentlink($parentid, $title);
    $title = "<a href=modules.php?name={$module_name}>" . _MAIN . "</a>/{$title}";
    menu(1);
    echo "<br>";
    if ($ldescription != '') {
        OpenTable2();
        echo "{$ldescription}";
        CloseTable2();
        echo "<BR>";
    }
    OpenTable();
    if ($cdescription != '') {
        $cdescription = "<BR>" . $cdescription;
    }
    echo "<center><font class=\"title\"><b>" . _CATEGORY . ": {$title}</b></font>{$cdescription}</center>";
    echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>";
    $result2 = sql_query("SELECT cid, title, cdescription FROM " . $prefix . "_downloads_categories WHERE parentid={$cid} order by title", $dbi);
    $count = 0;
    while (list($cid2, $title2, $cdescription2) = sql_fetch_row($result2, $dbi)) {
        if ($show_links_num == 1) {
            $cresult = sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid={$cid2}", $dbi);
            $cnumrows = sql_num_rows($cresult, $dbi);
            $cnumm = " ({$cnumrows})";
        } else {
            $cnum = "";
        }
        if ($cnumrows > 0) {
            $folder = "modules/Downloads/images/openfolder.gif";
        } else {
            $folder = "modules/Downloads/images/closedfolder.gif";
        }
        if (is_admin($admin)) {
            $folderImg = "<A HREF=\"admin.php?op=DownloadsModCat&amp;cat={$cid2}\"><IMG SRC=\"{$folder}\" BORDER=0 ALT=\"" . _EDIT . "\"></A>";
        } else {
            $folderImg = "<IMG SRC=\"{$folder}\" BORDER=0 ALT=\"{$title2}\">";
        }
        echo "<td><font class=\"title\">{$folderImg} <a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid2}\"><b>{$title2}</b></a></font>{$cnumm}";
        categorynewdownloadgraphic($cid2);
        if ($cdescription2) {
            echo "<BR><font class=\"content\">{$cdescription2}</font><br>";
        } else {
            echo "<br>";
        }
        $result3 = sql_query("SELECT cid, title FROM " . $prefix . "_downloads_categories WHERE parentid={$cid2} order by title limit 0,3", $dbi);
        $space = 0;
        while (list($cid3, $title3) = sql_fetch_row($result3, $dbi)) {
            if ($space > 0) {
                echo ",&nbsp;";
            }
            if ($show_links_num == 1) {
                $cresult2 = sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid={$cid3}", $dbi);
                $cnumrows2 = sql_num_rows($cresult2, $dbi);
                $cnum = " ({$cnumrows2})";
            } else {
                $cnum = "";
            }
            echo "<font class=\"content\"><a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid3}\">{$title3}</a></font>{$cnum}";
            $space++;
        }
        if ($count < 1) {
            echo "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</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&amp;cid={$cid}&amp;orderby=titleA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;orderby=titleD\">D</a>) " . "" . _DATE . " (<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;orderby=dateA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;orderby=dateD\">D</a>) " . "" . _RATING . " (<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;orderby=ratingA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;orderby=ratingD\">D</a>) " . "" . _POPULARITY . " (<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;orderby=hitsA\">A</a>\\<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;orderby=hitsD\">D</a>)" . "<br><b>" . _RESSORTED . ": {$orderbyTrans}</b></font></center>";
    echo "<hr noshade size=\"1\">";
    $result = sql_query("SELECT lid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $prefix . "_downloads_downloads WHERE cid={$cid} order by {$orderby} limit {$min},{$perpage} ", $dbi);
    $fullcountresult = sql_query("SELECT lid FROM " . $prefix . "_downloads_downloads WHERE cid={$cid}", $dbi);
    $totalselecteddownloads = sql_num_rows($fullcountresult, $dbi);
    echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">";
    $x = 0;
    $color = $bgcolor3;
    while (list($lid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = sql_fetch_row($result, $dbi)) {
        $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
        $title = stripslashes($title);
        $description = stripslashes($description);
        $color = switchColor($color);
        echo "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 WIDTH=100%><TR BGCOLOR=\"{$color}\"><TD>";
        if (is_admin($admin)) {
            if (eregi("http", $url)) {
                echo "<a href=\"admin.php?op=DownloadsModDownload&amp;lid={$lid}\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
            } else {
                echo "<a href=\"admin.php?op=DownloadsModDownload&amp;lid={$lid}\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
            }
        } else {
            if (eregi("http", $url)) {
                echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
            } else {
                echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
            }
        }
        echo "</td><TD WIDTH=100% CLASS=\"title\" VALIGN=TOP><a href=\"modules.php?name={$module_name}&d_op=getit&amp;lid={$lid}\" TARGET=\"_blank\"><B>{$title}</B></a>";
        newdownloadgraphic($datetime, $time);
        popgraphic($hits);
        detecteditorial($lid, $transfertitle, 1);
        echo "</TD></TR><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>";
        echo "<DIV ALIGN=\"JUSTIFY\"><b>" . _DESCRIPTION . ":</b> {$description}</TD></TR><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>";
        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> | ";
        }
        echo "<a href=\"modules.php?name={$module_name}&d_op=ratedownload&amp;lid={$lid}&amp;ttitle={$transfertitle}\">" . _RATERESOURCE . "</a>";
        if (is_user($user)) {
            echo " | <a href=\"modules.php?name={$module_name}&d_op=brokendownload&amp;lid={$lid}\">" . _REPORTBROKEN . "</a>";
        }
        echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloaddetails&amp;lid={$lid}&amp;ttitle={$transfertitle}\">" . _DETAILS . "</a>";
        if ($totalcomments != 0) {
            echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloadcomments&amp;lid={$lid}&amp;ttitle={$transfertitle}\">" . _SCOMMENTS . " ({$totalcomments})</a>";
        }
        detecteditorial($lid, $transfertitle, 0);
        echo "</DIV></TD></TR></TABLE><br>";
        $x++;
    }
    echo "</font>";
    $orderby = convertorderbyout($orderby);
    /* Calculates how many pages exist. Which page one should be on, etc... */
    $downloadpagesint = $totalselecteddownloads / $perpage;
    $downloadpageremainder = $totalselecteddownloads % $perpage;
    if ($downloadpageremainder != 0) {
        $downloadpages = ceil($downloadpagesint);
        if ($totalselecteddownloads < $perpage) {
            $downloadpageremainder = 0;
        }
    } else {
        $downloadpages = $downloadpagesint;
    }
    /* Page Numbering */
    if ($downloadpages != 1 && $downloadpages != 0) {
        echo "<br><br>";
        echo "" . _SELECTPAGE . ": ";
        $prev = $min - $perpage;
        if ($prev >= 0) {
            echo "&nbsp;&nbsp;<b>[ <a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;min={$prev}&amp;orderby={$orderby}&amp;show={$show}\">";
            echo " &lt;&lt; " . _PREVIOUS . "</a> ]</b> ";
        }
        $counter = 1;
        $currentpage = $max / $perpage;
        while ($counter <= $downloadpages) {
            $cpage = $counter;
            $mintemp = $perpage * $counter - $perpage;
            if ($counter == $currentpage) {
                echo "<b>{$counter}</b>&nbsp";
            } else {
                echo "<a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;min={$mintemp}&amp;orderby={$orderby}&amp;show={$show}\">{$counter}</a> ";
            }
            $counter++;
        }
        $next = $min + $perpage;
        if ($x >= $perpage) {
            echo "&nbsp;&nbsp;<b>[ <a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}&amp;min={$max}&amp;orderby={$orderby}&amp;show={$show}\">";
            echo " " . _NEXT . " &gt;&gt;</a> ]</b> ";
        }
    }
    echo "</td></tr></table>";
    CloseTable();
    include "footer.php";
}
Ejemplo n.º 9
0
 function moderation_reviews_view($id)
 {
     global $prefix, $db, $admin_file;
     $id = intval($id);
     include "header.php";
     GraphicAdmin();
     mod_menu();
     OpenTable();
     $comm = $db->sql_fetchrow($db->sql_query("SELECT * FROM " . $prefix . "_reviews_comments_moderated WHERE cid='{$id}'"));
     $comm['userid'] = intval($comm['userid']);
     $comm['score'] = intval($comm['score']);
     $comm['comments'] = filter($comm['comments']);
     $revi = $db->sql_fetchrow($db->sql_query("SELECT title FROM " . $prefix . "_reviews WHERE id=" . intval($comm['rid'])));
     $revi['title'] = filter($revi['title'], "nohtml");
     echo "<center><b>Comment to the Review:</b></center><br>";
     OpenTable2();
     echo "<center><i>" . $revi['title'] . "</i></center>";
     CloseTable2();
     echo "<br><br><center><b>" . _COMMENTAPPPENDING . "</b></center><br>";
     OpenTable2();
     echo "<b>" . $revi['title'] . "</b><br>" . _BY . " " . $comm['userid'] . " " . _WITHSCORE . " " . $comm['score'] . "/10<br><br>" . $comm['comments'] . "<br><br>";
     echo "<center><hr size=\"1\" width=\"80%\"><a href=\"" . $admin_file . ".php?op=moderation_approval&section=reviews&id={$id}\"><img src=\"images/karma/approve.gif\" alt=\"" . _APPROVE . "\" title=\"" . _APPROVE . "\" width=\"15\" heigh=\"15\" border=\"0\"></a> &nbsp; <a href=\"" . $admin_file . ".php?op=moderation_reject&section=reviews&id={$id}\"><img src=\"images/karma/reject.gif\" alt=\"" . _REJECT . "\" title=\"" . _REJECT . "\" width=\"15\" heigh=\"15\" border=\"0\"></a></center>";
     CloseTable2();
     echo "<br>";
     CloseTable();
     include "footer.php";
 }
function replace_var($vars)
{
    $var = $vars[1];
    if (substr($var, 0, 9) == '?sitemgr:') {
        $params = explode(',', substr($var, 9));
        switch (count($params)) {
            case 0:
                $val = '';
                break;
            case 1:
                $val = sitemgr_link2('', $params[0]);
                break;
            case 2:
                $val = sitemgr_link2($params[0], $params[1]);
                break;
            default:
                $val = $var;
        }
    } elseif (substr($var, 0, 7) == '?phpgw:') {
        $params = explode(',', substr($var, 7));
        switch (count($params)) {
            case 0:
                $val = '';
                break;
            case 1:
                $val = phpgw_link('', $params[0]);
                break;
            case 2:
                $val = phpgw_link($params[0], $params[1]);
                break;
            default:
                $val = $var;
        }
    } elseif (substr($var, 0, 1) == '?') {
        $val = sitemgr_link2('/index.php', substr($var, 1));
    } elseif ($var == 'news') {
        $ui = new ui();
        $val = $ui->get_news();
        unset($ui);
    } elseif (substr($var, 0, 6) == 'block-') {
        if (file_exists('blocks/' . $var . '.php')) {
            $title = ereg_replace('_', ' ', substr($var, 6));
            include 'blocks/' . $var . '.php';
        } else {
            $title = lang('Block not found.');
            $content = lang('Contact the administrator.');
        }
        add_theme_var('block_title', $title);
        add_theme_var('block_content', $content);
        if (function_exists('themecenterbox')) {
            $val = themecenterbox($title, $content);
        } else {
            $val = parse_theme_vars(implode("", file('templates/' . $GLOBALS['sitemgr_info']['themesel'] . '/centerblock.tpl')));
        }
    } else {
        /* Check for reserved vars first, otherwise
        			   get from the global theme_vars
        			*/
        switch (strtolower($var)) {
            case 'opentable':
                $val = OpenTable();
                break;
            case 'opentable2':
                $val = OpenTable2();
                break;
            case 'closetable':
                $val = CloseTable();
                break;
            case 'closetable2':
                $val = CloseTable2();
                break;
            default:
                $val = $GLOBALS['theme_vars'][$var];
        }
    }
    return $val;
}
Ejemplo n.º 11
0
function avatarlist($avatarcategory)
{
    global $module_name;
    include "header.php";
    $avatarcatname = ereg_replace("_", "&nbsp;", $avatarcategory);
    title("" . $avatarcategory . " Avatar Gallery");
    Opentable();
    nav();
    CloseTable();
    Opentable();
    echo "<center><font class=\"title\"><b>" . _AVAILABLEAVATARS . " on category " . $avatarcatname . "</b></font><br><br>";
    echo "<b>To Select Your Avatar Click On It</b><br><br></center>";
    Opentable2();
    echo "<center>";
    $d = dir("modules/Forums/images/avatars/{$avatarcategory}");
    $temcount = 1;
    while (false !== ($entry = $d->read())) {
        if (preg_match('/(\\.gif$|\\.png$|\\.jpg|\\.jpeg)$/is', $entry)) {
            if ($entry != '.' && $entry != '..') {
                $patterns[0] = "/\\.gif/";
                $patterns[1] = "/\\.png/";
                $patterns[2] = "/\\.jpg/";
                $patterns[3] = "/\\.jpeg/";
                $patterns[4] = "/-/";
                $patterns[5] = "/_/";
                $replacements[5] = "";
                $replacements[4] = "&nbsp;";
                $replacements[3] = "";
                $replacements[2] = "";
                $replacements[1] = "";
                $replacements[0] = "";
                ksort($patterns);
                ksort($replacements);
                $entryname = preg_replace($patterns, $replacements, $entry);
                $a = 1;
                echo "<a href=\"modules.php?name={$module_name}&op=avatarsave&category={$avatarcategory}&avatar={$entry}\"><img src=\"modules/Forums/images/avatars/{$avatarcategory}/{$entry}\" border=\"0\" alt=\"{$entryname}\" title=\"{$entryname}\" hspace=\"10\" vspace=\"10\"></a>";
            }
            if ($temcount == 10) {
                echo "<br>";
                $temcount -= 10;
            }
            $temcount++;
        }
    }
    echo "</center>";
    CloseTable2();
    echo "<center><br>" . "" . _GOBACK . "" . "<br></center>";
    $d->close();
    CloseTable();
    include "footer.php";
}
Ejemplo n.º 12
0
 function block_show($bid)
 {
     global $prefix, $db;
     include "header.php";
     GraphicAdmin();
     title("" . _BLOCKSADMIN . "");
     OpenTable2();
     $bid = intval($bid);
     $row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, bposition, blockfile from " . $prefix . "_blocks where bid='{$bid}'"));
     $bid = intval($row['bid']);
     $bkey = $row['bkey'];
     $title = $row['title'];
     $content = $row['content'];
     $url = $row['url'];
     $bposition = $row['bposition'];
     $blockfile = $row['blockfile'];
     if ($bkey == main) {
         mainblock();
     } elseif ($bkey == admin) {
         adminblock();
     } elseif ($bkey == modules) {
         modules_block();
     } elseif ($bkey == category) {
         category();
     } elseif ($bkey == userbox) {
         userblock();
     } elseif ($bkey == "") {
         if ($url == "") {
             if ($blockfile == "") {
                 if ($bposition == "c") {
                     themecenterbox($title, $content);
                 } else {
                     themesidebox($title, $content);
                 }
             } else {
                 if ($bposition == "c") {
                     blockfileinc($title, $blockfile, 1);
                 } else {
                     blockfileinc($title, $blockfile);
                 }
             }
         } else {
             headlines($bid);
         }
     }
     CloseTable2();
     echo "<br>";
     OpenTable();
     echo "<center><font class=\"option\"><b>" . _BLOCKSADMIN . ": " . _FUNCTIONS . "</b></font><br><br>" . "[ <a href=\"admin.php?op=ChangeStatus&bid={$bid}\">" . _ACTIVATE . "</a> | <a href=\"admin.php?op=BlocksEdit&bid={$bid}\">" . _EDIT . "</a> | ";
     if ($bkey == "") {
         echo "<a href=\"admin.php?op=BlocksDelete&bid={$bid}\">" . _DELETE . "</a> | ";
     } else {
         echo "" . _DELETE . " | ";
     }
     echo "<a href=\"admin.php?op=BlocksAdmin\">" . _BLOCKSADMIN . "</a> ]</center>";
     CloseTable();
     include "footer.php";
 }
Ejemplo n.º 13
0
function viewdownload()
{
    global $downloadsprefix, $db, $perpage, $module_name, $bgcolor1, $bgcolor3, $show_links_num;
    $cid = intval($_GET['cid']);
    $min = isset($_GET['min']) ? intval($_GET['min']) : 0;
    $orderby = convertorderbyin($_GET['orderby']);
    $max = $min + $perpage;
    include "header.php";
    $result = $db->sql_query("SELECT title,cdescription,ldescription,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}");
    list($title, $cdescription, $ldescription, $parentid) = $db->sql_fetchrow($result);
    $title = getparentlink($parentid, $title);
    $title = "<a href=" . getlink() . ">" . _MAIN . "</a>/{$title}";
    downl_menu_tpl(1);
    echo '<br />';
    if ($ldescription != '') {
        OpenTable2();
        echo "{$ldescription}";
        CloseTable2();
        echo '<br />';
    }
    OpenTable();
    if ($cdescription != '') {
        $cdescription = "<br />" . $cdescription;
    }
    echo "<center><font class=\"title\"><b>" . _CATEGORY . ": {$title}</b></font>{$cdescription}</center>";
    echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>";
    $result2 = $db->sql_query("SELECT cid, title, cdescription FROM " . $downloadsprefix . "_categories WHERE parentid={$cid} order by title");
    $count = 0;
    while (list($cid2, $title2, $cdescription2) = $db->sql_fetchrow($result2)) {
        if ($show_links_num == 1) {
            $cresult = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid2}");
            $cnumrows = $db->sql_numrows($cresult);
            $cnumm = " ({$cnumrows})";
        } else {
            $cnum = "";
        }
        if ($cnumrows > 0) {
            $folder = "modules/Downloads/images/openfolder.gif";
        } else {
            $folder = "modules/Downloads/images/closedfolder.gif";
        }
        if (can_admin('downloads')) {
            $folderImg = "<A HREF=\"" . adminlink("{$module_name}&mode=DownloadsModCat&amp;cat={$cid2}") . "\"><IMG SRC=\"{$folder}\" BORDER=0 ALT=\"" . _EDIT . "\"></A>";
        } else {
            $folderImg = "<IMG SRC=\"{$folder}\" BORDER=0 ALT=\"{$title2}\">";
        }
        echo "<td valign=\"top\"><font class=\"title\">{$folderImg} <a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid2}") . "\"><b>{$title2}</b></a></font>{$cnumm}";
        categorynewdownloadgraphic($cid2);
        if ($cdescription2) {
            echo "<br /><font class=\"content\">{$cdescription2}</font><br />";
        } else {
            echo '<br />';
        }
        $result3 = $db->sql_query("SELECT cid, title FROM " . $downloadsprefix . "_categories WHERE parentid={$cid2} order by title limit 0,3");
        $space = 0;
        while (list($cid3, $title3) = $db->sql_fetchrow($result3)) {
            if ($space > 0) {
                echo ",&nbsp;";
            }
            if ($show_links_num == 1) {
                $cresult2 = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid3}");
                $cnumrows2 = $db->sql_numrows($cresult2);
                $cnum = " ({$cnumrows2})";
            } else {
                $cnum = "";
            }
            echo "<font class=\"content\"><a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid3}") . "\">{$title3}</a></font>{$cnum}";
            $space++;
        }
        if ($count < 1) {
            echo "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</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=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;orderby=titleA") . "\">A</a>\\<a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;orderby=titleD") . "\">D</a>) " . _DATE . " (<a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;orderby=dateA") . "\">A</a>\\<a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;orderby=dateD") . "\">D</a>) " . _RATING . " (<a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;orderby=ratingA") . "\">A</a>\\<a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;orderby=ratingD") . "\">D</a>) " . _POPULARITY . " (<a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;orderby=hitsA") . "\">A</a>\\<a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;orderby=hitsD") . "\">D</a>)" . "<br /><b>" . _RESSORTED . ": {$orderbyTrans}</b></font></center>";
    echo "<hr noshade size=\"1\">";
    $result = $db->sql_query("SELECT lid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE cid={$cid} order by {$orderby} limit {$min},{$perpage} ");
    $fullcountresult = $db->sql_query("SELECT lid FROM " . $downloadsprefix . "_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;
    $color = $bgcolor3;
    while (list($lid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) {
        $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
        $color = $color == $bgcolor3 ? $bgcolor1 : $bgcolor3;
        echo "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 WIDTH=100%><TR BGCOLOR=\"{$color}\"><TD>";
        if (can_admin('downloads')) {
            if (eregi("http", $url)) {
                echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&amp;lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
            } else {
                echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&amp;lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>";
            }
        } else {
            if (eregi("http", $url)) {
                echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">";
            } else {
                echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">";
            }
        }
        echo "</td><td width=\"100%\" class=\"title\" valign=\"top\"><a href=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\"><B>{$title}</b></a>";
        $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
        newdownloadgraphic($datetime);
        popgraphic($hits);
        detecteditorial($lid, 1);
        echo "</td></tr><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>";
        echo "<DIV ALIGN=\"JUSTIFY\"><b>" . _DESCRIPTION . ":</b> {$description}</td></tr><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>";
        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> | ";
        }
        echo "<a href=\"" . getlink("&amp;d_op=ratedownload&amp;lid={$lid}") . "\">" . _RATERESOURCE . "</a>";
        if (is_user()) {
            echo " | <a href=\"" . getlink("&amp;d_op=brokendownload&amp;lid={$lid}") . "\">" . _REPORTBROKEN . "</a>";
        }
        echo " | <a href=\"" . getlink("&amp;d_op=viewdownloaddetails&amp;lid={$lid}") . "\">" . _DETAILS . "</a>";
        if ($totalcomments != 0) {
            echo " | <a href=\"" . getlink("&amp;d_op=viewdownloadcomments&amp;lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>";
        }
        detecteditorial($lid, 0);
        echo "</div></td></tr></table><br />";
        $x++;
    }
    echo "</font>";
    $orderby = convertorderbyout($orderby);
    /* Calculates how many pages exist. Which page one should be on, etc... */
    $downloadpagesint = $totalselecteddownloads / $perpage;
    $downloadpageremainder = $totalselecteddownloads % $perpage;
    if ($downloadpageremainder != 0) {
        $downloadpages = ceil($downloadpagesint);
        if ($totalselecteddownloads < $perpage) {
            $downloadpageremainder = 0;
        }
    } else {
        $downloadpages = $downloadpagesint;
    }
    /* Page Numbering */
    if ($downloadpages != 1 && $downloadpages != 0) {
        echo "<br /><br />";
        echo _SELECTPAGE . ": ";
        $prev = $min - $perpage;
        if ($prev >= 0) {
            echo "&nbsp;&nbsp;<b>[ <a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;min={$prev}&amp;orderby={$orderby}") . "\">";
            echo " &lt;&lt; " . _PREVIOUSPAGE . "</a> ]</b> ";
        }
        $counter = 1;
        $currentpage = $max / $perpage;
        while ($counter <= $downloadpages) {
            $cpage = $counter;
            $mintemp = $perpage * $counter - $perpage;
            if ($counter == $currentpage) {
                echo "<b>{$counter}</b>&nbsp";
            } else {
                echo "<a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;min={$mintemp}&amp;orderby={$orderby}") . "\">{$counter}</a> ";
            }
            $counter++;
        }
        $next = $min + $perpage;
        if ($x >= $perpage) {
            echo "&nbsp;&nbsp;<b>[ <a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}&amp;min={$max}&amp;orderby={$orderby}") . "\">" . _NEXTPAGE . " >></a> ]</b> ";
        }
    }
    echo "</td></tr></table>";
    CloseTable();
    include "footer.php";
}
Ejemplo n.º 14
0
function viewlinkeditorial($lid, $ttitle)
{
    global $linksprefix, $db, $module_name;
    require_once 'header.php';
    menu(1);
    $result = $db->sql_query("SELECT adminid, editorialtimestamp, editorialtext, editorialtitle FROM " . $linksprefix . "_editorials WHERE linkid = {$lid}");
    $recordexist = $db->sql_numrows($result);
    $transfertitle = ereg_replace('_', ' ', $ttitle);
    $displaytitle = $transfertitle;
    echo '<br />';
    OpenTable();
    echo '<div style="text-align:center;"><span class="option"><b>' . _LINKPROFILE . ': ' . $displaytitle . '</b></span><br />';
    linkinfomenu($lid, $ttitle);
    if ($recordexist != 0) {
        while (list($adminid, $editorialtimestamp, $editorialtext, $editorialtitle) = $db->sql_fetchrow($result)) {
            ereg('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})', $editorialtimestamp, $editorialtime);
            $editorialtime = strftime('%F', mktime($editorialtime[4], $editorialtime[5], $editorialtime[6], $editorialtime[2], $editorialtime[3], $editorialtime[1]));
            $date_array = explode('-', $editorialtime);
            $timestamp = mktime(0, 0, 0, $date_array['1'], $date_array['2'], $date_array['0']);
            $formatted_date = date('F j, Y', $timestamp);
            echo '<br /><br />';
            OpenTable2();
            echo '<span class="option"><b>' . $editorialtitle . '</b></span><br />' . '<span class="tiny">' . _EDITORIALBY . ' ' . $adminid . ' - ' . $formatted_date . '</span><br /><br />' . $editorialtext;
            CloseTable2();
        }
    } else {
        echo '<br /><br /><span class="option"><b>' . _NOEDITORIAL . '</b></span>';
    }
    echo '<br /><br />';
    linkfooter($lid, $ttitle);
    echo '</div>';
    CloseTable();
}
Ejemplo n.º 15
0
function index()
{
    global $prefix, $db, $module_name, $show_links_num, $show_links_info, $show_links_inum, $admin;
    include "header.php";
    $maindownload = 0;
    menu($maindownload);
    echo "<br>";
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _DOWNLOADSMAINCAT . "</b></font></center><br>";
    echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>";
    $sql = "SELECT cid, title, cdescription FROM " . $prefix . "_downloads_categories WHERE parentid='0' ORDER BY title";
    $result = $db->sql_query($sql);
    $count = 0;
    while ($row = $db->sql_fetchrow($result)) {
        $cid = $row[cid];
        $title = $row[title];
        $cdescription = $row[cdescription];
        if ($show_links_num == 1) {
            $cnumrows = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid='{$cid}'"));
            $cnumm = " ({$cnumrows})";
        } else {
            $cnumm = "";
        }
        if ($cnumrows > 0) {
            $folder = "modules/Downloads/images/openfolder.gif";
        } else {
            $folder = "modules/Downloads/images/closedfolder.gif";
        }
        if (is_admin($admin)) {
            $folderImg = "<A HREF=\"admin.php?op=DownloadsModCat&amp;cat={$cid}\"><IMG SRC=\"{$folder}\" BORDER=0 ALT=\"" . _EDIT . "\"></A>";
        } else {
            $folderImg = "<IMG SRC=\"{$folder}\" BORDER=0 ALT=\"{$title}\">";
        }
        echo "<td><font class=\"title\">{$folderImg} <a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}\"><b>{$title}</b></a></font>{$cnumm}";
        categorynewdownloadgraphic($cid);
        if ($cdescription) {
            echo "<br><font class=\"content\">{$cdescription}</font><br>";
        } else {
            echo "<br>";
        }
        $sql2 = "SELECT cid, title FROM " . $prefix . "_downloads_categories WHERE parentid='{$cid}' ORDER BY title LIMIT 0,3";
        $result2 = $db->sql_query($sql2);
        $space = 0;
        while ($row2 = $db->sql_fetchrow($result2)) {
            $cid = $row2[cid];
            $stitle = $row2[title];
            if ($space > 0) {
                echo ",&nbsp;";
            }
            if ($show_links_num == 1) {
                $cnumrows2 = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid='{$cid}'"));
                $cnum = " ({$cnumrows2})";
            } else {
                $cnumrows2 = "";
            }
            echo "<font class=\"content\"><a href=\"modules.php?name={$module_name}&d_op=viewdownload&amp;cid={$cid}\">{$stitle}</a>{$cnum}</font>";
            $space++;
        }
        if ($count < 1) {
            echo "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</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>";
    }
    $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_downloads"));
    $catnum = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_categories"));
    echo "<center><font class=\"content\">" . _THEREARE . " <b>{$numrows}</b> " . _DOWNLOADS . " " . _AND . " <b>{$catnum}</b> " . _CATEGORIES . " " . _INDB . "</font></center>";
    CloseTable();
    if ($show_links_info == 1) {
        echo "<BR>";
        OpenTable();
        echo "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=3 WIDTH=100%>" . "<TR><TD WIDTH=50% VALIGN=TOP ALIGN=CENTER>";
        //		OpenTable2();
        echo "<DIV ALIGN=CENTER CLASS=\"title\">" . _NEWDOWNLOADS . "</DIV>";
        //		CloseTable2();
        echo "</TD><TD WIDTH=50% VALIGN=TOP ALIGN=CENTER>";
        //		OpenTable2();
        echo "<DIV ALIGN=CENTER CLASS=\"title\">" . _MOSTPOPULAR . " {$show_links_inum}</DIV>";
        //		CloseTable2();
        echo "</TD></TR>" . "<TR><TD WIDTH=50% VALIGN=TOP ALIGN=CENTER>";
        OpenTable2();
        $content = "";
        $content .= "<TABLE BORDER=0 WIDTH=\"100%\">";
        $color = $bgcolor3;
        $sql = "SELECT lid, title, hits FROM " . $prefix . "_downloads_downloads ORDER BY date DESC LIMIT 0, {$show_links_inum}";
        $result = $db->sql_query($sql);
        while ($row = $db->sql_fetchrow($result)) {
            $title2 = ereg_replace("_", " ", $row[title]);
            $color = switchColor($color);
            $content .= "<TR><TD BGCOLOR=\"{$color}\" ALIGN=LEFT><a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid={$row['lid']}&amp;title={$row['title']}\">{$title2}</a></TD>";
            $content .= "<TD BGCOLOR=\"{$color}\" ALIGN=CENTER WIDTH=\"20\">{$row['hits']}</TD></TR>";
        }
        echo "{$content}</TABLE>";
        CloseTable2();
        echo "|[ <A HREF=\"modules.php?name=Downloads&d_op=NewDownloads\">" . _NEWDOWNLOADS . "</A> ]|";
        echo "</TD><TD WIDTH=50% VALIGN=TOP ALIGN=CENTER>";
        OpenTable2();
        $content = "";
        $content .= "<TABLE BORDER=0 WIDTH=\"100%\">";
        $color = $bgcolor3;
        $sql = "SELECT lid, title, hits FROM " . $prefix . "_downloads_downloads ORDER BY hits DESC LIMIT 0, {$show_links_inum}";
        $result = $db->sql_query($sql);
        while ($row = $db->sql_fetchrow($result)) {
            $title2 = ereg_replace("_", " ", $row[title]);
            $color = switchColor($color);
            $content .= "<TR><TD BGCOLOR=\"{$color}\" ALIGN=LEFT><a href=\"modules.php?name=Downloads&amp;d_op=viewdownloaddetails&amp;lid={$row['lid']}&amp;title={$row['title']}\">{$title2}</a></TD>";
            $content .= "<TD BGCOLOR=\"{$color}\" ALIGN=CENTER WIDTH=\"20\">{$row['hits']}</TD></TR>";
        }
        echo "{$content}</TABLE>";
        CloseTable2();
        echo "|[ <A HREF=\"modules.php?name=Downloads&d_op=MostPopular\">" . _MOSTPOPULAR . " " . _DOWNLOADS . "</A> ]|";
        echo "</TD></TR>" . "</TABLE>";
        CloseTable();
    }
    include "footer.php";
}