The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Where in the code is the post count increased?
In which file and where is the code that increases the user's post count when he or she posts?
I have a second field in the user database that I want to increment by 1 when users post. |
#2
|
|||
|
|||
The function post_save_each_post() inside the vB_Datamanager_ThreadPost class.
|
#3
|
|||
|
|||
So how would I make it increment a field in the user table called money each time a user posts? It seems that it should be something like this, but I have minimal knowledge of php & mySQL.
Code:
$money = $this->fetch_field('money', 'user'); $user->set('money', 'money + 1'); |
#4
|
||||
|
||||
Quote:
|
#5
|
|||
|
|||
You are unable to do it using that method. You will need to add money to the validfields array (see vbulletin documentation), and then you can just set, no need to use fetch_field at all.
|
#6
|
|||
|
|||
Yeah I added it to the validfields array, but when I post, nothing happens. The "money" count doesn't increase. Perhaps I am putting it in the wrong part of the file? I am putting it right below the post count increase line. Where should I be putting it?
Quote:
EDIT: I got it. I placed it on line 616 below Code:
$user->set_existing($this->info['user']); |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|