Beispiel #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";
}
Beispiel #2
0
function viewdownloadcomments()
{
    global $downloadsprefix, $db, $bgcolor2, $module_name;
    $lid = intval($_GET['lid']);
    include "header.php";
    downl_menu_tpl(1);
    echo '<br />';
    $result = $db->sql_query("SELECT ratinguser, rating, ratingcomments, ratingtimestamp FROM " . $downloadsprefix . "_votedata WHERE ratinglid = {$lid} AND ratingcomments != '' ORDER BY ratingtimestamp DESC");
    $totalcomments = $db->sql_numrows($result);
    $transfertitle = ereg_replace("_", " ", $ttitle);
    $displaytitle = $transfertitle;
    OpenTable();
    echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br /><br />";
    downl_infomenu_tpl($lid, $ttitle);
    echo "<br /><br /><br />" . _TOTALOF . " {$totalcomments} " . _COMMENTS . "</font></center><br />" . "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"450\">";
    $x = 0;
    while (list($ratinguser, $rating, $ratingcomments, $ratingtimestamp) = $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})", $ratingtimestamp, $ratingtime);
        $ratingtime = strftime("%F", mktime($ratingtime[4], $ratingtime[5], $ratingtime[6], $ratingtime[2], $ratingtime[3], $ratingtime[1]));
        $date_array = explode("-", $ratingtime);
        $timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
        $formatted_date = date("F j, Y", $timestamp);
        /* Individual user information */
        $result2 = $db->sql_query("SELECT rating FROM " . $downloadsprefix . "_votedata WHERE ratinguser = '******'");
        $usertotalcomments = $db->sql_numrows($result2);
        $useravgrating = 0;
        while (list($rating2) = $db->sql_fetchrow($result2)) {
            $useravgrating = $useravgrating + $rating2;
        }
        $useravgrating = $useravgrating / $usertotalcomments;
        $useravgrating = number_format($useravgrating, 1);
        echo "<tr><td bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b> " . _USER . ": </b><a href=\"{$nukeurl}/" . getlink("Your_Account&amp;op=userinfo&amp;username={$ratinguser}") . "\">{$ratinguser}</a></font></td>" . "<td bgcolor=\"{$bgcolor2}\"><font class=\"content\"><b>" . _RATING . ": </b>{$rating}</font></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"right\"><font class=\"content\">{$formatted_date}</font></td>" . "</tr><tr>" . "<td valign=\"top\"><font class=\"tiny\">" . _USERAVGRATING . ": {$useravgrating}</font></td>" . "<td valign=\"top\" colspan=\"2\"><font class=\"tiny\">" . _NUMRATINGS . ": {$usertotalcomments}</font></td>" . "</tr><tr>" . "<td colspan=\"3\">" . "<font class=\"content\">";
        if (can_admin('downloads')) {
            echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&amp;lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/editicon.gif\" border=\"0\" alt=\"" . _EDITTHISDOWNLOAD . "\"></a>";
        }
        echo " {$ratingcomments}</font><br /><br /><br /></td></tr>";
        $x++;
    }
    echo "</table><br /><br /><center>";
    downloadfooter($lid);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Beispiel #3
0
function ratedownload()
{
    global $userinfo;
    $lid = intval($_REQUEST['lid']);
    include "header.php";
    downl_menu_tpl(1);
    echo '<br />';
    OpenTable();
    $displaytitle = ereg_replace("_", " ", $ttitle);
    $ip = $_SERVER["REMOTE_HOST"];
    if (empty($ip)) {
        $ip = $_SERVER["REMOTE_ADDR"];
    }
    echo "<b>{$displaytitle}</b>" . "<ul><font class=\"content\">" . "<li>" . _RATENOTE1 . "<li>" . _RATENOTE2 . "<li>" . _RATENOTE3 . "<li>" . _DRATENOTE4 . "<li>" . _RATENOTE5;
    if (is_user()) {
        echo "<li>" . _YOUAREREGGED . "<li>" . _FEELFREE2ADD;
        $auth_name = $userinfo['username'];
    } else {
        echo "<li>" . _YOUARENOTREGGED . "<li>" . _IFYOUWEREREG;
        $auth_name = $anonymous;
    }
    echo "</ul>" . "<form method=\"post\" action=\"" . getlink() . "\">" . "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"100%\">" . "<tr><td width=\"25\" nowrap></td>" . "<tr><td width=\"25\" nowrap></td><td width=\"550\">" . "<input type=\"hidden\" name=\"ratinglid\" value=\"{$lid}\" />" . "<input type=\"hidden\" name=\"ratinguser\" value=\"{$auth_name}\" />" . "<input type=\"hidden\" name=\"ratinghost_name\" value=\"{$ip}\" />" . "<font class=content>" . _RATETHISSITE . "" . "<select name=\"rating\">" . "<option>--</option>" . "<option>10</option>" . "<option>9</option>" . "<option>8</option>" . "<option>7</option>" . "<option>6</option>" . "<option>5</option>" . "<option>4</option>" . "<option>3</option>" . "<option>2</option>" . "<option>1</option>" . "</select></font>" . "<font class=\"content\"><input type=\"submit\" value=\"" . _RATETHISSITE . "\" /></font>" . "<br /><br />";
    if (is_user()) {
        echo "<b>" . _SCOMMENTS . ":</b><br /><textarea wrap=\"virtual\" cols=\"50\" rows=\"10\" name=\"ratingcomments\"></textarea><br /><br /><br /></font>";
    } else {
        echo "<input type=\"hidden\" name=\"ratingcomments\" value=\"\" />";
    }
    echo "</td></tr></table></form>";
    echo "<center>";
    downloadfooterchild($lid);
    echo "</center>";
    CloseTable();
    include "footer.php";
}
Beispiel #4
0
function NewDownloadsDate()
{
    global $downloadsprefix, $db, $module_name;
    $selectdate = intval($_GET['selectdate']);
    $dateDB = date("d-M-Y", $selectdate);
    $dateView = date("F d, Y", $selectdate);
    include "header.php";
    downl_menu_tpl(1);
    echo '<br />';
    OpenTable();
    $newdownloadDB = Date("Y-m-d", $selectdate);
    $totaldownloads = $db->sql_numrows($db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE date LIKE '%{$newdownloadDB}%'"));
    echo "<font class=\"option\"><b>{$dateView} - {$totaldownloads} " . _NEWDOWNLOADS . "</b></font>" . "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">";
    $sql = "SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE date LIKE '%{$newdownloadDB}%' ORDER BY title ASC";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
        $lid = $row['lid'];
        $cid = $row['cid'];
        $title = $row['title'];
        $description = $row['description'];
        $time = $row['date'];
        $hits = $row['hits'];
        $url = $row['url'];
        $downloadratingsummary = $row['downloadratingsummary'];
        $totalvotes = $row['totalvotes'];
        $totalcomments = $row['totalcomments'];
        $filesize = $row['filesize'];
        $version = $row['version'];
        $homepage = $row['homepage'];
        $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
        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 "&nbsp;<a href=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\" class=\"title\">{$title}</a>";
        $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
        newdownloadgraphic($datetime);
        popgraphic($hits);
        detecteditorial($lid, 1);
        echo "<br /><b>" . _DESCRIPTION . ":</b> {$description}<br />";
        echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />";
        echo "<b>" . _ADDEDON . ":</b> <b>{$datetime}</b> <b>" . _UDOWNLOADS . ":</b> {$hits}";
        $transfertitle = str_replace(" ", "_", $title);
        /* voting & comments stats */
        $votestring = $totalvotes == 1 ? _VOTE : _VOTES;
        if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
            echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
        }
        echo '<br />';
        $sql2 = "SELECT title FROM " . $downloadsprefix . "_categories WHERE cid='{$cid}'";
        $result2 = $db->sql_query($sql2);
        $row2 = $db->sql_fetchrow($result2);
        $ctitle = $row2[title];
        $ctitle = getparent($cid, $ctitle);
        echo "<B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}") . "\">{$ctitle}</A><br />";
        if ($homepage != "") {
            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 "<br /><br />";
    }
    echo "</font></td></tr></table>";
    CloseTable();
    include "footer.php";
}
Beispiel #5
0
function MostPopular()
{
    global $downloadsprefix, $db, $module_name, $mainvotedecimal;
    include "header.php";
    downl_menu_tpl(1);
    echo '<br />';
    OpenTable();
    echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">";
    $mostpopdownloads = isset($_GET['ratenum']) ? intval($_GET['ratenum']) : 10;
    if (isset($_GET['ratetype']) && $_GET['ratetype'] == 'percent') {
        $topdownloadspercent = $mostpopdownloads;
        list($totalmostpopdownloads) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads", SQL_NUM, __FILE__);
        $mostpopdownloads = $mostpopdownloads / 100;
        $mostpopdownloads = $totalmostpopdownloads * $mostpopdownloads;
        $mostpopdownloads = round($mostpopdownloads);
        echo "<center><font class=\"option\"><b>" . _MOSTPOPULAR . " {$topdownloadspercent}% (" . _OFALL . " {$totalmostpopdownloads} " . _DOWNLOADS . ")</b></font></center><br />";
    } else {
        echo "<center><font class=\"option\"><b>" . _MOSTPOPULAR . " {$mostpopdownloads}</b></font></center><br />";
    }
    echo "<center>" . _SHOWTOP . ": [ <a href=\"" . getlink("&amp;d_op=MostPopular&amp;ratenum=10&amp;ratetype=num") . "\">10</a> - " . "<a href=\"" . getlink("&amp;d_op=MostPopular&amp;ratenum=25&amp;ratetype=num") . "\">25</a> - " . "<a href=\"" . getlink("&amp;d_op=MostPopular&amp;ratenum=50&amp;ratetype=num") . "\">50</a> | " . "<a href=\"" . getlink("&amp;d_op=MostPopular&amp;ratenum=1&amp;ratetype=percent") . "\">1%</a> - " . "<a href=\"" . getlink("&amp;d_op=MostPopular&amp;ratenum=5&amp;ratetype=percent") . "\">5%</a> - " . "<a href=\"" . getlink("&amp;d_op=MostPopular&amp;ratenum=10&amp;ratetype=percent") . "\">10%</a> ]</center><br /><br /></td></tr>";
    $result = $db->sql_query("SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads order by hits DESC limit 0, {$mostpopdownloads}");
    echo "<tr><td class=\"content\">";
    while (list($lid, $cid, $title, $description, $time, $hits, $url, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) {
        $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
        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 "&nbsp;<a href=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\" class=\"title\">{$title}</a>";
        $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
        newdownloadgraphic($datetime);
        popgraphic($hits);
        detecteditorial($lid, 1);
        echo '<br />';
        echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />";
        echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />";
        echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> <b>{$hits}</b>";
        $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})";
        }
        echo '<br />';
        $result2 = $db->sql_query("SELECT title FROM " . $downloadsprefix . "_categories WHERE cid={$cid}");
        list($ctitle) = $db->sql_fetchrow($result2);
        $ctitle = getparent($cid, $ctitle);
        echo "<b>" . _CATEGORY . ":</b> <a href=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}") . "\">{$ctitle}</a>";
        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 "<br /><br />";
    }
    echo "</td></tr></table>";
    CloseTable();
    include "footer.php";
}
Beispiel #6
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";
}
Beispiel #7
0
function TopRated()
{
    global $downloadsprefix, $db, $module_name, $downloadvotemin, $topdownloads;
    include "header.php";
    downl_menu_tpl(1);
    echo '<br />';
    OpenTable();
    echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">";
    if (isset($_GET['ratenum']) && isset($_GET['ratetype'])) {
        $topdownloads = intval($_GET['ratenum']);
        if ($_GET['ratetype'] == "percent") {
            $topdownloadspercentrigger = 1;
        }
    }
    if ($topdownloadspercentrigger == 1) {
        $topdownloadspercent = $topdownloads;
        list($totalrateddownloads) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads WHERE downloadratingsummary != 0", SQL_NUM, __FILE__);
        $topdownloads = $topdownloads / 100;
        $topdownloads = $totalrateddownloads * $topdownloads;
        $topdownloads = round($topdownloads);
    }
    if ($topdownloadspercentrigger == 1) {
        echo "<center><font class=\"option\"><b>" . _DBESTRATED . " {$topdownloadspercent}% (" . _OF . " {$totalrateddownloads} " . _TRATEDDOWNLOADS . ")</b></font></center><br />";
    } else {
        echo "<center><font class=\"option\"><b>" . _DBESTRATED . " {$topdownloads} </b></font></center><br />";
    }
    echo "</td></tr>" . "<tr><td><center>" . _NOTE . " {$downloadvotemin} " . _TVOTESREQ . "<br />" . _SHOWTOP . ":  [ <a href=\"" . getlink("&amp;d_op=TopRated&amp;ratenum=10&amp;ratetype=num") . "\">10</a> - " . "<a href=\"" . getlink("&amp;d_op=TopRated&amp;ratenum=25&amp;ratetype=num") . "\">25</a> - " . "<a href=\"" . getlink("&amp;d_op=TopRated&amp;ratenum=50&amp;ratetype=num") . "\">50</a> | " . "<a href=\"" . getlink("&amp;d_op=TopRated&amp;ratenum=1&amp;ratetype=percent") . "\">1%</a> - " . "<a href=\"" . getlink("&amp;d_op=TopRated&amp;ratenum=5&amp;ratetype=percent") . "\">5%</a> - " . "<a href=\"" . getlink("&amp;d_op=TopRated&amp;ratenum=10&amp;ratetype=percent") . "\">10%</a> ]</center><br /><br /></td></tr>";
    $sql = "SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE downloadratingsummary != 0 AND totalvotes >= {$downloadvotemin} ORDER BY downloadratingsummary DESC LIMIT 0,{$topdownloads}";
    $result = $db->sql_query($sql);
    echo '<tr><td>';
    while ($row = $db->sql_fetchrow($result)) {
        $lid = $row['lid'];
        $cid = $row['cid'];
        $title = $row['title'];
        $description = $row['description'];
        $time = $row['date'];
        $hits = $row['hits'];
        $url = $row['url'];
        $downloadratingsummary = number_format($row['downloadratingsummary'], $mainvotedecimal);
        $totalvotes = $row['totalvotes'];
        $totalcomments = $row['totalcomments'];
        $filesize = $row['filesize'];
        $version = $row['version'];
        $homepage = $row['homepage'];
        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}&amp;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 "&nbsp;<a href=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\" class=\"title\">{$title}</a>";
        $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
        newdownloadgraphic($datetime);
        popgraphic($hits);
        detecteditorial($lid, 1);
        echo '<br />';
        echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />";
        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> <b>{$downloadratingsummary}</b> ({$totalvotes} {$votestring})";
        }
        echo '<br />';
        $sql2 = "SELECT title FROM " . $downloadsprefix . "_categories WHERE cid={$cid}";
        $result2 = $db->sql_query($sql2);
        $row2 = $db->sql_fetchrow($result2);
        $ctitle = $row2[title];
        $ctitle = getparent($cid, $ctitle);
        echo "<b>" . _CATEGORY . ":</b> <a href=\"" . getlink("&amp;d_op=viewdownload&cid={$cid}") . "\">{$ctitle}</a><br />";
        if ($homepage != "") {
            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 "<br /><br />";
    }
    echo "</td></tr></table>";
    CloseTable();
    require 'footer.php';
}
Beispiel #8
0
function search()
{
    global $bgcolor2, $downloadsprefix, $downloadsresults, $db, $mainvotedecimal, $module_name;
    include "header.php";
    $min = isset($_GET['min']) ? intval($_GET['min']) : 0;
    $orderby = convertorderbyin($_GET['orderby']);
    if (isset($_GET['show']) && intval($_GET['show']) != 0) {
        $downloadsresults = intval($_GET['show']);
    } else {
        $show = $downloadsresults;
    }
    $max = $min + $downloadsresults;
    $query = isset($_POST['query']) ? $_POST['query'] : $_GET['query'];
    $the_query = htmlprepare($query);
    $query = Fix_Quotes($query, true);
    $result = $db->sql_query("SELECT lid, cid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ORDER BY {$orderby} LIMIT {$min},{$downloadsresults}");
    $fullcountresult = $db->sql_query("SELECT lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments FROM " . $downloadsprefix . "_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ");
    $totalselecteddownloads = $db->sql_numrows($fullcountresult);
    $nrows = $db->sql_numrows($result);
    $x = 0;
    downl_menu_tpl(1);
    echo '<br />';
    OpenTable();
    if ($query != "") {
        if ($nrows > 0) {
            echo "<font class=\"option\">" . _SEARCHRESULTS4 . ": <b>{$the_query}</b></font><br /><br />" . "<table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _USUBCATEGORIES . "</b></font></td></tr></table>";
            $result2 = $db->sql_query("SELECT cid, title FROM " . $downloadsprefix . "_categories WHERE title LIKE '%{$query}%' ORDER BY title DESC");
            while (list($cid, $stitle) = $db->sql_fetchrow($result2)) {
                $res = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid}");
                $numrows = $db->sql_numrows($res);
                $result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}");
                list($cid3, $title3, $parentid3) = $db->sql_fetchrow($result3);
                if ($parentid3 > 0) {
                    $title3 = getparent($parentid3, $title3);
                }
                $title3 = ereg_replace($query, "<b>{$query}</b>", $title3);
            }
            echo "<br /><table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _UDOWNLOADS . "</b></font></td></tr></table>";
            $orderbyTrans = convertorderbytrans($orderby);
            echo "<center><font class=\"content\">" . _SORTDOWNLOADSBY . ": " . _TITLE . " (<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;orderby=titleA") . "\">A</a>\\<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;orderby=titleD") . "\">D</a>) " . _DATE . " (<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;orderby=dateA") . "\">A</a>\\<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;orderby=dateD") . "\">D</a>) " . _RATING . " (<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;orderby=ratingA") . "\">A</a>\\<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;orderby=ratingD") . "\">D</a>) " . _POPULARITY . " (<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;orderby=hitsA") . "\">A</a>\\<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;orderby=hitsD") . "\">D</a>)" . "<br />" . _RESSORTED . ": {$orderbyTrans}</center><br /><br /><br />";
            while (list($lid, $cid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) {
                $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal);
                $transfertitle = str_replace(" ", "_", $title);
                $title = ereg_replace($query, "<b>{$query}</b>", $title);
                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 "&nbsp;<a href=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\" class=\"title\">{$title}</a>";
                $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3);
                newdownloadgraphic($datetime);
                popgraphic($hits);
                detecteditorial($lid, 1);
                echo '<br />';
                $description = ereg_replace($query, "<b>{$query}</b>", $description);
                echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />";
                echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />";
                echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}";
                /* voting & comments stats */
                if ($totalvotes == 1) {
                    $votestring = _VOTE;
                } else {
                    $votestring = _VOTES;
                }
                if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") {
                    echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})";
                }
                echo '<br />';
                $result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}");
                list($cid3, $title3, $parentid3) = $db->sql_fetchrow($result3);
                if ($parentid3 > 0) {
                    $title3 = getparent($parentid3, $title3);
                }
                echo "<B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}") . "\">{$title3}</A>";
                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>";
                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 "<br /><br />";
                $x++;
            }
            echo "</font>";
            $orderby = convertorderbyout($orderby);
        } else {
            echo "<br /><br /><center><font class=\"option\"><b>" . _NOMATCHES . "</b></font><br /><br />" . _GOBACK . "<br /></center>";
        }
        /* Calculates how many pages exist.  Which page one should be on, etc... */
        $downloadpagesint = $totalselecteddownloads / $downloadsresults;
        $downloadpageremainder = $totalselecteddownloads % $downloadsresults;
        if ($downloadpageremainder != 0) {
            $downloadpages = ceil($downloadpagesint);
            if ($totalselecteddownloads < $downloadsresults) {
                $downloadpageremainder = 0;
            }
        } else {
            $downloadpages = $downloadpagesint;
        }
        /* Page Numbering */
        if ($downloadpages != 1 && $downloadpages != 0) {
            echo "<br /><br />" . _SELECTPAGE . ": ";
            $prev = $min - $downloadsresults;
            if ($prev >= 0) {
                echo "&nbsp;&nbsp;<b>[ <a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;min={$prev}&amp;orderby={$orderby}&amp;show={$show}") . "\">" . " << " . _PREVIOUSPAGE . "</a> ]</b> ";
            }
            $counter = 1;
            $currentpage = $max / $downloadsresults;
            while ($counter <= $downloadpages) {
                $cpage = $counter;
                $mintemp = $downloadsresults * $counter - $downloadsresults;
                if ($counter == $currentpage) {
                    echo "<b>{$counter}</b> ";
                } else {
                    echo "<a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;min={$mintemp}&amp;orderby={$orderby}&amp;show={$show}") . "\">{$counter}</a> ";
                }
                $counter++;
            }
            $next = $min + $downloadsresults;
            if ($x >= $downloadsresults) {
                echo "&nbsp;&nbsp;<b>[ <a href=\"" . getlink("&amp;d_op=search&amp;query={$the_query}&amp;min={$max}&amp;orderby={$orderby}&amp;show={$show}") . "\">" . _NEXTPAGE . " >></a> ]</b>";
            }
        }
        echo "<br /><br /><center><font class=\"content\">" . _TRY2SEARCH . " \"{$the_query}\" " . _INOTHERSENGINES . "<br />" . "<a target=\"_blank\" href=\"http://www.altavista.com/cgi-bin/query?pg=q&amp;sc=on&amp;hl=on&amp;act=2006&amp;par=0&amp;q={$the_query}&amp;kl=XX&amp;stype=stext\">Alta Vista</a> - " . "<a target=\"_blank\" href=\"http://www.hotbot.com/?MT={$the_query}&amp;DU=days&amp;SW=web\">HotBot</a> - " . "<a target=\"_blank\" href=\"http://www.infoseek.com/Titles?qt={$the_query}\">Infoseek</a> - " . "<a target=\"_blank\" href=\"http://www.dejanews.com/dnquery.xp?QRY={$the_query}\">Deja News</a> - " . "<a target=\"_blank\" href=\"http://www.lycos.com/cgi-bin/pursuit?query={$the_query}&amp;maxhits=20\">Lycos</a> - " . "<a target=\"_blank\" href=\"http://search.yahoo.com/bin/search?p={$the_query}\">Yahoo</a>" . "<br />" . "<a target=\"_blank\" href=\"http://es.linuxstart.com/cgi-bin/sqlsearch.cgi?pos=1&amp;query={$the_query}&amp;language=&amp;advanced=&amp;urlonly=&amp;withid=\">LinuxStart</a> - " . "<a target=\"_blank\" href=\"http://search.1stlinuxsearch.com/compass?scope={$the_query}&amp;ui=sr\">1stLinuxSearch</a> - " . "<a target=\"_blank\" href=\"http://www.google.com/search?q={$the_query}\">Google</a> - " . "<a target=\"_blank\" href=\"http://www.linuxdownloads.com/cgi-bin/search.cgi?query={$the_query}&amp;engine=Downloads\">LinuxDownloads</a> - " . "<a target=\"_blank\" href=\"http://www.freshmeat.net/search/?q={$the_query}&amp;section=projects\">Freshmeat</a> - " . "<a target=\"_blank\" href=\"http://www.justlinux.com/bin/search.pl?key={$the_query}\">JustLinux</a>" . "</font>";
    } else {
        echo "<center><font class=\"option\"><b>" . _NOMATCHES . "</b></font></center><br /><br />";
    }
    CloseTable();
    include "footer.php";
}
Beispiel #9
0
function viewdownloaddetails()
{
    global $downloadsprefix, $db, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $module_name;
    global $useoutsidevoting, $detailvotedecimal, $outsideweight, $anonymous, $userinfo;
    $lid = intval($_GET['lid']);
    include "header.php";
    downl_menu_tpl(1);
    $voteresult = $db->sql_query("SELECT rating, ratinguser, ratingcomments FROM " . $downloadsprefix . "_votedata WHERE ratinglid = {$lid}");
    $totalvotesDB = $db->sql_numrows($voteresult);
    $anonvotes = 0;
    $anonvoteval = 0;
    $outsidevotes = 0;
    $outsidevoteeval = 0;
    $regvoteval = 0;
    $topanon = 0;
    $bottomanon = 11;
    $topreg = 0;
    $bottomreg = 11;
    $topoutside = 0;
    $bottomoutside = 11;
    $avv = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $rvv = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $ovv = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $truecomments = $totalvotesDB;
    while (list($ratingDB, $ratinguserDB, $ratingcommentsDB) = $db->sql_fetchrow($voteresult)) {
        if ($ratingcommentsDB == "") {
            $truecomments--;
        }
        if ($ratinguserDB == $anonymous) {
            $anonvotes++;
            $anonvoteval += $ratingDB;
        }
        if ($useoutsidevoting == 1) {
            if ($ratinguserDB == 'outside') {
                $outsidevotes++;
                $outsidevoteval += $ratingDB;
            }
        } else {
            $outsidevotes = 0;
        }
        if ($ratinguserDB != $anonymous && $ratinguserDB != "outside") {
            $regvoteval += $ratingDB;
        }
        if ($ratinguserDB != $anonymous && $ratinguserDB != "outside") {
            if ($ratingDB > $topreg) {
                $topreg = $ratingDB;
            }
            if ($ratingDB < $bottomreg) {
                $bottomreg = $ratingDB;
            }
            for ($rcounter = 1; $rcounter < 11; $rcounter++) {
                if ($ratingDB == $rcounter) {
                    $rvv[$rcounter]++;
                }
            }
        }
        if ($ratinguserDB == $anonymous) {
            if ($ratingDB > $topanon) {
                $topanon = $ratingDB;
            }
            if ($ratingDB < $bottomanon) {
                $bottomanon = $ratingDB;
            }
            for ($rcounter = 1; $rcounter < 11; $rcounter++) {
                if ($ratingDB == $rcounter) {
                    $avv[$rcounter]++;
                }
            }
        }
        if ($ratinguserDB == "outside") {
            if ($ratingDB > $topoutside) {
                $topoutside = $ratingDB;
            }
            if ($ratingDB < $bottomoutside) {
                $bottomoutside = $ratingDB;
            }
            for ($rcounter = 1; $rcounter < 11; $rcounter++) {
                if ($ratingDB == $rcounter) {
                    $ovv[$rcounter]++;
                }
            }
        }
    }
    $regvotes = $totalvotesDB - $anonvotes - $outsidevotes;
    if ($totalvotesDB == 0) {
        $finalrating = 0;
    } else {
        if ($anonvotes == 0 && $regvotes == 0) {
            /* Figure Outside Only Vote */
            $finalrating = $outsidevoteval / $outsidevotes;
            $finalrating = number_format($finalrating, $detailvotedecimal);
            $avgOU = $outsidevoteval / $totalvotesDB;
            $avgOU = number_format($avgOU, $detailvotedecimal);
        } else {
            if ($outsidevotes == 0 && $regvotes == 0) {
                /* Figure Anon Only Vote */
                $finalrating = $anonvoteval / $anonvotes;
                $finalrating = number_format($finalrating, $detailvotedecimal);
                $avgAU = $anonvoteval / $totalvotesDB;
                $avgAU = number_format($avgAU, $detailvotedecimal);
            } else {
                if ($outsidevotes == 0 && $anonvotes == 0) {
                    /* Figure Reg Only Vote */
                    $finalrating = $regvoteval / $regvotes;
                    $finalrating = number_format($finalrating, $detailvotedecimal);
                    $avgRU = $regvoteval / $totalvotesDB;
                    $avgRU = number_format($avgRU, $detailvotedecimal);
                } else {
                    if ($regvotes == 0 && $useoutsidevoting == 1 && $outsidevotes != 0 && $anonvotes != 0) {
                        /* Figure Reg and Anon Mix */
                        $avgAU = $anonvoteval / $anonvotes;
                        $avgOU = $outsidevoteval / $outsidevotes;
                        if ($anonweight > $outsideweight) {
                            /* Anon is 'standard weight' */
                            $newimpact = $anonweight / $outsideweight;
                            $impactAU = $anonvotes;
                            $impactOU = $outsidevotes / $newimpact;
                        } else {
                            /* Outside is 'standard weight' */
                            $newimpact = $outsideweight / $anonweight;
                            $impactOU = $outsidevotes;
                            $impactAU = $anonvotes / $newimpact;
                        }
                        $finalrating = ($avgOU * $impactOU + $avgAU * $impactAU) / ($impactAU + $impactOU);
                        $finalrating = number_format($finalrating, $detailvotedecimal);
                    } else {
                        /* REG User vs. Anonymous vs. Outside User Weight Calutions */
                        $impact = $anonweight;
                        $outsideimpact = $outsideweight;
                        if ($regvotes == 0) {
                            $avgRU = 0;
                        } else {
                            $avgRU = $regvoteval / $regvotes;
                        }
                        if ($anonvotes == 0) {
                            $avgAU = 0;
                        } else {
                            $avgAU = $anonvoteval / $anonvotes;
                        }
                        if ($outsidevotes == 0) {
                            $avgOU = 0;
                        } else {
                            $avgOU = $outsidevoteval / $outsidevotes;
                        }
                        $impactRU = $regvotes;
                        $impactAU = $anonvotes / $impact;
                        $impactOU = $outsidevotes / $outsideimpact;
                        $finalrating = ($avgRU * $impactRU + $avgAU * $impactAU + $avgOU * $impactOU) / ($impactRU + $impactAU + $impactOU);
                        $finalrating = number_format($finalrating, $detailvotedecimal);
                    }
                }
            }
        }
    }
    if (!isset($avgO)) {
        $avgOU = "";
    } else {
        $avgOU = number_format($avgOU, $detailvotedecimal);
    }
    if (!isset($avgRU)) {
        $avgRU = "";
    } else {
        $avgRU = number_format($avgRU, $detailvotedecimal);
    }
    if (!isset($avgAU)) {
        $avgAU = "";
    } else {
        $avgAU = number_format($avgAU, $detailvotedecimal);
    }
    if ($topanon == 0) {
        $topanon = "";
    }
    if ($bottomanon == 11) {
        $bottomanon = "";
    }
    if ($topreg == 0) {
        $topreg = "";
    }
    if ($bottomreg == 11) {
        $bottomreg = "";
    }
    if ($topoutside == 0) {
        $topoutside = "";
    }
    if ($bottomoutside == 11) {
        $bottomoutside = "";
    }
    $totalchartheight = 70;
    $chartunits = $totalchartheight / 10;
    $avvper = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $rvvper = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $ovvper = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $avvpercent = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $rvvpercent = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $ovvpercent = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $avvchartheight = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $rvvchartheight = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $ovvchartheight = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    $avvmultiplier = 0;
    $rvvmultiplier = 0;
    $ovvmultiplier = 0;
    for ($rcounter = 1; $rcounter < 11; $rcounter++) {
        if ($anonvotes != 0) {
            $avvper[$rcounter] = $avv[$rcounter] / $anonvotes;
        }
        if ($regvotes != 0) {
            $rvvper[$rcounter] = $rvv[$rcounter] / $regvotes;
        }
        if ($outsidevotes != 0) {
            $ovvper[$rcounter] = $ovv[$rcounter] / $outsidevotes;
        }
        $avvpercent[$rcounter] = number_format($avvper[$rcounter] * 100, 1);
        $rvvpercent[$rcounter] = number_format($rvvper[$rcounter] * 100, 1);
        $ovvpercent[$rcounter] = number_format($ovvper[$rcounter] * 100, 1);
        if ($avv[$rcounter] > $avvmultiplier) {
            $avvmultiplier = $avv[$rcounter];
        }
        if ($rvv[$rcounter] > $rvvmultiplier) {
            $rvvmultiplier = $rvv[$rcounter];
        }
        if ($ovv[$rcounter] > $ovvmultiplier) {
            $ovvmultiplier = $ovv[$rcounter];
        }
    }
    if ($avvmultiplier != 0) {
        $avvmultiplier = 10 / $avvmultiplier;
    }
    if ($rvvmultiplier != 0) {
        $rvvmultiplier = 10 / $rvvmultiplier;
    }
    if ($ovvmultiplier != 0) {
        $ovvmultiplier = 10 / $ovvmultiplier;
    }
    for ($rcounter = 1; $rcounter < 11; $rcounter++) {
        $avvchartheight[$rcounter] = $avv[$rcounter] * $avvmultiplier * $chartunits;
        $rvvchartheight[$rcounter] = $rvv[$rcounter] * $rvvmultiplier * $chartunits;
        $ovvchartheight[$rcounter] = $ovv[$rcounter] * $ovvmultiplier * $chartunits;
        if ($avvchartheight[$rcounter] == 0) {
            $avvchartheight[$rcounter] = 1;
        }
        if ($rvvchartheight[$rcounter] == 0) {
            $rvvchartheight[$rcounter] = 1;
        }
        if ($ovvchartheight[$rcounter] == 0) {
            $ovvchartheight[$rcounter] = 1;
        }
    }
    $res = $db->sql_query("SELECT cid, date, hits, name, email, description, filesize, version, homepage, title FROM " . $downloadsprefix . "_downloads WHERE lid='{$lid}'");
    list($cid, $time, $hits, $auth_name, $email, $description, $filesize, $version, $homepage, $ttitle) = $db->sql_fetchrow($res);
    $displaytitle = $ttitle;
    echo '<br />';
    OpenTable();
    echo "<center><font class=\"title\">" . _DOWNLOADPROFILE . ": <A HREF=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\">{$displaytitle}</A>";
    newdownloadgraphic(L10NTime::date('d-M-Y', $time . ' 00:00:00', $userinfo['user_dst'], $userinfo['user_timezone']));
    popgraphic($hits);
    detecteditorial($lid, 1);
    $catResult = $db->sql_query("select title,cdescription,ldescription,parentid from " . $downloadsprefix . "_categories where cid='{$cid}'");
    list($catTitle, $cdescription, $ldescription, $parentid) = $db->sql_fetchrow($catResult);
    $catTitle = getparent($parentid, $catTitle);
    $catTitle = _MAIN . "/{$catTitle}";
    echo "</FONT><br /><br /><B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&amp;d_op=viewdownload&amp;cid={$cid}") . "\">{$catTitle}</A></B><br />";
    $ttitle = ereg_replace(" ", "_", $ttitle);
    downl_infomenu_tpl($lid, $ttitle);
    echo "<br /><br /><b><u>" . _DOWNLOADRATINGDET . "</u></b><br />" . "<b>" . _TOTALVOTES . "</B> {$totalvotesDB}<br />" . "<b>" . _OVERALLRATING . ":</B> {$finalrating}<br /><br />" . "<div align=\"justify\" class=\"content\">{$description}</div>";
    if ($auth_name == "") {
        $auth_name = "<i>" . _UNKNOWN . "</i>";
    } else {
        if ($email == "") {
            $auth_name = "{$auth_name}";
        } else {
            $email = ereg_replace("@", " <i>at</i> ", $email);
            $email = ereg_replace("\\.", " <i>dot</i> ", $email);
            $auth_name = "{$auth_name} ({$email})";
        }
    }
    echo "<br /><b>" . _CREDITS_AUTHORS . ":</b> {$auth_name}<br />" . "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "</font><br /><br />" . "[ <b><a href=\"" . getlink("&amp;d_op=getit&amp;lid={$lid}") . "\">" . _DOWNLOADNOW . "</a></b> ";
    if ($homepage == "" or $homepage == "http://") {
        echo "]<br /><br />";
    } else {
        echo "| <a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> ]<br /><br />";
    }
    echo "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"455\">" . "<tr><td colspan=\"2\" bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b>" . _REGISTEREDUSERS . "</b></font>" . "</td></tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\">" . "<font class=\"content\">" . _NUMBEROFRATINGS . ": {$regvotes}</font>" . "</td>" . "<td rowspan=\"5\">";
    if ($regvotes == 0) {
        echo "<center><font class=\"content\">" . _NOREGUSERSVOTES . "</font></center>";
    } else {
        echo "<CENTER><table border=\"1\" WIDTH=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['1']} " . _LVOTES . " ({$rvvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['1']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['2']} " . _LVOTES . " ({$rvvpercent['2']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['2']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['3']} " . _LVOTES . " ({$rvvpercent['3']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['3']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['4']} " . _LVOTES . " ({$rvvpercent['4']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['4']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['5']} " . _LVOTES . " ({$rvvpercent['5']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['5']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['6']} " . _LVOTES . " ({$rvvpercent['6']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['6']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['7']} " . _LVOTES . " ({$rvvpercent['7']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['7']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['8']} " . _LVOTES . " ({$rvvpercent['8']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['8']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['9']} " . _LVOTES . " ({$rvvpercent['9']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['9']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['10']} " . _LVOTES . " ({$rvvpercent['10']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$rvvchartheight['10']}\"></td>" . "</tr>" . "<tr><td colspan=\"10\" bgcolor=\"{$bgcolor2}\" ALIGN=CENTER>" . "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"200\"><tr>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">1</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">2</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">3</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">4</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">5</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">6</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">7</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">8</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">9</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">10</font></td>" . "</tr></table></CENTER>" . "</td></tr></table>";
    }
    echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgRU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topreg}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomreg}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _NUMOFCOMMENTS . ": {$truecomments}</font></td></tr>" . "<tr><td></td></tr>";
    if (isset($anonweight)) {
        echo "<tr><td valign=\"top\" colspan=\"2\"><font class=\"tiny\"><br /><br />" . $anonweight . ' ' . _TO . ' 1.</font></td></tr>';
    }
    echo "<tr><td colspan=\"2\" bgcolor=\"{$bgcolor2}\"><font class=\"content\"><b>" . _UNREGISTEREDUSERS . "</b></font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _NUMBEROFRATINGS . ": {$anonvotes}</font></td>" . "<td rowspan=\"5\">";
    if ($anonvotes == 0) {
        echo "<center><font class=\"content\">" . _NOUNREGUSERSVOTES . "</font></center>";
    } else {
        echo "<CENTER><table border=\"1\" width=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['1']} " . _LVOTES . " ({$avvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['1']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['2']} " . _LVOTES . " ({$avvpercent['2']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['2']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['3']} " . _LVOTES . " ({$avvpercent['3']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['3']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['4']} " . _LVOTES . " ({$avvpercent['4']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['4']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['5']} " . _LVOTES . " ({$avvpercent['5']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['5']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['6']} " . _LVOTES . " ({$avvpercent['6']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['6']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['7']} " . _LVOTES . " ({$avvpercent['7']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['7']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['8']} " . _LVOTES . " ({$avvpercent['8']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['8']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['9']} " . _LVOTES . " ({$avvpercent['9']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['9']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['10']} " . _LVOTES . " ({$avvpercent['10']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$avvchartheight['10']}\"></td>" . "</tr>" . "<tr><td colspan=\"10\" bgcolor=\"{$bgcolor2}\">" . "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"200\"><tr>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">1</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">2</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">3</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">4</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">5</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">6</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">7</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">8</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">9</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">10</font></td>" . "</tr></table>" . "</td></tr></table></CENTER>";
    }
    echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgAU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topanon}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomanon}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">&nbsp;</font></td></tr>";
    if (isset($useoutsidevoting) && $useoutsidevoting == 1) {
        echo "<tr><td valign=top colspan=\"2\"><font class=\"tiny\"><br /><br />" . _WEIGHOUTNOTE . " {$outsideweight} " . _TO . " 1.</font></td></tr>" . "<tr><td colspan=\"2\" bgcolor=\"{$bgcolor2}\"><font class=\"content\"><b>" . _OUTSIDEVOTERS . "</b></font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _NUMBEROFRATINGS . ": {$outsidevotes}</font></td>" . "<td rowspan=\"5\">";
        if ($outsidevotes == 0) {
            echo "<center><font class=\"content\">" . _NOOUTSIDEVOTES . "</font></center>";
        } else {
            echo "<CENTER><table border=\"1\" width=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['1']} " . _LVOTES . " ({$ovvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['1']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['2']} " . _LVOTES . " ({$ovvpercent['2']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['2']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['3']} " . _LVOTES . " ({$ovvpercent['3']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['3']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['4']} " . _LVOTES . " ({$ovvpercent['4']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['4']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['5']} " . _LVOTES . " ({$ovvpercent['5']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['5']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['6']} " . _LVOTES . " ({$ovvpercent['6']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['6']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['7']} " . _LVOTES . " ({$ovvpercent['7']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['7']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['8']} " . _LVOTES . " ({$ovvpercent['8']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['8']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['9']} " . _LVOTES . " ({$ovvpercent['9']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['9']}\"></td>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['10']} " . _LVOTES . " ({$ovvpercent['10']}% " . _LTOTALVOTES . ")\" src=\"modules/{$module_name}/images/blackpixel.gif\" width=\"15\" height=\"{$ovvchartheight['10']}\"></td>" . "</tr>" . "<tr><td colspan=\"10\" bgcolor=\"{$bgcolor2}\">" . "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"200\"><tr>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">1</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">2</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">3</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">4</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">5</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">6</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">7</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">8</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">9</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">10</font></td>" . "</tr></table>" . "</td></tr></table></CENTER>";
        }
        echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgOU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topoutside}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomoutside}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">&nbsp;</font></td></tr>";
    }
    echo "</table><br /><br /><center>";
    downloadfooter($lid);
    echo "</center>";
    CloseTable();
    include "footer.php";
}