vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vB3 Forum Quick Stats Cache Serialize Hack v1.1 (https://vborg.vbsupport.ru/showthread.php?t=61581)

surfhog 04-10-2004 10:07 PM

thanks and sorry but nope :( if I use the forumdisplay.php file with the above replacement code, I still getting the same error. :(

Boofo 04-10-2004 11:52 PM

Ok, this is definately the fix now. Apparently I have to do the AS part on all tables in a query that has more than 1 table. I never knew nthat before, so I guess we're both learning something here. ;)

PHP Code:

    $topposter $DB_site->query_first("
        SELECT user.userid, user.username, COUNT(post.postid) AS postcount
        FROM " 
TABLE_PREFIX "post AS post
        LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON (post.threadid = thread.threadid)
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON (post.userid = user.userid)
        WHERE thread.forumid=
$forumid
        GROUP BY post.userid
        ORDER BY postcount DESC
        LIMIT 1
    "
); 


surfhog 04-11-2004 08:26 PM

Quote:

Originally Posted by Boofo
Ok, this is definately the fix now. Apparently I have to do the AS part on all tables in a query that has more than 1 table. I never knew nthat before, so I guess we're both learning something here. ;)

PHP Code:

    $topposter $DB_site->query_first("
        SELECT user.userid, user.username, COUNT(post.postid) AS postcount
        FROM " 
TABLE_PREFIX "post AS post
        LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON (post.threadid = thread.threadid)
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON (post.userid = user.userid)
        WHERE thread.forumid=
$forumid
        GROUP BY post.userid
        ORDER BY postcount DESC
        LIMIT 1
    "
); 


-------------------------------------------------------------------------
I still get error:
-------------------------------------------------------------------------
Quote:

Database error in vBulletin 3.0.0:
Invalid SQL:
SELECT forum.title AS forum, COUNT(attachment.attachmentid) AS count, SUM(IF(thumbnail = '', 0, 1)) AS thumbs, SUM(IF(thumbnail = '', 1, 0)) AS files, SUM(attachment.filesize) AS bytes
FROM vb3_attachment, vb3_post, vb3_thread, vb3_forum
WHERE attachment.postid = post.postid
AND post.threadid=thread.threadid
AND forum.forumid=thread.forumid
AND forum.forumid=2
GROUP BY thread.forumid
ORDER BY count DESC

mysql error: Unknown table 'forum' in field list
mysql error number: 1109

Boofo 04-11-2004 09:31 PM

This should take care of that.

PHP Code:

    $attachs=$DB_site->query_first("
        SELECT forum.title AS forum, COUNT(attachment.attachmentid) AS count, SUM(IF(thumbnail = '', 0, 1)) AS thumbs, SUM(IF(thumbnail = '', 1, 0)) AS files, SUM(attachment.filesize) AS bytes
        FROM " 
TABLE_PREFIX "attachment, " TABLE_PREFIX "post AS post, " TABLE_PREFIX "thread AS thread, " TABLE_PREFIX "forum AS forum
        WHERE attachment.postid = post.postid
        AND post.threadid=thread.threadid
        AND forum.forumid=thread.forumid
        AND forum.forumid=
$forumid
        GROUP BY thread.forumid
        ORDER BY count DESC
    "
); 

Jusr replace the attachs query with this one. ;)

surfhog 04-11-2004 09:40 PM

:( sorry it dosn't, i still get this error:

PHP Code:

 Database error in vBulletin 3.0.0:
Invalid SQL:  
        
SELECT forum.title AS forumCOUNT(attachment.attachmentid) AS countSUM(IF(thumbnail ''01)) AS thumbsSUM(IF(thumbnail ''10)) AS filesSUM(attachment.filesize) AS bytes 
        FROM vb3_attachment
vb3_post AS postvb3_thread AS threadvb3_forum AS forum 
        WHERE attachment
.postid post.postid 
        
AND post.threadid=thread.threadid 
        
AND forum.forumid=thread.forumid 
        
AND forum.forumid=
        GROUP BY thread
.forumid 
        ORDER BY count DESC 
    
mysql error
Unknown table 'attachment' in field list
mysql error number1109 


Boofo 04-11-2004 09:48 PM

Ok, hold on, I missed one. Sorry about that. This WILL work now. ;)

PHP Code:

    $attachs=$DB_site->query_first("
        SELECT forum.title AS forum, COUNT(attachment.attachmentid) AS count, SUM(IF(thumbnail = '', 0, 1)) AS thumbs, SUM(IF(thumbnail = '', 1, 0)) AS files, SUM(attachment.filesize) AS bytes
        FROM " 
TABLE_PREFIX "attachment AS attachment, " TABLE_PREFIX "post AS post, " TABLE_PREFIX "thread AS thread, " TABLE_PREFIX "forum AS forum
        WHERE attachment.postid = post.postid
        AND post.threadid=thread.threadid
        AND forum.forumid=thread.forumid
        AND forum.forumid=
$forumid
        GROUP BY thread.forumid
        ORDER BY count DESC
    "
); 


surfhog 04-11-2004 10:07 PM

nope sorry still the same error :( lol

Boofo 04-11-2004 10:58 PM

Quote:

Originally Posted by surfhog
nope sorry still the same error :( lol

There's no way it can be the same error. Try it again and post the exact error here, will you please? ;)

surfhog 04-11-2004 11:06 PM

okay this is the error, when i attempt to view forum with post within it - if no post, then i get nps.

Quote:

Database error in vBulletin 3.0.0:

Invalid SQL:
SELECT forum.title, forum.forumid, COUNT( post.postid ) AS yourposts, SUM( IF( thread.postuserid = 1 AND post.dateline = thread.dateline , 1, 0 ) ) AS yourthreads
FROM vb3_forum, vb3_thread, vb3_post
WHERE forum.forumid = thread.forumid
AND thread.threadid = post.threadid
AND post.userid = 1
AND forum.forumid = 2
GROUP BY forum.forumid
ORDER BY yourposts
DESC LIMIT 1

mysql error: Unknown table 'forum' in field list

mysql error number: 1109
not sure it will help? but if u have email addy i can post my file for u to view?

Boofo 04-11-2004 11:18 PM

Ok, I was right, it was a different query. Replace the yourpost query with this one and be ready to celebrate! ;)

PHP Code:

    $yourpost $DB_site->query_first("
        SELECT forum.title, forum.forumid, COUNT( post.postid ) AS yourposts, SUM( IF(  thread.postuserid = 
$bbuserinfo[userid] AND post.dateline = thread.dateline , 1, 0 ) ) AS yourthreads
        FROM " 
TABLE_PREFIX "forum AS forum, " TABLE_PREFIX "thread AS thread, " TABLE_PREFIX "post AS post
        WHERE forum.forumid = thread.forumid
        AND thread.threadid = post.threadid
        AND post.userid = 
$bbuserinfo[userid]
        AND forum.forumid = 
$forumid
        GROUP BY forum.forumid
        ORDER BY yourposts
        DESC LIMIT 1
    "
); 



All times are GMT. The time now is 10:04 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01350 seconds
  • Memory Usage 1,776KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete