Author
Message
Asger New Member Joined: Nov 02, 2006 Posts: 18 Location: Denmark
Posted:
Sat Jun 07, 2008 9:20 am
Hi
A have a problem with NSN GR Downloads. When there is more than 1 page of downloads in a category and i try to go to page 2 (or higher) i get HTTP404 - Not found.
Here is the url it's trying to open:
Web site:
RN 2.20.01
NSN GR Downloads 1.0.3 pl1 with TN_ShortLinks_NSN_GR_Downloads_010001 patch from Montego
jakec Site Admin Joined: Feb 06, 2006 Posts: 3038 Location: United Kingdom
Posted:
Sat Jun 07, 2008 9:23 am
If you turn shortlinks off does it work?
Susann Moderator Joined: Dec 19, 2004 Posts: 3143 Location: Germany:Moderator German NukeSentinel Support
Posted:
Sat Jun 07, 2008 9:56 am
The second page within a downloads category looks like this until there is something new released:
downloads.html&min=10&cid=7
Make sure you have the correct entries in your .htaccess
Asger New Member Joined: Nov 02, 2006 Posts: 18 Location: Denmark
Posted:
Sat Jun 07, 2008 12:31 pm
Hi
It works if i turn shortlinks of.
Here is what i have in:
htaccess
Code:
#NSN GR Downloads
RewriteRule ^download-mod-([0-9]*).html modules.php?name=Downloads&op=modifydownloadrequest&lid=$1 [L]
RewriteRule ^download-file-([0-9]*).html modules.php?name=Downloads&op=getit&lid=$1 [L]
RewriteRule ^downloads-(NewDownloads|newdownloads).html modules.php?name=Downloads&op=NewDownloads [L]
RewriteRule ^download-shownew-([0-9]*).html modules.php?name=Downloads&op=NewDownloads&newdownloadshowdays=$1 [L]
RewriteRule ^download-seldate-([a-zA-Z0-9+]*).html modules.php?name=Downloads&op=NewDownloadsDate&selectdate=$1 [L]
RewriteRule ^downloads-(MostPopular|mostpopular).html modules.php?name=Downloads&op=MostPopular [L]
RewriteRule ^download-(MostPopular|mostpopular)-([0-9]*)-(num|percent).html modules.php?name=Downloads&op=MostPopular&ratenum=$2&ratetype=$3 [L]
RewriteRule ^download-sort-([0-9]*)-orderby-title([aA]).html modules.php?name=Downloads&cid=$1&orderby=titleA [L]
RewriteRule ^download-sort-([0-9]*)-orderby-title([dD]).html modules.php?name=Downloads&cid=$1&orderby=titleD [L]
RewriteRule ^download-sort-([0-9]*)-orderby-date([aA]).html modules.php?name=Downloads&cid=$1&orderby=dateA [L]
RewriteRule ^download-sort-([0-9]*)-orderby-date([dD]).html modules.php?name=Downloads&cid=$1&orderby=dateD [L]
RewriteRule ^download-sort-([0-9]*)-orderby-hits([aA]).html modules.php?name=Downloads&cid=$1&orderby=hitsA [L]
RewriteRule ^download-sort-([0-9]*)-orderby-hits([dD]).html modules.php?name=Downloads&cid=$1&orderby=hitsD [L]
RewriteRule ^download-search-([[:punct:]/:\-\'{}()._&a-zA-Z0-9+=]*)-([0-9]*)-([a-zA-Z0-9+]*)-([0-9]*).html modules.php?name=Downloads&d_op=search&query=$1&min=$2&orderby=$3&show=$4 [L]
RewriteRule ^download-search-([[:punct:]/:\-\'{}()._&a-zA-Z0-9+=]*)-([a-zA-Z0-9+]*).html modules.php?name=Downloads&d_op=search&query=$1&orderby=$2 [L]
RewriteRule ^download-search.html modules.php?name=Downloads&op=search [L]
RewriteRule ^download-gfx-([0-9]*).html modules.php?name=Downloads&op=gfx&random_num=$1 [L]
RewriteRule ^downloads-cat([0-9]*).html modules.php?name=Downloads&cid=$1 [L]
RewriteRule ^downloads.html&min=([0-9]*)&cid=([0-9]*)$ modules.php?name=Downloads&min=$1&cid=$2 [L]
RewriteRule ^downloads.html downloads.html [L]
GT-Downloads.php
Code:
<?php
/******************************************************************************
* Script: TegoNuke(tm) ShortLinks "Tap" for NSN GR Downloads v1.0.3pl1
* from http://www.nukescripts.net.
* Version: 1.0.1
* Author: Rob Herder (aka: montego) of http://montegoscripts.com
* Contact:
* Copyright: Copyright © 2006-2008 by Montego Scripts
* License: GNU/GPL (see provided LICENSE.txt file)
******************************************************************************/
$urlin = array(
'"(?<!/)modules.php\?name=Downloads&op=modifydownloadrequest&lid=([0-9]*)"',
'"(?<!/)modules.php\?name=Downloads&op=NewDownloads&newdownloadshowdays=([0-9]*)"',
'"(?<!/)modules.php\?name=Downloads&op=NewDownloadsDate&selectdate=([a-zA-Z0-9+]*)"',
'"(?<!/)modules.php\?name=Downloads&op=getit&lid=([0-9]*)"',
'"(?<!/)modules.php\?name=Downloads&op=(MostPopular)&ratenum=([0-9]*)&ratetype=(num|percent)"',
'"(?<!/)modules.php\?name=Downloads&op=(NewDownloads|MostPopular)"',
'"(?<!/)modules.php\?name=Downloads&cid=([0-9]*)&orderby=([a-zA-Z0-9+]*)"',
'"(?<!/)modules.php\?name=Downloads&min=([0-9]*)&cid=([0-9]*)"', //Must make code chg to work!
'"(?<!/)modules.php\?name=Downloads&op=search&query=([/:\-\'{}()\,\._&a-zA-Z0-9+=]*)&min=([0-9]*)&orderby=([a-zA-Z0-9+]*)&show=([0-9]*)"', //Must make code chg to work!
'"(?<!/)modules.php\?name=Downloads&op=search&query=([/:\-\'{}()\,\._&a-zA-Z0-9+= ]*)&orderby=([a-zA-Z0-9+]*)"', //Must make code chg to work!
'"(?<!/)modules.php\?name=Downloads&op=search"', //Must make code chg to work!
'"(?<!/)modules.php\?name=Downloads&op=gfx&random_num=([0-9]*)"',
'"(?<!/)modules.php\?name=Downloads&cid=([0-9]*)"',
'"(?<!/)modules.php\?name=Downloads"'
);
$urlout = array(
'download-mod-\\1.html',
'download-shownew-\\1.html',
'download-seldate-\\1.html',
'download-file-\\1.html',
'download-\\1-\\2-\\3.html',
'downloads-\\1.html',
'download-sort-\\1-orderby-\\2.html',
'download-paging-\\1-\\2.html', //Must make code chg to work!
'download-search-\\1-\\2-\\3-\\4.html', //Must make code chg to work!
'download-search-\\1-\\2.html', //Must make code chg to work!
'download-search.html', //Must make code chg to work!
'download-gfx-\\1.html',
'downloads-cat\\1.html',
'downloads.html'
);
?>
Is something missing or wrong?
Susann Moderator Joined: Dec 19, 2004 Posts: 3143 Location: Germany:Moderator German NukeSentinel Support
Posted:
Sat Jun 07, 2008 3:03 pm
I just found out that my version is another.
Guess Montego will see this topic within the next hours. So just wait.
montego Site Admin Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Mon Jun 09, 2008 5:22 am
Regarding this here within the GT-Downloads.php:
Quote:
//Must make code chg to work!
I have to go back and see if I missed a code change in the instructions, but there was a slight change in the includes file. Had you made that change?
Asger New Member Joined: Nov 02, 2006 Posts: 18 Location: Denmark
Posted:
Mon Jun 09, 2008 10:33 am
Hi Montego
Yes i have made the changes in "nsngd_func.php". I guess you refer to this:
Code:
=== OPEN ===
includes/nsngd_func.php
=== FIND CODE ===
function SearchForm() {
global $module_name, $query;
echo "<table border='0' cellspacing='0' cellpadding='0' align='center'>\n";
echo "<form action='modules.php?name=$module_name&op=search&query=$query' method='post'>\n";
echo "<tr><td><font class='content'><input type='text' size='25' name='query' value='$query'> <input type='submit' value='"._DL_SEARCH."'></td></tr>\n";
echo "</form>\n";
echo "</table>\n";
}
=== REPLACE WITH ===
function SearchForm() {
global $module_name, $query;
echo "<table border='0' cellspacing='0' cellpadding='0' align='center'>\n";
//TegoNuke(tm) ShortLinks:BEGIN - Comment out the original line and replace with the new one
// echo "<form action='modules.php?name=$module_name&op=search&query=$query' method='post'>\n";
echo "<form action='modules.php?name=$module_name&op=search' method='post'>\n";
//TegoNuke(tm) ShortLinks:END
echo "<tr><td><font class='content'><input type='text' size='25' name='query' value='$query'> <input type='submit' value='"._DL_SEARCH."'></td></tr>\n";
echo "</form>\n";
echo "</table>\n";
}
=== THAT IS ALL FOLKS! ===
As far as i can see it's only for the search function
Here is my "nsngd_func.php"
Code:
<?php
/********************************************************/
/* NSN GR Downloads */
/* By: NukeScripts Network (webmaster@nukescripts.net) */
/* http://www.nukescripts.net */
/* Copyright © 2000-2005 by NukeScripts Network */
/********************************************************/
function of_group($gid) {
global $prefix, $db, $user, $admin, $cookie;
/*if (is_admin($admin)) {
return 1;
} else*/if (is_user($user)) {
cookiedecode($user);
$guid = $cookie[0];
$currdate = time();
$ingroup = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nsngr_users WHERE gid='$gid' AND uid='$guid' AND (edate>'$currdate' OR edate='0')"));
if ($ingroup > 0) { return 1; }
}
return 0;
}
global $admin_file;
if(empty($admin_file)) { $admin_file= "admin"; }
function myimage($imgfile) {
global $module_name;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/downloads/$imgfile")) {
$myimage = "themes/$ThemeSel/images/downloads/$imgfile";
} else {
$myimage = "modules/$module_name/images/$imgfile";
}
return($myimage);
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function gdget_configs(){
global $prefix, $db;
$configresult = $db->sql_query("SELECT config_name, config_value FROM ".$prefix."_nsngd_config");
while (list($config_name, $config_value) = $db->sql_fetchrow($configresult)) {
$config[$config_name] = $config_value;
}
return $config;
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function gdsave_config($config_name, $config_value){
global $prefix, $db;
$db->sql_query("UPDATE ".$prefix."_nsngd_config SET config_value='$config_value' WHERE config_name='$config_name'");
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function CrawlLevelR($parentid) {
global $prefix, $db, $crawler;
$bresult = $db->sql_query("SELECT parentid FROM ".$prefix."_nsngd_categories WHERE cid='$parentid' ORDER BY title");
while(list($parentid2)=$db->sql_fetchrow($bresult)){
array_push($crawler,$parentid2);
CrawlLevelR($parentid2);
}
return $crawler;
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function CrawlLevel($cid) {
global $prefix, $db, $crawled;
$bresult = $db->sql_query("SELECT cid FROM ".$prefix."_nsngd_categories WHERE parentid='$cid' ORDER BY title");
while(list($cid2)=$db->sql_fetchrow($bresult)){
array_push($crawled,$cid2);
CrawlLevel($cid2);
}
return $crawled;
}
function CoolSize($size) {
$mb = 1024*1024;
$gb = $mb*1024;
if ( $size > $gb ) {
$mysize = sprintf ("%01.2f",$size/$gb)." "._GB;
} elseif ( $size > $mb ) {
$mysize = sprintf ("%01.2f",$size/$mb)." "._MB;
} elseif ( $size >= 1024 ) {
$mysize = sprintf ("%01.2f",$size/1024)." "._KB;
} else {
$mysize = $size." "._BYTES;
}
return $mysize;
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function CoolDate($date) {
global $dl_config;
$mydate = date ($dl_config['dateformat'], strtotime ("$date"));
return $mydate;
}
// Copyright (c) 2003 --- Michael K. Squires ---
// Can not be reproduced in whole or in part without
// written consent from Michael K. Squires
function getcategoryinfo($catID){
global $prefix, $db, $user;
$category = array($catID);
$cats_detected = 0;
$downloads_detected = 0;
while(count($category) != 0){
sort($category, SORT_STRING);
reset($category);
$curr_category = end($category);
$dresult = $db->sql_query("SELECT * FROM ".$prefix."_nsngd_downloads WHERE cid='$curr_category'");
$catdownloads = $db->sql_numrows($dresult);
$downloads_detected += $catdownloads;
$cresult = $db->sql_query("SELECT cid FROM ".$prefix."_nsngd_categories WHERE parentid='$curr_category'");
while (list($cid) = $db->sql_fetchrow($cresult)){
array_unshift($category, "$cid");
$cats_detected++;
}
array_pop($category);
}
$categoryinfo['categories'] = $cats_detected;
$categoryinfo['downloads'] = $downloads_detected;
return $categoryinfo;
}
function getparent($parentid,$title) {
global $prefix,$db;
$result = $db->sql_query("SELECT * FROM ".$prefix."_nsngd_categories WHERE cid='$parentid'");
$cidinfo = $db->sql_fetchrow($result);
if ($cidinfo['title'] != "") $title = $cidinfo['title']." -> ".$title;
if ($cidinfo['parentid'] != 0) { $title=getparent($cidinfo['parentid'], $title); }
return $title;
}
function getparentlink($parentid,$title) {
global $prefix, $db, $module_name;
$parentid = intval($parentid);
$cidinfo = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_nsngd_categories WHERE cid=$parentid"));
if ($cidinfo['title'] != "") $title = "<a href=modules.php?name=$module_name&cid=".$cidinfo['cid'].">".$cidinfo['title']."</a> -> ".$title;
if ($cidinfo['parentid'] != 0) { $title = getparentlink($cidinfo['parentid'],$title); }
return $title;
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function restricted($perm) {
global $db, $prefix, $module_name;
if ($perm == 1) {
$who_view = _DL_USERS;
} elseif ($perm == 2) {
$who_view = _DL_ADMIN;
} elseif ($perm >2) {
$newView = $perm - 2;
list($who_view) = $db->sql_fetchrow($db->sql_query("SELECT gname FROM ".$prefix."_nsngr_groups WHERE gid=$newView"));
$who_view = $who_view." "._DL_ONLY;
}
$myimage = myimage("restricted.png");
echo "<center><img src='$myimage'></center><br>\n";
echo "<center>"._DL_DENIED."!</center><br>\n";
echo "<center>"._DL_CANBEDOWN." $who_view</center><br>\n";
echo "<center>"._GOBACK."</center>\n";
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function restricted2($perm) {
global $db, $prefix, $module_name;
if ($perm == 1) {
$who_view = _DL_USERS;
} elseif ($perm == 2) {
$who_view = _DL_ADMIN;
} elseif ($perm >2) {
$newView = $perm - 2;
list($who_view) = $db->sql_fetchrow($db->sql_query("SELECT gname FROM ".$prefix."_nsngr_groups WHERE gid=$newView"));
$who_view = $who_view." "._DL_ONLY;
}
echo "<center>"._DL_DENIED."!<br>\n";
echo ""._DL_CANBEVIEW."<br><b>$who_view</b></center>\n";
}
function newdownloadgraphic($datetime, $time) {
global $module_name;
echo " ";
setlocale (LC_TIME, $locale);
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
$datetime = strftime(""._LINKSDATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
$datetime = ucfirst($datetime);
$startdate = time();
$count = 0;
while ($count <= 14) {
$daysold = date("d-M-Y", $startdate);
if ("$daysold" == "$datetime") {
$myimage = myimage("new_01.png");
if ($count<=1) { echo "<img align='middle' src='$myimage' alt='"._NEWTODAY."' title='"._NEWTODAY."'>"; }
$myimage = myimage("new_03.png");
if ($count<=3 && $count>1) { echo "<img align='middle' src='$myimage' alt='"._NEWLAST3DAYS."' title='"._NEWLAST3DAYS."'>"; }
$myimage = myimage("new_07.png");
if ($count<=7 && $count>3) { echo "<img align='middle' src='$myimage' alt='"._NEWTHISWEEK."' title='"._NEWTHISWEEK."'>"; }
$myimage = myimage("new_14.png");
if ($count<=14 && $count>7) { echo "<img align='middle' src='$myimage' alt='"._NEWLAST2WEEKS."' title='"._NEWLAST2WEEKS."'>"; }
}
$count++;
$startdate = (time()-(86400 * $count));
}
}
function newcategorygraphic($cat) {
global $prefix, $db, $module_name;
$cat = intval($cat);
$newresult = $db->sql_query("SELECT date FROM ".$prefix."_nsngd_downloads WHERE cid=$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 <= 14) {
$daysold = date("d-M-Y", $startdate);
if ("$daysold" == "$datetime") {
$myimage = myimage("new_01.png");
if ($count<=1) { echo "<img align='middle' src='$myimage' alt='"._DCATNEWTODAY."' title='"._DCATNEWTODAY."'>"; }
$myimage = myimage("new_03.png");
if ($count<=3 && $count>1) { echo "<img align='middle' src='$myimage' alt='"._DCATLAST3DAYS."' title='"._DCATLAST3DAYS."'>"; }
$myimage = myimage("new_07.png");
if ($count<=7 && $count>3) { echo "<img align='middle' src='$myimage' alt='"._DCATTHISWEEK."' title='"._DCATTHISWEEK."'>"; }
$myimage = myimage("new_14.png");
if ($count<=14 && $count>7) { echo "<img align='middle' src='$myimage' alt='"._DCATLAST2WEEKS."' title='"._DCATLAST2WEEKS."'>"; }
}
$count++;
$startdate = (time()-(86400 * $count));
}
}
function popgraphic($hits) {
global $module_name, $dl_config;
$hits = intval($hits);
$myimage = myimage("popular.png");
if ($hits >= $dl_config['popular']) { echo " <img align='middle' src='$myimage' alt='"._POPULAR."' title='"._POPULAR."'>"; }
}
function DLadminmain() {
global $admin_file, $module_name, $prefix, $db, $textcolor1, $bgcolor1, $bgcolor2;
$brokendownloads = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nsngd_mods WHERE brokendownload='1'"));
$modrequests = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nsngd_mods WHERE brokendownload='0'"));
$newdownloads = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_nsngd_new"));
OpenTable();
echo "<table align='center' border='0' cellpadding='2' cellspacing='2' width='100%'>\n";
echo "<tr>\n";
echo "<td align='center' width='25%'><b>"._DOWNLOADS."</b></td>\n";
echo "<td align='center' width='25%'><b>"._CATEGORIES."</b></td>\n";
echo "<td align='center' width='25%'><b>"._EXTENSIONS."</b></td>\n";
echo "<td align='center' width='25%'><b>"._OTHERS."</b></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=DownloadAdd'>"._ADDDOWNLOAD."</a></td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=CategoryAdd'>"._ADDCATEGORY."</a></td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=ExtensionAdd'>"._ADDEXTENSION."</a></td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=DLConfig'>"._DOWNCONFIG."</a></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=Downloads'>"._DOWNLOADSLIST."</a></td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=Categories'>"._CATEGORIESLIST."</a></td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=Extensions'>"._EXTENSIONSLIST."</a></td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php'>"._MAINADMIN."</a></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=DownloadCheck'>"._VALIDATEDOWNLOADS."</a></td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=CategoryTransfer'>"._CATTRANS."</a></td>\n";
echo "<td align='center' width='25%'> </td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=DownloadBroken'>"._BROKENREP."</a> ($brokendownloads)</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=FilesizeCheck'>"._VALIDATESIZES."</a></td>\n";
echo "<td align='center' width='25%'> </td>\n";
echo "<td align='center' width='25%'> </td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=DownloadModifyRequests'>"._MODREQUEST."</a> ($modrequests)</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='center' width='25%'> </td>\n";
echo "<td align='center' width='25%'> </td>\n";
echo "<td align='center' width='25%'> </td>\n";
echo "<td align='center' width='25%'><a href='".$admin_file.".php?op=DownloadNew'>"._WAITINGDOWNLOADS."</a> ($newdownloads)</td>\n";
echo "</tr>\n";
echo "</table>\n";
CloseTable();
}
function convertorderbyin($orderby) {
if ($orderby == "titleA") $orderby = "title ASC";
if ($orderby == "dateA") $orderby = "date ASC";
if ($orderby == "hitsA") $orderby = "hits ASC";
if ($orderby == "titleD") $orderby = "title DESC";
if ($orderby == "dateD") $orderby = "date DESC";
if ($orderby == "hitsD") $orderby = "hits DESC";
return $orderby;
}
function convertorderbytrans($orderby) {
if ($orderby == "hits ASC") $orderbyTrans = _POPULARITY1;
if ($orderby == "hits DESC") $orderbyTrans = _POPULARITY2;
if ($orderby == "title ASC") $orderbyTrans = _TITLEAZ;
if ($orderby == "title DESC") $orderbyTrans = _TITLEZA;
if ($orderby == "date ASC") $orderbyTrans = _DDATE1;
if ($orderby == "date DESC") $orderbyTrans = _DDATE2;
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 == "title DESC") $orderby = "titleD";
if ($orderby == "date DESC") $orderby = "dateD";
if ($orderby == "hits DESC") $orderby = "hitsD";
return $orderby;
}
function menu($maindownload) {
global $module_name;
OpenTable();
$myimage = myimage("down-logo.gif");
echo "<center><a href='modules.php?name=$module_name'><img src='$myimage' border='0' alt='' title=''></a></center><br>\n";
SearchForm();
echo "<br><center><font class='content'>[ ";
if ($maindownload>0) { echo "<a href='modules.php?name=$module_name'>"._DOWNLOADSMAIN."</a> | "; }
//echo "<a href='modules.php?name=Submit_Downloads'>"._DL_ADD."</a>";
echo " <a href='modules.php?name=$module_name&op=NewDownloads'>"._NEW."</a>";
echo " | <a href='modules.php?name=$module_name&op=MostPopular'>"._POPULAR."</a>";
echo " ]</font></center>\n";
CloseTable();
echo "<br>\n";
OpenTable();
echo "<table align='center' cellpadding='2' cellspacing='2' border='0' width='100%'>\n";
echo "<tr><td align='center' colspan='3'><b>"._DL_LEGEND."</b></td></tr>\n";
echo "<tr>\n";
$myimage = myimage("new_01.png");
echo "<td align='center' width='33%'><img align='middle' src='$myimage' alt='' title=''> = "._NEWTODAY."</td>\n";
$myimage = myimage("new_03.png");
echo "<td align='center' width='34%'><img align='middle' src='$myimage' alt='' title=''> = "._NEWLAST3DAYS."</td>\n";
$myimage = myimage("new_07.png");
echo "<td align='center' width='33%'><img align='middle' src='$myimage' alt='' title=''> = "._NEWTHISWEEK."</td>\n";
echo "</tr>\n";
echo "<tr>\n";
$myimage = myimage("new_14.png");
echo "<td align='center' width='33%'><img align='middle' src='$myimage' alt='' title=''> = "._NEWLAST2WEEKS."</td>\n";
echo "<td align='center' width='34%'> </td>\n";
$myimage = myimage("popular.png");
echo "<td align='center' width='33%'><img align='middle' src='$myimage' alt='' title=''> = "._POPULAR."</td>\n";
echo "</tr>\n";
echo "</table>\n";
CloseTable();
}
function SearchForm() {
global $module_name, $query;
echo "<table border='0' cellspacing='0' cellpadding='0' align='center'>\n";
//TegoNuke(tm) ShortLinks:BEGIN - Comment out the original line and replace with the new one
// echo "<form action='modules.php?name=$module_name&op=search&query=$query' method='post'>\n";
echo "<form action='modules.php?name=$module_name&op=search' method='post'>\n";
//TegoNuke(tm) ShortLinks:END
echo "<tr><td><font class='content'><input type='text' size='25' name='query' value='$query'> <input type='submit' value='"._DL_SEARCH."'></td></tr>\n";
echo "</form>\n";
echo "</table>\n";
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function showlisting($lid) {
global $admin_file, $module_name, $admin, $db, $prefix, $user, $dl_config;
$lid = intval($lid);
$result = $db->sql_query("SELECT * FROM ".$prefix."_nsngd_downloads WHERE lid=$lid");
$lidinfo = $db->sql_fetchrow($result);
OpenTable();
$priv = $lidinfo['sid'] - 2;
if (($lidinfo['sid'] == 0) || ($lidinfo['sid'] == 1 AND is_user($user)) || ($lidinfo['sid'] == 2 AND is_admin($admin)) || ($lidinfo['sid'] > 2 AND of_group($priv)) || $dl_config['show_download'] == '1') {
$lidinfo['title'] = stripslashes($lidinfo['title']);
$lidinfo['description'] = stripslashes($lidinfo['description']);
if (is_admin($admin)) {
$myimage = myimage("edit.png");
echo "<a href='".$admin_file.".php?op=DownloadModify&lid=$lid' target='$lid'><img align='middle' src='$myimage' border='0' alt='"._DL_EDIT."'></a> ";
} else {
$myimage = myimage("show.png");
echo "<img align='middle' src='$myimage' border='0' alt=''> ";
}
echo "<a href='modules.php?name=$module_name&op=getit&lid=$lid'><b>".$lidinfo['title']."</b></a>";
newdownloadgraphic($datetime, $lidinfo['date']);
popgraphic($lidinfo['hits']);
echo "<br>";
if ($lidinfo['sid'] == 0) {
$who_view = _DL_ALL;
} elseif ($lidinfo['sid'] == 1) {
$who_view = _DL_USERS;
} elseif ($lidinfo['sid'] == 2) {
$who_view = _DL_ADMIN;
} elseif ($lidinfo['sid'] >2) {
$newView = $lidinfo['sid'] - 2;
list($who_view) = $db->sql_fetchrow($db->sql_query("SELECT gname FROM ".$prefix."_nsngr_groups WHERE gid=$newView"));
$who_view = $who_view." "._DL_ONLY;
}
echo "<b>"._DL_PERM.":</b> $who_view<br>\n";
echo "<b>"._VERSION.":</b> ".$lidinfo['version']."<br>\n";
echo "<b>"._FILESIZE.":</b> ".CoolSize($lidinfo['filesize'])."<br>\n";
echo "<b>"._ADDEDON.":</b> ".CoolDate($lidinfo['date'])."<br>\n";
echo "<b>"._DOWNLOADS.":</b> ".$lidinfo['hits']."<br>\n";
echo "<b>"._HOMEPAGE.":</b> ";
if ($lidinfo['homepage'] == "" || $lidinfo['homepage'] == "http://") {
echo _DL_NOTLIST;
} else {
echo "<a href='".$lidinfo['homepage']."' target='new'>".$lidinfo['homepage']."</a>";
}
} else {
restricted2($lidinfo['sid']);
}
CloseTable();
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function showresulting($lid) {
global $admin_file, $module_name, $admin, $db, $prefix, $user, $dl_config;
$lid = intval($lid);
$lidinfo = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_nsngd_downloads WHERE lid=$lid"));
OpenTable();
$priv = $lidinfo['sid'] - 2;
if (($lidinfo['sid'] == 0) || ($lidinfo['sid'] == 1 AND is_user($user)) || ($lidinfo['sid'] == 2 AND is_admin($admin)) || ($lidinfo['sid'] > 2 AND of_group($priv)) || $dl_config['show_download'] == '1') {
$lidinfo['title'] = stripslashes($lidinfo['title']);
$lidinfo['description'] = stripslashes($lidinfo['description']);
if (is_admin($admin)) {
$myimage = myimage("edit.png");
echo "<a href='".$admin_file.".php?op=DownloadModify&lid=$lid' target='$lid'><img align='middle' src='$myimage' border='0' alt='"._DL_EDIT."' title='"._DL_EDIT."'></a> ";
} else {
$myimage = myimage("show.png");
echo "<img align='middle' src='$myimage' border='0' alt='' title=''> ";
}
echo "<a href='modules.php?name=$module_name&op=getit&lid=$lid'><b>".$lidinfo['title']."</b></a>";
newdownloadgraphic($datetime, $lidinfo['date']);
popgraphic($lidinfo['hits']);
echo "<br>\n";
if ($lidinfo['sid'] == 0) {
$who_view = _DL_ALL;
} elseif ($lidinfo['sid'] == 1) {
$who_view = _DL_USERS;
} elseif ($lidinfo['sid'] == 2) {
$who_view = _DL_ADMIN;
} elseif ($lidinfo['sid'] >2) {
$newView = $lidinfo['sid'] - 2;
list($who_view) = $db->sql_fetchrow($db->sql_query("SELECT gname FROM ".$prefix."_nsngr_groups WHERE gid=$newView"));
$who_view = $who_view." "._DL_ONLY;
}
echo "<b>"._DL_PERM.":</b> $who_view<br>\n";
echo "<b>"._VERSION.":</b> ".$lidinfo['version']."<br>\n";
echo "<b>"._FILESIZE.":</b> ".CoolSize($lidinfo['filesize'])."<br>\n";
echo "<b>"._ADDEDON.":</b> ".CoolDate($lidinfo['date'])."<br>\n";
echo "<b>"._DOWNLOADS.":</b> ".$lidinfo['hits']."<br>\n";
echo "<b>"._HOMEPAGE.":</b> ";
if ($lidinfo['homepage'] == "" || $lidinfo['homepage'] == "http://") {
echo _DL_NOTLIST."<br>\n";
} else {
echo "<a href='".$lidinfo['homepage']."' target='new'>".$lidinfo['homepage']."</a><br>\n";
}
$result2 = $db->sql_query("SELECT * FROM ".$prefix."_nsngd_categories WHERE cid='".$lidinfo['cid']."'");
$cidinfo = $db->sql_fetchrow($result2);
$cidinfo['title'] = "<a href=modules.php?name=$module_name&cid=".$lidinfo['cid'].">".$cidinfo['title']."</a>";
$cidinfo['title'] = getparentlink($cidinfo['parentid'], $cidinfo['title']);
echo "<b>"._CATEGORY.":</b> ".$cidinfo['title']."\n";
} else {
restricted2($lidinfo['sid']);
}
CloseTable();
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function pagenums_admin($op, $totalselected, $perpage, $max) {
global $admin_file;
$pagesint = ($totalselected / $perpage);
$pageremainder = ($totalselected % $perpage);
if ($pageremainder != 0) {
$pages = ceil($pagesint);
if ($totalselected < $perpage) { $pageremainder = 0; }
} else {
$pages = $pagesint;
}
if ($pages != 1 && $pages != 0) {
$counter = 1;
$currentpage = ($max / $perpage);
echo "<table border='0' cellpadding='2' cellspacing='2' width='100%'>\n";
echo "<tr><form action='".$admin_file.".php' method='post'>\n";
echo "<td align='right'><b>"._DL_SELECTPAGE.": </b><select name='min' onChange='top.location.href=this.options[this.selectedIndex].value'>\n";
while ($counter <= $pages ) {
$cpage = $counter;
$mintemp = ($perpage * $counter) - $perpage;
if ($counter == $currentpage) {
echo "<option selected>$counter</option>\n";
} else {
echo "<option value='".$admin_file.".php?op=$op&min=$mintemp";
if ($op > "" ) { echo "&op=$op"; }
if ($query > "") { echo "&query=$query"; }
if (isset($cid)) { echo "&cid=$cid"; }
echo "'>$counter</option>\n";
}
$counter++;
}
echo "</select><b> "._DL_OF." $pages "._DL_PAGES."</b></td>\n</form>\n</tr>\n";
echo "</table>\n";
}
}
// Copyright (c) 2003 --- NukeScripts Network ---
// Can not be reproduced in whole or in part without
// written consent from NukeScripts Network CEO
function pagenums($cid, $query, $orderby, $op, $totalselected, $perpage, $max) {
global $module_name;
$pagesint = ($totalselected / $perpage);
$pageremainder = ($totalselected % $perpage);
if ($pageremainder != 0) {
$pages = ceil($pagesint);
if ($totalselected < $perpage) { $pageremainder = 0; }
} else {
$pages = $pagesint;
}
if ($pages != 1 && $pages != 0) {
$counter = 1;
$currentpage = ($max / $perpage);
echo "<table border='0' cellpadding='2' cellspacing='2' width='100%'>\n";
echo "<tr><form action='modules.php?name=$module_name' method='post'>\n";
echo "<td align='right'><b>"._DL_SELECTPAGE.": </b><select name='min' onChange='top.location.href=this.options[this.selectedIndex].value'>\n";
while ($counter <= $pages ) {
$cpage = $counter;
$mintemp = ($perpage * $counter) - $perpage;
if ($counter == $currentpage) {
echo "<option selected>$counter</option>\n";
} else {
echo "<option value='modules.php?name=$module_name&min=$mintemp";
if ($op > "" ) { echo "&op=$op"; }
if ($query > "") { echo "&query=$query"; }
if (isset($cid)) { echo "&cid=$cid"; }
echo "'>$counter</option>\n";
}
$counter++;
}
echo "</select><b> "._DL_OF." $pages "._DL_PAGES."</b></td>\n</form>\n</tr>\n";
echo "</table>\n";
}
}
?>
montego Site Admin Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Mon Jun 09, 2008 7:56 pm
Ok, I see one of the problems. Looks like I forgot a couple of taps. For this particular one, try adding this line to your .htaccess file along with the other Downloads ones:
Code:
RewriteRule ^downloads-paging-([0-9]*)-([0-9]*).html modules.php?name=Downloads&min=$1&cid=$2 [L]
I have another issue too on the search paging. Will work on that next...
Asger New Member Joined: Nov 02, 2006 Posts: 18 Location: Denmark
Posted:
Tue Jun 10, 2008 9:20 am
Hi Montego
That did not work. Still get HTTP404 - Not found
montego Site Admin Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Tue Jun 10, 2008 6:38 pm
Sorry, got ahead of myself and forgot the op. Try this instead:
Code:
RewriteRule ^downloads-paging-([0-9]*)-([0-9]*).html modules.php?name=Downloads&min=$1&op=search&cid=$2 [L]
Asger New Member Joined: Nov 02, 2006 Posts: 18 Location: Denmark
Posted:
Thu Jun 12, 2008 9:36 am
Still the same
montego Site Admin Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Fri Jun 13, 2008 5:10 am
Asger , my first post should have fixed the following link:
Are you sure that the following rewrite rule is in your .htaccess:
RewriteRule ^downloads-paging-([0-9]*)-([0-9]*).html modules.php?name=Downloads&min=$1&cid=$2 [L]
If you want me to try and fix this for you, please PM me an FTP login so that I can see and adjust these files.
Asger New Member Joined: Nov 02, 2006 Posts: 18 Location: Denmark
Posted:
Sat Jun 14, 2008 4:08 am
Yes Montego, i'm sure the rules are in my .htaccess. I will send you my FTP info.
montego Site Admin Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Sat Jun 14, 2008 1:04 pm
Ok... will check it out this weekend.
montego Site Admin Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Sat Jun 14, 2008 3:13 pm
Ok, I checked it out and have fixed this. I simply had an "s" on the end of "download"... We both should have simply checked more closely what URL was being attempted vs. what was in .htaccess.
Oh well. It was good to go through this as I find another paging issue with the search that I also fixed. Time to update the download on my site. bummer...
Asger New Member Joined: Nov 02, 2006 Posts: 18 Location: Denmark
Posted:
Mon Jun 16, 2008 2:20 am
Oops.. Glad you fixed it. Thanks a lot Montego.
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum