point system 6.5

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   point system 6.5
mayona
CZ Newbie
mayona has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 28, 2004
0.00 posts per day
Posts: 9
Points: 804
   
I modified alot on my site and I don't want to upgrade to 7.0+. *headache*

6.5 point sys only give points to post and answering post... are there any hacks to add points to certain modules?

Thanks icon_smile.gif



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,475
   
Get the admin section from a 7.0 install and just install that. Then look in the mainfile.php of the nuke 7.0 for the function update_points($id) copy that and put into your mainfile.php (Change the update points to update user_points) . That will give you the extra points. Now where you want to use them you just place the function

update_points(1);


The #1 is associated with the admin panel you will see what I mean.



_________________
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   re: point system 6.5
mayona
CZ Newbie
mayona has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 28, 2004
0.00 posts per day
Posts: 9
Points: 804
   
Hi Telli,

I followed your instruction...

html-->admin

I downloaded all the files and I noticed that there is this group.php added... I included it too.

got the 7.0 patch from Nuke Resouces and saw this 2 functions in the mainfile

<?php function is_group($user, $name) {
    global $prefix, $db, $user_prefix;
    if(!is_array($user)) {
   $user = addslashes($user);
   $user = base64_decode($user);
   $user = explode(":", $user);
        $uid = "$user[0]";
   $pwd = "$user[2]";
    } else {
        $uid = "$user[0]";
        $uid = intval($uid);
   $pwd = "$user[2]";
    }
    if ($uid != "" AND $pwd != "") {
        $result = $db->sql_query("SELECT user_password FROM ".$user_prefix."_users WHERE user_id='$uid'");
   $row = $db->sql_fetchrow($result);
   $pass = $row['user_password'];
   if($pass == $pwd && $pass != "") {
            $result2 = $db->sql_query("SELECT points FROM ".$user_prefix."_users WHERE user_id='$uid'");
       $row2 = $db->sql_fetchrow($result2);
       $points = $row2['points'];
            $result3 = $db->sql_query("SELECT mod_group FROM ".$prefix."_modules WHERE title='$name'");
       $row3 = $db->sql_fetchrow($result3);
       $mod_group = $row3['mod_group'];
            $result4 = $db->sql_query("SELECT points FROM ".$prefix."_groups WHERE id='$mod_group'");
       $row4 = $db->sql_fetchrow($result4);
       $grp = intval($row4['points']);
        if (($points >= 0 AND $points >= $grp) OR $mod_group == 0) {
      return 1;
       }
   }
    }
    return 0;
}




function user_points($id) {
    global $user_prefix, $prefix, $db, $user;
    if (is_user($user)) {
   if(!is_array($user)) {
       $user = addslashes($user);
       $user1 = base64_decode($user);
       $user1 = explode(":", $user1);
           $username = "$user1[1]";
   } else {
           $username = "$user1[1]";
   }
   if ($db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_groups")) > '0') {
       $id = intval($id);
            $result = $db->sql_query("SELECT points FROM ".$prefix."_groups_points WHERE id='$id'");
       $row = $db->sql_fetchrow($result);
       $rpoints = intval($row['points']);
       $db->sql_query("UPDATE ".$user_prefix."_users SET points=points+" . $rpoints . " WHERE username='$username'");
   }
    }
}?>
[/code]

And that's what i copied since it looks the same as what you told me, Did I do it right?

and when I went to the Admin panel and click the users groups it gives me this on the url:..../admin.php?op=Groups

and the outcome was "Not Acceptable
An appropriate representation of the requested resource /admin.php could not be found on this server." although i have it. This is also the reason why i didn't upgrade to 7.0. (clicking that users groups in the panel).

And lastly,

update_points(1);

If i want it in my coppermine gallery where should i put it...soryy it's not clear to me icon_sad.gif .
I am a newbie but trying to learn this trade...

thanks icon_smile.gif


Back to top Reply with quote
#4   re: point system 6.5
mayona
CZ Newbie
mayona has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Apr 28, 2004
0.00 posts per day
Posts: 9
Points: 804
   
Alrighty... seems no one know this. I will upgrade to whatever version of phpnuke that has a point system "working"... will someone link me to it?



Back to top Reply with quote
#5   re: point system 6.5
Taut
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif california.gif
Occupation: Entrepreneur
Gender: Female
Fav. Sports Team: SF Giants
Status: Offline
Joined: May 27, 2003
0.70 posts per day
Posts: 5530
Points: 481,695
   
Telli may just have not seen your post however any Nuke dl from 7.0 on up shoul dhave th epoints system already installed



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