Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Sun Jun 23, 2013 8:59 am Reply with quote

Hi Montego. I am getting this error. I don't know why. Everything is working fine but I am still gettting this result.

Code:
Code: 1052 - Message: Column 'active' in where clause is ambiguous
SQL was: SELECT `lid`, a.`title`, `hits`, b.`title` FROM `nuke_nsngd_downloads` a LEFT JOIN `nuke_nsngd_categories` b ON (a.`cid` = b.`cid`) WHERE `active` = 1 ORDER BY `date` DESC LIMIT 0, 2
 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Sun Jun 23, 2013 6:34 pm Reply with quote

Haven't look at the code but from the warning message and my very limited understanding of JOINs, it seems that both tables have a field called 'active' so the sql statement might need modification to assert which table is the correct one (although the code should work as it is just fine) because it's merely a warning rather than an error.
I suspect (I might be wrong) that one of these might work;
Code:

WHERE b. `active` = 1 ORDER BY `date` DESC LIMIT 0, 2
or
WHERE nuke_nsng_downloads. `active` = 1 ORDER BY `date` DESC LIMIT 0, 2
 
View user's profile Send private message
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Sun Jun 23, 2013 9:25 pm Reply with quote

I compare database with original and I got the same result. What could cause this warning?
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Jun 23, 2013 11:29 pm Reply with quote

Sorry, having issues getting at my code today. If you know where this SQL statement is being generated, it looks like it needs to be the following instead:

Code:

SELECT `lid`, a.`title`, `hits`, b.`title` FROM `nuke_nsngd_downloads` a LEFT JOIN `nuke_nsngd_categories` b ON (a.`cid` = b.`cid`) WHERE a.`active` = 1 ORDER BY `date` DESC LIMIT 0, 2


The field `active` on the download table is the one which needs to be considered in this case I think.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Mon Jun 24, 2013 4:17 am Reply with quote

If you mean run Run SQL query/queries on my database. I did it but the problem is still there.

Code:
Code: 1052 - Message: Column 'active' in where clause is ambiguous
SQL was: SELECT `lid`, a.`title`, `hits`, b.`title` FROM `nuke_nsngd_downloads` a LEFT JOIN `nuke_nsngd_categories` b ON (a.`cid` = b.`cid`) WHERE `active` = 1 ORDER BY `date` DESC LIMIT 0, 2
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Jun 24, 2013 7:29 am Reply with quote

You did not use the query I gave you as it is missing the a.`active` in the posted text... what I posted should work in phpMyAdmin.
 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Mon Jun 24, 2013 9:44 am Reply with quote

of course I did it. Take a look but when I remove the log again and refresh the website and go into the Download module I get the same warning again and again.

Code:
Showing rows 0 - 1 ( 2 total, Query took 0.0007 sec)
SELECT `lid` , a.`title` , `hits` , b.`title`
FROM `nuke_nsngd_downloads` a
LEFT JOIN `nuke_nsngd_categories` b ON ( a.`cid` = b.`cid` )
WHERE a.`active` =1
ORDER BY `date` DESC
LIMIT 0 , 2


When I validate download I get a blank page.

Code:
DownloadValidate&cid=0&__csrf_magic=sid:76a2cd9513b527a1120665ed7852e2dc52d24278,1372081517


The fix doesn't work. Any other suggestion? Shocked
Code:
Code: 1052 - Message: Column 'active' in where clause is ambiguous
SQL was: SELECT `lid`, a.`title`, `hits`, b.`title` FROM `nuke_nsngd_downloads` a LEFT JOIN `nuke_nsngd_categories` b ON (a.`cid` = b.`cid`) WHERE `active` = 1 ORDER BY `date` DESC LIMIT 0, 2
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Jun 24, 2013 10:59 am Reply with quote

I can't look at my code right now because I am at work, but if you obviously have not made the change in the right place, otherwise, the error message would show "WHERE a.`active` = 1" instead of what you are showing "WHERE `active` = 1".

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Tue Jun 25, 2013 2:50 am Reply with quote

well let me know what i have to do cause im out of ideas now
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Jun 25, 2013 9:40 am Reply with quote

