function search($query, $min, $orderby, $show) { global $prefix, $db, $admin, $bgcolor2, $module_name; include "modules/{$module_name}/l_config.php"; include "header.php"; if (!isset($min)) { $min = 0; } if (!isset($max)) { $max = $min + $linksresults; } if (isset($orderby)) { $orderby = convertorderbyin($orderby); } else { $orderby = "title ASC"; } if ($show != "") { $linksresults = $show; } else { $show = $linksresults; } $query = check_html($query, nohtml); $query = addslashes($query); $result = $db->sql_query("SELECT lid, cid, sid, title, url, description, date, hits, linkratingsummary, totalvotes, totalcomments from " . $prefix . "_links_links where title LIKE '%{$query}%' OR description LIKE '%{$query}%' ORDER BY {$orderby} LIMIT {$min},{$linksresults}"); $fullcountresult = $db->sql_query("SELECT lid, title, description, date, hits, linkratingsummary, totalvotes, totalcomments from " . $prefix . "_links_links where title LIKE '%{$query}%' OR description LIKE '%{$query}%'"); $totalselectedlinks = $db->sql_numrows($fullcountresult); $nrows = $db->sql_numrows($result); $x = 0; $the_query = stripslashes($query); $the_query = str_replace("\\'", "'", $the_query); 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 = $db->sql_query("SELECT cid, title from " . $prefix . "_links_categories where title LIKE '%{$query}%' ORDER BY title DESC"); while ($row2 = $db->sql_fetchrow($result2)) { $cid = intval($row2['cid']); $stitle = stripslashes(check_html($row2['title'], "nohtml")); $res = $db->sql_query("SELECT * from " . $prefix . "_links_links where cid='{$cid}'"); $numrows = $db->sql_numrows($res); $row3 = $db->sql_fetchrow($db->sql_query("SELECT cid,title,parentid from " . $prefix . "_links_categories where cid='{$cid}'")); $cid3 = intval($row3['cid']); $title3 = stripslashes(check_html($row3['title'], "nohtml")); $parentid3 = intval($row3['parentid']); 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}&l_op=viewlink&cid={$cid}\">{$title3}</a> ({$numrows})<br>"; } echo "<br><table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _LINKS . "</b></font></td></tr></table>"; $orderbyTrans = convertorderbytrans($orderby); echo "<br><font class=\"content\">" . _SORTLINKSBY . ": " . "" . _TITLE . " (<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&orderby=titleA\">A</a>\\<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&orderby=titleD\">D</a>)" . "" . _DATE . " (<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&orderby=dateA\">A</a>\\<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&orderby=dateD\">D</a>)" . "" . _RATING . " (<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&orderby=ratingA\">A</a>\\<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&orderby=ratingD\">D</a>)" . "" . _POPULARITY . " (<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&orderby=hitsA\">A</a>\\<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&orderby=hitsD\">D</a>)" . "<br>" . _SITESSORTED . ": {$orderbyTrans}<br><br>"; while ($row = $db->sql_fetchrow($result)) { $lid = intval($row['lid']); $cid = intval($row['cid']); $sid = intval($row['sid']); $title = stripslashes(check_html($row['title'], "nohtml")); $url = stripslashes($row['url']); $description = stripslashes($row['description']); $time = $row['date']; $hits = intval($row['hits']); $linkratingsummary = $row['linkratingsummary']; $totalvotes = intval($row['totalvotes']); $totalcomments = $row['totalcomments']; $linkratingsummary = number_format($linkratingsummary, $mainvotedecimal); $transfertitle = str_replace(" ", "_", $title); $title = ereg_replace($query, "<b>{$query}</b>", $title); echo "<a href=\"modules.php?name={$module_name}&l_op=visit&lid={$lid}\" target=\"new\">{$title}</a>"; newlinkgraphic($datetime, $time); popgraphic($hits); echo "<br>"; $description = ereg_replace($query, "<b>{$query}</b>", $description); echo "" . _DESCRIPTION . ": {$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 "" . _ADDEDON . ": {$datetime} " . _HITS . ": {$hits}"; /* voting & comments stats */ if ($totalvotes == 1) { $votestring = _VOTE; } else { $votestring = _VOTES; } if ($linkratingsummary != "0" || $linkratingsummary != "0.0") { echo " " . _RATING . ": {$linkratingsummary} ({$totalvotes} {$votestring})"; } echo "<br><a href=\"modules.php?name={$module_name}&l_op=ratelink&lid={$lid}&ttitle={$transfertitle}\">" . _RATESITE . "</a>"; if ($totalvotes != 0) { echo " | <a href=\"modules.php?name={$module_name}&l_op=viewlinkdetails&lid={$lid}&ttitle={$transfertitle}\">" . _DETAILS . "</a>"; } if ($totalcomments != 0) { echo " | <a href=\"modules.php?name={$module_name}&l_op=viewlinkcomments&lid={$lid}&ttitle={$transfertitle}>" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, $transfertitle); echo "<br>"; $row4 = $db->sql_fetchrow($db->sql_query("SELECT cid,title,parentid from " . $prefix . "_links_categories where cid='{$cid}'")); $cid3 = intval($row4['cid']); $title3 = stripslashes(check_html($row4['title'], "nohtml")); $parentid3 = intval($row4['parentid']); 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... */ $linkpagesint = $totalselectedlinks / $linksresults; $linkpageremainder = $totalselectedlinks % $linksresults; if ($linkpageremainder != 0) { $linkpages = ceil($linkpagesint); if ($totalselectedlinks < $linksresults) { $linkpageremainder = 0; } } else { $linkpages = $linkpagesint; } /* Page Numbering */ if ($linkpages != 1 && $linkpages != 0) { echo "<br><br>" . "" . _SELECTPAGE . ": "; $prev = $min - $linksresults; if ($prev >= 0) { echo " <b>[ <a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&min={$prev}&orderby={$orderby}&show={$show}\">" . " << " . _PREVIOUS . "</a> ]</b> "; } $counter = 1; $currentpage = $max / $linksresults; while ($counter <= $linkpages) { $cpage = $counter; $mintemp = $perpage * $counter - $linksresults; if ($counter == $currentpage) { echo "<b>{$counter}</b> "; } else { echo "<a href=\"modules.php?name={$module_name}&l_op=search&query={$the_query}&min={$mintemp}&orderby={$orderby}&show={$show}\">{$counter}</a> "; } $counter++; } $next = $min + $linksresults; if ($x >= $perpage) { echo " <b>[ <a href=\"modules.php?name={$module_name}&l_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.linuxlinks.com/cgi-bin/search.cgi?query={$the_query}&engine=Links\">LinuxLinks</a> - " . "<a target=\"_blank\" href=\"http://www.freshmeat.net/search/?q={$the_query}&section=projects\">Freshmeat</a> - " . "<a target=\"_blank\" href=\"http://www.justlinux.com/bin/search.pl?key={$the_query}\">JustLinux</a>" . "</font>"; } else { echo "<center><font class=\"option\"><b>" . _NOMATCHES . "</b></font></center><br><br>"; } CloseTable(); include "footer.php"; }
function search($query, $min, $orderby, $show) { global $prefix, $db, $admin, $bgcolor2, $module_name, $admin_file, $datetime, $transfertitle, $locale; include "modules/{$module_name}/d_config.php"; include "header.php"; if (!isset($min)) { $min = 0; } if (!isset($max)) { $max = $min + $downloadsresults; } if (!empty($orderby)) { $orderby = convertorderbyin($orderby); } else { $orderby = "title ASC"; } if ($show != "") { $downloadsresults = $show; } else { $show = $downloadsresults; } $query1 = filter($query, "nohtml", 1); $query1 = addslashes($query1); $query2 = filter($query, "", 1); if (!is_numeric($min)) { $min = 0; } $result = $db->sql_query("SELECT lid, cid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $prefix . "_downloads_downloads WHERE title LIKE '%{$query1}%' OR description LIKE '%{$query2}%' ORDER BY {$orderby} LIMIT {$min},{$downloadsresults}"); $fullcountresult = $db->sql_query("SELECT lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments FROM " . $prefix . "_downloads_downloads WHERE title LIKE '%{$query1}%' OR description LIKE '%{$query2}%' "); $totalselecteddownloads = $db->sql_numrows($fullcountresult); $nrows = $db->sql_numrows($result); $x = 0; $the_query = filter($query, "nohtml"); $the_query = FixQuotes($the_query); menu(1); echo "<br>"; OpenTable(); if (!empty($query)) { if ($nrows > 0) { echo "<font class=\"option\">" . _SEARCHRESULTS4 . ": <b>{$the_query}</b></font><br><br>" . "<table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _USUBCATEGORIES . "</b></font></td></tr></table>"; $result2 = $db->sql_query("SELECT cid, title FROM " . $prefix . "_downloads_categories WHERE title LIKE '%{$query1}%' ORDER BY title DESC"); while (list($cid, $stitle) = $result2->fetch_row()) { $cid = intval($cid); $res = $db->sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE cid='{$cid}'"); $numrows = $db->sql_numrows($res); $result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $prefix . "_downloads_categories WHERE cid='{$cid}'"); list($cid3, $title3, $parentid3) = $result3->fetch_row(); $cid3 = intval($cid3); $title3 = filter($title3, "nohtml"); $parentid3 = intval($parentid3); 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) = $result->fetch_row()) { $lid = intval($lid); $cid = intval(trim($cid)); $hits = intval($hits); $totalvotes = intval($totalvotes); $totalcomments = 0; $totalcomments = intval($totalcomments); $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); $title = filter($title, "nohtml"); $url = filter($url, "nohtml"); $description = filter($description); $transfertitle = str_replace(" ", "_", $title); $title = ereg_replace($query1, "<b>{$query1}</b>", $title); global $prefix, $db, $admin; if (is_admin($admin)) { echo "<a href=\"" . $admin_file . ".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($the_query, "<b>{$the_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 (empty($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}\">" . _RATERESOURCE . "</a>"; echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloaddetails&lid={$lid}\">" . _DETAILS . "</a>"; if ($totalcomments != 0) { echo " | <a href=\"modules.php?name={$module_name}&d_op=viewdownloadcomments&lid={$lid}>" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, $transfertitle, 0); echo "<br>"; $result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $prefix . "_downloads_categories WHERE cid='{$cid}'"); list($cid3, $title3, $parentid3) = $result3->fetch_row(); $cid3 = intval($cid3); $title3 = filter($title3, "nohtml"); $parentid3 = intval($parentid3); 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://search.yahoo.com/bin/search?p={$the_query}\">Yahoo</a> - " . "<a target=\"_blank\" href=\"http://www.google.com/search?q={$the_query}\">Google</a>" . "</font>"; } else { echo "<center><font class=\"option\"><b>" . _NOMATCHES . "</b></font></center><br><br>"; } 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"; if ($ttitle == 0) { list($ttitle) = sql_fetch_row(sql_query("select title from " . $prefix . "_downloads_downloads where lid='{$lid}'", $dbi), $dbi); $ttitle = ereg_replace(" ", "_", $ttitle); } 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 cid, date, hits, name, email, description, filesize, version, homepage FROM " . $prefix . "_downloads_downloads WHERE lid='{$lid}'", $dbi); list($cid, $time, $hits, $auth_name, $email, $description, $filesize, $version, $homepage) = sql_fetch_row($res, $dbi); echo "<br>"; OpenTable(); echo "<center><font class=\"title\">" . _DOWNLOADPROFILE . ": <A HREF=\"modules.php?name={$module_name}&d_op=getit&lid={$lid}\" TARGET=\"_blank\">{$displaytitle}</A>"; newdownloadgraphic($datetime, $time); popgraphic($hits); detecteditorial($lid, $transfertitle, 1); $catResult = sql_query("select title,cdescription,ldescription,parentid from " . $prefix . "_downloads_categories where cid='{$cid}'", $dbi); list($catTitle, $cdescription, $ldescription, $parentid) = sql_fetch_row($catResult, $dbi); $catTitle = getparent($parentid, $catTitle); $catTitle = _MAIN . "/{$catTitle}"; echo "</FONT><BR><BR><B>" . _CATEGORY . ":</B> <A HREF=\"modules.php?name=Downloads&d_op=viewdownload&cid={$cid}\">{$catTitle}</A></B><BR>"; downloadinfomenu($lid, $ttitle); echo "<br><br><B><U>" . _DOWNLOADRATINGDET . "</U></B><br>" . "<B>" . _TOTALVOTES . "</B> {$totalvotesDB}<br>" . "<B>" . _OVERALLRATING . ":</B> {$finalrating}<br><br>" . "<DIV ALIGN=JUSTIFY CLASS=\"content\">{$description}</DIV>"; if ($auth_name == "") { $auth_name = "<i>" . _UNKNOWN . "</i>"; } else { if ($email == "") { $auth_name = "{$auth_name}"; } else { $email = ereg_replace("@", " <i>at</i> ", $email); $email = ereg_replace("\\.", " <i>dot</i> ", $email); $auth_name = "{$auth_name} ({$email})"; } } echo "<br><b>" . _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}\" TARGET=\"_blank\">" . _DOWNLOADNOW . "</a></b> "; if ($homepage == "" or $homepage == "http://") { echo "]<br><br>"; } else { echo "| <a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> ]<br><br>"; } echo "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"455\">" . "<tr><td colspan=\"2\" bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b>" . _REGISTEREDUSERS . "</b></font>" . "</td></tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\">" . "<font class=\"content\">" . _NUMBEROFRATINGS . ": {$regvotes}</font>" . "</td>" . "<td rowspan=\"5\">"; if ($regvotes == 0) { echo "<center><font class=\"content\">" . _NOREGUSERSVOTES . "</font></center>"; } else { echo "<CENTER><table border=\"1\" WIDTH=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$rvv['1']} " . _LVOTES . " ({$rvvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"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}\" ALIGN=CENTER>" . "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"200\"><tr>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">1</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">2</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">3</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">4</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">5</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">6</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">7</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">8</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">9</font></td>" . "<td width=\"10%\" valign=\"bottom\" align=\"center\"><font class=\"content\">10</font></td>" . "</tr></table></CENTER>" . "</td></tr></table>"; } echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgRU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topreg}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomreg}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _NUMOFCOMMENTS . ": {$truecomments}</font></td></tr>" . "<tr><td></td></tr>" . "<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\">"; if ($anonvotes == 0) { echo "<center><font class=\"content\">" . _NOUNREGUSERSVOTES . "</font></center>"; } else { echo "<CENTER><table border=\"1\" width=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$avv['1']} " . _LVOTES . " ({$avvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"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></CENTER>"; } echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgAU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topanon}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomanon}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\"> </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\">"; if ($outsidevotes == 0) { echo "<center><font class=\"content\">" . _NOOUTSIDEVOTES . "</font></center>"; } else { echo "<CENTER><table border=\"1\" width=\"200\">" . "<tr>" . "<td valign=\"top\" align=\"center\" colspan=\"10\" bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _BREAKDOWNBYVAL . "</font></td>" . "</tr>" . "<tr>" . "<td bgcolor=\"{$bgcolor1}\" valign=\"bottom\"><img border=\"0\" alt=\"{$ovv['1']} " . _LVOTES . " ({$ovvpercent['1']}% " . _LTOTALVOTES . ")\" src=\"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></CENTER>"; } echo "</td>" . "</tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _DOWNLOADRATING . ": {$avgOU}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\">" . _HIGHRATING . ": {$topoutside}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor2}\"><font class=\"content\">" . _LOWRATING . ": {$bottomoutside}</font></td></tr>" . "<tr><td bgcolor=\"{$bgcolor1}\"><font class=\"content\"> </font></td></tr>"; } echo "</table><br><br><center>"; downloadfooter($lid, $ttitle); echo "</center>"; CloseTable(); include "footer.php"; }
$path = substr($path, 1); $path = str_replace("/", " <img src='" . $_CONF['site_url'] . "/filemgmt/images/arrow.gif' alt=''" . XHTML . "> ", $path); $p->set_var('LANG_CATEGORY', _MD_CATEGORYC); $p->set_var('category_path', $path); if (empty($submitter_name)) { $submitter_name = 'Unknown UID'; } else { $submitter_name = "<a href='" . $_CONF['site_url'] . "/users.php?mode=profile&uid=" . $submitter . "'>" . $submitter_name . "</a>"; } $p->set_var('LANG_SUBMITTEDBY', _MD_SUBMITTEDBY); $p->set_var('submitter_name', $submitter_name); $p->set_var('lid', $lid); $p->set_var('LANG_DLNOW', _MD_DLNOW); $p->set_var('dtitle', $dtitle); $p->set_var('image_newdownload', newdownloadgraphic($time, $status)); $p->set_var('image_popular', popgraphic($hits)); $p->set_var('download_title', _MD_CLICK2DL . urldecode($url)); $p->set_var('url', $url); $p->set_var('file_description', $description); if ($_FM_CONF['enable_rating']) { if ($rating != "0" || $rating != "0.00") { $votestring = sprintf(_MD_NUMVOTES, $votes); $p->set_var('rating', $rating); $p->set_var('votestring', $votestring); } else { $p->set_var('rating', $rating); $p->set_var('votestring', ''); } } if ($logourl != '') { $p->set_var('snapshot_icon', '<img src="' . $_CONF['site_url'] . '/filemgmt/images/screenshoticon.gif" width="14" height="14" alt="" border="0" />');
function NewDownloadsDate() { global $downloadsprefix, $db, $module_name; $selectdate = intval($_GET['selectdate']); $dateDB = date("d-M-Y", $selectdate); $dateView = date("F d, Y", $selectdate); include "header.php"; downl_menu_tpl(1); echo '<br />'; OpenTable(); $newdownloadDB = Date("Y-m-d", $selectdate); $totaldownloads = $db->sql_numrows($db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE date LIKE '%{$newdownloadDB}%'")); echo "<font class=\"option\"><b>{$dateView} - {$totaldownloads} " . _NEWDOWNLOADS . "</b></font>" . "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">"; $sql = "SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE date LIKE '%{$newdownloadDB}%' ORDER BY title ASC"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $lid = $row['lid']; $cid = $row['cid']; $title = $row['title']; $description = $row['description']; $time = $row['date']; $hits = $row['hits']; $url = $row['url']; $downloadratingsummary = $row['downloadratingsummary']; $totalvotes = $row['totalvotes']; $totalcomments = $row['totalcomments']; $filesize = $row['filesize']; $version = $row['version']; $homepage = $row['homepage']; $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); if (can_admin('downloads')) { if (eregi("http", $url)) { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo " <a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\" class=\"title\">{$title}</a>"; $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3); newdownloadgraphic($datetime); popgraphic($hits); detecteditorial($lid, 1); echo "<br /><b>" . _DESCRIPTION . ":</b> {$description}<br />"; echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />"; echo "<b>" . _ADDEDON . ":</b> <b>{$datetime}</b> <b>" . _UDOWNLOADS . ":</b> {$hits}"; $transfertitle = str_replace(" ", "_", $title); /* voting & comments stats */ $votestring = $totalvotes == 1 ? _VOTE : _VOTES; if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") { echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})"; } echo '<br />'; $sql2 = "SELECT title FROM " . $downloadsprefix . "_categories WHERE cid='{$cid}'"; $result2 = $db->sql_query($sql2); $row2 = $db->sql_fetchrow($result2); $ctitle = $row2[title]; $ctitle = getparent($cid, $ctitle); echo "<B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$ctitle}</A><br />"; if ($homepage != "") { echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | "; } echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>"; if (is_user()) { echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>"; } echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>"; if ($totalcomments != 0) { echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, 0); echo "<br /><br />"; } echo "</font></td></tr></table>"; CloseTable(); include "footer.php"; }
function search($query, $min, $orderby, $show) { global $prefix, $dbi, $admin, $bgcolor2, $module_name; include "modules/{$module_name}/d_config.php"; include "header.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 = check_html($query, nohtml); $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); 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)) { if (eregi("http", $url)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo " <a href=\"modules.php?name={$module_name}&d_op=getit&lid={$lid}\" CLASS=\"title\" TARGET=\"_blank\">{$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})"; } 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 "<B>" . _CATEGORY . ":</B> <A HREF=\"modules.php?name=Downloads&d_op=viewdownload&cid={$cid}\">{$title3}</A>"; 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><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/search/?q={$the_query}&section=projects\">Freshmeat</a> - " . "<a target=\"_blank\" href=\"http://www.justlinux.com/bin/search.pl?key={$the_query}\">JustLinux</a>" . "</font>"; } else { echo "<center><font class=\"option\"><b>" . _NOMATCHES . "</b></font></center><br><br>"; } CloseTable(); include "footer.php"; }
function viewsdownload($sid, $min, $orderby, $show) { global $prefix, $dbi, $admin, $module_name, $user; 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>"; if (is_user($user)) { 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 search($query, $min, $orderby, $show) { global $linksprefix, $db, $bgcolor2, $module_name, $weblinks_config; require_once 'header.php'; $perpage = $weblinks_config['perpage']; $linksresults = $weblinks_config['linksresults']; if (!isset($min)) { $min = 0; } if (!isset($max)) { $max = $min + $linksresults; } $orderby = isset($_GET['orderby']) ? convertorderbyin($_GET['orderby']) : 'title ASC'; if ($show != '') { $linksresults = $show; } else { $show = $linksresults; } $the_query = htmlprepare($query); $query = Fix_Quotes($query, true); $result = $db->sql_query("SELECT lid, cid, title, url, description, date, hits, linkratingsummary, totalvotes, totalcomments FROM " . $linksprefix . "_links WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ORDER BY {$orderby} LIMIT {$min},{$linksresults}"); $fullcountresult = $db->sql_query("SELECT COUNT(*) FROM " . $linksprefix . "_links WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%'"); list($totalselectedlinks) = $db->sql_fetchrow($fullcountresult); $nrows = $db->sql_numrows($result); $x = 0; menu(1); echo '<br />'; OpenTable(); if ($query != '') { if ($nrows > 0) { echo '<span class="option">' . _SEARCHRESULTS4 . ': <b>' . $the_query . '</b></span><br /><br />' . '<table width="100%" style="background:' . $bgcolor2 . ';"><tr><td><span class="option"><b>' . _USUBCATEGORIES . '</b></span></td></tr></table>'; $result2 = $db->sql_query("SELECT cid, title FROM " . $linksprefix . "_categories WHERE title LIKE '%{$query}%' ORDER BY title DESC"); while (list($cid, $stitle) = $db->sql_fetchrow($result2)) { $res = $db->sql_query("SELECT * FROM " . $linksprefix . "_links WHERE cid={$cid}"); $numrows = $db->sql_numrows($res); $result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $linksprefix . "_categories WHERE cid={$cid}"); list($cid3, $title3, $parentid3) = $db->sql_fetchrow($result3); if ($parentid3 > 0) { $title3 = getparent($parentid3, $title3); } $title3 = ereg_replace($query, "<b>{$query}</b>", $title3); } echo '<br /><table width="100%" style="background:' . $bgcolor2 . ';"><tr><td class="option"><b>' . _LINKS . '</b></td></tr></table>'; $orderbyTrans = isset($_GET['orderby']) ? convertorderbytrans($_GET['orderby']) : _TITLEAZ; echo '<br /><span class="content">' . _SORTLINKSBY . ': ' . _TITLE . ' (<a href="' . URL::index("&l_op=search&query={$the_query}&orderby=titlea") . '">A</a>\\<a href="' . URL::index("&l_op=search&query={$the_query}&orderby=titled") . '">D</a>)' . _DATE . ' (<a href="' . URL::index("&l_op=search&query={$the_query}&orderby=datea") . '">A</a>\\<a href="' . URL::index("&l_op=search&query={$the_query}&orderby=dated") . '">D</a>)' . _RATING . ' (<a href="' . URL::index("&l_op=search&query={$the_query}&orderby=ratinga") . '">A</a>\\<a href="' . URL::index("&l_op=search&query={$the_query}&orderby=ratingd") . '">D</a>)' . _POPULARITY . ' (<a href="' . URL::index("&l_op=search&query={$the_query}&orderby=hitsa") . '">A</a>\\<a href="' . URL::index("&l_op=search&query={$the_query}&orderby=hitsd") . '">D</a>)' . '<br />' . _SITESSORTED . ": {$orderbyTrans}<br /><br />"; while (list($lid, $cid, $title, $url, $description, $time, $hits, $linkratingsummary, $totalvotes, $totalcomments) = $db->sql_fetchrow($result)) { $linkratingsummary = number_format($linkratingsummary, $weblinks_config['mainvotedecimal']); $transfertitle = str_replace(' ', '_', $title); $title = ereg_replace($query, "<b>{$query}</b>", $title); echo '<a href="' . URL::index('&l_op=visit&lid=' . $lid) . '" target="_blank">' . $title . '</a>'; $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3); newlinkgraphic($datetime); popgraphic($hits); echo '<br />'; $description = ereg_replace($query, "<b>{$query}</b>", $description); echo _DESCRIPTION . ": {$description}<br />"; echo _ADDEDON . ": {$datetime} " . _HITS . ": {$hits}"; /* voting & comments stats */ $votestring = $totalvotes == 1 ? _VOTE : _VOTES; if ($linkratingsummary != '0' || $linkratingsummary != '0.0') { echo ' ' . _RATING . ": {$linkratingsummary} ({$totalvotes} {$votestring})"; } echo '<br /><a href="' . URL::index('&l_op=ratelink&lid=' . $lid . '&ttitle=' . $transfertitle) . '">' . _RATESITE . '</a>'; if ($totalvotes != 0) { echo ' | <a href="' . URL::index("&l_op=viewlinkdetails&lid={$lid}&ttitle={$transfertitle}") . '">' . _DETAILS . '</a>'; } if ($totalcomments != 0) { echo ' | <a href="' . URL::index('&l_op=viewlinkcomments&lid=' . $lid . '&ttitle=' . $transfertitle) . '">' . _SCOMMENTS . ' (' . $totalcomments . ')</a>'; } detecteditorial($lid, $transfertitle); echo '<br />'; $result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $linksprefix . "_categories WHERE cid={$cid}"); list($cid3, $title3, $parentid3) = $db->sql_fetchrow($result3); if ($parentid3 > 0) { $title3 = getparent($parentid3, $title3); } echo _CATEGORY . ": {$title3}<br /><br />"; $x++; } echo '</span>'; $orderby = isset($_GET['orderby']) ? convertorderbyout($_GET['orderby']) : 'title ASC'; } else { echo '<br /><br /><div style="text-align:center;" class="option"><b>' . _NOMATCHES . '</b><br /><br />' . _GOBACK . '<br /></div>'; } /* Calculates how many pages exist. Which page one should be on, etc... */ $linkpagesint = $totalselectedlinks / $linksresults; $linkpageremainder = $totalselectedlinks % $linksresults; if ($linkpageremainder != 0) { $linkpages = ceil($linkpagesint); if ($totalselectedlinks < $linksresults) { $linkpageremainder = 0; } } else { $linkpages = $linkpagesint; } /* Page Numbering */ if ($linkpages != 1 && $linkpages != 0) { echo '<br /><br />' . _SELECTPAGE . ': '; $prev = $min - $linksresults; if ($prev >= 0) { echo ' <b>[ <a href="' . URL::index("&l_op=search&query={$the_query}&min={$prev}&orderby={$orderby}&show={$show}") . '">' . ' « ' . _PREVIOUSPAGE . '</a> ]</b> '; } $counter = 1; $currentpage = $max / $linksresults; while ($counter <= $linkpages) { $cpage = $counter; $mintemp = $perpage * $counter - $linksresults; if ($counter == $currentpage) { echo "<b>{$counter}</b> "; } else { echo '<a href="' . URL::index("&l_op=search&query={$the_query}&min={$mintemp}&orderby={$orderby}&show={$show}") . '">' . $counter . '</a> '; } $counter++; } $next = $min + $linksresults; if ($x >= $perpage) { echo ' <b>[ <a href="' . URL::index("&l_op=search&query={$the_query}&min={$max}&orderby={$orderby}&show={$show}") . '"> ' . _NEXTPAGE . ' »</a> ]</b>'; } } } else { echo '<div style="text-align:center;" class="option"><b>' . _NOMATCHES . '</b></div><br /><br />'; } echo '<br /><br /><p style="text-align:left;">' . _TRY2SEARCH . ' "' . $the_query . '" ' . _INOTHERSENGINES . '<br /> <ul><li><a href="http://groups.google.com/groups?q=' . $the_query . '" target="_blank">Google Groups</a></li> <li><a href="http://images.google.com/images?q=' . $the_query . '" target="_blank">Google Images</a></li> <li><a href="http://news.google.com/news?q=' . $the_query . '" target="_blank">Google News</a></li> <li><a href="http://froogle.google.com/froogle?q=' . $the_query . '" target="_blank">Froogle</a></li> <li><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></li> <li><a target="_blank" href="http://www.hotbot.com/?MT=' . $the_query . '&DU=days&SW=web">HotBot</a></li> <li><a target="_blank" href="http://www.infoseek.com/Titles?qt=' . $the_query . '">Infoseek</a></li> <li><a target="_blank" href="http://www.dejanews.com/dnquery.xp?QRY=' . $the_query . '">Deja News</a></li> <li><a target="_blank" href="http://www.lycos.com/cgi-bin/pursuit?query=' . $the_query . '&maxhits=20">Lycos</a></li> <li><a target="_blank" href="http://search.yahoo.com/bin/search?p=' . $the_query . '">Yahoo</a></li> </ul> </p>'; CloseTable(); }
function MostPopular($ratenum, $ratetype) { global $prefix, $dbi, $admin, $module_name, $user; 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, url, 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, $url, $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)) { if (eregi("http", $url)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo " <font class=\"content\"><a href=\"modules.php?name={$module_name}&d_op=getit&lid={$lid}\" CLASS=\"title\" TARGET=\"_blank\">{$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})"; } 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 "<B>" . _CATEGORY . ":</B> <A HREF=\"modules.php?name=Downloads&d_op=viewdownload&cid={$cid}\">{$ctitle}</A>"; 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>"; if (is_user($user)) { 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>"; } echo "</font></td></tr></table>"; CloseTable(); include "footer.php"; }
function NewDownloadsDate($selectdate) { global $prefix, $db, $module_name, $admin, $user; $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); $totaldownloads = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_downloads_downloads WHERE date LIKE '%{$newdownloadDB}%'")); echo "<font class=\"option\"><b>{$dateView} - {$totaldownloads} " . _NEWDOWNLOADS . "</b></font>" . "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">"; $sql = "SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $prefix . "_downloads_downloads WHERE date LIKE '%{$newdownloadDB}%' ORDER BY title ASC"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $lid = $row[lid]; $cid = $row[cid]; $title = $row[title]; $description = $row[description]; $time = $row[date]; $hits = $row[hits]; $url = $row[url]; $downloadratingsummary = $row[downloadratingsummary]; $totalvotes = $row[totalvotes]; $totalcomments = $row[totalcomments]; $filesize = $row[filesize]; $version = $row[version]; $homepage = $row[homepage]; $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); $title = stripslashes($title); $description = stripslashes($description); if (is_admin($admin)) { if (eregi("http", $url)) { echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo " <a href=\"modules.php?name={$module_name}&d_op=getit&lid={$lid}\" TARGET=\"_blank\" CLASS=\"title\">{$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})"; } echo "<br>"; $sql2 = "SELECT title FROM " . $prefix . "_downloads_categories WHERE cid='{$cid}'"; $result2 = $db->sql_query($sql2); $row2 = $db->sql_fetchrow($result2); $ctitle = $row2[title]; $ctitle = getparent($cid, $ctitle); echo "<B>" . _CATEGORY . ":</B> <A HREF=\"modules.php?name=Downloads&d_op=viewdownload&cid={$cid}\">{$ctitle}</A>"; 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>"; if (is_user($user)) { 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>"; } echo "</font></td></tr></table>"; CloseTable(); include "footer.php"; }
function MostPopular() { global $downloadsprefix, $db, $module_name, $mainvotedecimal; include "header.php"; downl_menu_tpl(1); echo '<br />'; OpenTable(); echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">"; $mostpopdownloads = isset($_GET['ratenum']) ? intval($_GET['ratenum']) : 10; if (isset($_GET['ratetype']) && $_GET['ratetype'] == 'percent') { $topdownloadspercent = $mostpopdownloads; list($totalmostpopdownloads) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads", SQL_NUM, __FILE__); $mostpopdownloads = $mostpopdownloads / 100; $mostpopdownloads = $totalmostpopdownloads * $mostpopdownloads; $mostpopdownloads = round($mostpopdownloads); echo "<center><font class=\"option\"><b>" . _MOSTPOPULAR . " {$topdownloadspercent}% (" . _OFALL . " {$totalmostpopdownloads} " . _DOWNLOADS . ")</b></font></center><br />"; } else { echo "<center><font class=\"option\"><b>" . _MOSTPOPULAR . " {$mostpopdownloads}</b></font></center><br />"; } echo "<center>" . _SHOWTOP . ": [ <a href=\"" . getlink("&d_op=MostPopular&ratenum=10&ratetype=num") . "\">10</a> - " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=25&ratetype=num") . "\">25</a> - " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=50&ratetype=num") . "\">50</a> | " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=1&ratetype=percent") . "\">1%</a> - " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=5&ratetype=percent") . "\">5%</a> - " . "<a href=\"" . getlink("&d_op=MostPopular&ratenum=10&ratetype=percent") . "\">10%</a> ]</center><br /><br /></td></tr>"; $result = $db->sql_query("SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads order by hits DESC limit 0, {$mostpopdownloads}"); echo "<tr><td class=\"content\">"; while (list($lid, $cid, $title, $description, $time, $hits, $url, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) { $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); if (can_admin('downloads')) { if (eregi("http", $url)) { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\" /></a>"; } else { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\" /></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\" />"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\" />"; } } echo " <a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\" class=\"title\">{$title}</a>"; $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3); newdownloadgraphic($datetime); popgraphic($hits); detecteditorial($lid, 1); echo '<br />'; echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />"; echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />"; echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> <b>{$hits}</b>"; $transfertitle = str_replace(" ", "_", $title); /* voting & comments stats */ if ($totalvotes == 1) { $votestring = _VOTE; } else { $votestring = _VOTES; } if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") { echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})"; } echo '<br />'; $result2 = $db->sql_query("SELECT title FROM " . $downloadsprefix . "_categories WHERE cid={$cid}"); list($ctitle) = $db->sql_fetchrow($result2); $ctitle = getparent($cid, $ctitle); echo "<b>" . _CATEGORY . ":</b> <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$ctitle}</a>"; if ($homepage == "") { echo '<br />'; } else { echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | "; } echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>"; if (is_user()) { echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>"; } echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>"; if ($totalcomments != 0) { echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, 0); echo "<br /><br />"; } echo "</td></tr></table>"; CloseTable(); include "footer.php"; }
function viewdownload() { global $downloadsprefix, $db, $perpage, $module_name, $bgcolor1, $bgcolor3, $show_links_num; $cid = intval($_GET['cid']); $min = isset($_GET['min']) ? intval($_GET['min']) : 0; $orderby = convertorderbyin($_GET['orderby']); $max = $min + $perpage; include "header.php"; $result = $db->sql_query("SELECT title,cdescription,ldescription,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}"); list($title, $cdescription, $ldescription, $parentid) = $db->sql_fetchrow($result); $title = getparentlink($parentid, $title); $title = "<a href=" . getlink() . ">" . _MAIN . "</a>/{$title}"; downl_menu_tpl(1); echo '<br />'; if ($ldescription != '') { OpenTable2(); echo "{$ldescription}"; CloseTable2(); echo '<br />'; } OpenTable(); if ($cdescription != '') { $cdescription = "<br />" . $cdescription; } echo "<center><font class=\"title\"><b>" . _CATEGORY . ": {$title}</b></font>{$cdescription}</center>"; echo "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\" align=\"center\"><tr>"; $result2 = $db->sql_query("SELECT cid, title, cdescription FROM " . $downloadsprefix . "_categories WHERE parentid={$cid} order by title"); $count = 0; while (list($cid2, $title2, $cdescription2) = $db->sql_fetchrow($result2)) { if ($show_links_num == 1) { $cresult = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid2}"); $cnumrows = $db->sql_numrows($cresult); $cnumm = " ({$cnumrows})"; } else { $cnum = ""; } if ($cnumrows > 0) { $folder = "modules/Downloads/images/openfolder.gif"; } else { $folder = "modules/Downloads/images/closedfolder.gif"; } if (can_admin('downloads')) { $folderImg = "<A HREF=\"" . adminlink("{$module_name}&mode=DownloadsModCat&cat={$cid2}") . "\"><IMG SRC=\"{$folder}\" BORDER=0 ALT=\"" . _EDIT . "\"></A>"; } else { $folderImg = "<IMG SRC=\"{$folder}\" BORDER=0 ALT=\"{$title2}\">"; } echo "<td valign=\"top\"><font class=\"title\">{$folderImg} <a href=\"" . getlink("&d_op=viewdownload&cid={$cid2}") . "\"><b>{$title2}</b></a></font>{$cnumm}"; categorynewdownloadgraphic($cid2); if ($cdescription2) { echo "<br /><font class=\"content\">{$cdescription2}</font><br />"; } else { echo '<br />'; } $result3 = $db->sql_query("SELECT cid, title FROM " . $downloadsprefix . "_categories WHERE parentid={$cid2} order by title limit 0,3"); $space = 0; while (list($cid3, $title3) = $db->sql_fetchrow($result3)) { if ($space > 0) { echo ", "; } if ($show_links_num == 1) { $cresult2 = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid3}"); $cnumrows2 = $db->sql_numrows($cresult2); $cnum = " ({$cnumrows2})"; } else { $cnum = ""; } echo "<font class=\"content\"><a href=\"" . getlink("&d_op=viewdownload&cid={$cid3}") . "\">{$title3}</a></font>{$cnum}"; $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=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=titleA") . "\">A</a>\\<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=titleD") . "\">D</a>) " . _DATE . " (<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=dateA") . "\">A</a>\\<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=dateD") . "\">D</a>) " . _RATING . " (<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=ratingA") . "\">A</a>\\<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=ratingD") . "\">D</a>) " . _POPULARITY . " (<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=hitsA") . "\">A</a>\\<a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&orderby=hitsD") . "\">D</a>)" . "<br /><b>" . _RESSORTED . ": {$orderbyTrans}</b></font></center>"; echo "<hr noshade size=\"1\">"; $result = $db->sql_query("SELECT lid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE cid={$cid} order by {$orderby} limit {$min},{$perpage} "); $fullcountresult = $db->sql_query("SELECT lid FROM " . $downloadsprefix . "_downloads WHERE cid={$cid}"); $totalselecteddownloads = $db->sql_numrows($fullcountresult); echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"10\" border=\"0\"><tr><td><font class=\"content\">"; $x = 0; $color = $bgcolor3; while (list($lid, $title, $url, $description, $time, $hits, $downloadratingsummary, $totalvotes, $totalcomments, $filesize, $version, $homepage) = $db->sql_fetchrow($result)) { $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); $color = $color == $bgcolor3 ? $bgcolor1 : $bgcolor3; echo "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=0 WIDTH=100%><TR BGCOLOR=\"{$color}\"><TD>"; if (can_admin('downloads')) { if (eregi("http", $url)) { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo "</td><td width=\"100%\" class=\"title\" valign=\"top\"><a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\"><B>{$title}</b></a>"; $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3); newdownloadgraphic($datetime); popgraphic($hits); detecteditorial($lid, 1); echo "</td></tr><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>"; echo "<DIV ALIGN=\"JUSTIFY\"><b>" . _DESCRIPTION . ":</b> {$description}</td></tr><TR BGCOLOR=\"{$color}\"><TD COLSPAN=2>"; echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />"; echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}"; $transfertitle = str_replace(" ", "_", $title); /* voting & comments stats */ if ($totalvotes == 1) { $votestring = _VOTE; } else { $votestring = _VOTES; } if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") { echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})"; } if ($homepage == "") { echo '<br />'; } else { echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | "; } echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>"; if (is_user()) { echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>"; } echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>"; if ($totalcomments != 0) { echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, 0); echo "</div></td></tr></table><br />"; $x++; } echo "</font>"; $orderby = convertorderbyout($orderby); /* Calculates how many pages exist. Which page one should be on, etc... */ $downloadpagesint = $totalselecteddownloads / $perpage; $downloadpageremainder = $totalselecteddownloads % $perpage; if ($downloadpageremainder != 0) { $downloadpages = ceil($downloadpagesint); if ($totalselecteddownloads < $perpage) { $downloadpageremainder = 0; } } else { $downloadpages = $downloadpagesint; } /* Page Numbering */ if ($downloadpages != 1 && $downloadpages != 0) { echo "<br /><br />"; echo _SELECTPAGE . ": "; $prev = $min - $perpage; if ($prev >= 0) { echo " <b>[ <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&min={$prev}&orderby={$orderby}") . "\">"; echo " << " . _PREVIOUSPAGE . "</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=\"" . getlink("&d_op=viewdownload&cid={$cid}&min={$mintemp}&orderby={$orderby}") . "\">{$counter}</a> "; } $counter++; } $next = $min + $perpage; if ($x >= $perpage) { echo " <b>[ <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}&min={$max}&orderby={$orderby}") . "\">" . _NEXTPAGE . " >></a> ]</b> "; } } echo "</td></tr></table>"; CloseTable(); include "footer.php"; }
function TopRated() { global $downloadsprefix, $db, $module_name, $downloadvotemin, $topdownloads; include "header.php"; downl_menu_tpl(1); echo '<br />'; OpenTable(); echo "<table border=\"0\" width=\"100%\"><tr><td align=\"center\">"; if (isset($_GET['ratenum']) && isset($_GET['ratetype'])) { $topdownloads = intval($_GET['ratenum']); if ($_GET['ratetype'] == "percent") { $topdownloadspercentrigger = 1; } } if ($topdownloadspercentrigger == 1) { $topdownloadspercent = $topdownloads; list($totalrateddownloads) = $db->sql_ufetchrow("SELECT COUNT(*) FROM " . $downloadsprefix . "_downloads WHERE downloadratingsummary != 0", SQL_NUM, __FILE__); $topdownloads = $topdownloads / 100; $topdownloads = $totalrateddownloads * $topdownloads; $topdownloads = round($topdownloads); } if ($topdownloadspercentrigger == 1) { echo "<center><font class=\"option\"><b>" . _DBESTRATED . " {$topdownloadspercent}% (" . _OF . " {$totalrateddownloads} " . _TRATEDDOWNLOADS . ")</b></font></center><br />"; } else { echo "<center><font class=\"option\"><b>" . _DBESTRATED . " {$topdownloads} </b></font></center><br />"; } echo "</td></tr>" . "<tr><td><center>" . _NOTE . " {$downloadvotemin} " . _TVOTESREQ . "<br />" . _SHOWTOP . ": [ <a href=\"" . getlink("&d_op=TopRated&ratenum=10&ratetype=num") . "\">10</a> - " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=25&ratetype=num") . "\">25</a> - " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=50&ratetype=num") . "\">50</a> | " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=1&ratetype=percent") . "\">1%</a> - " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=5&ratetype=percent") . "\">5%</a> - " . "<a href=\"" . getlink("&d_op=TopRated&ratenum=10&ratetype=percent") . "\">10%</a> ]</center><br /><br /></td></tr>"; $sql = "SELECT lid, cid, title, description, date, hits, url, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE downloadratingsummary != 0 AND totalvotes >= {$downloadvotemin} ORDER BY downloadratingsummary DESC LIMIT 0,{$topdownloads}"; $result = $db->sql_query($sql); echo '<tr><td>'; while ($row = $db->sql_fetchrow($result)) { $lid = $row['lid']; $cid = $row['cid']; $title = $row['title']; $description = $row['description']; $time = $row['date']; $hits = $row['hits']; $url = $row['url']; $downloadratingsummary = number_format($row['downloadratingsummary'], $mainvotedecimal); $totalvotes = $row['totalvotes']; $totalcomments = $row['totalcomments']; $filesize = $row['filesize']; $version = $row['version']; $homepage = $row['homepage']; if (can_admin('downloads')) { if (eregi("http", $url)) { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo " <a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\" class=\"title\">{$title}</a>"; $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3); newdownloadgraphic($datetime); popgraphic($hits); detecteditorial($lid, 1); echo '<br />'; echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />"; echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />"; echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}"; $transfertitle = str_replace(" ", "_", $title); /* voting & comments stats */ if ($totalvotes == 1) { $votestring = _VOTE; } else { $votestring = _VOTES; } if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") { echo " <b>" . _RATING . ":</b> <b>{$downloadratingsummary}</b> ({$totalvotes} {$votestring})"; } echo '<br />'; $sql2 = "SELECT title FROM " . $downloadsprefix . "_categories WHERE cid={$cid}"; $result2 = $db->sql_query($sql2); $row2 = $db->sql_fetchrow($result2); $ctitle = $row2[title]; $ctitle = getparent($cid, $ctitle); echo "<b>" . _CATEGORY . ":</b> <a href=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$ctitle}</a><br />"; if ($homepage != "") { echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | "; } echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>"; if (is_user()) { echo " | <a href=\"" . getlink("&d_op=brokendownload&lid={$lid}") . "\">" . _REPORTBROKEN . "</a>"; } echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>"; if ($totalcomments != 0) { echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, 0); echo "<br /><br />"; } echo "</td></tr></table>"; CloseTable(); require 'footer.php'; }
} else { $imgpath = "" . IMAGE_URL . "/{$timg}"; } if ($timgwidth > 0 && $timgheight > 0) { $setsize = "width=" . $timgwidth . " height=" . $timgheight; } else { $setsize = ""; } $show = str_replace("[image]", "<a href=\"" . $link_url . "\"" . $link_target . "><img src=\"" . $imgpath . "\" border=1 alt=\"{$tname}\" " . $setsize . "></a>", $show); $show = str_replace("[image left]", "<a href=\"" . $link_url . "\"" . $link_target . "><img src=\"" . $imgpath . "\" border=1 alt=\"{$tname}\" " . $setsize . " align=\"left\"></a>", $show); $show = str_replace("[image right]", "<a href=\"" . $link_url . "\"" . $link_target . "><img src=\"" . $imgpath . "\" border=1 alt=\"{$tname}\" " . $setsize . " align=\"right\"></a>", $show); } else { $show = str_replace("[image]", "", $show); } $newupdate = newgraphic($date, $status); $pop = popgraphic($hits, $popular); $show = str_replace("[title]", "<a href=\"" . $link_url . "\"" . $link_target . ">" . $tname . "</a>" . $newupdate . "" . $pop . "", $show); if ($tauthor != XoopsUser::getUnameFromId($submitter)) { $showt = str_replace("[author]", sprintf(_MD_WRITTENBY, $tauthor), $show); } else { $show = str_replace("[author]", sprintf(_MD_WRITTENBY, "<a href=\"" . XOOPS_URL . "/userinfo.php?uid=" . $submitter . "\">" . $tauthor . "</a>"), $show); } $show = str_replace("[author]", sprintf(_MD_AUTHOR, $tauthor), $show); $date = formatTimestamp($date, "m"); $show = str_replace("[date]", sprintf(_MD_CREATEDATE, $date), $show); $show = str_replace("[hits]", "(" . sprintf(_MD_TUTORIALREAD, $hits) . ")", $show); if ($rating != "0" || $rating != "0.0") { if ($votes == 1) { $votestring = _MD_ONEVOTE; } else { $votestring = sprintf(_MD_NUMVOTES, $votes);
function listArticle($catid, $start = 0, $num = 20) { global $xoopsDB, $orderby, $xoopsConfig, $xoopsUser, $xoopsModule, $wfsConfig, $myts, $counter, $mydownloads_popular, $dataselect; global $wfsModule; // add $xt = new WfsCategory($catid); if (file_exists(XOOPS_ROOT_PATH . "/" . $wfsConfig['sgraphicspath'] . "/" . $xt->imgurl) && $xt->imgurl !='blank.gif' ) { $image = "<img src='" . XOOPS_URL . "/" . $wfsConfig['sgraphicspath'] . "/" . $xt->imgurl("S") . "'>"; } else { if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid()) && $xt->imgurl !='blank.gif') { // multi language // $image = "ERROR: Please check path/file for image"; $image = "<font color=red>"._WFS_ERROR_IMAGE."</font>"; } else { $image = ''; } } $title = $xt->title() ; $catdescription = $xt->catdescription('S'); echo "<table border='0' cellpadding='2' cellspacing='1' valign='top' align = 'center' width = '100%'>"; if ((!empty($xt->imgurl) && $xt->displayimg == 1)) { echo "<tr><td colspan='5' align='center'>".$image."</td></tr>\n"; } echo "<tr><td colspan='5' align='center'> </td></tr>\n"; echo "<tr><td colspan='5' align='center'><h3>".$title."</h3></td></tr>\n"; echo "<tr><td>"; // -- Skalpack2 [start] // easy to rename module and table // $jump = XOOPS_URL."/modules/wfsection/index.php?"; $jump = XOOPS_URL."/modules/$wfsModule/index.php?"; $tree = new wfsTree($xt->table, "id", "pid"); switch ($wfsConfig['aidxpathtype']) { case 1: // Local selectbox $tree->makeMyRootedSelBox('title', 'title', $xt->id, true, $xt->id, true, "", "location.href='{$jump}category='+this.options[this.selectedIndex].value"); break; case 2: // Linked path // BUG 217: category link is wrong // echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->id, "title", $jump)); echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->id, "title", $jump)); break; case 3: // Path and local select box // BUG 217: category link is wrong // echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->pid, "title", $jump)); echo preg_replace('/&id=/', '&category=', $tree->getNicePathFromId($xt->pid, "title", $jump)); // bug fix: it can't jump at Path and local select box // $tree->makeMySelBox('title', 'title', $xt->id, true, $xt->id, true, "", "location.href='{$jump}category='+this.options[this.selectedIndex].value"); $tree->makeMyRootedSelBox('title', 'title', $xt->id, true, $xt->id, true, "", "location.href='{$jump}category='+this.options[this.selectedIndex].value"); break; case 4: // None break; case 0: // Full selectbox default: $xt->makeSelBox(1, $xt->id, "pid", "location.href='{$jump}category='+this.options[this.selectedIndex].value").""; break; } // -- Skalpack2 [/end] echo "</td></td>"; echo "<tr><td colspan='5'><br />$catdescription<br /></td></tr>\n"; echo "<tr><td colspan='5'> </td></tr>\n"; echo "</table>\n"; $sarray = WfsArticle::getAllArticle($num, $start, $catid, $dataselect='4'); $articlecount = WfsArticle::countByCategory($catid); echo "<table border='0' cellpadding='2' cellspacing='1' width = '100%' class= 'outer'>"; If ($articlecount != 0) { echo "<tr align='left'>"; // These will always be shown echo "<td align='left' width = '30%' class='itemHead'><b>" . _WFS_ARTICLE . "</b></td>"; if ($wfsConfig['summary']) { echo "<td align='left' width = '50%' class='itemHead'><b>" . _WFS_SUMMARY . "</b></td>"; } // You can choose which of these to show if ($wfsConfig['showauthor']) echo "<td align='center' class='itemHead'><b>" . _WFS_AUTH . "</b></td>"; if ($wfsConfig['showhits']) echo "<td align='center' class='itemHead'><b>" . _WFS_HITS . "</b></td>"; if ($wfsConfig['showcomments']) { if ($wfsConfig['comments']) echo "<td align='center' class='itemHead'><b>" . _WFS_COMMENT . "</b></td>"; } if ($wfsConfig['showfile']) echo "<td align='center' class='itemHead'><b>" . _WFS_FILES . "</b></td>"; if ($wfsConfig['novote']) { if ($wfsConfig['showrated']) echo "<td align='center' class='itemHead'><b>" . _WFS_RATED . "</b></td>"; } if ($wfsConfig['novote']) { if ($wfsConfig['showvotes']) echo "<td align='center' class='itemHead'><b>" . _WFS_VOTES . "</b></td>"; } if ($wfsConfig['showupdated']) echo "<td align='center' class='itemHead'><b>" . _WFS_PUBLISHEDHOME . "</b></td>"; echo "</tr>\n"; foreach ($sarray as $article) { $counter = $article->counter(); $time = $article->created(); $stat = $article->changed(); $articlelink = "<a href='" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/article.php?articleid=" . $article->articleid() . "'>"; if ($wfsConfig['picon']) { $articlelink .= "".$article->iconLink("S") . "</a>"; } else { $articlelink .= "".$article->textLink("S") . "</a>"; } $summary = $article->summary(); $published = formatTimestamp($article->published(), $wfsConfig['timestamp']); $counter = $article->counter(); if ($wfsConfig['comments']) $commentcount = $article->getCommentsCount(); $attachedfiles = $article->getFilesCount(); if ($article->uid > 0) { $user = new xoopsUser($article->uid); if (($wfsConfig['realname']) && $user->getvar('name')) { $username = $user->getvar('name'); } else { $username = $user->getvar('uname'); } $username = "******".XOOPS_URL."/userinfo.php?uid=".$article->uid()."'>".$username."</a>"; } else { $username = $GLOBALS['xoopsConfig']['anonymous']; } //$username = "******" . XOOPS_URL . "/userinfo.php?uid=" . $article->uid() . "'>" . $article->uname() . "</a>"; if ($wfsConfig['novote']) $rating = number_format($article->rating, 2); $groupid = $article->groupid; if ($wfsConfig['novote']) $votes = $myts->makeTboxData4Show($article->votes) ; $status = 1; $orderbyTrans = convertorderbytrans($orderby); if ($stat != $time) $status = 2; if (checkAccess($groupid)) { echo "<tr><td valign='top' class='even'>$articlelink"; if ($wfsConfig['noicons']) { popgraphic($counter); newdownloadgraphic($time, $status); } echo "</td>"; if ($wfsConfig['summary']) echo "<td valign='top' class='even'>$summary</td>"; if ($wfsConfig['showauthor']) echo "<td align='center' valign='top' class='even' nowrap='nowrap'>$username</td>"; if ($wfsConfig['showhits']) echo "<td align='center' valign='top' class='even'>$counter</td>"; //if ($wfsConfig['comments']) { if ($wfsConfig['showcomments']) { if ($wfsConfig['comments']) echo "<td align='center' valign='top' class='even'>$commentcount</td>"; } if ($wfsConfig['showfile']) echo "<td align='center' valign='top' class='even'>$attachedfiles</td>"; if ($wfsConfig['novote']) { if ($wfsConfig['showrated']) echo "<td align='center' valign='top' class='even'>$rating</td>"; if ($wfsConfig['showvotes']) echo "<td align='center' valign='top' class='even'>$votes</td>"; } if ($wfsConfig['showupdated']) { echo "<td align='center' nowrap='nowrap' valign='top' class='even'>$published</td></tr>\n"; } } } //end check access } echo "</table>\n"; if ($articlecount > $num) { echo "<table border='0' width='100%' cellpadding='0' cellspacing='0' align='center' valign='top'><tr><td align='center'>"; // take over the order to previos and next page // if ($articlecount < $start + $num) echo "<a href='index.php?category=" . $catid . "&start=" . ($start - $num) . "'>" . _WFS_PREVPAGE . "</a> "; // if ($articlecount > $start + $num) echo "<a href='index.php?category=" . $catid . "&start=" . ($start + $num) . "'>" . _WFS_NEXTPAGE . "</a> "; $orderbyOut = convertorderbyout($orderby); if ($articlecount < $start + $num) echo "<a href='index.php?category=" . $catid . "&start=" . ($start - $num) . "&orderby=" . $orderbyOut . "'>" . _WFS_PREVPAGE . "</a> "; if ($articlecount > $start + $num) echo "<a href='index.php?category=" . $catid . "&start=" . ($start + $num) . "&orderby=" . $orderbyOut . "'>" . _WFS_NEXTPAGE . "</a> "; // BUG 8186: page number is displayed too many // for($i = 0, $j = 1; $i <= $articlecount; $i += $num, $j++) for($i = 0, $j = 1; $i < $articlecount; $i += $num, $j++) { if (($i <= $start) && ($start < ($i + $num))) { echo $j . " "; } else { // take over the order to previos and next page // echo "<a href='index.php?category=" . $catid . "&start=" . ($i) . "'>" . ($j) . "</a> "; echo "<a href='index.php?category=" . $catid . "&start=" . ($i) . "&orderby=" . $orderbyOut . "'>" . ($j) . "</a> "; } } echo "</td></tr></table>\n"; } echo "<table cellpadding='2' cellspacing='1' width='100%'>"; if ($xt->catfooter) { echo "<tr><td><br />\n"; echo $xt->catfooter('S') . "<br /><br />\n"; echo "</td></tr>\n"; } echo "</table>\n"; echo "<table border='0' cellpadding='1' cellspacing='1' width='100%'>"; if (!$xt->catfooter) echo "<br />"; echo "<tr><td align='center' class='head' >[ <a href='javascript:history.back(1)'>" . _WFS_BACK2 . "</a> | <a href='./index.php'>" . _WFS_RETURN2INDEX . "</a> ]</a></td></tr>\n"; echo "</table>\n"; echo "<br />"; if (($articlecount > 0)) { echo "<table border='0' cellpadding='1' cellspacing='1' width='100%' class = 'outer'>"; echo "<tr><td align='center' class='even'>"; $orderbyTrans = convertorderbytrans($orderby); // BUG 7854: redundant samll tag // echo "<small><center>" . _WFS_SORTBY1 . " "; echo "<center>" . _WFS_SORTBY1 . " "; echo " " . _WFS_TITLE1 . " (<a href='index.php?category=$catid&orderby=titleA'><img src='images/up.gif' border='0' align='middle' alt='' /></a><a href='index.php?category=$catid&orderby=titleD'><img src='images/down.gif' border='0' align='middle' alt='' /></a>)"; echo " " . _WFS_DATE1 . " (<a href='index.php?category=$catid&orderby=createdA'><img src='images/up.gif' border='0' align='middle' alt='' /></a><a href='index.php?category=$catid&orderby=createdD'><img src='images/down.gif' border='0' align='middle' alt='' /></a>)"; echo " " . _WFS_WEIGHT . " (<a href='index.php?category=$catid&orderby=weight'>Reset</a>)"; if ($wfsConfig['novote']) { echo " " . _WFS_RATING1 . " (<a href='index.php?category=$catid&orderby=ratingA'><img src='images/up.gif' border='0' align='middle' alt='' /></a><a href=index.php?category=$catid&orderby=ratingD><img src='images/down.gif' border='0' align='middle' alt='' /></a>)"; } echo " " . _WFS_POPULARITY1 . " (<a href='index.php?category=$catid&orderby=counterA'><img src='images/up.gif' border='0' align='middle' alt='' /></a><a href='index.php?category=$catid&orderby=counterD'><img src='images/down.gif' border='0' align='middle' alt='' /></a>)"; echo "<br /><b><small>"; printf(_WFS_CURSORTBY1, $orderbyTrans); $orderby = convertorderbyout($orderby); echo "</small></b></center>"; echo "</td></tr></table>\n"; } }
$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC); $xoopsTpl->assign('lang_hits', _MD_HITSC); $xoopsTpl->assign('lang_rating', _MD_RATINGC); $xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE); $xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN); $xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND); $xoopsTpl->assign('lang_modify', _MD_MODIFY); $xoopsTpl->assign('lang_latestlistings', _MD_LATESTLIST); $xoopsTpl->assign('lang_category', _MD_CATEGORYC); $xoopsTpl->assign('lang_visit', _MD_VISIT); $xoopsTpl->assign('lang_comments', _COMMENTS); $result = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description FROM " . $xoopsDB->prefix("mylinks_links") . " l, " . $xoopsDB->prefix("mylinks_text") . " t where l.status>0 and l.lid=t.lid ORDER BY date DESC", $xoopsModuleConfig['newlinks'], 0); while (list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result)) { if ($isadmin) { $adminlink = '<a href="' . XOOPS_URL . '/modules/mylinks/admin/?op=modLink&lid=' . $lid . '"><img src="' . XOOPS_URL . '/modules/mylinks/images/editicon.gif" border="0" alt="' . _MD_EDITTHISLINK . '" /></a>'; } else { $adminlink = ''; } if ($votes == 1) { $votestring = _MD_ONEVOTE; } else { $votestring = sprintf(_MD_NUMVOTES, $votes); } $path = $mytree->getPathFromId($cid, "title"); $path = substr($path, 1); $path = str_replace("/", " <img src='" . XOOPS_URL . "/modules/mylinks/images/arrow.gif' board='0' alt=''> ", $path); $new = newlinkgraphic($time, $status); $pop = popgraphic($hits); $xoopsTpl->append('links', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle) . $new . $pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time, "m"), 'description' => $myts->makeTareaData4Show($description, 0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK, $xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/mylinks/singlelink.php?cid=' . $cid . '&lid=' . $lid))); } include XOOPS_ROOT_PATH . '/footer.php';
function search() { global $bgcolor2, $downloadsprefix, $downloadsresults, $db, $mainvotedecimal, $module_name; include "header.php"; $min = isset($_GET['min']) ? intval($_GET['min']) : 0; $orderby = convertorderbyin($_GET['orderby']); if (isset($_GET['show']) && intval($_GET['show']) != 0) { $downloadsresults = intval($_GET['show']); } else { $show = $downloadsresults; } $max = $min + $downloadsresults; $query = isset($_POST['query']) ? $_POST['query'] : $_GET['query']; $the_query = htmlprepare($query); $query = Fix_Quotes($query, true); $result = $db->sql_query("SELECT lid, cid, title, url, description, date, hits, downloadratingsummary, totalvotes, totalcomments, filesize, version, homepage FROM " . $downloadsprefix . "_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' ORDER BY {$orderby} LIMIT {$min},{$downloadsresults}"); $fullcountresult = $db->sql_query("SELECT lid, title, description, date, hits, downloadratingsummary, totalvotes, totalcomments FROM " . $downloadsprefix . "_downloads WHERE title LIKE '%{$query}%' OR description LIKE '%{$query}%' "); $totalselecteddownloads = $db->sql_numrows($fullcountresult); $nrows = $db->sql_numrows($result); $x = 0; downl_menu_tpl(1); echo '<br />'; OpenTable(); if ($query != "") { if ($nrows > 0) { echo "<font class=\"option\">" . _SEARCHRESULTS4 . ": <b>{$the_query}</b></font><br /><br />" . "<table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _USUBCATEGORIES . "</b></font></td></tr></table>"; $result2 = $db->sql_query("SELECT cid, title FROM " . $downloadsprefix . "_categories WHERE title LIKE '%{$query}%' ORDER BY title DESC"); while (list($cid, $stitle) = $db->sql_fetchrow($result2)) { $res = $db->sql_query("SELECT * FROM " . $downloadsprefix . "_downloads WHERE cid={$cid}"); $numrows = $db->sql_numrows($res); $result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}"); list($cid3, $title3, $parentid3) = $db->sql_fetchrow($result3); if ($parentid3 > 0) { $title3 = getparent($parentid3, $title3); } $title3 = ereg_replace($query, "<b>{$query}</b>", $title3); } echo "<br /><table width=\"100%\" bgcolor=\"{$bgcolor2}\"><tr><td><font class=\"option\"><b>" . _UDOWNLOADS . "</b></font></td></tr></table>"; $orderbyTrans = convertorderbytrans($orderby); echo "<center><font class=\"content\">" . _SORTDOWNLOADSBY . ": " . _TITLE . " (<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=titleA") . "\">A</a>\\<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=titleD") . "\">D</a>) " . _DATE . " (<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=dateA") . "\">A</a>\\<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=dateD") . "\">D</a>) " . _RATING . " (<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=ratingA") . "\">A</a>\\<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=ratingD") . "\">D</a>) " . _POPULARITY . " (<a href=\"" . getlink("&d_op=search&query={$the_query}&orderby=hitsA") . "\">A</a>\\<a href=\"" . getlink("&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) = $db->sql_fetchrow($result)) { $downloadratingsummary = number_format($downloadratingsummary, $mainvotedecimal); $transfertitle = str_replace(" ", "_", $title); $title = ereg_replace($query, "<b>{$query}</b>", $title); if (can_admin('downloads')) { if (eregi("http", $url)) { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } else { echo "<a href=\"" . adminlink("{$module_name}&mode=DownloadsModDownload&lid={$lid}") . "\"><img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"" . _EDIT . "\"></a>"; } } else { if (eregi("http", $url)) { echo "<img src=\"modules/{$module_name}/images/icon30.gif\" border=\"0\" alt=\"\">"; } else { echo "<img src=\"modules/{$module_name}/images/download.gif\" border=\"0\" alt=\"\">"; } } echo " <a href=\"" . getlink("&d_op=getit&lid={$lid}") . "\" class=\"title\">{$title}</a>"; $datetime = formatDateTime($time . ' 00:00:00', _DATESTRING3); newdownloadgraphic($datetime); popgraphic($hits); detecteditorial($lid, 1); echo '<br />'; $description = ereg_replace($query, "<b>{$query}</b>", $description); echo "<b>" . _DESCRIPTION . ":</b> {$description}<br />"; echo "<b>" . _VERSION . ":</b> {$version} <b>" . _FILESIZE . ":</b> " . CoolSize($filesize) . "<br />"; echo "<b>" . _ADDEDON . ":</b> {$datetime} <b>" . _UDOWNLOADS . ":</b> {$hits}"; /* voting & comments stats */ if ($totalvotes == 1) { $votestring = _VOTE; } else { $votestring = _VOTES; } if ($downloadratingsummary != "0" || $downloadratingsummary != "0.0") { echo " <b>" . _RATING . ":</b> {$downloadratingsummary} ({$totalvotes} {$votestring})"; } echo '<br />'; $result3 = $db->sql_query("SELECT cid,title,parentid FROM " . $downloadsprefix . "_categories WHERE cid={$cid}"); list($cid3, $title3, $parentid3) = $db->sql_fetchrow($result3); if ($parentid3 > 0) { $title3 = getparent($parentid3, $title3); } echo "<B>" . _CATEGORY . ":</B> <A HREF=\"" . getlink("&d_op=viewdownload&cid={$cid}") . "\">{$title3}</A>"; if ($homepage == "") { echo '<br />'; } else { echo "<br /><a href=\"{$homepage}\" target=\"new\">" . _HOMEPAGE . "</a> | "; } echo "<a href=\"" . getlink("&d_op=ratedownload&lid={$lid}") . "\">" . _RATERESOURCE . "</a>"; echo " | <a href=\"" . getlink("&d_op=viewdownloaddetails&lid={$lid}") . "\">" . _DETAILS . "</a>"; if ($totalcomments != 0) { echo " | <a href=\"" . getlink("&d_op=viewdownloadcomments&lid={$lid}") . "\">" . _SCOMMENTS . " ({$totalcomments})</a>"; } detecteditorial($lid, 0); echo "<br /><br />"; $x++; } echo "</font>"; $orderby = convertorderbyout($orderby); } else { echo "<br /><br /><center><font class=\"option\"><b>" . _NOMATCHES . "</b></font><br /><br />" . _GOBACK . "<br /></center>"; } /* Calculates how many pages exist. Which page one should be on, etc... */ $downloadpagesint = $totalselecteddownloads / $downloadsresults; $downloadpageremainder = $totalselecteddownloads % $downloadsresults; if ($downloadpageremainder != 0) { $downloadpages = ceil($downloadpagesint); if ($totalselecteddownloads < $downloadsresults) { $downloadpageremainder = 0; } } else { $downloadpages = $downloadpagesint; } /* Page Numbering */ if ($downloadpages != 1 && $downloadpages != 0) { echo "<br /><br />" . _SELECTPAGE . ": "; $prev = $min - $downloadsresults; if ($prev >= 0) { echo " <b>[ <a href=\"" . getlink("&d_op=search&query={$the_query}&min={$prev}&orderby={$orderby}&show={$show}") . "\">" . " << " . _PREVIOUSPAGE . "</a> ]</b> "; } $counter = 1; $currentpage = $max / $downloadsresults; while ($counter <= $downloadpages) { $cpage = $counter; $mintemp = $downloadsresults * $counter - $downloadsresults; if ($counter == $currentpage) { echo "<b>{$counter}</b> "; } else { echo "<a href=\"" . getlink("&d_op=search&query={$the_query}&min={$mintemp}&orderby={$orderby}&show={$show}") . "\">{$counter}</a> "; } $counter++; } $next = $min + $downloadsresults; if ($x >= $downloadsresults) { echo " <b>[ <a href=\"" . getlink("&d_op=search&query={$the_query}&min={$max}&orderby={$orderby}&show={$show}") . "\">" . _NEXTPAGE . " >></a> ]</b>"; } } echo "<br /><br /><center><font class=\"content\">" . _TRY2SEARCH . " \"{$the_query}\" " . _INOTHERSENGINES . "<br />" . "<a target=\"_blank\" href=\"http://www.altavista.com/cgi-bin/query?pg=q&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/search/?q={$the_query}&section=projects\">Freshmeat</a> - " . "<a target=\"_blank\" href=\"http://www.justlinux.com/bin/search.pl?key={$the_query}\">JustLinux</a>" . "</font>"; } else { echo "<center><font class=\"option\"><b>" . _NOMATCHES . "</b></font></center><br /><br />"; } CloseTable(); include "footer.php"; }