vBulletin Modifications

Profile Enhancements - Create new variable to use in postbit - HOW!?

Welcome to vBHackers.com! - vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > vBulletin Hacker Forum

Reply
 
LinkBack Thread Tools
Old 11-28-2007, 08:18 PM   #1
vB Newbie
Join Date: Mar 2007
dakis is on a distinguished road

Default Profile Enhancements - Create new variable to use in postbit - HOW!?

Hello,

I've been doing a lot of reading throughout any VB resource I could find, but still cannot figure out how to get this to work;

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, next to each user avatar for example.


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

$stories = $vbulletin->db->query_read("
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 my query as a variable?

2. Where should I use this code to define the variable and then be able to use the $stories variable inside my postbit template? I tried creating a new plugin using a hook from postbit_start or postbit_complete, but it does not work.

Any ideas please? I've been trying to make this work for quite a few days now.

Thanks.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 12-01-2007, 03:16 PM   #2
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

I posted an XML file that allowed you to do this, a fairly long time ago. To sum up you should use something like this;
You must first be a registered member to view any code.
Comment says the rest




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-02-2007, 05:34 AM   #3
vB Newbie
Join Date: Mar 2007
dakis is on a distinguished road

Default

Woooooot!!! It worked!!!

Thankyou so much for your help!!!

Can I send you a Christmas present or something?


Best regards from Athens, Greece.

Last edited by dakis; 12-02-2007 at 05:45 AM.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-04-2007, 10:01 AM   #4
vBulletin Guru
Nick R's Avatar
Join Date: May 2006
Real Name: Nick
Location: Cyberspace, UK
Nick R is on a distinguished road

Default

You can if you want but the postage would be a killer :p.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-16-2007, 12:17 PM   #5
vB Newbie
Join Date: Mar 2007
dakis is on a distinguished road

Default

LOL I came back with another question regarding this hack.

I now have it as a plugin, located in the postbit_start hook. But I need to use it in other pages as well, for example the memberinfo page. How could I do that? Is there any other hook location I could place this code so that it would work more "globally" instead of just the postbit?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-09-2008, 08:46 AM   #6
vB Newbie
Join Date: Mar 2007
dakis is on a distinguished road

Default

Can anyone help me on this ? I use the abovementioned code as a plugin, and then call the $stories[num] variable in the postbit templates, and it's working ok.

But it's messing up my rss feeds now, they are not working and I get database errors pointing at this hack.

I think it is a problem with the hook location I'm using. I'm using postbit_display_start , should I use it in another hook location?????




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FAQ] Change the Postbit toonmaster vBulletin Modification Tutorials 8 10-09-2007 10:01 AM
Need Help On My Postbit flipboyz General vBulletin Discussion 1 09-09-2007 02:16 PM
create templates FoxFireDiego General vBulletin Support 28 10-07-2006 03:16 AM
is there a way to create multiple annoments jeneepen General vBulletin Support 4 06-05-2006 09:42 PM


All times are GMT -3. The time now is 10:06 PM.


SEO by vBSEO 3.2.0 RC8 ©2008, Crawlability, Inc. (Patent Pending)