Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-18-2008, 11:07 AM
zodehala's Avatar
zodehala zodehala is offline
 
Join Date: Sep 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default error in rss threads

inorder to print rss thread on statistics i have created hack is called rss_thred. its codes are like following

PHP Code:
$rssp $db->query_first("SELECT COUNT(*) AS total FROM thread WHERE postusername='rss_poster'");

$rssp $rssp[total]; 

threads which are opened by rss_poster are 775 but hack says they are 7

where is my error ?
Reply With Quote
  #2  
Old 04-18-2008, 12:16 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried using a userid then Username?
Reply With Quote
  #3  
Old 04-18-2008, 07:09 PM
zodehala's Avatar
zodehala zodehala is offline
 
Join Date: Sep 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

like this ? (the same result (7))

PHP Code:
$rssp $db->query_first("
SELECT COUNT(*)AS total 
FROM thread 
WHERE postuserid= 1"
); 
$rssp = $rssp[total];
Reply With Quote
  #4  
Old 04-18-2008, 07:33 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm, I tried that on my site for a couple of different userids and it worked fine. Where are you getting the count of 775?
Reply With Quote
  #5  
Old 04-19-2008, 09:47 AM
zodehala's Avatar
zodehala zodehala is offline
 
Join Date: Sep 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

like you see in attchment

pic.-1 : query i run in PMA and its result = 775

pic.-2 : my plugin codes

pic.-3 : codes in forumhome

pic.-4 : result in home

where is my error ?
Attached Images
File Type: gif 1.gif (5.9 KB, 0 views)
File Type: jpg 2.jpg (54.7 KB, 0 views)
File Type: jpg 3.jpg (34.9 KB, 0 views)
File Type: gif 4.gif (7.6 KB, 0 views)
Reply With Quote
  #6  
Old 04-19-2008, 10:04 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure you are working on the same database in PMA and vB?
Reply With Quote
  #7  
Old 04-19-2008, 12:02 PM
zodehala's Avatar
zodehala zodehala is offline
 
Join Date: Sep 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

pic.1 = db name is forum and table name is thread

pic.2 = forum's config.php file

pic.3 = result of query i run in admincp

(vBulletin 3.7.0 Beta 3 )
Attached Images
File Type: gif 1.GIF (7.0 KB, 0 views)
File Type: gif 2.GIF (5.2 KB, 0 views)
File Type: jpg 3.jpg (26.2 KB, 0 views)
Reply With Quote
  #8  
Old 04-19-2008, 02:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have no idea if it makes a difference, but shouldn't the line be:
$rssp = $rssp['total'];
(with the single quotes)

This gets the award for weird problem today!
Reply With Quote
  #9  
Old 04-19-2008, 02:38 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The variable to use in your template is $rssp, not $rssp[total].

Or you must remove the line:

$rssp = $rssp['total']

from the plugin.
Reply With Quote
  #10  
Old 04-19-2008, 06:34 PM
zodehala's Avatar
zodehala zodehala is offline
 
Join Date: Sep 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok thanks

when i remove $rssp = $rssp['total'] it is ok
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:20 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05087 seconds
  • Memory Usage 2,278KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (7)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete