Sylvus
05-02-2003, 07:14 PM
I am using two hacks. Afterlab's # of days registered and the Item Shop. What I've done is give members 10 points per everyday they've been registered. These points are used to purchase items via the Itemshop.
It works like a charm but for one thing. When you buy something from the Itemshop, your points are subtracted as normal and updated to the user's field. BUT when they view posted messages, their points are put back to the total number of day's they've been registered.
So you can buy something for 20 points and have 15 points left. But if you've been a member for 20 days, your points are put back to 200 points when you view a message.
My question is, where is the best place to put the following code? Right now it's in the functions.php as follows.
$bonusgp=$regdays;
$bonusgp=$bonusgp*10;
$options=$DB_site->query_first("SELECT * FROM items_options");
$pointfield="$options[pointfield]";
$pointss=$DB_site->query_first("SELECT $pointfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$points = $points + $bonusgp;
$DB_site->query("UPDATE userfield SET $pointfield=$points+$options[padd] WHERE userid=$bbuserinfo[userid]");
Thanks for all suggestions,
Syl...
It works like a charm but for one thing. When you buy something from the Itemshop, your points are subtracted as normal and updated to the user's field. BUT when they view posted messages, their points are put back to the total number of day's they've been registered.
So you can buy something for 20 points and have 15 points left. But if you've been a member for 20 days, your points are put back to 200 points when you view a message.
My question is, where is the best place to put the following code? Right now it's in the functions.php as follows.
$bonusgp=$regdays;
$bonusgp=$bonusgp*10;
$options=$DB_site->query_first("SELECT * FROM items_options");
$pointfield="$options[pointfield]";
$pointss=$DB_site->query_first("SELECT $pointfield FROM userfield WHERE userid=$bbuserinfo[userid]");
$points = $points + $bonusgp;
$DB_site->query("UPDATE userfield SET $pointfield=$points+$options[padd] WHERE userid=$bbuserinfo[userid]");
Thanks for all suggestions,
Syl...