sql_query("select id from ".$prefix."_".$mainprefix."_categories"); $waiting2 = $db->sql_numrows($result6); if ($waiting2==0) { $encoded = bin2hex("$adminmail"); $encoded = chunk_split($encoded, 2, '%'); $encoded = '%' . substr($encoded, 0, strlen($encoded) - 1); $adminmail = str_replace("@", "(at)", $adminmail); $adminmail = str_replace(".", "(dot)", $adminmail); OpenTable(); echo "" ."" ."" ."" ."
" ."

"._NOMAINCAT.".

" ."

"._CONTACTWEB.".
" ."$adminmail

"; CloseTable(); } else { OpenTable(); echo "" ."" ."
"; OpenTable(); echo "
$pagetitle - "._MAINCATEGORY." -

"; echo ""; $result = $db->sql_query("select id, parentid, title, description from ".$prefix."_".$mainprefix."_categories where parentid=0 order by title"); while(list($id, $parentid, $title, $cdescription) = $db->sql_fetchrow($result)) { $cresult = $db->sql_query("select id from ".$prefix."_".$mainprefix."_items where parentid=$id and active = '1'"); $cnumrows = $db->sql_numrows($cresult); echo ""; $dum = 1; } $count++; if ($count==2) { echo ""; $count = 0; $dum = 0; } } if ($dum == 1) { echo "
· $title ($cnumrows)"; categorynewdownloadgraphic($id); if ($cdescription) { echo "
$cdescription
"; } else { echo "
"; } $result2 = $db->sql_query("select id, title from ".$prefix."_".$mainprefix."_categories where parentid=$id order by title limit 0,".getconfigvar("maxcatlimit").""); $space = 0; while(list($cid, $stitle) = $db->sql_fetchrow($result2)) { $cresult2 = $db->sql_query("select id from ".$prefix."_".$mainprefix."_items where parentid=$cid and active = '1'"); $cnumrows2 = $db->sql_numrows($cresult2); if ($space>0) { echo ", "; } echo "$stitle ($cnumrows2)"; $space++; } if ($count<1) { echo "
    
"; } elseif ($dum == 0) { echo "
"; } if (getconfigvar("multilinguel") == 1) { $unilang = $currentlang; } else { $unilang = "english"; } $result3 = $db->sql_query("select id from ".$prefix."_".$mainprefix."_items where language = '$unilang' and active = '1'"); $numrows = $db->sql_numrows($result3); echo "

"._THEREAREMAIN." $numrows "._ITEMS." "._AND." $waiting2 "._CATEGORIES2." "._INDATABASE."
"; CloseTable(); $mostpopblock = getconfigvar("mostpopblock"); $newblock = getconfigvar("newblock"); echo ""; if ($mostpopblock == 1 OR $newblock == 1) { echo ""; } if ($newblock == 1) { include("modules/$modulename/blocks/block-Universal_New.php"); $universalnewtitle = "5 Newests $simtitle"; themesidebox($universalnewtitle, $uninewcontent); } if ($mostpopblock == 1) { include("modules/$modulename/blocks/block-Universal_Pop.php"); $universalpoptitle = "5 Most Popular $simtitle"; themesidebox($universalpoptitle, $unipopcontent); } echo "" ."" .""; CloseTable(); // Quick Pull if (getconfigvar("quickview") == 1) { if (getconfigvar("randomquick") == 1) { $quickviewnum2 = getconfigvar("quickviewnum"); } else { $quickviewnum2 = 1; } for ($i = 1; $i <= $quickviewnum2; $i++) { // Random Item Number if (getconfigvar("randomquick") == 1) { $result = $db->sql_query("SELECT id from ".$prefix."_".$mainprefix."_items where language = '$unilang' and active = '1'"); $id_cache = array(); while($row = $db->sql_fetchrow($result)) { $id_cache[] = $row['id']; } mt_srand((double) microtime() * 1000000); $random = $id_cache[rand(0,count($id_cache))]; unset($id_cache); } $quickviewnum = getconfigvar("quickviewnum"); $qvacharlimit = getconfigvar("qvacharlimit"); // End Random Grab if (getconfigvar("randomquick") == 1) { $sqlquery = $db->sql_query("SELECT id, parentid, author, title, description, votes, rating, comments, content, submitter, date, lastdate, views, bbcode_uid from ".$prefix."_".$mainprefix."_items where id = '$random' AND language = '$unilang' and active = '1'"); } else { $sqlquery = $db->sql_query("SELECT id, parentid, author, title, description, votes, rating, comments, content, submitter, date, lastdate, views, bbcode_uid from ".$prefix."_".$mainprefix."_items where language = '$unilang' and active = '1' order by id DESC limit 0,$quickviewnum"); } while (list($vid, $parentid, $author, $title, $description, $votes, $rating, $comments, $content, $submitter, $date, $lastdate, $views, $bbcode_uid) = $db->sql_fetchrow($sqlquery)) { if ($lastdate) { $overalldate = $lastdate; } else { $overalldate = $date; } if ($votes == 0) { $averagerating = 0; } else { $averagerating = substr($rating / $votes, 0, 4); } $overalldate2 = FormatDate($overalldate); $formatteddate = FormatDate($date); $title = stripslashes($title); if (getconfigvar("qvarticle") == 1) { $content = stripslashes($content); $content2 = substr($content,0,$qvacharlimit); $content2 = parse_bbcode($content2,$bbcode_uid); } else { $content = stripslashes($description); $content = nl2br($description); $content2 = $content; } $cattitlequery = $db->sql_query("select parentid, title from ".$prefix."_".$mainprefix."_categories where id=$parentid"); list($parentid2,$title2)= $db->sql_fetchrow($cattitlequery); $title2=getparentlink($parentid2,$title2); if ($comments == 0) { $comm = "comments?"; } else { $comm = "comments($comments)"; } //$friendlink = "\""._FRIEND."\"  "._FRIEND.""; $printpage = "\""._PRINTER."\"  "._PRINTER.""; $posted = "Posted by $submitter on $formatteddate ($views reads)"; $morelink = "($comm | $printpage $friendlink | Score: $averagerating)"; $popgraphic = popgraphic($views); $newgraphic = newdownloadgraphic($date, $time); $title1 = "$title $popgraphic $newgraphic"; $title = "$title2: $title1"; // Import Template $ThemeSel = get_theme(); if (file_exists("modules/$modulename/templates/$ThemeSel-cat.html")) { $tmpl_file = "modules/$modulename/templates/$ThemeSel-cat.html"; $thefile = implode("", file($tmpl_file)); $thefile = addslashes($thefile); $thefile = "\$r_file=\"".$thefile."\";"; eval($thefile); print $r_file; } else { $tmpl_file = "modules/$modulename/templates/nuke-cat.html"; $thefile = implode("", file($tmpl_file)); $thefile = addslashes($thefile); $thefile = "\$r_file=\"".$thefile."\";"; eval($thefile); print $r_file; } } } } else { } // End Quick Pull $queuequery = $db->sql_query("select id from ".$prefix."_".$mainprefix."_queue where language = '$unilang'"); $waiting = $db->sql_numrows($queuequery); if (getconfigvar("showqueue")==1) { OpenTable(); if (is_admin($admin)) { echo ""._WAIT1." $waiting "._WAIT2.""; } else { echo ""._WAIT1." $waiting "._WAIT2.""; } CloseTable(); } } include("modules/$modulename/includes/credit-line.php"); include("footer.php"); } function CatIndex($cid, $orderby, $sortletter, $page) { global $prefix, $db, $modulename, $admin, $sitename, $textcolor1, $bgcolor2, $bgcolor1, $mainprefix, $start, $currentlang; if (isset($page)) $page = intval($page); if (isset($start)) $start = intval($start); $cid = intval($cid); include("header.php"); include("modules/$modulename/includes/js.php"); require_once("modules/$modulename/includes/pagenumbering.php"); require_once("modules/$modulename/includes/bbstuff.php"); $perpage = getconfigvar("perpage"); if (getconfigvar("multilinguel") == 1) { $unilang = $currentlang; } else { $unilang = "english"; } $mainindex = 1; mainheader($mainindex); if(isset($sortletter)) { $letter = "yes"; $sortletter = $sortletter; } else { $letter = "no"; } if(isset($orderby)) { $orderby = convertorderbyin($orderby); } else { $orderby = "title ASC"; } $orderby2 = convertorderbyout($orderby); if (isset($start)) { $start = $start; } else { $start = 0; } if (getconfigvar("phpbb_pages") == 0) { list ($offset, $pages, $page, $mwpages) = generate_pagination_pages("and where parentid=$cid"); } if (getconfigvar("nosubcats") == 1) { // Do nothing } else { OpenTable(); $subcatcount = $db->sql_query("select * from ".$prefix."_".$mainprefix."_categories where parentid=$cid order by title"); $subcatnum = $db->sql_numrows($subcatcount); if ($subcatnum==0) { echo "" ."" ."" ."" ."
" ."

"._NOSUBCAT.".

"; } else { echo ""; $subcatquery = $db->sql_query("select id, parentid, title, description from ".$prefix."_".$mainprefix."_categories where parentid=$cid order by title"); $count = 0; while(list($id5, $parentid5, $title5, $cdescription5) = $db->sql_fetchrow($subcatquery)) { $cresult = $db->sql_query("select * from ".$prefix."_".$mainprefix."_items where parentid=$id5 and active = '1'"); $cnumrows = $db->sql_numrows($cresult); echo ""; $dum = 1; } $count++; if ($count==4) { echo ""; $count = 0; $dum = 0; } } if ($dum == 1) { echo "
· $title5 ($cnumrows)"; categorynewdownloadgraphic($id5); if ($cdescription) { echo "
$cdescription5
"; } else { echo "
"; } $subcatquery2 = $db->sql_query("select id, title from ".$prefix."_".$mainprefix."_categories where parentid=$id5 order by title limit 0,3"); $space = 0; while(list($cidi, $stitlei) = $db->sql_fetchrow($subcatquery2)) { $cresult7 = $db->sql_query("select id from ".$prefix."_".$mainprefix."_items where parentid=$cidi AND language = '$unilang' and active = '1'"); $cnumrows7 = $db->sql_numrows($cresult7); if ($space>0) { echo ", "; } echo "$stitlei ($cnumrows7)"; $space++; } if ($count<1) { echo "
    
"; } elseif ($dum == 0) { echo ""; } } CloseTable(); } OpenTable(); echo "" ."" .""; echo ""; if (getconfigvar("sortbytype") == 1) { include("modules/$modulename/includes/drop-down.php"); } else { include("modules/$modulename/includes/links.php"); } echo ""; echo ""; if ($letter == "no") { if (getconfigvar("phpbb_pages") == 1) { $mainindexquery = $db->sql_query("select id, parentid, author, title, description, votes, rating, comments, content, submitter, date, lastdate, views, bbcode_uid from ".$prefix."_".$mainprefix."_items where parentid=$cid AND language = '$unilang' and active = '1' order by $orderby limit $start,$perpage"); } else { $mainindexquery = $db->sql_query("select id, parentid, author, title, description, votes, rating, comments, content, submitter, date, lastdate, views, bbcode_uid from ".$prefix."_".$mainprefix."_items where parentid=$cid AND language = '$unilang' and active = '1' order by $orderby limit $offset,$perpage"); } } else { if (getconfigvar("phpbb_pages") == 1) { $mainindexquery = $db->sql_query("select id, parentid, author, title, description, votes, rating, comments, content, submitter, date, lastdate, views, bbcode_uid from ".$prefix."_".$mainprefix."_items where parentid=$cid and UPPER(title) LIKE '$sortletter%' AND language = '$unilang' and active = '1' order by $orderby limit $start,$perpage"); } else { $mainindexquery = $db->sql_query("select id, parentid, author, title, description, votes, rating, comments, content, submitter, date, lastdate, views, bbcode_uid from ".$prefix."_".$mainprefix."_items where parentid=$cid and UPPER(title) LIKE '$sortletter%' AND language = '$unilang' and active = '1' order by $orderby limit $offset,$perpage"); } } $mainindexqueryr = $db->sql_numrows($mainindexquery); if ($mainindexqueryr > 0) { echo ""; echo "\n"; echo "" ."" ."" ."" .""; } else { echo "" ."" .""; } echo "
"; $cattitlequery = $db->sql_query("select parentid, title from ".$prefix."_".$mainprefix."_categories where id=$cid"); list($parentid2,$title2)= $db->sql_fetchrow($cattitlequery); $title2=getparentlink($parentid2,$title2); $title2=""._MAIN."/$title2"; echo "
"._CATEGORY.": $title2
"; echo "
"; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
"._CIITEMSFOR." $sitename"; echo "
"; echo "

"._CIVIEWONLY.":
"; echo "

"; echo "
\n"; while (list($vid, $parentid, $author, $title, $description, $votes, $rating, $comments, $content, $submitter, $date, $lastdate, $views, $bbcode_uid) = $db->sql_fetchrow($mainindexquery)) { if ($lastdate) { $overalldate = $lastdate; } else { $overalldate = $date; } if ($votes == 0) { $averagerating = 0; } else { $averagerating = substr($rating / $votes, 0, 4); } $overalldate2 = FormatDate($overalldate); $formatteddate = FormatDate($date); $title = stripslashes($title); $qvacharlimit = getconfigvar("qvacharlimit"); if (getconfigvar("usedescript") == 0) { $content = stripslashes($content); $content2 = parse_bbcode($content2,$bbcode_uid); } else { $content = stripslashes($description); $content2 = nl2br($content); } if ($comments == 0) { $comm = "comments?"; } else { $comm = "comments($comments)"; } //$friendlink = "\""._FRIEND."\"  "._FRIEND.""; $printpage = "\""._PRINTER."\"  "._PRINTER.""; $posted = "Posted by $submitter on $formatteddate ($views reads)"; $morelink = "($comm | $printpage $friendlink | Score: $averagerating)"; $popgraphic = popgraphic($views); $newgraphic = newdownloadgraphic($date, $time); $title = "$title $popgraphic $newgraphic"; // Import Template $ThemeSel = get_theme(); if (file_exists("modules/$modulename/templates/$ThemeSel-cat.html")) { $tmpl_file = "modules/$modulename/templates/$ThemeSel-cat.html"; $thefile = implode("", file($tmpl_file)); $thefile = addslashes($thefile); $thefile = "\$r_file=\"".$thefile."\";"; eval($thefile); print $r_file; } else { $tmpl_file = "modules/$modulename/templates/nuke-cat.html"; $thefile = implode("", file($tmpl_file)); $thefile = addslashes($thefile); $thefile = "\$r_file=\"".$thefile."\";"; eval($thefile); print $r_file; } } echo "
  
" ."

"._NOITEMS.".

"; if (getconfigvar("phpbb_pages") == 0) { generate_pagination_old_catindex($page, $pages, $modulename, $letter, $sortletter); } CloseTable(); if (getconfigvar("phpbb_pages") == 1) { $per_page = $perpage; if ($sortletter) { $topics_count = $db->sql_numrows($db->sql_query("SELECT id FROM ".$prefix."_".$mainprefix."_items where parentid = '$cid' and UPPER(title) LIKE '$sortletter%' and language = '$unilang' and active = '1'")); } else { $topics_count = $db->sql_numrows($db->sql_query("SELECT id FROM ".$prefix."_".$mainprefix."_items where parentid = '$cid' and language = '$unilang' and active = '1'")); } if ($letter == "no") { $page_string = generate_pagination_phpbb("modules.php?name=$modulename&op=CatIndex&cid=$cid&orderby=$orderby2", $topics_count, $per_page, $start); } else { $page_string = generate_pagination_phpbb("modules.php?name=$modulename&op=CatIndex&cid=$cid&sortletter=$sortletter&orderby=$orderby2", $topics_count, $per_page, $start); } if ($page_string) { OpenTable(); echo "
$page_string
"; CloseTable(); } } include("modules/$modulename/includes/credit-line.php"); include("footer.php"); } function Random() { global $prefix, $db, $modulename, $mainprefix, $currentlang; if (getconfigvar("multilinguel") == 1) { $unilang = $currentlang; } else { $unilang = "english"; } $result = $db->sql_query("SELECT id from ".$prefix."_".$mainprefix."_items where language = '$unilang' and active = '1'"); $id_cache = array(); while($row = $db->sql_fetchrow($result)) { $id_cache[] = $row['id']; } mt_srand((double) microtime() * 1000000); $random = $id_cache[rand(0,count($id_cache))]; unset($id_cache); Header("Location: modules.php?name=$modulename&op=ViewItems&vid=$random"); } function search($query) { global $admin, $prefix, $db, $modulename, $mainprefix, $currentlang; include("header.php"); include("modules/$modulename/includes/js.php"); if (getconfigvar("multilinguel") == 1) { $unilang = $currentlang; } else { $unilang = "english"; } $mainindex = 1; mainheader($mainindex); OpenTable(); $searchresults = getconfigvar("searchresults"); $result = $db->sql_query("select id, parentid, author, website, title, description, submitter, date, lastdate, views from ".$prefix."_".$mainprefix."_items where title LIKE '%$query%' or description LIKE '%$query%' AND language = '$unilang' and active = '1' order by title LIMIT 0,$searchresults"); $numrow = $db->sql_numrows($result); if ($numrow > 0) { echo "" ."" ."" ."" ."" ."" ."" ."" ."" ."" .""; while(list($id, $parentid, $author, $website, $title, $description, $submitter, $date, $lastdate, $views) = $db->sql_fetchrow($result)) { if ($lastdate) { $overalldate = $lastdate; } else { $overalldate = $date; } $overalldate2 = FormatDate($overalldate); $formatteddate = FormatDate($date); $title = stripslashes($title); $description = stripslashes($description); echo "" .""; } echo "
"._RESULTSFOR.": $query
"._THEREAREIS." $numrow "._QUERYRESULTS.".
 
"._TITLE.": $title
" .""._DESCRIPTION.": $description
" .""._VIEWS.": $views
" .""._SUBMITBY.": $submitter "._ON." $formatteddate
" .""._LASTMOD." "._ON.": $overalldate2
" ."[ "; if (is_admin($admin)) { echo ""._EDIT." |"; } echo " "._HOMEPAGE." ]
" ." 
" ."
"; } else { echo "" ."" ."" ."" ."" ."" ."" ."
"._RESULTSFOR.": $query
" ."


" .""._NORESULTSFOR." \"$query\"
" .""._PLEASETRY.".

"; } CloseTable(); include("modules/$modulename/includes/credit-line.php"); include("footer.php"); } function ViewItems($vid, $page) { global $prefix, $db, $modulename, $bgcolor1, $bgcolor2, $textcolor1, $admin, $cookie, $user, $mainprefix, $user_prefix, $currentlang, $viewed; $vid = intval($vid); if (isset($viewed)) $viewed = intval($viewed); if (isset($page)) $page = intval($page); $vid2 = $vid; include("header.php"); include("modules/$modulename/includes/js.php"); require_once("modules/$modulename/includes/bbstuff.php"); $mainindex = 1; mainheader($mainindex); if (getconfigvar("multilinguel") == 1) { $unilang = $currentlang; } else { $unilang = "english"; } if(isset($viewed)) { $viewed = 1; } else { $viewed = 0; } if ($viewed == 0) { $db->sql_query("UPDATE ".$prefix."_".$mainprefix."_items SET views = views + 1 WHERE id = $vid2"); } $datapull = $db->sql_query("select * from ".$prefix."_".$mainprefix."_items where id = '$vid2' and active = '1'"); while(list($id, $parentid, $author, $website, $title, $description, $votes, $rating, $comments, $content, $submitter, $date, $lastdate, $views, $youremail, $bbcode_uid) = $db->sql_fetchrow($datapull)) { if ($lastdate) { $overalldate = $lastdate; } else { $overalldate = $date; } $overalldate2 = FormatDate($overalldate); $formatteddate = FormatDate($date); $usercheck = $db->sql_query("select username from ".$user_prefix."_users where username = '$submitter'"); $isuser = $db->sql_numrows($usercheck); if ($isuser == 1) { $contactemail = $youremail; $submitterq = "".stripslashes($submitter).""; } else { $contactemail = $youremail; $submitterq = stripslashes($submitter); } // Multiple Pages Start $formattedcontent = explode( "", $content ); $pageno = count($formattedcontent); if ( $page=="" || $page < 1 ) $page = 1; if ( $page > $pageno ) $page = $pageno; $arrayelement = (int)$page; $arrayelement --; // End // Build the the left/right selections include("modules/$modulename/includes/vilinks.php"); if ($vid2 == $first_id) { //@RJR-Pwmg@Rncvkpwo@-@Eqratkijv@(e)@VgejIHZ.eqo $titleheader1 = ""; } else { $titleheader1 = ""; } if (!$next_id == 0) { $titleheader2 = ""; } else { $titleheader2 = ""; } // End if ($votes == 0) { $averagerating = 0; } else { $averagerating = substr($rating / $votes, 0, 4); } $formattedcontent[$arrayelement] = stripslashes($formattedcontent[$arrayelement]); $title = stripslashes($title); $description = stripslashes($description); $cattitlequery = $db->sql_query("select parentid, title from ".$prefix."_".$mainprefix."_categories where id=$parentid"); list($parentid2,$title2)= $db->sql_fetchrow($cattitlequery); $title2=getparentlink($parentid2,$title2); $title2 = stripslashes($title2); OpenTable(); echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
"; echo "
$titleheader1 - $title - $titleheader2
"._CATEGORY.": $title2

"; echo " "; echo " "; echo " "; echo " "; if (getconfigvar("allowratings") == 1) { echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; } echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo "
"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; if ($author and $website) { echo " "; } else { echo " "; } echo " "; echo " "; echo " "; echo " "; } else { echo " "._VBNOEMAIL.""; } echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; if ($pageno > 1) { echo " "; echo " "; echo " "; echo " "; } echo "
"._VBFROM.":$submitterq
"._AUTHOR.":".stripslashes($author).""._VBUNKNOWN."
"._VBEMAIL.":"; if ($contactemail) { $encoded = bin2hex("$contactemail"); $encoded = chunk_split($encoded, 2, '%'); $encoded = '%' . substr($encoded, 0, strlen($encoded) - 1); echo " "._VBEMAIL2."
"._VBADDED.":$formatteddate
"._VBMODIFIED.":"; echo " $overalldate2
"._VBVIEWS.":$views "; popgraphic($views); echo "
"._VBVOTES.":$votes
"._VBRATING.":$averagerating
"._PAGE.":$page/$pageno
"; echo "
"; echo "
"; echo "

"; echo "

"; echo " "; echo " "; echo "
"; echo "
"; include("modules/$modulename/blocks/block-Related_Links.php"); themesidebox($boxtitle, $boxstuff); $optiontitle = ""._OPTIONS.""; include("modules/$modulename/blocks/blocks-Universal_Options.php"); themesidebox($optiontitle, $optionbox); echo "
"; echo "
"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $parse_content = parse_bbcode($formattedcontent[$arrayelement], $bbcode_uid); echo " "; echo " "; echo " "; echo " "; echo "
"; echo "

"._ITEMSFOR." $title:
"; echo " ".stripslashes($description)."
"; echo "


".stripslashes($parse_content)."
"; if($page >= $pageno) { $next_page = ""; } else { $next_pagenumber = $page + 1; if ($page != 1) { $next_page .= "- "; } $next_page .= ""._NEXT." ($next_pagenumber/$pageno) \""._NEXT."\""; } if($page <= 1) { $previous_page = ""; } else { $previous_pagenumber = $page - 1; $previous_page = "\""._PREVIOUS."\" "._PREVIOUS." ($previous_pagenumber/$pageno)"; } echo "