Hicux,

I have now searched for LEFT JOIN throughout RavenNuke 2.5.x branch of code, through my latest Downloads code and even on all my site code, and no where do I see this SQL tied with a LEFT JOIN. The only LEFT JOIN in my code is in Downloads/Admin/Categories.php and the SQL is this:

Code:

$sql = 'SELECT a.`cid`, a.`title`, a.`parentid`, a.`active`, b.`acnt`, b.`icnt` FROM `' . $prefix . '_nsngd_categories` a LEFT JOIN '
   . '(SELECT s1.`cid`, SUM(s1.`acnt`) AS acnt, SUM(s1.`icnt`) AS icnt FROM (SELECT `cid`, COUNT(`lid`) AS acnt, 0 AS icnt FROM `'
   . $prefix . '_nsngd_downloads` WHERE `active` > 0 GROUP BY `cid` UNION ALL SELECT `cid`, 0 AS acnt, COUNT(`lid`) AS icnt FROM `'
   . $prefix . '_nsngd_downloads` WHERE `active` = 0 GROUP BY `cid`) s1 GROUP BY s1.`cid`) b ON (a.`cid` = b.`cid`) ORDER BY `parentid`, `title`';


And as you can see, there is no SELECT of the `lid` anywhere in this.

I am not sure what script you are using, but it isn't mind or from the latest release of RavenNuke.

Therefore, I would suggest getting the latest from my site and installing that (make sure to run the installer and do an "upgrade").

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Jun 25, 2013 9:40 am Reply with quote

Another option is for you to find the code where the SQL statement is being generated and post just that bit of code here and I can probably help you.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Tue Jun 25, 2013 6:50 pm Reply with quote

Montego. I do have the latest version.

After taking the time searching I found out where it is coming from and finally I got them. It took me one day to find this. Grrr. Very Happy

This error is generating from one of your blocks.

block-NSNGD_Advanced2.php

Code:
/*
 * Latest Downloads
 */
$content .= '<strong>' . _DL_NEWDOWNLOADS . '</strong><br />';
$a = 1;
$result = $db->sql_query('SELECT `lid`, a.`title`, `hits`, b.`title` FROM `' . $prefix . '_nsngd_downloads` a'
   . ' LEFT JOIN `' . $prefix . '_nsngd_categories` b ON (a.`cid` = b.`cid`) WHERE `active` = 1 ORDER BY `date` DESC LIMIT 0, ' . $blkh);
while (list($lid, $title, $hits, $ctitle) = $db->sql_fetchrow($result)) {
   if (!empty($ctitle)) $title = $title . ' - ' . $ctitle;
   if ($blkw > 0) {
      if (strlen($title) > $blkw) {
         $title = substr($title, 0, $blkw);
      }
   }
   if ($a < 10) {
      $content .= '0' . $a . ': ';
   } else {
      $content .= $a . ': ';
   }
   $content .= '<a href="modules.php?name=' . $tndlModName . '&amp;op=getit&amp;lid=' . $lid . '">'
      . htmlspecialchars($title, ENT_QUOTES, _CHARSET) . '</a><br />(' . _DL_HITS . ': ' . $hits . ')<br />';
   $a++;
}
/*
 * Top Downloads
 */
$content .= '<br /><b>' . _DL_POPULARDLS . '</b><br />';
$a = 1;
$result = $db->sql_query('SELECT `lid`, a.`title`, `hits`, b.`title` FROM `' . $prefix . '_nsngd_downloads` a'
   . ' LEFT JOIN `' . $prefix . '_nsngd_categories` b ON (a.`cid` = b.`cid`) ORDER BY `hits` DESC LIMIT 0, ' . $blkh);
while (list($lid, $title, $hits, $ctitle) = $db->sql_fetchrow($result)) {
   if (!empty($ctitle)) $title = $title . ' - ' . $ctitle;
   if ($blkw > 0) {
      if (strlen($title) > $blkw) {
         $title = substr($title, 0, $blkw);
      }
   }
   if ($a < 10) {
      $content .= '0' . $a . ': ';
   } else {
      $content .= $a . ': ';
   }
   $content .= '<a href="modules.php?name=' . $tndlModName . '&amp;op=getit&amp;lid=' . $lid . '">'
      . htmlspecialchars($title, ENT_QUOTES, _CHARSET) . '</a><br />(' . _DL_HITS . ': ' . $hits . ')<br />';
   $a++;
}
if ($scron == 1) {
   $content .= '</marquee>';
}
 
