Log in

View Full Version : error in rss threads


zodehala
04-18-2008, 11:07 AM
inorder to print rss thread on statistics i have created hack is called rss_thred. its codes are like following

$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 ?

MoT3rror
04-18-2008, 12:16 PM
Have you tried using a userid then Username?

zodehala
04-18-2008, 07:09 PM
like this ? (the same result (7))

$rssp = $db->query_first("
SELECT COUNT(*)AS total
FROM thread
WHERE postuserid= 1");

$rssp = $rssp[total];

Lynne
04-18-2008, 07:33 PM
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?

zodehala
04-19-2008, 09:47 AM
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 ?

Marco van Herwaarden
04-19-2008, 10:04 AM
Are you sure you are working on the same database in PMA and vB?

zodehala
04-19-2008, 12:02 PM
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 )

Lynne
04-19-2008, 02:13 PM
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!

Marco van Herwaarden
04-19-2008, 02:38 PM
The variable to use in your template is $rssp, not $rssp[total]. ;)

Or you must remove the line:

$rssp = $rssp['total']

from the plugin.

zodehala
04-19-2008, 06:34 PM
ok thanks

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