Go Back   vBulletin Setup > vBulletinSetup Information > vBulletin Questions


Please Register to get full access to the forums.
Post New Thread  Reply



#1   11-25-2007, 03:23 PM
aragorn has a spectacular aura about Join Date: Oct 2007 Posts: 13
Create a new variable -- where?


I have built an SQL query that returns the count of a user's topics in certain forums. I want to use this as a variable, so I can use it in my postbit templates.

The problem is I don't know how to do that.

The code I THINK I should use to define the variable with this SQL query is this;

$stories = $db->query_first("
SELECT
Count(vbthread.threadid)
FROM vbthread
WHERE
(vbthread.forumid = '57' OR
vbthread.forumid = '58' OR
vbthread.forumid = '59' OR
vbthread.forumid = '60' OR
vbthread.forumid = '61' OR
vbthread.forumid = '62' OR
vbthread.forumid = '63' ) AND
vbthread.postuserid = '$post[userid]'
");


1. Is this correct? If not, what is the way to define the query as a variable? It's obvious that the Query part is between "select" and "[userid]".

2. Where should I use this code to define the variable and then be able to use the $stories variable inside my postbit templates?

Last edited by aragorn; 11-25-2007 at 03:25 PM.
Quote   |  
Post New Thread  Reply
vBulletin Setup > vBulletinSetup Information > vBulletin Questions


Thread Tools
Display Modes

 
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create vB pages by creating a template News vBulletin Questions 3 02-14-2008 04:31 PM
Tutorial To Create Vb Skins? marketprofits vBulletin Questions 3 10-25-2007 10:11 PM
Create Your own Simpsons Avatar ! Brandon General Discussion 0 07-30-2007 09:32 PM
How do I create link back section? Yvgeniy vBulletin Questions 5 02-03-2007 10:08 AM


All times are GMT -6. The time now is 10:11 PM.

vBulletin Setup, vBulletin Setup Forums, vBulletin Services, vBulletin Blogs, vBulletin SEO, vBulletin Questions, vBulletin Skins, Styles, Templates
vBulletin Hacks / Modifications, vBulletin Monetization, Blogs, vBulletin Link Directory,Quality Link Directory