View user's profile Send private message Visit poster's website
hicux
Newbie
Newbie



Joined: Jan 30, 2009
Posts: 92
Location: NL

PostPosted: Tue Jun 25, 2013 7:16 pm Reply with quote

This is the whole block I have.

Code:
<?php
/**
 * TegoNuke(tm)/NSN GR Downloads (NSNGD): Downloads
 *
 * This module allows admins and end users (if so configured - see Submit Downloads
 * module) to add/submit downloads to their site.  This module is NSN Groups aware
 * (Note: NSN Groups is already built into RavenNuke(tm)) and carries more features
 * than the stock *nuke system Downloads module.  Check out the admin screens for a
 * multitude of configuration options.
 *
 * The original NSN GR Downloads was given to montego by Bob Marion back in 2006 to
 * take over on-going development and support.  It has undergone extensive bug
 * removal, including XHTML compliance and further security checking, among other
 * fine enhancements made over time.
 *
 * Original copyright statements are below these.
 *
 * PHP versions 5.2+ ONLY
 *
 * LICENSE: GNU/GPL 2 (provided with the download of this script)
 *
 * @category    Module
 * @package     TegoNuke(tm)/NSN
 * @subpackage  Downloads
 * @author      Rob Herder (aka: montego) <montego@montegoscripts.com>
 * @copyright   2006 - 2011 by Montego Scripts
 * @license     http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt GNU/GPL 2
 * @version     1.1.3_51
 * @link        http://montegoscripts.com
 */
/********************************************************/
/* NSN GR Downloads                                     */
/* By: NukeScripts Network (webmasternukescripts.net)   */
/* http://www.nukescripts.net                           */
/* Copyright (c) 2000-2005 by NukeScripts Network       */
/********************************************************/
/********************************************************/
/* NSN GR Downloads Advanced Downloads Block            */
/* By: NukeCode (adminnukecode.com)                    */
/* http://nukecode.com                                  */
/* Copyright 2003-2005 by NukeCode and NSN Mirror Site  */
/********************************************************/
/********************************************************/
/* This block is intended for use ONLY with NSN GR      */
/* Downloads... Do not attempt to use it with any other */
/* Downloads Module, It will not work properly          */
/********************************************************/
if (!defined('BLOCK_FILE')) {
   Header('Location: ../index.php');
   die();
}
/*
 * If you change the name of your module from Download to anything
 * else, you need to also change the below line to match
 */
$tndlModName = 'Downloads';
/**
 * Configuration Options
 */
$blkh  = 2;       // Number of lines high
$blkw  = 0;        // Number of characters wide 0 = unused
$scron = 0;        // Turn scrolling on by setting to 1
$scrdr = 'up';     // Scroll direction ('up', 'down', 'left', or 'right')
$scrhg = 200;      // Scroller height in pixels
$scrwd = 145;      // Scroller width in pixels
$speed = 2;        // Speed Of Scroll
$scrolldelay = 75; // Scroll delay - small the number the smoother the scroll
/*
 * End of Configuration Options
 */
if (!defined('_DL_LANG_MODULE')) get_lang('Downloads');
global $prefix, $db;
$content = '';
/*
 * Total downloads in the database
 */
if (!(list($files) = $db->sql_fetchrow($db->sql_query('SELECT COUNT(`lid`) FROM `' . $prefix . '_nsngd_downloads`')))) $files = 0;
/*
 * Total download categories in the database
 */
if (!(list($cats) = $db->sql_fetchrow($db->sql_query('SELECT COUNT(`cid`) FROM `' . $prefix . '_nsngd_categories`')))) $cats = 0;
/*
 * Total hits across all downloads (including inactives)
 */
if (!(list($total_hits) = $db->sql_fetchrow($db->sql_query('SELECT SUM(`hits`) FROM `' . $prefix . '_nsngd_downloads`')))) $total_hits = 0;
/*
 * Total GB Served
 */
