Make 'em use points?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Make 'em use points?
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 60
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
I have seen several ways members can receive points. I am looking for ways that require members to USE points. I have the rabbitoshi mod installed, and this works to some extent. It just isn't required for members to have a pet.

Anyone have any suggestions on a way to make a member automatically use points until their points go to zero?

Thanks




_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
I charge points for adding a photo to coppermine, adding downloads, adding links etc.To charge just add another update points to the mainfile.

function update_points2($id) {
    global $user_prefix, $prefix, $db, $user;
    if (is_user($user)) {
   if(!is_array($user)) {
       $user1 = base64_decode($user);
       $user1 = explode(":", $user1);
           $username = "$user1[1]";
   } else {
           $username = "$user1[1]";
   }
          $row = $db->sql_fetchrow($db->sql_query("SELECT points FROM ".$prefix."_czsite_points WHERE id='$id'"));
       $db->sql_query("UPDATE ".$user_prefix."_users SET user_points=user_points-$row[points] WHERE username='$username'");
    }
}




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 60
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
I follow how the query subtracts points instead of adding them. How do you call the function update_points2 when you lets say view pages? I am guessing you change the update_points to update_points2, but where exactly is this bit of code located in PHPNuke?

Again, I am guessing here, but it would seem the simple way would be to add the update_points2 (id_number); near the end of the specific function I want to charge for. Where do the specific id numbers come from? Can I make them up and add them to the database, or is there a specific way?




_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
#4   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
What points system are you using?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#5   re: Make 'em use points?
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 60
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
cash mod

EDIT: In the previous post I was referring to adding the update_points2 AFTER the function was added to the mainfile. Just wanted to make that clear.




_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
#6   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Your going to have to set up a table for charging and a page to set up the id's. I suggest you get a copy of the Nuke admin Points (Versions 7.0+) and use that for a template.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#7   re: Make 'em use points?
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 60
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
ok, appreciate the help. Off I go on another adventure.....




_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum