home *** CD-ROM | disk | FTP | other *** search
Wrap
<?php /************************************************************************/ /* PHP-NUKE: Web Portal System */ /* =========================== */ /* */ /* Copyright (c) 2002 by Francisco Burzi */ /* http://phpnuke.org */ /* */ /* Based on Journey Links Hack */ /* Copyright (c) 2000 by James Knickelbein */ /* Journey Milwaukee (http://www.journeymilwaukee.com) */ /* */ /* This program is free software. You can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License. */ /************************************************************************/ if (!eregi("modules.php", $PHP_SELF)) { die ("You can't access this file directly..."); } require_once("mainfile.php"); $module_name = basename(dirname(__FILE__)); get_lang($module_name); $pagetitle = "- "._UDOWNLOADS.""; require_once("modules/$module_name/d_config.php"); $index = 1; // ALTERED BY PALADIN - 170102 - Start function getparent($parentid,$title) { global $prefix, $dbi; $result = sql_query("select cid, title, parentid from ".$prefix."_downloads_categories where cid=$parentid", $dbi); list($cid, $ptitle, $pparentid) = sql_fetch_row($result, $dbi); if ($ptitle!="") $title=$ptitle."/".$title; if ($pparentid!=0) { $title=getparent($pparentid,$title); } return $title; } function getparentlink($parentid,$title) { global $prefix, $dbi, $module_name; $result=sql_query("select cid, title, parentid from ".$prefix."_downloads_categories where cid=$parentid", $dbi); list($cid, $ptitle, $pparentid) = sql_fetch_row($result, $dbi); if ($ptitle!="") $title="<a href=modules.php?name=$module_name&d_op=viewdownload&cid=$cid>$ptitle</a>/".$title; if ($pparentid!=0) { $title=getparentlink($pparentid,$title); } return $title; } // ALTERED BY PALADIN - 170102 - End function menu($maindownload) { global $prefix, $dbi, $user_adddownload, $module_name; OpenTable(); echo "<br><center><a href=\"modules.php?name=$module_name\"><img src=\"modules/$module_name/images/down-logo.gif\" border=\"0\" alt=\"\"></a><br><br>"; echo "<form action=\"modules.php?name=$module_name&d_op=search&query=$query\" method=\"post\">" ."<font class=\"content\"><input type=\"text\" size=\"25\" name=\"query\"> <input type=\"submit\" value=\""._SEARCH."\"></font>" ."</form>"; echo "<font class=\"content\">[ "; if ($maindownload>0) { echo "<a href=\"modules.php?name=$module_name\">"._DOWNLOADSMAIN."</a> | "; } if ($user_adddownload == 1) { echo "<a href=\"modules.php?name=$module_name&d_op=AddDownload\">"._ADDDOWNLOAD."</a>" ." | "; } echo "<a href=\"modules.php?name=$module_name&d_op=NewDownloads\">"._NEW."</a>" ." | <a href=\"modules.php?name=$module_name&d_op=MostPopular\">"._POPULAR."</a>" ." | <a href=\"modules.php?name=$module_name&d_op=TopRated\">"._TOPRATED."</a> ]" ."</font></center>"; CloseTable(); } function SearchForm() { global $module_name; echo "<form action=\"modules.php?name=$module_name&d_op=search&query=$query\" method=\"post\">" ."<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">" ."<tr><td><font class=\"content\"><input type=\"text\" size=\"25\" name=\"query\"> <input type=\"submit\" value=\""._SEARCH."\"></td></tr>" ."</table>" ."</form>"; } function downloadinfomenu($lid, $ttitle) { global $module_name; echo "<br><font class=\"content\">[ " ."<a href=\"modules.php?name=$module_name&d_op=viewdownloadcomments&lid=$lid&ttitle=$ttitle\">"._DOWNLOADCOMMENTS."</a>" ." | <a href=\"modules.php?name=$module_name&d_op=viewdownloaddetails&lid=$lid&ttitle=$ttitle\">"._ADDITIONALDET."</a>" ." | <a href=\"modules.php?name=$module_name&d_op=viewdownloadeditorial&lid=$lid&ttitle=$ttitle\">"._EDITORREVIEW."</a>" ." | <a href=\"modules.php?name=$module_name&d_op=modifydownloadrequest&lid=$lid\">"._MODIFY."</a>" ." | <a href=\"modules.php?name=$module_name&d_op=brokendownload&lid=$lid\">"._REPORTBROKEN."</a> ]</font>"; } function index() { global $prefix, $dbi, $show_links_num, $module_name; 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>"; $result = sql_query("select cid, title, cdescription from ".$prefix."_downloads_categories where parentid=0 order by title", $dbi); $count = 0; while(list($cid, $title, $cdescription) = sql_fetch_row($result, $dbi)) { if ($show_links_num == 1) { $cresult = sql_query("select * from ".$prefix."_downloads_downloads where cid='$cid'", $dbi); $cnumrows = sql_num_rows($cresult, $dbi); $cnumm = "($cnumrows)"; } else { $cnumm = ""; } echo "<td><font class=\"option\"><strong><big>·</big></strong> <a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid\"><b>$title</b></a>$cnumm</font>"; categorynewdownloadgraphic($cid); if ($cdescription) { echo "<br><font class=\"content\">$cdescription</font><br>"; } else { echo "<br>"; } $result2 = sql_query("select cid, title from ".$prefix."_downloads_categories where parentid=$cid order by title limit 0,3", $dbi); $space = 0; while(list($cid, $stitle) = sql_fetch_row($result2, $dbi)) { if ($space>0) { echo ", "; } if ($show_links_num == 1) { $cresult2 = sql_query("select * from ".$prefix."_downloads_downloads where cid='$cid'", $dbi); $cnumrows2 = sql_num_rows($cresult2, $dbi); $cnum = " ($cnumrows2)"; } else { $cnumrows2 = ""; } echo "<font class=\"content\"><a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid\">$stitle</a>$cnum</font>"; $space++; } if ($count<1) { echo "</td><td> </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>"; } $result = sql_query("select * from ".$prefix."_downloads_downloads", $dbi); $numrows = sql_num_rows($result, $dbi); $result = sql_query("select * from ".$prefix."_downloads_categories", $dbi); $catnum = sql_num_rows($result, $dbi); echo "<center><font class=\"content\">"._THEREARE." <b>$numrows</b> "._DOWNLOADS." "._AND." <b>$catnum</b> "._CATEGORIES." "._INDB."</font></center>"; CloseTable(); include("footer.php"); } function AddDownload() { global $prefix, $dbi, $cookie, $user, $downloads_anonadddownloadlock, $module_name; include("header.php"); $maindownload = 1; menu(1); echo "<br>"; OpenTable(); echo "<center><font class=\"title\"><b>"._ADDADOWNLOAD."</b></font></center><br><br>"; if (is_user($user) || $downloads_anonadddownloadlock != 1) { echo "<b>"._INSTRUCTIONS.":</b><br>" ."<strong><big>·</big></strong> "._DSUBMITONCE."<br>" ."<strong><big>·</big></strong> "._DPOSTPENDING."<br>" ."<strong><big>·</big></strong> "._USERANDIP."<br>"; echo "<form method=\"post\" action=\"modules.php?name=$module_name&d_op=Add\">" .""._DOWNLOADNAME.": <input type=\"text\" name=\"title\" size=\"40\" maxlength=\"100\"><br>" .""._FILEURL.": <input type=\"text\" name=\"url\" size=\"50\" maxlength=\"100\" value=\"http://\"><br>"; $result = sql_query("select cid, title from ".$prefix."_downloads_categories order by title", $dbi); echo ""._CATEGORY.": <select name=\"cat\">"; $result2=sql_query("select cid, title, parentid from ".$prefix."_downloads_categories order by parentid,title", $dbi); while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) { if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2); echo "<option value=\"$cid2\">$ctitle2</option>"; } echo "</select><br><br>" .""._LDESCRIPTION."<br><textarea name=\"description\" cols=\"60\" rows=\"8\"></textarea><br><br>" .""._AUTHORNAME.": <input type=\"text\" name=\"auth_name\" size=\"30\" maxlength=\"60\"><br>" .""._AUTHOREMAIL.": <input type=\"text\" name=\"email\" size=\"30\" maxlength=\"60\"><br>" .""._FILESIZE.": <input type=\"text\" name=\"filesize\" size=\"12\" maxlength=\"11\"> ("._INBYTES.")<br>" .""._VERSION.": <input type=\"text\" name=\"version\" size=\"11\" maxlength=\"10\"><br>" .""._HOMEPAGE.": <input type=\"text\" name=\"homepage\" size=\"50\" maxlength=\"200\" value=\"http://\"><br><br>" ."<input type=\"hidden\" name=\"d_op\" value=\"Add\">" ."<input type=\"submit\" value=\""._ADDTHISFILE."\"> "._GOBACK."<br><br>" ."</form>"; } else { echo "<center>"._DOWNLOADSNOTUSER1."<br>" .""._DOWNLOADSNOTUSER2."<br><br>" .""._DOWNLOADSNOTUSER3."<br>" .""._DOWNLOADSNOTUSER4."<br>" .""._DOWNLOADSNOTUSER5."<br>" .""._DOWNLOADSNOTUSER6."<br>" .""._DOWNLOADSNOTUSER7."<br><br>" .""._DOWNLOADSNOTUSER8.""; } CloseTable(); include("footer.php"); } function Add($title, $url, $auth_name, $cat, $description, $email, $filesize, $version, $homepage) { global $prefix, $dbi, $user; $result = sql_query("select url from ".$prefix."_downloads_downloads where url='$url'", $dbi); $numrows = sql_num_rows($result, $dbi); if ($numrows>0) { include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><b>"._DOWNLOADALREADYEXT."</b><br><br>" .""._GOBACK.""; CloseTable(); include("footer.php"); } else { if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $submitter = $cookie[1]; } // Check if Title exist if ($title=="") { include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><b>"._DOWNLOADNOTITLE."</b><br><br>" .""._GOBACK.""; CloseTable(); include("footer.php"); } // Check if URL exist if ($url=="") { include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><b>"._DOWNLOADNOURL."</b><br><br>" .""._GOBACK.""; CloseTable(); include("footer.php"); } // Check if Description exist if ($description=="") { include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><b>"._DOWNLOADNODESC."</b><br><br>" .""._GOBACK.""; CloseTable(); include("footer.php"); } $cat = explode("-", $cat); if ($cat[1]=="") { $cat[1] = 0; } $title = stripslashes(FixQuotes($title)); $url = stripslashes(FixQuotes($url)); $description = stripslashes(FixQuotes($description)); $auth_name = stripslashes(FixQuotes($auth_name)); $email = stripslashes(FixQuotes($email)); $filesize = ereg_replace("\.","",$filesize); $filesize = ereg_replace("\,","",$filesize); sql_query("insert into ".$prefix."_downloads_newdownload values (NULL, '$cat[0]', '$cat[1]', '$title', '$url', '$description', '$auth_name', '$email', '$submitter', '$filesize', '$version', '$homepage')", $dbi); include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><b>"._DOWNLOADRECEIVED."</b><br>"; if ($email == "") { echo _CHECKFORIT; } CloseTable(); include("footer.php"); } } function NewDownloads($newdownloadshowdays) { global $prefix, $dbi, $module_name; include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><font class=\"option\"><b>"._NEWDOWNLOADS."</b></font></center><br>"; $counter = 0; $allweekdownloads = 0; while ($counter <= 7-1){ $newdownloaddayRaw = (time()-(86400 * $counter)); $newdownloadday = date("d-M-Y", $newdownloaddayRaw); $newdownloadView = date("F d, Y", $newdownloaddayRaw); $newdownloadDB = Date("Y-m-d", $newdownloaddayRaw); $result = sql_query("select * FROM ".$prefix."_downloads_downloads WHERE date LIKE '%$newdownloadDB%'", $dbi); $totaldownloads = sql_num_rows($result, $dbi); $counter++; $allweekdownloads = $allweekdownloads + $totaldownloads; } $counter = 0; while ($counter <=30-1){ $newdownloaddayRaw = (time()-(86400 * $counter)); $newdownloadDB = Date("Y-m-d", $newdownloaddayRaw); $result = sql_query("select * FROM ".$prefix."_downloads_downloads WHERE date LIKE '%$newdownloadDB%'", $dbi); $totaldownloads = sql_num_rows($result, $dbi); $allmonthdownloads = $allmonthdownloads + $totaldownloads; $counter++; } echo "<center><b>"._TOTALNEWDOWNLOADS.":</b> "._LASTWEEK." - $allweekdownloads \ "._LAST30DAYS." - $allmonthdownloads<br>" .""._SHOW.": <a href=\"modules.php?name=$module_name&d_op=NewDownloads&newdownloadshowdays=7\">"._1WEEK."</a> - <a href=\"modules.php?name=$module_name&d_op=NewDownloads&newdownloadshowdays=14\">"._2WEEKS."</a> - <a href=\"modules.php?name=$module_name&d_op=NewDownloads&newdownloadshowdays=30\">"._30DAYS."</a>" ."</center><br>"; /* List Last VARIABLE Days of Downloads */ if (!isset($newdownloadshowdays)) { $newdownloadshowdays = 7; } echo "<br><center><b>"._DTOTALFORLAST." $newdownloadshowdays "._DAYS.":</b><br><br>"; $counter = 0; $allweekdownloads = 0; while ($counter <= $newdownloadshowdays-1) { $newdownloaddayRaw = (time()-(86400 * $counter)); $newdownloadday = date("d-M-Y", $newdownloaddayRaw); $newdownloadView = date("F d, Y", $newdownloaddayRaw); $newdownloadDB = Date("Y-m-d", $newdownloaddayRaw); $result = sql_query("select * FROM ".$prefix."_downloads_downloads WHERE date LIKE '%$newdownloadDB%'", $dbi); $totaldownloads = sql_num_rows($result, $dbi); $counter++; $allweekdownloads = $allweekdownloads + $totaldownloads; echo "<strong><big>·</big></strong> <a href=\"modules.php?name=$module_name&d_op=NewDownloadsDate&selectdate=$newdownloaddayRaw\">$newdownloadView</a> ($totaldownloads)<br>"; } $counter = 0; $allmonthdownloads = 0; echo "</center>"; CloseTable(); include("footer.php"); } function NewDownloadsDate($selectdate) { global $prefix, $dbi, $module_name; $dateDB = (date("d-M-Y", $selectdate)); $dateView = (date("F d, Y", $selectdate)); include("header.php"); menu(1); echo "<br>"; OpenTable(); $newdownloadDB = Date("Y-m-d", $selectdate); $result = sql_query("select * FROM ".$prefix."_downloads_downloads WHERE date LIKE '%$newdownloadDB%'", $dbi); $totaldownloads = sql_num_rows($result, $dbi); echo "<font class=\"option\"><b>$dateView - $totaldownloads "._NEWDOWNLOADS."</b></font>" ."<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">"; $result = sql_query("select lid, cid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage from ".$prefix."_downloads_downloads where date LIKE '%$newdownloadDB%' order by title ASC", $dbi); while(list($lid, $cid, $title, $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); global $prefix, $dbi, $admin; if (is_admin($admin)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid=$lid\"><img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\""._EDIT."\"></a> "; } else { echo "<img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\"\"> "; } echo "<a href=\"modules.php?name=$module_name&d_op=getit&lid=$lid\">$title</a>"; newdownloadgraphic($datetime, $time); popgraphic($hits); detecteditorial($lid, $transfertitle, 1); echo "<br><b>"._DESCRIPTION.":</b> $description<br>"; setlocale ("LC_TIME", "$locale"); /* INSERT code for *editor review* here */ 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> <b>$datetime</b> <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&lid=$lid&ttitle=$transfertitle\">"._RATERESOURCE."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=brokendownload&lid=$lid\">"._REPORTBROKEN."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloaddetails&lid=$lid&ttitle=$transfertitle\">"._DETAILS."</a>"; if ($totalcomments != 0) { echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloadcomments&lid=$lid&ttitle=$transfertitle\">"._SCOMMENTS." ($totalcomments)</a>"; } detecteditorial($lid, $transfertitle, 0); echo "<br>"; $result2=sql_query("select title from ".$prefix."_downloads_categories where cid=$cid", $dbi); list($ctitle) = sql_fetch_row($result2, $dbi); $ctitle=getparent($cid,$ctitle); echo ""._CATEGORY.": $ctitle"; echo "<br><br>"; } echo "</font></td></tr></table>"; CloseTable(); include("footer.php"); } function TopRated($ratenum, $ratetype) { global $prefix, $dbi, $admin, $module_name; include("header.php"); include("modules/$module_name/d_config.php"); menu(1); echo "<br>"; OpenTable(); echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">"; if ($ratenum != "" && $ratetype != "") { $topdownloads = $ratenum; if ($ratetype == "percent") { $topdownloadspercentrigger = 1; } } if ($topdownloadspercentrigger == 1) { $topdownloadspercent = $topdownloads; $result = sql_query("select * from ".$prefix."_downloads_downloads where downloadratingsummary != 0", $dbi); $totalrateddownloads = sql_num_rows($result, $dbi); $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=\"modules.php?name=$module_name&d_op=TopRated&ratenum=10&ratetype=num\">10</a> - " ."<a href=\"modules.php?name=$module_name&d_op=TopRated&ratenum=25&ratetype=num\">25</a> - " ."<a href=\"modules.php?name=$module_name&d_op=TopRated&ratenum=50&ratetype=num\">50</a> | " ."<a href=\"modules.php?name=$module_name&d_op=TopRated&ratenum=1&ratetype=percent\">1%</a> - " ."<a href=\"modules.php?name=$module_name&d_op=TopRated&ratenum=5&ratetype=percent\">5%</a> - " ."<a href=\"modules.php?name=$module_name&d_op=TopRated&ratenum=10&ratetype=percent\">10%</a> ]</center><br><br></td></tr>"; $result = sql_query("select lid, cid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage from ".$prefix."_downloads_downloads where downloadratingsummary != 0 and totalvotes >= $downloadvotemin order by downloadratingsummary DESC limit 0,$topdownloads ", $dbi); echo "<tr><td>"; while(list($lid, $cid, $title, $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); global $prefix, $dbi, $admin; if (is_admin($admin)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid=$lid\"><img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\""._EDIT."\"></a> "; } else { echo "<img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\"\"> "; } echo "<a href=\"modules.php?name=$module_name&d_op=getit&lid=$lid\">$title</a>"; newdownloadgraphic($datetime, $time); popgraphic($hits); detecteditorial($lid, $transfertitle, 1); echo "<br>"; echo "<b>"._DESCRIPTION.":</b> $description<br>"; 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> <b>$downloadratingsummary</b> ($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&lid=$lid&ttitle=$transfertitle\">"._RATERESOURCE."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=brokendownload&lid=$lid\">"._REPORTBROKEN."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloaddetails&lid=$lid&ttitle=$transfertitle\">"._DETAILS."</a>"; if ($totalcomments != 0) { echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloadcomments&lid=$lid&ttitle=$transfertitle\">"._SCOMMENTS." ($totalcomments)</a>"; } detecteditorial($lid, $transfertitle, 0); echo "<br>"; $result2=sql_query("select title from ".$prefix."_downloads_categories where cid=$cid", $dbi); list($ctitle) = sql_fetch_row($result2, $dbi); $ctitle=getparent($cid,$ctitle); echo ""._CATEGORY.": $ctitle"; echo "<br><br>"; } echo "</font></td></tr></table>"; CloseTable(); include("footer.php"); } function MostPopular($ratenum, $ratetype) { global $prefix, $dbi, $admin, $module_name; include("header.php"); include("modules/$module_name/d_config.php"); menu(1); echo "<br>"; OpenTable(); echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">"; if ($ratenum != "" && $ratetype != "") { $mostpopdownloads = $ratenum; if ($ratetype == "percent") $mostpopdownloadspercentrigger = 1; } if ($mostpopdownloadspercentrigger == 1) { $topdownloadspercent = $mostpopdownloads; $result = sql_query("select * from ".$prefix."_downloads_downloads", $dbi); $totalmostpopdownloads = sql_num_rows($result, $dbi); $mostpopdownloads = $mostpopdownloads / 100; $mostpopdownloads = $totalmostpopdownloads * $mostpopdownloads; $mostpopdownloads = round($mostpopdownloads); } if ($mostpopdownloadspercentrigger == 1) { echo "<center><font class=\"option\"><b>"._MOSTPOPULAR." $topdownloadspercent% ("._OFALL." $totalmostpopdownloads "._DOWNLOADS.")</b></font></center>"; } else { echo "<center><font class=\"option\"><b>"._MOSTPOPULAR." $mostpopdownloads</b></font></center>"; } echo "<tr><td><center>"._SHOWTOP.": [ <a href=\"modules.php?name=$module_name&d_op=MostPopular&ratenum=10&ratetype=num\">10</a> - " ."<a href=\"modules.php?name=$module_name&d_op=MostPopular&ratenum=25&ratetype=num\">25</a> - " ."<a href=\"modules.php?name=$module_name&d_op=MostPopular&ratenum=50&ratetype=num\">50</a> | " ."<a href=\"modules.php?name=$module_name&d_op=MostPopular&ratenum=1&ratetype=percent\">1%</a> - " ."<a href=\"modules.php?name=$module_name&d_op=MostPopular&ratenum=5&ratetype=percent\">5%</a> - " ."<a href=\"modules.php?name=$module_name&d_op=MostPopular&ratenum=10&ratetype=percent\">10%</a> ]</center><br><br></td></tr>"; $result = sql_query("select lid, cid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage from ".$prefix."_downloads_downloads order by hits DESC limit 0,$mostpopdownloads ", $dbi); echo "<tr><td>"; while(list($lid, $cid, $title, $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); global $prefix, $dbi, $admin; if (is_admin($admin)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid=$lid\"><img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\""._EDIT."\"></a> "; } else { echo "<img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\"\"> "; } echo "<font class=\"content\"><a href=\"modules.php?name=$module_name&d_op=getit&lid=$lid\">$title</a>"; newdownloadgraphic($datetime, $time); popgraphic($hits); detecteditorial($lid, $transfertitle, 1); echo "<br>"; echo "<b>"._DESCRIPTION.":</b> $description<br>"; 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> <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)"; } 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&lid=$lid&ttitle=$transfertitle\">"._RATERESOURCE."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=brokendownload&lid=$lid\">"._REPORTBROKEN."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloaddetails&lid=$lid&ttitle=$transfertitle\">"._DETAILS."</a>"; if ($totalcomments != 0) { echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloadcomments&lid=$lid&ttitle=$transfertitle\">"._SCOMMENTS." ($totalcomments)</a>"; } detecteditorial($lid, $transfertitle, 0); echo "<br>"; $result2=sql_query("select title from ".$prefix."_downloads_categories where cid=$cid", $dbi); list($ctitle) = sql_fetch_row($result2, $dbi); $ctitle=getparent($cid,$ctitle); echo ""._CATEGORY.": $ctitle"; echo "<br><br>"; } echo "</font></td></tr></table>"; CloseTable(); include("footer.php"); } function viewdownload($cid, $min, $orderby, $show) { global $prefix, $dbi, $admin, $perpage, $module_name; 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; } menu(1); echo "<br>"; OpenTable(); $result = sql_query("select title,parentid from ".$prefix."_downloads_categories where cid=$cid", $dbi); list($title,$parentid)=sql_fetch_row($result, $dbi); $title=getparentlink($parentid,$title); $title="<a href=modules.php?name=$module_name>"._MAIN."</a>/$title"; echo "<center><font class=\"option\"><b>"._CATEGORY.": $title</b></font></center><br>"; 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)) { $cresult = sql_query("select * from ".$prefix."_downloads_downloads where cid=$cid2", $dbi); $cnumrows = sql_num_rows($cresult, $dbi); echo "<td><font class=\"option\"><strong><big>â•–</big></strong> <a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid2\"><b>$title2</b></a></font> ($cnumrows)"; categorynewdownloadgraphic($cid2); if ($cdescription2) { echo "<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 ", "; } $cresult2 = sql_query("select * from ".$prefix."_downloads_downloads where cid=$cid3", $dbi); $cnumrows2 = sql_num_rows($cresult2, $dbi); echo "<font class=\"content\"><a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid3\">$title3</a> ($cnumrows2)</font>"; $space++; } if ($count<1) { echo "</td><td> </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&cid=$cid&orderby=titleA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=titleD\">D</a>) " .""._DATE." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=dateA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=dateD\">D</a>) " .""._RATING." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=ratingA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=ratingD\">D</a>) " .""._POPULARITY." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=hitsA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&orderby=hitsD\">D</a>)" ."<br><b>"._RESSORTED.": $orderbyTrans</b></font></center><br><br>"; $result=sql_query("select lid, title, 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, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments 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; while(list($lid, $title, $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); global $prefix, $dbi, $admin; if (is_admin($admin)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid=$lid\"><img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\""._EDIT."\"></a> "; } else { echo "<img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\"\"> "; } echo "<a href=\"modules.php?name=$module_name&d_op=getit&lid=$lid\">$title</a>"; newdownloadgraphic($datetime, $time); popgraphic($hits); /* INSERT code for *editor review* here */ detecteditorial($lid, $transfertitle, 1); echo "<br>"; echo "<b>"._DESCRIPTION.":</b> $description<br>"; 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&lid=$lid&ttitle=$transfertitle\">"._RATERESOURCE."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=brokendownload&lid=$lid\">"._REPORTBROKEN."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloaddetails&lid=$lid&ttitle=$transfertitle\">"._DETAILS."</a>"; if ($totalcomments != 0) { echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloadcomments&lid=$lid&ttitle=$transfertitle\">"._SCOMMENTS." ($totalcomments)</a>"; } detecteditorial($lid, $transfertitle, 0); echo "<br><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 " <b>[ <a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&min=$prev&orderby=$orderby&show=$show\">"; echo " << "._PREVIOUS."</a> ]</b> "; } $counter = 1; $currentpage = ($max / $perpage); while ($counter<=$downloadpages ) { $cpage = $counter; $mintemp = ($perpage * $counter) - $perpage; if ($counter == $currentpage) { echo "<b>$counter</b> "; } else { echo "<a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&min=$mintemp&orderby=$orderby&show=$show\">$counter</a> "; } $counter++; } $next=$min+$perpage; if ($x>=$perpage) { echo " <b>[ <a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid&min=$max&orderby=$orderby&show=$show\">"; echo " "._NEXT." >></a> ]</b> "; } } echo "</td></tr></table>"; CloseTable(); include("footer.php"); } function viewsdownload($sid, $min, $orderby, $show) { global $prefix, $dbi, $admin, $module_name; include("modules/$module_name/d_config.php"); include("header.php"); menu(1); 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; } echo "<br>"; OpenTable(); $result = sql_query("select title,parentid from ".$prefix."_downloads_categories where cid=$cid", $dbi); list($title,$parentid)=sql_fetch_row($result, $dbi); $title=getparentlink($parentid,$title); $title="<a href=modules.php?name=$module_name>"._MAIN."</a>/$title"; echo "<center><font class=\"option\"><b>"._CATEGORY.": $title</b></font></center><br>"; 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)) { echo "<td><font class=\"option\"><strong><big>â•–</big></strong> <a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid2\"><b>$title2</b></a></font>"; categorynewdownloadgraphic($cid2); if ($cdescription2) { echo "<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 ", "; } echo "<font class=\"content\"><a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid3\">$title3</a></font>"; $space++; } if ($count<1) { echo "</td><td> </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 "<br><center><font class=\"content\">"._SORTDOWNLOADSBY.": " .""._TITLE." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&orderby=titleA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&orderby=titleD\">D</a>)" ." "._DATE." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&orderby=dateA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&orderby=dateD\">D</a>)" ." "._RATING." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&orderby=ratingA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&orderby=ratingD\">D</a>)" ." "._POPULARITY." (<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&orderby=hitsA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&orderby=hitsD\">D</a>)" ."<br><b>"._RESSORTED.": $orderbyTrans</b></font></center><br><br>"; $result=sql_query("select lid, url, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage from ".$prefix."_downloads_downloads where sid=$sid order by $orderby limit $min,$perpage", $dbi); $fullcountresult=sql_query("select lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments from ".$prefix."_downloads_downloads where sid=$sid", $dbi); $totalselecteddownloads = sql_num_rows($fullcountresult, $dbi); echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">"; $x=0; while(list($lid, $url, $title, $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); global $prefix, $dbi, $admin; if (is_admin($admin)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid=$lid\"><img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\""._EDIT."\"></a> "; } else { echo "<img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\"\"> "; } echo "<a href=\"modules.php?name=$module_name&d_op=getit&lid=$lid\">$title</a>"; newdownloadgraphic($datetime, $time); popgraphic($hits); /* code for *editor review* insert here */ detecteditorial($lid, $transfertitle, 1); echo "<br><b>"._DESCRIPTION.":</b> $description<br>"; 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&lid=$lid&ttitle=$transfertitle\">"._RATERESOURCE."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=brokendownload&lid=$lid\">"._REPORTBROKEN."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloaddetails&lid=$lid&ttitle=$transfertitle\">"._DETAILS."</a>"; if ($totalcomments != 0) { echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloadcomments&lid=$lid&ttitle=$transfertitle\">"._SCOMMENTS." ($totalcomments)</a>"; } detecteditorial($lid, $transfertitle, 0); echo "<br><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>" .""._SELECTPAGE.": "; $prev=$min-$perpage; if ($prev>=0) { echo " <b>[ <a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&min=$prev&orderby=$orderby&show=$show\">" ." << "._PREVIOUS."</a> ]</b> "; } $counter = 1; $currentpage = ($max / $perpage); while ($counter<=$downloadpages ) { $cpage = $counter; $mintemp = ($perpage * $counter) - $perpage; if ($counter == $currentpage) { echo "<b>$counter</b> "; } else { echo "<a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&min=$mintemp&orderby=$orderby&show=$show\">$counter</a> "; } $counter++; } $next=$min+$perpage; if ($x>=$perpage) { echo " <b>[ <a href=\"modules.php?name=$module_name&d_op=viewdownload&sid=$sid&min=$max&orderby=$orderby&show=$show\">" ." "._NEXT." >></a> ]</b> "; } } echo "</td></tr></table>"; CloseTable(); include("footer.php"); } function newdownloadgraphic($datetime, $time) { global $module_name; echo " "; 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); $startdate = time(); $count = 0; while ($count <= 7) { $daysold = date("d-M-Y", $startdate); if ("$daysold" == "$datetime") { if ($count<=1) { echo "<img src=\"modules/$module_name/images/new_1.gif\" alt=\""._NEWTODAY."\">"; } if ($count<=3 && $count>1) { echo "<img src=\"modules/$module_name/images/new_3.gif\" alt=\""._NEWLAST3DAYS."\">"; } if ($count<=7 && $count>3) { echo "<img src=\"modules/$module_name/images/new_7.gif\" alt=\""._NEWTHISWEEK."\">"; } } $count++; $startdate = (time()-(86400 * $count)); } } function categorynewdownloadgraphic($cat) { global $prefix, $dbi, $module_name; $newresult = sql_query("select date from ".$prefix."_downloads_downloads where cid=$cat order by date desc limit 1", $dbi); list($time)=sql_fetch_row($newresult, $dbi); echo " "; 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); $startdate = time(); $count = 0; while ($count <= 7) { $daysold = date("d-M-Y", $startdate); if ("$daysold" == "$datetime") { if ($count<=1) { echo "<img src=\"modules/$module_name/images/new_1.gif\" alt=\""._DCATNEWTODAY."\">"; } if ($count<=3 && $count>1) { echo "<img src=\"modules/$module_name/images/new_3.gif\" alt=\""._DCATLAST3DAYS."\">"; } if ($count<=7 && $count>3) { echo "<img src=\"modules/$module_name/images/new_7.gif\" alt=\""._DCATTHISWEEK."\">"; } } $count++; $startdate = (time()-(86400 * $count)); } } function popgraphic($hits) { global $module_name; include("modules/$module_name/d_config.php"); if ($hits>=$popular) { echo " <img src=\"modules/$module_name/images/popular.gif\" alt=\""._POPULAR."\">"; } } function convertorderbyin($orderby) { if ($orderby == "titleA") $orderby = "title ASC"; if ($orderby == "dateA") $orderby = "date ASC"; if ($orderby == "hitsA") $orderby = "hits ASC"; if ($orderby == "ratingA") $orderby = "downloadratingsummary ASC"; if ($orderby == "titleD") $orderby = "title DESC"; if ($orderby == "dateD") $orderby = "date DESC"; if ($orderby == "hitsD") $orderby = "hits DESC"; if ($orderby == "ratingD") $orderby = "downloadratingsummary DESC"; return $orderby; } function convertorderbytrans($orderby) { if ($orderby == "hits ASC") $orderbyTrans = ""._POPULARITY1.""; if ($orderby == "hits DESC") $orderbyTrans = ""._POPULARITY2.""; if ($orderby == "title ASC") $orderbyTrans = ""._TITLEAZ.""; if ($orderby == "title DESC") $orderbyTrans = ""._TITLEZA.""; if ($orderby == "date ASC") $orderbyTrans = ""._DDATE1.""; if ($orderby == "date DESC") $orderbyTrans = ""._DDATE2.""; if ($orderby == "downloadratingsummary ASC") $orderbyTrans = ""._RATING1.""; if ($orderby == "downloadratingsummary DESC") $orderbyTrans = ""._RATING2.""; return $orderbyTrans; } function convertorderbyout($orderby) { if ($orderby == "title ASC") $orderby = "titleA"; if ($orderby == "date ASC") $orderby = "dateA"; if ($orderby == "hits ASC") $orderby = "hitsA"; if ($orderby == "downloadratingsummary ASC") $orderby = "ratingA"; if ($orderby == "title DESC") $orderby = "titleD"; if ($orderby == "date DESC") $orderby = "dateD"; if ($orderby == "hits DESC") $orderby = "hitsD"; if ($orderby == "downloadratingsummary DESC") $orderby = "ratingD"; return $orderby; } function getit($lid) { global $prefix, $dbi; sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 where lid=$lid", $dbi); $result = sql_query("select url from ".$prefix."_downloads_downloads where lid=$lid", $dbi); list($url) = sql_fetch_row($result, $dbi); Header("Location: $url"); } function search($query, $min, $orderby, $show) { global $prefix, $dbi, $admin, $bgcolor2, $module_name; include("modules/$module_name/d_config.php"); if (!isset($min)) $min=0; if (!isset($max)) $max=$min+$downloadsresults; if(isset($orderby)) { $orderby = convertorderbyin($orderby); } else { $orderby = "title ASC"; } if ($show!="") { $downloadsresults = $show; } else { $show=$downloadsresults; } $query = addslashes($query); $result = sql_query("select lid, cid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage from ".$prefix."_downloads_downloads where title LIKE '%$query%' OR description LIKE '%$query%' ORDER BY $orderby LIMIT $min,$downloadsresults", $dbi); $fullcountresult = sql_query("select lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments from ".$prefix."_downloads_downloads where title LIKE '%$query%' OR description LIKE '%$query%' ", $dbi); $totalselecteddownloads = sql_num_rows($fullcountresult, $dbi); $nrows = sql_num_rows($result, $dbi); $x=0; $the_query = stripslashes($query); $the_query = str_replace("\'", "'", $the_query); include("header.php"); menu(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 = sql_query("select cid, title from ".$prefix."_downloads_categories where title LIKE '%$query%' ORDER BY title DESC", $dbi); while(list($cid, $stitle) = sql_fetch_row($result2, $dbi)) { $res = sql_query("select * from ".$prefix."_downloads_downloads where cid=$cid", $dbi); $numrows = sql_num_rows($res, $dbi); $result3 = sql_query("select cid,title,parentid from ".$prefix."_downloads_categories where cid=$cid", $dbi); list($cid3,$title3,$parentid3) = sql_fetch_row($result3, $dbi); if ($parentid3>0) $title3 = getparent($parentid3,$title3); $title3 = ereg_replace($query, "<b>$query</b>", $title3); echo "<strong><big>â•–</big></strong> <a href=\"modules.php?name=$module_name&d_op=viewdownload&cid=$cid\">$title3</a> ($numrows)<br>"; } 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=\"modules.php?name=$module_name&d_op=search&query=$the_query&orderby=titleA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&orderby=titleD\">D</a>) " .""._DATE." (<a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&orderby=dateA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&orderby=dateD\">D</a>) " .""._RATING." (<a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&orderby=ratingA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&orderby=ratingD\">D</a>) " .""._POPULARITY." (<a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&orderby=hitsA\">A</a>\<a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&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) = sql_fetch_row($result, $dbi)) { $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); $title = stripslashes($title); $description = stripslashes($description); $transfertitle = str_replace (" ", "_", $title); $title = ereg_replace($query, "<b>$query</b>", $title); global $prefix, $dbi, $admin; if (is_admin($admin)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid=$lid\"><img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\""._EDIT."\"></a> "; } else { echo "<img src=\"modules/$module_name/images/lwin.gif\" border=\"0\" alt=\"\"> "; } echo "<a href=\"modules.php?name=$module_name&d_op=getit&lid=$lid\">$title</a>"; newdownloadgraphic($datetime, $time); popgraphic($hits); detecteditorial($lid, $transfertitle, 1); echo "<br>"; $description = ereg_replace($query, "<b>$query</b>", $description); echo "<b>"._DESCRIPTION.":</b> $description<br>"; 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"; /* 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&lid=$lid&ttitle=$transfertitle\">"._RATERESOURCE."</a>"; echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloaddetails&lid=$lid&ttitle=$transfertitle\">"._DETAILS."</a>"; if ($totalcomments != 0) { echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloadcomments&lid=$lid&ttitle=$transfertitle>"._SCOMMENTS." ($totalcomments)</a>"; } detecteditorial($lid, $transfertitle, 0); echo "<br>"; $result3 = sql_query("select cid,title,parentid from ".$prefix."_downloads_categories where cid=$cid", $dbi); list($cid3,$title3,$parentid3) = sql_fetch_row($result3, $dbi); if ($parentid3>0) $title3 = getparent($parentid3,$title3); echo ""._CATEGORY.": $title3<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 " <b>[ <a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&min=$prev&orderby=$orderby&show=$show\">" ." << "._PREVIOUS."</a> ]</b> "; } $counter = 1; $currentpage = ($max / $downloadsresults); while ($counter<=$downloadpages ) { $cpage = $counter; $mintemp = ($perpage * $counter) - $downloadsresults; if ($counter == $currentpage) { echo "<b>$counter</b> "; } else { echo "<a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&min=$mintemp&orderby=$orderby&show=$show\">$counter</a> "; } $counter++; } $next=$min+$downloadsresults; if ($x>=$perpage) { echo " <b>[ <a href=\"modules.php?name=$module_name&d_op=search&query=$the_query&min=$max&orderby=$orderby&show=$show\">" ." "._NEXT." >></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&sc=on&hl=on&act=2006&par=0&q=$the_query&kl=XX&stype=stext\">Alta Vista</a> - " ."<a target=\"_blank\" href=\"http://www.hotbot.com/?MT=$the_query&DU=days&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&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&query=$the_query&language=&advanced=&urlonly=&withid=\">LinuxStart</a> - " ."<a target=\"_blank\" href=\"http://search.1stlinuxsearch.com/compass?scope=$the_query&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&engine=Downloads\">LinuxDownloads</a> - " ."<a target=\"_blank\" href=\"http://www.freshmeat.net/modules.php?name=Search&query=$the_query\">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"); } 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); $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"); } function detecteditorial($lid, $ttitle, $img) { global $prefix, $dbi, $module_name; $resulted2 = sql_query("select adminid from ".$prefix."_downloads_editorials where downloadid=$lid", $dbi); $recordexist = sql_num_rows($resulted2, $dbi); if ($recordexist != 0) { if ($img == 1) { echo " <a href=\"modules.php?name=$module_name&d_op=viewdownloadeditorial&lid=$lid&ttitle=$ttitle\"><img src=\"modules/$module_name/images/cool.gif\" alt=\""._EDITORIAL."\" border=\"0\"></a>"; } else { echo " | <a href=\"modules.php?name=$module_name&d_op=viewdownloadeditorial&lid=$lid&ttitle=$ttitle\">"._EDITORIAL."</a>"; } } } function viewdownloadcomments($lid, $ttitle) { global $prefix, $dbi, $admin, $bgcolor2, $module_name; include("header.php"); include("modules/$module_name/d_config.php"); menu(1); echo "<br>"; $result=sql_query("SELECT ratinguser, rating, ratingcomments, ratingtimestamp FROM ".$prefix."_downloads_votedata WHERE ratinglid = $lid AND ratingcomments != '' ORDER BY ratingtimestamp DESC", $dbi); $totalcomments = sql_num_rows($result, $dbi); $transfertitle = ereg_replace ("_", " ", $ttitle); $displaytitle = $transfertitle; OpenTable(); echo "<center><font class=\"option\"><b>"._DOWNLOADPROFILE.": $displaytitle</b></font><br><br>"; downloadinfomenu($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)=sql_fetch_row($result, $dbi)) { $ratingcomments = stripslashes($ratingcomments); 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=sql_query("SELECT rating FROM ".$prefix."_downloads_votedata WHERE ratinguser = '$ratinguser'", $dbi); $usertotalcomments = sql_num_rows($result2, $dbi); $useravgrating = 0; while(list($rating2)=sql_fetch_row($result2, $dbi)) $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/modules.php?name=Your_Account&op=userinfo&uname=$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 (is_admin($admin)) { echo "<a href=\"admin.php?op=DownloadsModDownload&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,$ttitle); echo "</center>"; CloseTable(); include("footer.php"); } function viewdownloaddetails($lid, $ttitle) { global $prefix, $dbi, $admin, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $module_name; include("header.php"); include("modules/$module_name/d_config.php"); menu(1); $voteresult = sql_query("select rating, ratinguser, ratingcomments FROM ".$prefix."_downloads_votedata WHERE ratinglid = $lid", $dbi); $totalvotesDB = sql_num_rows($voteresult, $dbi); $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)=sql_fetch_row($voteresult, $dbi)) { 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; $finalrating = ((($avgOU * $impactOU) + ($avgAU * $impactAU)) / ($impactAU + $impactOU)); $finalrating = number_format($finalrating, $detailvotedecimal); } 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 ($avgOU == 0 || $avgOU == "") { $avgOU = ""; } else { $avgOU = number_format($avgOU, $detailvotedecimal); } if ($avgRU == 0 || $avgRU == "") { $avgRU = ""; } else { $avgRU = number_format($avgRU, $detailvotedecimal); } if ($avgAU == 0 || $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; } $transfertitle = ereg_replace ("_", " ", $ttitle); $displaytitle = $transfertitle; $res = sql_query("select name, email, description, filesize, version, homepage from ".$prefix."_downloads_downloads where lid='$lid'", $dbi); list($auth_name, $email, $description, $filesize, $version, $homepage) = sql_fetch_row($res, $dbi); echo "<br>"; OpenTable(); echo "<center><font class=\"option\"><b>"._DOWNLOADPROFILE.": $displaytitle</b></font><br><br>"; downloadinfomenu($lid, $ttitle); echo "<br><br>"._DOWNLOADRATINGDET."<br>" .""._TOTALVOTES." $totalvotesDB<br>" .""._OVERALLRATING.": $finalrating<br><br>" ."<font class=\"content\">$description<br>"; 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>"._AUTHOR.":</b> $auth_name<br>" ."<b>"._VERSION.":</b> $version <b>"._FILESIZE.":</b> ".CoolSize($filesize)."</font><br><br>" ."[ <b><a href=\"modules.php?name=$module_name&d_op=getit&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\" width=\"200\">"; if ($regvotes==0) { echo "<center><font class=\"content\">"._NOREGUSERSVOTES."</font></center>"; } else { echo "<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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"images/blackpixel.gif\" width=\"15\" height=\"$rvvchartheight[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>"; } 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>" ."<tr><td valign=\"top\" colspan=\"2\"><font class=\"tiny\"><br><br>"._WEIGHNOTE." $anonweight "._TO." 1.</font></td></tr>" ."<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\" width=\"200\">"; if ($anonvotes==0) { echo "<center><font class=\"content\">"._NOUNREGUSERSVOTES."</font></center>"; } else { echo "<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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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>"; } 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\"> </font></td></tr>"; if ($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\" width=\"200\">"; if ($outsidevotes==0) { echo "<center><font class=\"content\">"._NOOUTSIDEVOTES."</font></center>"; } else { echo "<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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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=\"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>"; } 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\"> </font></td></tr>"; } echo "</table><br><br><center>"; downloadfooter($lid,$ttitle); echo "</center>"; CloseTable(); include("footer.php"); } function downloadfooter($lid,$ttitle) { global $module_name; echo "<font class=\"content\">[ <a href=\"modules.php?name=$module_name&d_op=getit&lid=$lid\">"._DOWNLOADNOW."</a> | <a href=\"modules.php?name=$module_name&d_op=ratedownload&lid=$lid&ttitle=$ttitle\">"._RATETHISSITE."</a> ]</font><br><br>"; downloadfooterchild($lid); } function downloadfooterchild($lid) { global $module_name; include("modules/$module_name/d_config.php"); if ($useoutsidevoting = 1) { echo "<br><font class=\"content\">"._ISTHISYOURSITE." <a href=\"modules.php?name=$module_name&d_op=outsidedownloadsetup&lid=$lid\">"._ALLOWTORATE."</a></font>"; } } function outsidedownloadsetup($lid) { global $module_name, $sitename, $nukeurl; include("header.php"); include("modules/$module_name/d_config.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><font class=\"option\"><b>"._PROMOTEYOURSITE."</b></font></center><br><br> "._PROMOTE01."<br><br> <b>1) "._TEXTLINK."</b><br><br> "._PROMOTE02."<br><br> <center><a href=\"$nukeurl/modules.php?name=$module_name&d_op=ratedownload&lid=$lid\">"._RATETHISSITE." @ $sitename</a></center><br><br> <center>"._HTMLCODE1."</center><br> <center><i><a href=\"$nukeurl/modules.php?name=$module_name&d_op=ratedownload&lid=$lid\">"._RATETHISSITE."</a></i></center> <br><br> "._THENUMBER." \"$lid\" "._IDREFER."<br><br> <b>2) "._BUTTONLINK."</b><br><br> "._PROMOTE03."<br><br> <center> <form action=\"modules.php?name=$module_name\" method=\"post\">\n <input type=\"hidden\" name=\"lid\" value=\"$lid\">\n <input type=\"hidden\" name=\"d_op\" value=\"ratedownload\">\n <input type=\"submit\" value=\""._RATEIT."\">\n </form>\n </center> <center>"._HTMLCODE2."</center><br><br> <table border=\"0\" align=\"center\"><tr><td align=\"left\"><i> <form action=\"$nukeurl/modules.php?name=$module_name\" method=\"post\"><br>\n <input type=\"hidden\" name=\"lid\" value=\"$lid\"><br>\n <input type=\"hidden\" name=\"d_op\" value=\"ratedownload\"><br>\n <input type=\"submit\" value=\""._RATEIT."\"><br>\n </form>\n </i></td></tr></table> <br><br> <b>3) "._REMOTEFORM."</b><br><br> "._PROMOTE04." <center> <form method=\"post\" action=\"$nukeurl/modules.php?name=$module_name\"> <table align=\"center\" border=\"0\" width=\"175\" cellspacing=\"0\" cellpadding=\"0\"> <tr><td align=\"center\"><b>"._VOTE4THISSITE."</b></a></td></tr> <tr><td> <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tr><td valign=\"top\"> <select name=\"rating\"> <option selected>--</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> </td><td valign=\"top\"> <input type=\"hidden\" name=\"ratinglid\" value=\"$lid\"> <input type=\"hidden\" name=\"ratinguser\" value=\"outside\"> <input type=\"hidden\" name=\"op value=\"addrating\"> <input type=\"submit\" value=\""._DOWNLOADVOTE."\"> </td></tr></table> </td></tr></table></form> <br>"._HTMLCODE3."<br><br></center> <blockquote><i> <form method=\"post\" action=\"$nukeurl/modules.php?name=$module_name\"><br> <table align=\"center\" border=\"0\" width=\"175\" cellspacing=\"0\" cellpadding=\"0\"><br> <tr><td align=\"center\"><b>"._VOTE4THISSITE."</b></a></td></tr><br> <tr><td><br> <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><br> <tr><td valign=\"top\"><br> <select name=\"rating\"><br> <option selected>--</option><br> <option>10</option><br> <option>9</option><br> <option>8</option><br> <option>7</option><br> <option>6</option><br> <option>5</option><br> <option>4</option><br> <option>3</option><br> <option>2</option><br> <option>1</option><br> </select><br> </td><td valign=\"top\"><br> <input type=\"hidden\" name=\"ratinglid\" value=\"$lid\"><br> <input type=\"hidden\" name=\"ratinguser\" value=\"outside\"><br> <input type=\"hidden\" name=\"d_op\" value=\"addrating\"><br> <input type=\"submit\" value=\""._DOWNLOADVOTE."\"><br> </td></tr></table><br> </td></tr></table><br> </form><br> </i></blockquote> <br><br><center> "._PROMOTE05."<br><br> - $sitename "._STAFF." <br><br></center>"; CloseTable(); include("footer.php"); } function brokendownload($lid) { global $prefix, $dbi, $user, $cookie, $module_name; include("header.php"); include("modules/$module_name/d_config.php"); if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } menu(1); echo "<br>"; OpenTable(); echo "<center><font class=\"option\"><b>"._REPORTBROKEN."</b></font><br><br><br><font class=\"content\">"; echo "<form action=\"modules.php?name=$module_name\" method=\"post\">"; echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\">"; echo "<input type=\"hidden\" name=\"modifysubmitter\" value=\"$ratinguser\">"; echo ""._THANKSBROKEN."<br>"._SECURITYBROKEN."<br><br>"; echo "<input type=\"hidden\" name=\"d_op\" value=\"brokendownloadS\"><input type=\"submit\" value=\""._REPORTBROKEN."\"></center></form>"; CloseTable(); include("footer.php"); } function brokendownloadS($lid, $modifysubmitter) { global $prefix, $dbi, $user, $anonymous, $cookie, $module_name; include("modules/$module_name/d_config.php"); if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } sql_query("insert into ".$prefix."_downloads_modrequest values (NULL, $lid, 0, 0, '', '', '', '$ratinguser', 1, '$auth_name', '$email', '$filesize', '$version', '$homepage')", $dbi); include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<br><center>"._THANKSFORINFO."<br><br>"._LOOKTOREQUEST."</center><br>"; CloseTable(); include("footer.php"); } function modifydownloadrequest($lid) { global $prefix, $dbi, $user, $module_name; include("header.php"); if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } menu(1); echo "<br>"; OpenTable(); $blocknow = 0; if ($blockunregmodify == 1 && $ratinguser=="$anonymous") { echo "<br><br><center>"._DONLYREGUSERSMODIFY."</center>"; $blocknow = 1; } if ($blocknow != 1) { $result = sql_query("select cid, title, url, description, name, email, filesize, version, homepage from ".$prefix."_downloads_downloads where lid=$lid", $dbi); echo "<center><font class=\"option\"><b>"._REQUESTDOWNLOADMOD."</b></font><br><font class=\"content\">"; while(list($cid, $title, $url, $description, $auth_name, $email, $filesize, $version, $homepage) = sql_fetch_row($result, $dbi)) { $title = stripslashes($title); $description = stripslashes($description); echo "<form action=\"modules.php?name=$module_name\" method=\"post\">" .""._DOWNLOADID.": <b>$lid</b></center><br><br><br>" .""._DOWNLOADNAME.":<br><input type=\"text\" name=\"title\" value=\"$title\" size=\"50\" maxlength=\"100\"><br><br>" .""._URL.":<br><input type=\"text\" name=\"url\" value=\"$url\" size=\"50\" maxlength=\"100\"><br><br>" .""._DESCRIPTION.": <br><textarea name=\"description\" cols=\"60\" rows=\"10\">$description</textarea><br><br>"; $result2=sql_query("select cid, title from ".$prefix."_downloads_categories order by title", $dbi); echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\">" ."<input type=\"hidden\" name=\"modifysubmitter\" value=\"$ratinguser\">" .""._CATEGORY.": <select name=\"cat\">"; $result2=sql_query("select cid, title, parentid from ".$prefix."_downloads_categories order by title", $dbi); while(list($cid2, $ctitle2, $parentid2) = sql_fetch_row($result2, $dbi)) { if ($cid2==$cid) { $sel = "selected"; } else { $sel = ""; } if ($parentid2!=0) $ctitle2=getparent($parentid2,$ctitle2); echo "<option value=\"$cid2\" $sel>$ctitle2</option>"; } echo "</select><br><br>" .""._AUTHORNAME.":<br><input type=\"text\" name=\"auth_name\" value=\"$auth_name\" size=\"30\" maxlength=\"80\"><br><br>" .""._AUTHOREMAIL.":<br><input type=\"text\" name=\"email\" value=\"$email\" size=\"30\" maxlength=\"80\"><br><br>" .""._FILESIZE.": ("._INBYTES.")<br><input type=\"text\" name=\"filesize\" value=\"$filesize\" size=\"12\" maxlength=\"11\"><br><br>" .""._VERSION.":<br><input type=\"text\" name=\"version\" value=\"$version\" size=\"11\" maxlength=\"10\"><br><br>" .""._HOMEPAGE.":<br><input type=\"text\" name=\"homepage\" value=\"$homepage\" size=\"50\" maxlength=\"200\"><br><br>" ."<input type=\"hidden\" name=\"d_op\" value=\"modifydownloadrequestS\">" ."<input type=\"submit\" value=\""._SENDREQUEST."\"></form>"; } } CloseTable(); include("footer.php"); } function modifydownloadrequestS($lid, $cat, $title, $url, $description, $modifysubmitter, $auth_name, $email, $filesize, $version, $homepage) { global $prefix, $dbi, $user, $module_name; include("modules/$module_name/d_config.php"); if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else { $ratinguser = "$anonymous"; } $blocknow = 0; if ($blockunregmodify == 1 && $ratinguser=="$anonymous") { include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><font class=\"content\">"._DONLYREGUSERSMODIFY."</font></center>"; $blocknow = 1; CloseTable(); include("footer.php"); } if ($blocknow != 1) { $cat = explode("-", $cat); if ($cat[1]=="") { $cat[1] = 0; } $title = stripslashes(FixQuotes($title)); $url = stripslashes(FixQuotes($url)); $description = stripslashes(FixQuotes($description)); sql_query("insert into ".$prefix."_downloads_modrequest values (NULL, $lid, $cat[0], $cat[1], '$title', '$url', '$description', '$ratinguser', 0, '$auth_name', '$email', '$filesize', '$version', '$homepage')", $dbi); include("header.php"); menu(1); echo "<br>"; OpenTable(); echo "<center><font class=\"content\">"._THANKSFORINFO." "._LOOKTOREQUEST."</font></center>"; CloseTable(); include("footer.php"); } } function rateinfo($lid) { global $prefix, $dbi; sql_query("update ".$prefix."_downloads_downloads set hits=hits+1 where lid=$lid", $dbi); $result = sql_query("select url from ".$prefix."_downloads_downloads where lid=$lid", $dbi); list($url) = sql_fetch_row($result, $dbi); Header("Location: $url"); } function addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments) { global $prefix, $dbi, $cookie, $user, $module_name; $passtest = "yes"; include("header.php"); include("modules/$module_name/d_config.php"); completevoteheader(); if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; } else if ($ratinguser=="outside") { $ratinguser = "outside"; } else { $ratinguser = "$anonymous"; } $results3 = sql_query("SELECT title FROM ".$prefix."_downloads_downloads WHERE lid=$ratinglid", $dbi); while(list($title)=sql_fetch_row($results3, $dbi)) $ttitle = $title; /* Make sure only 1 anonymous from an IP in a single day. */ $ip = getenv("REMOTE_HOST"); if (empty($ip)) { $ip = getenv("REMOTE_ADDR"); } /* Check if Rating is Null */ if ($rating=="--") { $error = "nullerror"; completevote($error); $passtest = "no"; } /* Check if Download POSTER is voting (UNLESS Anonymous users allowed to post) */ if ($ratinguser != $anonymous && $ratinguser != "outside") { $result=sql_query("select submitter from ".$prefix."_downloads_downloads where lid=$ratinglid", $dbi); while(list($ratinguserDB)=sql_fetch_row($result, $dbi)) { if ($ratinguserDB==$ratinguser) { $error = "postervote"; completevote($error); $passtest = "no"; } } } /* Check if REG user is trying to vote twice. */ if ($ratinguser!=$anonymous && $ratinguser != "outside") { $result=sql_query("select ratinguser from ".$prefix."_downloads_votedata where ratinglid=$ratinglid", $dbi); while(list($ratinguserDB)=sql_fetch_row($result, $dbi)) { if ($ratinguserDB==$ratinguser) { $error = "regflood"; completevote($error); $passtest = "no"; } } } /* Check if ANONYMOUS user is trying to vote more than once per day. */ if ($ratinguser==$anonymous){ $yesterdaytimestamp = (time()-(86400 * $anonwaitdays)); $ytsDB = Date("Y-m-d H:i:s", $yesterdaytimestamp); $result=sql_query("select * FROM ".$prefix."_downloads_votedata WHERE ratinglid=$ratinglid AND ratinguser='$anonymous' AND ratinghostname = '$ip' AND TO_DAYS(NOW()) - TO_DAYS(ratingtimestamp) < $anonwaitdays", $dbi); $anonvotecount = sql_num_rows($result, $dbi); if ($anonvotecount >= 1) { $error = "anonflood"; completevote($error); $passtest = "no"; } } /* Check if OUTSIDE user is trying to vote more than once per day. */ if ($ratinguser=="outside"){ $yesterdaytimestamp = (time()-(86400 * $outsidewaitdays)); $ytsDB = Date("Y-m-d H:i:s", $yesterdaytimestamp); $result=sql_query("select * FROM ".$prefix."_downloads_votedata WHERE ratinglid=$ratinglid AND ratinguser='outside' AND ratinghostname = '$ip' AND TO_DAYS(NOW()) - TO_DAYS(ratingtimestamp) < $outsidewaitdays", $dbi); $outsidevotecount = sql_num_rows($result, $dbi); if ($outsidevotecount >= 1) { $error = "outsideflood"; completevote($error); $passtest = "no"; } } /* Passed Tests */ if ($passtest == "yes") { $comment = stripslashes(FixQuotes($comment)); /* All is well. Add to Line Item Rate to DB. */ sql_query("INSERT into ".$prefix."_downloads_votedata values (NULL,'$ratinglid', '$ratinguser', '$rating', '$ip', '$ratingcomments', now())", $dbi); /* All is well. Calculate Score & Add to Summary (for quick retrieval & sorting) to DB. */ /* NOTE: If weight is modified, ALL downloads need to be refreshed with new weight. */ /* Running a SQL statement with your modded calc for ALL downloads will accomplish this. */ $voteresult = sql_query("select rating, ratinguser, ratingcomments FROM ".$prefix."_downloads_votedata WHERE ratinglid = $ratinglid", $dbi); $totalvotesDB = sql_num_rows($voteresult, $dbi); include ("modules/$module_name/voteinclude.php"); sql_query("UPDATE ".$prefix."_downloads_downloads SET downloadratingsummary=$finalrating,totalvotes=$totalvotesDB,totalcomments=$truecomments WHERE lid = $ratinglid", $dbi); $error = "none"; completevote($error); } completevotefooter($ratinglid, $ttitle, $ratinguser); include("footer.php"); } function completevoteheader(){ menu(1); echo "<br>"; OpenTable(); } function completevotefooter($lid, $ttitle, $ratinguser) { global $prefix, $dbi, $module_name; include("modules/$module_name/d_config.php"); $result = sql_query("select url FROM ".$prefix."_downloads_downloads WHERE lid=$lid", $dbi); list($url)=sql_fetch_row($result, $dbi); echo "<font class=\"content\">"._THANKSTOTAKETIME." $sitename. "._DLETSDECIDE."</font><br><br><br>"; if ($ratinguser=="outside") { echo "<center><font class=\"content\">".WEAPPREACIATE." $sitename!<br><a href=\"$url\">"._RETURNTO." $ttitle</a></font><center><br><br>"; $result=sql_query("select title FROM ".$prefix."_downloads_downloads where lid=$lid", $dbi); list($title)=sql_fetch_row($result, $dbi); $ttitle = ereg_replace (" ", "_", $title); } echo "<center>"; downloadinfomenu($lid,$ttitle); echo "</center>"; CloseTable(); } function completevote($error) { global $module_name; include("modules/$module_name/d_config.php"); if ($error == "none") echo "<center><font class=\"content\"><b>"._COMPLETEVOTE1."</b></font></center>"; if ($error == "anonflood") echo "<center><font class=\"option\"><b>"._COMPLETEVOTE2."</b></font></center><br>"; if ($error == "regflood") echo "<center><font class=\"option\"><b>"._COMPLETEVOTE3."</b></font></center><br>"; if ($error == "postervote") echo "<center><font class=\"option\"><b>"._COMPLETEVOTE4."</b></font></center><br>"; if ($error == "nullerror") echo "<center><font class=\"option\"><b>"._COMPLETEVOTE5."</b></font></center><br>"; if ($error == "outsideflood") echo "<center><font class=\"option\"><b>"._COMPLETEVOTE6."</b></font></center><br>"; } function ratedownload($lid, $user, $ttitle) { global $prefix, $dbi, $cookie, $datetime, $module_name; include("header.php"); menu(1); echo "<br>"; OpenTable(); $transfertitle = ereg_replace ("_", " ", $ttitle); $displaytitle = $transfertitle; $ip = getenv("REMOTE_HOST"); if (empty($ip)) { $ip = getenv("REMOTE_ADDR"); } echo "<b>$displaytitle</b>" ."<ul><font class=\"content\">" ."<li>"._RATENOTE1."" ."<li>"._RATENOTE2."" ."<li>"._RATENOTE3."" ."<li>"._DRATENOTE4."" ."<li>"._RATENOTE5.""; if(is_user($user)) { $user2 = base64_decode($user); $cookie = explode(":", $user2); echo "<li>"._YOUAREREGGED."" ."<li>"._FEELFREE2ADD.""; cookiedecode($user); $auth_name = $cookie[1]; } else { echo "<li>"._YOUARENOTREGGED."" ."<li>"._IFYOUWEREREG.""; $auth_name = "$anonymous"; } echo "</ul>" ."<form method=\"post\" action=\"modules.php?name=$module_name\">" ."<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($user)) { echo "<b>"._SCOMMENTS.":</b><br><textarea wrap=\"virtual\" cols=\"50\" rows=\"10\" name=\"ratingcomments\"></textarea>" ."<br><br><br>" ."</font></td>"; } else { echo"<input type=\"hidden\" name=\"ratingcomments\" value=\"\">"; } echo "</tr></table></form>"; echo "<center>"; downloadfooterchild($lid); echo "</center>"; CloseTable(); include("footer.php"); } function CoolSize($size) { $mb = 1024*1024; if ( $size > $mb ) { $mysize = sprintf ("%01.2f",$size/$mb) . " MB"; } elseif ( $size >= 1024 ) { $mysize = sprintf ("%01.2f",$size/1024) . " Kb"; } else { $mysize = $size . " bytes"; } return $mysize; } if (isset($ratinglid) && isset ($ratinguser) && isset ($rating)) { $ret = addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments); } switch($d_op) { case "menu": menu($maindownload); break; case "AddDownload": AddDownload(); break; case "NewDownloads": NewDownloads($newdownloadshowdays); break; case "NewDownloadsDate": NewDownloadsDate($selectdate); break; case "CoolSize": CoolSize($size); break; case "TopRated": TopRated($ratenum, $ratetype); break; case "MostPopular": MostPopular($ratenum, $ratetype); break; case "viewdownload": viewdownload($cid, $min, $orderby, $show); break; case "viewsdownload": viewsdownload($sid, $min, $orderby, $show); break; case "brokendownload": brokendownload($lid); break; case "modifydownloadrequest": modifydownloadrequest($lid); break; case "modifydownloadrequestS": modifydownloadrequestS($lid, $cat, $title, $url, $description, $modifysubmitter, $auth_name, $email, $filesize, $version, $homepage); break; case "brokendownloadS": brokendownloadS($lid, $modifysubmitter); break; case "getit": getit($lid); break; case "Add": Add($title, $url, $auth_name, $cat, $description, $email, $filesize, $version, $homepage); break; case "search": search($query, $min, $orderby, $show); break; case "rateinfo": rateinfo($lid, $user, $title); break; case "ratedownload": ratedownload($lid, $user, $ttitle); break; case "addrating": addrating($ratinglid, $ratinguser, $rating, $ratinghost_name, $ratingcomments, $user); break; case "viewdownloadcomments": viewdownloadcomments($lid, $ttitle); break; case "outsidedownloadsetup": outsidedownloadsetup($lid); break; case "viewdownloadeditorial": viewdownloadeditorial($lid, $ttitle); break; case "viewdownloaddetails": viewdownloaddetails($lid, $ttitle); break; default: index(); break; } ?>