if (!(list($served) = $db->sql_fetchrow($db->sql_query('SELECT SUM(`filesize`*`hits`) AS serv FROM `' . $prefix . '_nsngd_downloads`')))) $served = 0;
$tb = 1024*1024*1024*1024;
$gb = 1024*1024*1024;
$mb = 1024*1024;
$kb = 1024;
if ($served >= $tb) {
   $mysizes = sprintf('%01.2f', $served/$tb) . ' TB ';
} elseif ($served >= $gb) {
   $mysizes = sprintf('%01.2f', $served/$gb) . ' GB ';
} elseif ($served >= $mb) {
   $mysizes = sprintf('%01.2f', $served/$mb) . ' MB ';
} elseif ($served >= $kb) {
   $mysizes = sprintf('%01.2f', $served/$kb) . ' KB ';
} else {
   $mysizes = $served . ' B ';
}
/*
 * Ok, start building the content.
 */
$content .= _DL_TOTALDLFILES . ': ' . $files . '<br />' . _DL_TOTALDLCATEGORIES . ': ' . $cats . '<br /> ' . _DL_TDN . ': ' . $total_hits . '<br /> ' . _DL_TOTALDLSERVED . ': ' . $mysizes . '<br />';
if ($scron == 1) {
   $content .= '<marquee behavior="scroll" direction="' . $scrdr . '" height="' . $scrhg . '" width="' . $scrwd . '" scrollamount="' . $speed . '" scrolldelay="' . $scrolldelay . '" onmouseover="this.stop()" onmouseout="this.start()"><br />';
}
/*
 * Latest Downloads
 */
$content .= '<strong>' . _DL_NEWDOWNLOADS . '</strong><br />';
$a = 1;
$result = $db->sql_query('SELECT `lid`, a.`title`, `hits`, b.`title` FROM `' . $prefix . '_nsngd_downloads` a'
   . ' LEFT JOIN `' . $prefix . '_nsngd_categories` b ON (a.`cid` = b.`cid`) WHERE `active` = 1 ORDER BY `date` DESC LIMIT 0, ' . $blkh);
while (list($lid, $title, $hits, $ctitle) = $db->sql_fetchrow($result)) {
   if (!empty($ctitle)) $title = $title . ' - ' . $ctitle;
   if ($blkw > 0) {
      if (strlen($title) > $blkw) {
         $title = substr($title, 0, $blkw);
      }
   }
   if ($a < 10) {
      $content .= '0' . $a . ': ';
   } else {
      $content .= $a . ': ';
   }
   $content .= '<a href="modules.php?name=' . $tndlModName . '&amp;op=getit&amp;lid=' . $lid . '">'
      . htmlspecialchars($title, ENT_QUOTES, _CHARSET) . '</a><br />(' . _DL_HITS . ': ' . $hits . ')<br />';
   $a++;
}
/*
 * Top Downloads
 */
$content .= '<br /><b>' . _DL_POPULARDLS . '</b><br />';
$a = 1;
$result = $db->sql_query('SELECT `lid`, a.`title`, `hits`, b.`title` FROM `' . $prefix . '_nsngd_downloads` a'
   . ' LEFT JOIN `' . $prefix . '_nsngd_categories` b ON (a.`cid` = b.`cid`) ORDER BY `hits` DESC LIMIT 0, ' . $blkh);
while (list($lid, $title, $hits, $ctitle) = $db->sql_fetchrow($result)) {
   if (!empty($ctitle)) $title = $title . ' - ' . $ctitle;
   if ($blkw > 0) {
      if (strlen($title) > $blkw) {
         $title = substr($title, 0, $blkw);
      }
   }
   if ($a < 10) {
      $content .= '0' . $a . ': ';
   } else {
      $content .= $a . ': ';
   }
   $content .= '<a href="modules.php?name=' . $tndlModName . '&amp;op=getit&amp;lid=' . $lid . '">'
      . htmlspecialchars($title, ENT_QUOTES, _CHARSET) . '</a><br />(' . _DL_HITS . ': ' . $hits . ')<br />';
   $a++;
}
if ($scron == 1) {
   $content .= '</marquee>';
}


