Your Ads Here
Advertise with Western Studios.
www.westernstudios.net

PHP Nuke Downloads
The latest and best in php nuke downloads.
www.westernstudios.net

PHP Nuke Subscription
The #1 php nuke subscription module.
www.westernstudios.net

Theme Shop
Get the best in phpnuke themes, stock photos, icons from Western Studios themes shop.
shop.westernstudios.net

PHP Nuke Services
Need work done on your site? View our services for the best in phpnuke services.
www.westernstudios.net


Advertise Here


Western Studios :: View topic - Charging members points for anything
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups     ProfileProfile   Log inLog in 


Charging members points for anything



 
Post new topic   Reply to topicprinter friendly version    Western Studios Forum Index -> Hack and Mods
Western Studios

X-perienced
X-perienced
~PHP Nuke User~

Platinum Subscriber

Posts: 78
Next Group: 72 posts
seboyd2000 wrote:

admin

maybe you can help me here, or maybe create a new Tutorial on this... or maybe you already have one

Lets say I have the nuke point system installed (and I believe its already in phpnuke v7.9+)

I just want a simple way to allow member to use their point for different things... For example:

Lets say that I want to give members an item... if they have collected enough points to get it... and the item that i want to give them, is named a WIDGET

Now I create a block, and put in a picture of the item,
and state that it costs 1000 points... for example,
to download it, and I upload a file of the item to the downloads module

Is there a section of code that I can install or place into this new block, that will first check the users points to see if they have enough points for the item, and if so allow an auto-download of the item, without redirecting them to the download listing page,

and if they do not have enough points, tell them this instead...


thanks

Posted: Mon May 07, 2007 6:22 am

Western Studios

Site Admin
Site Admin
~PHP Nuke User~

Platinum Subscriber

Posts: 3234
Staff
Next Group: 1766 posts
admin(Mark) wrote:

You can create function to simplify the points check. The example should do the trick

Code:

function _userpoints(){
global $user, $prefix, $user_prefix, $db, $cookie;

if(!is_user($user)){//not a member/not logged in so points total =0
$points = '';
}else{
     cookiedecode($user);
    $uid = $cookie[0];
$sql = "SELECT points FROM ".$user_prefix."_users
        WHERE user_id ='$uid'";
$result = $db->sql_query($sql);

//get the points
list($points) = $db->sql_fetchrow($result);

}
//send the points total
return $points;

}

//total points needed
$tpoints = 200;

if(_userpoints() >= $tpoints){

$content = 'Display the download link here';

}else{

$content = 'You do not have enough points';

}


That code will do the check and make sure the user has enough points before seeing the download link.
Of course you would need another function if you want to subtract the points from their account.

Posted: Mon May 07, 2007 12:06 pm

Western Studios

X-perienced
X-perienced
~PHP Nuke User~

Platinum Subscriber

Posts: 78
Next Group: 72 posts
seboyd2000 wrote:

Admin

excellent... thanks

so could you give me the other section that would subtract the points, when you have time ti make it (please please)... because that would be the main thing that I need to accomplish this action that I described above

thanks again

Posted: Tue May 08, 2007 8:01 am

Western Studios

X-perienced
X-perienced
~PHP Nuke User~

Platinum Subscriber

Posts: 78
Next Group: 72 posts
seboyd2000 wrote:

any luck on the part I asked about above

thanks

Posted: Fri May 11, 2007 7:09 pm

Western Studios

Site Admin
Site Admin
~PHP Nuke User~

Platinum Subscriber

Posts: 3234
Staff
Next Group: 1766 posts
admin(Mark) wrote:

I will try to write a function for you later today that should take away the points when a user clicks to download the file.

Posted: Sat May 12, 2007 9:04 am

Post new topic   Reply to topic    Western Studios Forum Index -> PHP Nuke -> Hack and Mods All times are GMT - 5 Hours
Page 1 of 1

 
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


Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts [ Poll ] What browser are you using 71 admin 4543 Wed May 30, 2007 5:51 pm
admin View latest post
No new posts two for one special coming soon! 4 admin 489 Thu Mar 30, 2006 9:48 pm
admin View latest post
No new posts Hundreds of Gmail invites to give away 2 Anna 551 Sat Feb 04, 2006 11:01 am
leachy View latest post
No new posts Are you getting Xbox 2? 20 admin 1246 Mon Jan 30, 2006 1:19 pm
sanelx View latest post
No new posts Admin intro 8 admin 878 Sun Nov 06, 2005 12:03 am
Wheat View latest post
 
Forums ©