View Full Version : Latest Forum Topics wont work
rstan
06-11-2004, 09:38 PM
For some reason this has stoped working. I installed cmps last night and it worked fine, this morning I get this error.
Database error in vBulletin 3.0.1:
Invalid SQL:
SELECT
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
L
L
L
L
FROM thread as thread
L
L
L
LEFT JOIN deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
L
WHERE open <> '10' AND thread.visible = 1 AND deletionlog.primaryid IS NULL
ORDER BY lastpost DESC
LIMIT 5
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'L
L
L
FROM thread as thread
L
L
L
LEFT JOI
mysql error number: 1064
If I set the Latest Forum Topics to inactive everything else works.
Zachery
06-11-2004, 10:59 PM
Where are there tons of L's in that query O.o ? try reuploading the moduals folder.
rstan
06-12-2004, 12:30 AM
Uploaded again...same error.
Brian
06-13-2004, 12:38 PM
If you'd like to fill out a support ticket via the Members Area here I'll be glad to take a look. I honestly have no idea how the query could look like that though unless there's something really werid going on with your host.
rstan
06-14-2004, 12:50 AM
Thanks for the reply Brian, I was going to do that but I cant give out the access info due to the nature of the site. Can I post any code you need to look at? VBadvanced is exactly what I need and Ive already spent alot of time changing the look and adding stuff. But I need Latest forum topics.
Zachery
06-14-2004, 01:47 AM
Is there any reason you cant give ftp access? all the stuff that is given out is kept stricky between our staff, which is me and brain.
rstan
06-14-2004, 02:19 AM
I realize its confidential but....I cant give out that kind of info because of the content of the site....The owners would lynch me. :p
Zachery
06-14-2004, 02:45 AM
Ok, well, try downloading a fresh copy of vBa and all the files in ASCII mode, also dont use dreamweaver to edit any of the files.
rstan
06-14-2004, 04:14 AM
Tried that again....Same error. Weird thing is, it worked when I first installed it. I diddnt make any changes then I went to bed. Next morning it was all foobared. The site isnt live so I duno what happened. Something corrupt in the databse maybe?
mholtum
06-14-2004, 04:29 AM
You can trust them. I did. And knowbody has to know but you! :)
mholtum
06-14-2004, 04:29 AM
What kind of site is it?
rstan
06-14-2004, 05:27 AM
....sort of a gardening site.... ;)
rstan
06-14-2004, 10:33 PM
Can someone narow this down for me please? Im getting down to this last thing.
Brian
06-15-2004, 11:51 AM
I've never seen a problem like this before, so I can't really tell you what to do without being able to see everything myself to try and figure out what could be causing that.
One thing you could do is download your latesttopics.php file from your server, and then attach it here so I can have a look and make sure it wasn't somehow corrupted. Other than that though, I don't know of many other things that it could be.
rstan
06-15-2004, 06:34 PM
<?php
// ++=========================================================================++
// || vBadvanced CMPS 1.0.0 ||
// || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved ||
// || This file may not be redistributed in whole or significant part. ||
// || http://vbadvanced.com ||
// ++ ========================================================================++
// ######################### Latest Forum Topics #########################
if ($vba_options['portal_threads_maxthreads'])
{
$inforums = '';
if ($vba_options['portal_threads_forumids'])
{
if (!empty($forumperms))
{
$inforums = array();
$threadsforums = explode(',', $vba_options['portal_threads_forumids']);
foreach ($threadsforums AS $tforum)
{
if (!in_array($tforum, $forumperms))
{
$inforums[] = $tforum;
}
}
if (!empty($inforums))
{
$inforums = implode(',', $inforums);
}
}
else
{
$inforums = $vba_options['portal_threads_forumids'];
}
if ($inforums)
{
$inforums = 'AND thread.forumid IN (' . $inforums . ')';
}
}
$foruminfo['allowratings'] = $vba_options['portal_threads_showrating'];
$show['lastpost'] = $vba_options['portal_threads_lastpost'];
if ($vba_options['portal_threads_showsubscribed'] AND $bbuserinfo['userid'])
{
$query['subfields'] = ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed';
$query['subjoin'] = 'LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = ' . $bbuserinfo['userid'] . ')';
}
if ($vba_options['portal_threads_showpreview'] AND $vboptions['threadpreview'])
{
$query['previewfields'] = ', post.pagetext AS preview';
$query['previewjoin'] = 'LEFT JOIN ' . TABLE_PREFIX . 'post AS post ON (post.postid = thread.firstpostid)';
}
if ($vba_options['portal_threads_showforum'])
{
$query['forumfields'] = ',thread.forumid, forum.title AS forumtitle';
$query['forumjoin'] = 'LEFT JOIN ' . TABLE_PREFIX . 'forum AS forum ON (thread.forumid = forum.forumid)';
}
if ($vba_options['portal_threads_showicon'])
{
$query['iconfields'] = ', thread.iconid AS threadiconid, iconpath AS threadiconpath';
$query['iconjoin'] = 'LEFT JOIN ' . TABLE_PREFIX . 'icon USING (iconid)';
}
$threads = $DB_site->query("
SELECT
" . iif($vba_options['portal_threads_showrating'], 'IF(votenum >= ' . $vboptions['showvotes'] . ', votenum, 0) AS votenum, IF(votenum >= ' . $vboptions['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
$query[iconfields]
$query[forumfields]
$query[previewfields]
$query[subfields]
FROM " . TABLE_PREFIX . "thread as thread
$query[iconjoin]
$query[forumjoin]
$query[previewjoin]
$deljoin
$query[subjoin]
WHERE open <> '10' AND thread.visible = 1 $iforumperms $inforums $notdeleted
ORDER BY lastpost DESC
LIMIT $vba_options[portal_threads_maxthreads]
");
while ($thread = $DB_site->fetch_array($threads))
{
if (strlen($thread['title']) > $vba_options['portal_threads_maxchars'] AND $vba_options['portal_threads_maxchars'])
{
$thread['title'] = fetch_trimmed_title($thread['title'], $vba_options['portal_threads_maxchars']);
}
$thread = process_thread_array($thread, '', $vba_options['portal_threads_showicon']);
$getbgrow = getrowcolor();
eval('$threadbits .= "' . fetch_template('adv_portal_latesttopicbits') . '";');
}
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_latesttopics') . '";');
$DB_site->free_result($threads);
unset($thread, $threadbits, $foruminfo, $query, $inforums);
}
?>
Brian
06-15-2004, 07:12 PM
$inforums = '';
Right below that line, near the top of the file, try adding this:
$query = array();
Let me know if that makes any difference.
rstan
06-15-2004, 07:43 PM
yep, fired right up....you sir are the man!
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.