$previous_page $next_page


"; echo "
"; echo "
"; CloseTable(); } if (getconfigvar("allowcomments") == 1) { $username1 = $cookie[1]; if ($username1 == "") { $username1 = "Anonymous"; } if (getconfigvar("restrictcomments") == 1) { if (is_user($user)) { OpenTable(); echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; echo "
"; echo "

"._CPWM.""; echo "

"; echo "
"; echo "

"; echo "

"; echo " "; echo " "; echo " "; echo "
"; echo "
"; CloseTable(); OpenTable(); include("modules/$modulename/comments.php"); CloseTable(); } else { OpenTable(); echo ""._COMMREG." "._LOGIN.""; CloseTable(); } } else { OpenTable(); echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; echo "
"; echo "

"._CPWM.""; echo "

"; echo "
"; echo "

"; echo "

"; echo " "; echo " "; echo " "; echo "
"; echo "
"; CloseTable(); OpenTable(); include("modules/$modulename/comments.php"); CloseTable(); } } else { OpenTable(); echo ""._COMMNOTMESS.""; CloseTable(); } include("modules/$modulename/includes/credit-line.php"); include("footer.php"); } function TopRated() { global $prefix, $db, $modulename, $bgcolor1, $bgcolor2, $textcolor1, $mainprefix, $currentlang; include("header.php"); include("modules/$modulename/includes/js.php"); if (getconfigvar("multilinguel") == 1) { $unilang = $currentlang; } else { $unilang = "english"; } $mainindex = 1; mainheader($mainindex); OpenTable(); echo "
"; echo "
"; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $toprated = getconfigvar("toprated"); $topviewed = $db->sql_query("select id, title, views from ".$prefix."_".$mainprefix."_items where language = '$unilang' and active = '1' order by views DESC limit 0, $toprated"); while (list($cid, $vitemitle, $views) = $db->sql_fetchrow($topviewed)) { $vitemitle = stripslashes($vitemitle); $vpos += 1; echo " "; echo " "; echo " "; echo " "; echo " "; } echo "
"; echo " "._TOPTOP." $toprated"; echo " ("._TOPBYHITS.")
"; echo " "._TOPPOS.""; echo " "; echo " "._VBVIEWS.""; echo "

