PDA

View Full Version : New posts not adding xp


Cyricx
09 Mar 2005, 13:57
Currently posting is not adding xp. Did you change the new post code from the first V3 you sent out?

Might I suggest that you name them 3.1, 3.2, etc as ya hammer out at the bugs? :)

Revan
09 Mar 2005, 15:43
Are you sure you turned the setting on?
Because I gain EXP just fine and Im using the same code as you (else I wouldn't have anything to compare the v2 and v3 file changes against, eh? :p)

And naming them 3.1 etc would cause me to end up with 3.1245653434 before it oculd be labelled final ;)
Nah I only increase version number as DB changes are needed :p

Cyricx
09 Mar 2005, 17:48
Postive it's on.

Set to yes and xp per post is 1.

I doubled checked my code in the newreply and newthread to your last zip, matches. And I even checked my database to ensure the values are there.

Both rpg_givepostexp and rpg_expperpost are set to 1.

Revan
09 Mar 2005, 19:01
This is utterly weird.
You seem to be the only one having this problem, yet I can't find anything wrong with the setting, be it 1 or 10....

Try removing the "$vboptions['rpg_givepostexp'] == 1 AND " from the if() in newreply, then try to make a post.
If this does not fix it, readd it and remove " AND $vboptions['rpg_expperpost'] > 0" from the if() and try again.

This should get us one step closer to fixing it, at least for your forum.

Cyricx
09 Mar 2005, 22:44
I'll definately have to run those when I get home.

The weird thing is, it's adding points when you post a new thread..

but not when you reply :ermm:

Fixed. I think it was where the code was being put. I checked out the newthread mod and it put it just above where it started defining the variables, so I moved the newreply code to the same spot and it worked.

Short version to fix this bug if you have it like I did.

Open newreply.php

Find:

$newpost['title'] = $_POST['title'];




ABOVE IT PUT:

// rpg
// Itemshop code by Mewtwo and Battle Code by Bitsys
if ($vboptions['rpg_givepostexp'] == 1 AND $vboptions['rpg_expperpost'] >

0)
{
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET

xp=xp+$vboptions[rpg_expperpost] WHERE userid='$bbuserinfo[userid]'");
// End Itemshop code by Mewtwo and Battle Code by Bitsys
if ($bbuserinfo['inbattle'] == 0 AND

$bbuserinfo['inmonsterbattle'] == 0)
{
process_rpg_stats($bbuserinfo);
}
}
//end auto-update stats add-on for the RPG Integration Hack by Bitsys

Revan
10 Mar 2005, 15:31
Ah good you got it fixed. I never would have guessed to do what you did there :p
I'm not sure I want to put this in the official version if you are the only one this is happening to, because since it works for everyone else (so far), fixing something that ain't broken...;)