Question: Does RaveNuke have the latest version or is it only on your site?

I noticed from this site is showing @version 1.1.3_51 but RavenNuke has @version 1.1.3_47.
 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Jun 26, 2013 7:35 am Reply with quote

hicux,

My site has the latest version. However, what you are showing is just a build number difference which is odd. Been too long for me to remember why that would be.

No matter though, because even if you download my latest, you will not find a block_NSNGD_Advanced2.php file and the block_NSNGD_Advanced.php script isn't what you have posted. This is what my code has:

Code:

<?php
/**
 * TegoNuke(tm)/NSN GR Downloads (NSNGD): Downloads
 *
 * This module allows admins and end users (if so configured - see Submit Downloads
 * module) to add/submit downloads to their site.  This module is NSN Groups aware
 * (Note: NSN Groups is already built into RavenNuke(tm)) and carries more features
 * than the stock *nuke system Downloads module.  Check out the admin screens for a
 * multitude of configuration options.
 *
 * The original NSN GR Downloads was given to montego by Bob Marion back in 2006 to
 * take over on-going development and support.  It has undergone extensive bug
 * removal, including XHTML compliance and further security checking, among other
 * fine enhancements made over time.
 *
 * Original copyright statements are below these.
 *
 * PHP versions 5.2+ ONLY
 *
 * LICENSE: GNU/GPL 2 (provided with the download of this script)
 *
 * @category    Module
 * @package     TegoNuke(tm)/NSN
 * @subpackage  Downloads
 * @author      Rob Herder (aka: montego) <montego@montegoscripts.com>
 * @copyright   2006 - 2011 by Montego Scripts
 * @license     http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt GNU/GPL 2
 * @version     1.1.3_51
 * @link        http://montegoscripts.com
 */
/********************************************************/
/* NSN GR Downloads                                     */
/* By: NukeScripts Network (webmasternukescripts.net)   */
/* http://www.nukescripts.net                           */
/* Copyright (c) 2000-2005 by NukeScripts Network       */
/********************************************************/
/********************************************************/
/* NSN GR Downloads Advanced Downloads Block            */
/* By: NukeCode (adminnukecode.com)                    */
/* http://nukecode.com                                  */
/* Copyright 2003-2005 by NukeCode and NSN Mirror Site  */
/********************************************************/
/********************************************************/
/* This block is intended for use ONLY with NSN GR      */
/* Downloads... Do not attempt to use it with any other */
/* Downloads Module, It will not work properly          */
/********************************************************/
if (!defined('BLOCK_FILE')) {
   Header('Location: ../index.php');
   die();
}
/*
 * If you change the name of your module from Download to anything
 * else, you need to also change the below line to match
 */
$tndlModName = 'Downloads';
/**
 * Configuration Options
 */
$blkh  = 10;       // Number of lines high
$blkw  = 0;        // Number of characters wide 0 = unused
$scron = 0;        // Turn scrolling on by setting to 1
$scrdr = 'up';     // Scroll direction ('up', 'down', 'left', or 'right')
$scrhg = 200;      // Scroller height in pixels
$scrwd = 145;      // Scroller width in pixels
$speed = 2;        // Speed Of Scroll
$scrolldelay = 75; // Scroll delay - small the number the smoother the scroll
/*
 * End of Configuration Options
 */
if (!defined('_DL_LANG_MODULE')) get_lang('Downloads');
global $prefix, $db;
$content = '';
/*
 * Total downloads in the database
 */
if (!(list($files) = $db->sql_fetchrow($db->sql_query('SELECT COUNT(`lid`) FROM `' . $prefix . '_nsngd_downloads`')))) $files = 0;
/*
 * Total download categories in the database
 */
if (!(list($cats) = $db->sql_fetchrow($db->sql_query('SELECT COUNT(`cid`) FROM `' . $prefix . '_nsngd_categories`')))) $cats = 0;
/*
 * Total hits across all downloads (including inactives)
 */