"; echo " "._TOPITEM."

"; echo "

$vpos

"; echo "

$views

$vitemitle
"; echo "

"; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $topratedquery = $db->sql_query("select id, title, votes, rating from ".$prefix."_".$mainprefix."_items where language = '$unilang' and active = '1' order by votes DESC limit 0, $toprated"); while (list($vid, $ritemitle, $votes, $rating) = $db->sql_fetchrow($topratedquery)) { if ($votes == 0) { $score = 0; } else { $score = substr($rating / $votes, 0, 4); } $rpos += 1; $ritemitle = stripslashes($ritemitle); echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; } echo "
"; echo " "._TOPTOP." $toprated"; echo " ("._TOPBYRAT.")
"; echo "

"; echo " "._TOPPOS.""; echo " "; echo " "._CTSCORE.""; echo " # "._VBVOTES.""; echo "

"; echo " "._TOPITEM."

"; echo " $rpos"; echo " $score"; echo " $votes"; echo "

$ritemitle

"; echo "

"; CloseTable(); include("modules/$modulename/includes/credit-line.php"); include("footer.php"); } function dorating($rid, $ratingchoice) { global $prefix, $db, $modulename, $mainprefix; $rid = intval($rid); $ratingchoice = intval($ratingchoice); $db->sql_query("UPDATE ".$prefix."_".$mainprefix."_items SET votes = votes + 1 WHERE id = $rid"); $db->sql_query("UPDATE ".$prefix."_".$mainprefix."_items SET rating = rating + $ratingchoice WHERE id = $rid"); Header("Location: modules.php?name=$modulename&op=ViewItems&vid=$rid&viewed=1"); } function FormatDate($strDate){ ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $strDate, $Adob); $newdob = $Adob[3]; if ($Adob[2] == 1)$month = _JANUARY; if ($Adob[2] == 2)$month = _FEBRUARY; if ($Adob[2] == 3)$month = _MARCH; if ($Adob[2] == 4)$month = _APRIL; if ($Adob[2] == 5)$month = _MAY; if ($Adob[2] == 6)$month = _JUNE; if ($Adob[2] == 7)$month = _JULY; if ($Adob[2] == 8)$month = _AUGUST; if ($Adob[2] == 9)$month = _SEPTEMBER; if ($Adob[2] == 10)$month = _OCTOBER; if ($Adob[2] == 11)$month = _NOVEMBER; if ($Adob[2] == 12)$month = _DECEMBER; $newdob = "$month"." ".$newdob.", ".$Adob[1]; return $newdob; } function convertorderbyin($orderby) { if ($orderby == "titleA") $orderby = "title ASC"; if ($orderby == "dateA") $orderby = "date ASC"; if ($orderby == "hitsA") $orderby = "views ASC"; if ($orderby == "ratingA") $orderby = "ratings ASC"; if ($orderby == "titleD") $orderby = "title DESC"; if ($orderby == "dateD") $orderby = "date DESC"; if ($orderby == "hitsD") $orderby = "views DESC"; if ($orderby == "ratingD") $orderby = "ratings DESC"; return $orderby; } function convertorderbytrans($orderby) { if ($orderby == "views ASC") $orderbyTrans = ""._POPULARITY1.""; if ($orderby == "views DESC") $orderbyTrans = ""._POPULARITY2.""; if ($orderby == "title ASC") $orderbyTrans = ""._TITLEAZ.""; if ($orderby == "title DESC") $orderbyTrans = ""._TITLEZA.""; if ($orderby == "date ASC") $orderbyTrans = ""._DDATE1.""; if ($orderby == "date DESC") $orderbyTrans = ""._DDATE2.""; if ($orderby == "rating ASC") $orderbyTrans = ""._RATING1.""; if ($orderby == "rating DESC") $orderbyTrans = ""._RATING2.""; return $orderbyTrans; } function convertorderbyout($orderby) { if ($orderby == "title ASC") $orderby = "titleA"; if ($orderby == "date ASC") $orderby = "dateA"; if ($orderby == "hits ASC") $orderby = "hitsA"; if ($orderby == "downloadratingsummary ASC") $orderby = "ratingA"; if ($orderby == "title DESC") $orderby = "titleD"; if ($orderby == "date DESC") $orderby = "dateD"; if ($orderby == "hits DESC") $orderby = "hitsD"; if ($orderby == "downloadratingsummary DESC") $orderby = "ratingD"; return $orderby; } function popgraphic($views) { global $modulename; $popular = getconfigvar("popular"); $views = intval($views); if ($views>=$popular) { $pop = " \""._POPULARIMAGE."\""; } return $pop; } function alpha($sortletter, $cid, $orderby2) { global $modulename; $cid = intval($cid); echo " "; $alphabet = array ("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0"); $counter = 0; while (list(, $ltr) = each($alphabet)) { if ($ltr==$sortletter) { $sel = " selected"; } echo " $ltr\n"; echo " \n"; $counter++; $sel = ''; } } function getparentlink($parentid2,$title2) { global $prefix, $db, $modulename, $mainprefix; $parentid2 = intval($parentid2); $result2=$db->sql_query("select id, parentid, title from ".$prefix."_".$mainprefix."_categories where id=$parentid2"); list($cid2, $pparentid2, $ptitle2) = $db->sql_fetchrow($result2); if ($ptitle2!="") $title2="$ptitle2/".$title2; if ($pparentid2!=0) { $title2=getparentlink($pparentid2,$title2); } return $title2; } function newdownloadgraphic($date, $time) { global $modulename; echo " "; setlocale (LC_TIME, "$locale"); ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime); $datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); $datetime = ucfirst($datetime); $startdate = time(); $count = 0; while ($count <= 7) { $daysold = date("d-M-Y", $startdate); if ("$daysold" == "$datetime") { if ($count<=1) { $newitem = " \""._NEWTODAY."\""; } if ($count<=3 && $count>1) { $newitem = " \""._NEWLAST3DAYS."\""; } if ($count<=7 && $count>3) { $newitem = " \""._NEWTHISWEEK."\""; } } $count++; $startdate = (time()-(86400 * $count)); } return $newitem; } function categorynewdownloadgraphic($cat) { global $prefix, $db, $modulename, $mainprefix; $cat = intval($cat); $newresult = $db->sql_query("select date from ".$prefix."_".$mainprefix."_items where parentid=$cat order by date desc limit 1"); list($time)=$db->sql_fetchrow($newresult); echo " "; setlocale (LC_TIME, "$locale"); ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime); $datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1])); $datetime = ucfirst($datetime); $startdate = time(); $count = 0; while ($count <= 7) { $daysold = date("d-M-Y", $startdate); if ("$daysold" == "$datetime") { if ($count<=1) { echo "\""._DCATNEWTODAY."\""; } if ($count<=3 && $count>1) { echo "\""._DCATLAST3DAYS."\""; } if ($count<=7 && $count>3) { echo "\""._DCATTHISWEEK."\""; } } $count++; $startdate = (time()-(86400 * $count)); } } function MostWanted($page) { global $prefix, $mainprefix, $db, $modulename, $bgcolor2, $textcolor1; $page = intval($page); if (getconfigvar("mostwanted") == 1) { include("header.php"); include("modules/$modulename/includes/js.php"); $mainindex = 1; mainheader($mainindex); // Calculate Page Numbering $mwpages = getconfigvar("mwpages"); $result = $db->sql_query("SELECT count(*) FROM ".$prefix."_".$mainprefix."_requests where approved='1'"); list($total) = $db->sql_fetchrow($result); if ($total>$mwpages) { $pages=ceil($total/$mwpages); if ($page > $pages) { $page = $pages; } if (!$page) { $page=1; } $offset=($page-1)*$mwpages; } else { $offset=0; $pages=1; $page=1; } // End Page Numbering OpenTable(); echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "

"._ITEMSREQUESTED.":\n"; echo "
"._REQUESTMESS."
"._REQUESTMESS2." "._REQUESTFORM."\n"; echo "

\n"; echo "
\n"; $sqlcheck = $db->sql_query("SELECT id from ".$prefix."_".$mainprefix."_requests"); $sqlnum = $db->sql_numrows($sqlcheck); if ($sqlnum >= 1) { echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; $mwpages = getconfigvar("mwpages"); $datapull = $db->sql_query("SELECT itemtitle, submitter, date from ".$prefix."_".$mainprefix."_requests where approved='1' order by date DESC limit $offset,$mwpages"); while (list($itemname, $submitter, $date) = $db->sql_fetchrow($datapull)) { $formatteddate = FormatDate($date); $itemname = stripslashes($itemname); echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; } echo "
\n"; echo " "._ITEMNAME."\n"; echo " "._REQUESTEDBY."\n"; echo " "._REQUESTDATE."
$itemname$submitter$formatteddate
\n"; echo "
\n"; } else { echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo "

"._NOREQUESTED.".

\n"; } if ($pages > 1) { echo "
\n"; $pcnt=1; echo "
"; echo ""; if ($page > 1) { echo "\n"; } else { echo "\n"; } echo "
\""._PREVPAGE."\""; } else { echo "\""._PREVPAGENO."\""; } while($pcnt < $page) { echo "[ $pcnt ] "; $pcnt++; } echo "[ $page ]"; $pcnt++; while($pcnt <= $pages) { echo " [ $pcnt ]"; $pcnt++; } if ($page < $pages) { echo "\""._NEXTPAGE."\"\""._NEXTPAGENO."\"

"; } CloseTable(); include("modules/$modulename/includes/credit-line.php"); include("footer.php"); } else { Header("Location: modules.php?name=$modulename"); } } switch($op) { case "index": index(); break; case "CatIndex": CatIndex($cid, $orderby, $sortletter, $page); break; case "search": search($query); break; case "ViewItems": ViewItems($vid, $page); break; case "dorating": dorating($rid, $ratingchoice); break; case "Random": Random(); break; case "TopRated": TopRated(); break; case "MostWanted": MostWanted($page); break; default: index(); break; } ?>