Gamingforce Interactive Forums
85242 35212

Go Back   Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk
Register FAQ GFWiki Community Donate Arcade ChocoJournal Calendar

Notices

Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis.
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).


vBulletin Question
Closed Thread
 
Thread Tools
Bigblah
Tails is incompetent!


Member 5

Level 45.31

Feb 2006


Old Dec 2, 2006, 06:53 AM Local time: Dec 2, 2006, 07:53 PM #1 of 7
A better way would be to add a new field to the user table instead -- this way you don't end up modifying original forum behaviour. Assuming your vBulletin tables have no prefix, you could run this query:

Code:
ALTER TABLE user ADD totalposts int(10) UNSIGNED NOT NULL DEFAULT '0' AFTER posts
And then, to populate them initially,

Code:
UPDATE user SET totalposts = posts
From now on, the 'totalposts' field will be available through $vbulletin->userinfo['totalposts'], or $bbuserinfo['totalposts'] for templates. To update totalposts whenever someone successfully makes a post, you could use the Plugin Manager to add the necessary code to, say, the postdata_postsave plugin hook. (Doing this will also circumvent non-postcount forum behaviour.)

Code:
$this->dbobject->query_write("UPDATE " . TABLE_PREFIX . "user SET totalposts = (totalposts + 1) WHERE userid = " . intval($this->fetch_field('userid')));
I haven't tried it out myself, hopefully it works

(Note: the database object above corresponds to vBulletin 3.5x, you should check if your own install has the same syntax.)

Most amazing jew boots
Bigblah
Tails is incompetent!


Member 5

Level 45.31

Feb 2006


Old Dec 2, 2006, 07:08 AM Local time: Dec 2, 2006, 08:08 PM #2 of 7
What's your vBulletin version?

Edit: No problem =D

There's nowhere I can't reach.
Bigblah
Tails is incompetent!


Member 5

Level 45.31

Feb 2006


Old Dec 2, 2006, 07:48 AM Local time: Dec 2, 2006, 08:48 PM #3 of 7
Yeah, a common hook location to use would be postbit_display_complete. The totalposts value (specific to each postbit) should be available as the $post['totalposts'] variable.

Most amazing jew boots
Closed Thread


Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk > vBulletin Question

Forum Jump


All times are GMT -5. The time now is 05:14 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2026, vBulletin Solutions, Inc.