if (!(list($total_hits) = $db->sql_fetchrow($db->sql_query('SELECT SUM(`hits`) FROM `' . $prefix . '_nsngd_downloads`')))) $total_hits = 0;
/*
 * Total GB Served
 */
if (!(list($served) = $db->sql_fetchrow($db->sql_query('SELECT SUM(`filesize`*`hits`) AS serv FROM `' . $prefix . '_nsngd_downloads`')))) $served = 0;
$tb = 1024*1024*1024*1024;
$gb = 1024*1024*1024;
$mb = 1024*1024;
$kb = 1024;
if ($served >= $tb) {
   $mysizes = sprintf('%01.2f', $served/$tb) . ' TB ';
} elseif ($served >= $gb) {
   $mysizes = sprintf('%01.2f', $served/$gb) . ' GB ';
} elseif ($served >= $mb) {
   $mysizes = sprintf('%01.2f', $served/$mb) . ' MB ';
} elseif ($served >= $kb) {
   $mysizes = sprintf('%01.2f', $served/$kb) . ' KB ';
} else {
   $mysizes = $served . ' B ';
}
/*
 * Ok, start building the content.
 */
$content .= _DL_TOTALDLFILES . ': ' . $files . '<br />' . _DL_TOTALDLCATEGORIES . ': ' . $cats . '<br /> ' . _DL_TDN . ': ' . $total_hits . '<br /> ' . _DL_TOTALDLSERVED . ': ' . $mysizes . '<br />';
if ($scron == 1) {
   $content .= '<marquee behavior="scroll" direction="' . $scrdr . '" height="' . $scrhg . '" width="' . $scrwd . '" scrollamount="' . $speed . '" scrolldelay="' . $scrolldelay . '" onmouseover="this.stop()" onmouseout="this.start()"><br />';
}
/*
 * Latest Downloads
 */
$content .= '<strong>' . _DL_NEWDOWNLOADS . '</strong><br />';
$a = 1;
$result = $db->sql_query('SELECT `lid`, `title`, `hits` FROM `' . $prefix . '_nsngd_downloads` ORDER BY `date` DESC LIMIT 0, ' . $blkh);
while (list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
   if ($blkw > 0) {
      if (strlen($title) > $blkw) {
         $title = substr($title, 0, $blkw);
      }
   }
   if ($a < 10) {
      $content .= '0' . $a . ': ';
   } else {
      $content .= $a . ': ';
   }
   $content .= '<a href="modules.php?name=' . $tndlModName . '&amp;op=getit&amp;lid=' . $lid . '">'
      . htmlspecialchars($title, ENT_QUOTES, _CHARSET) . '</a><br />(' . _DL_HITS . ': ' . $hits . ')<br />';
   $a++;
}
/*
 * Top Downloads
 */
$content .= '<br /><b>' . _DL_POPULARDLS . '</b><br />';
$a = 1;
$result = $db->sql_query('SELECT `lid`, `title`, `hits` FROM `' . $prefix . '_nsngd_downloads` ORDER BY `hits` DESC LIMIT 0, ' . $blkh);
while (list($lid, $title, $hits) = $db->sql_fetchrow($result)) {
   if ($blkw > 0) {
      if (strlen($title) > $blkw) {
         $title = substr($title, 0, $blkw);
      }
   }
   if ($a < 10) {
      $content .= '0' . $a . ': ';
   } else {
      $content .= $a . ': ';
   }
   $content .= '<a href="modules.php?name=' . $tndlModName . '&amp;op=getit&amp;lid=' . $lid . '">'
      . htmlspecialchars($title, ENT_QUOTES, _CHARSET) . '</a><br />(' . _DL_HITS . ': ' . $hits . ')<br />';
   $a++;
}
if ($scron == 1) {
   $content .= '</marquee>';
}



So not sure where you got the Advanced2 or how you got that code.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Jun 26, 2013 9:15 am Reply with quote

It is becoming clearer to me now. I see where you got the original code... it was posted here in this thread:

http://montegoscripts.com/ftopict-463.html

However, you have added the restriction of `active` = 1 to it (makes sense), but you did not do it correctly. So you caused the syntax error yourself.

Shocked Evil or Very Mad Rolling Eyes
 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch