Points Mod & User Groups

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Points Mod & User Groups
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 20 year's 20 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 47
Gender: Male
Fav. Sports Team: Da Bears.
Website:
Status: Offline
Joined: Jul 01, 2004
0.04 posts per day
Posts: 288
Points: 15,094
  MSN Messenger 
I'm using the Points mod from this site and nuke 7.5. I'm also using Telli's CZModules which has functionality to limit modules based on user groups. The user groups are linked by points.

Long story short, I setup a user group with a minimum 500 points to be a member of the group...then tried to restrict my downloads section to that group, but it doesn't work. Anyone have ideas? My points mod is working great everywhere else in the site. TIA icon_razz.gif icon_question.gif




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
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
   
Problem lies in your modules.php try uploading a new one from the version you use.




_________________
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: Points Mod & User Groups
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 20 year's 20 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 47
Gender: Male
Fav. Sports Team: Da Bears.
Website:
Status: Offline
Joined: Jul 01, 2004
0.04 posts per day
Posts: 288
Points: 15,094
  MSN Messenger 
Will do. Thanks Telli.


Uploaded modules.php file in my website's main dir and there's no change. nuke 7.5




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#4   re: Points Mod & User Groups
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 20 year's 20 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 47
Gender: Male
Fav. Sports Team: Da Bears.
Website:
Status: Offline
Joined: Jul 01, 2004
0.04 posts per day
Posts: 288
Points: 15,094
  MSN Messenger 
Open to more suggestions?? icon_question.gif




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#5   re: Points Mod & User Groups
erald
CZ Newbie
erald has been a member for over 20 year's 20 Year Member
belgium.gif
Age: 68
Gender: Male
Status: Offline
Joined: Oct 11, 2004
0.00 posts per day
Posts: 9
Points: 2,134
   
got the same problem it seems the usergroup restrictions to access certain modules is not intergrated into module.php.

anyone?



Back to top Reply with quote
#6   re: Points Mod & User Groups
erald
CZ Newbie
erald has been a member for over 20 year's 20 Year Member
belgium.gif
Age: 68
Gender: Male
Status: Offline
Joined: Oct 11, 2004
0.00 posts per day
Posts: 9
Points: 2,134
   
I'm not a PHP programmer but several hours chasing this problems got me a solution which works for me.

In module.php find
            } else if ($view == 1 AND (is_user($user) OR is_group($user, $name)) OR is_admin($admin)) {
      $modpath .= "modules/$name/".$file.".php";
             if (file_exists($modpath)) {
                include($modpath);
             } else {
                die ("Sorry, such file doesn't exist...");
            }
          } elseif ($view == 1 AND !is_user($user) AND !is_admin($admin)) {
            $pagetitle = "- "._ACCESSDENIED."";
            include("header.php");
            title("$sitename: "._ACCESSDENIED."");
            OpenTable();
            echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
                .""._MODULEUSERS."";
      $result2 = $db->sql_query("SELECT mod_group FROM ".$prefix."_modules WHERE title='$name'");
      $row2 = $db->sql_fetchrow($result2);
       if ($row2[mod_group] != 0) {
      $result3 = $db->sql_query("SELECT name FROM ".$prefix."_groups WHERE id='$row2[mod_group]'");
      $row3 = $db->sql_fetchrow($result3);
      echo ""._ADDITIONALYGRP.": <b>$row3[name]</b><br><br>";
            }
            echo ""._GOBACK."";
            CloseTable();
            include("footer.php");
            die();

and replace with
            } else if ($view == 1 AND (is_user($user) OR is_group($user, $name)) OR is_admin($admin)) {

      $result2 = $db->sql_query("SELECT mod_group FROM ".$prefix."_modules WHERE title='$name'");
      $row2 = $db->sql_fetchrow($result2);
      $nustr = explode(":", $nukeuser);
      $result4 = $db->sql_query("SELECT points FROM ".$prefix."_users WHERE user_id='$nustr[0]'");
      $row4 = $db->sql_fetchrow($result4);
      $user_points = $row4[points];
          if ($row2[mod_group] != 0) {
         $result3 = $db->sql_query("SELECT name, points FROM ".$prefix."_groups WHERE id='$row2[mod_group]'");
         $row3 = $db->sql_fetchrow($result3);
         if ($user_points<$row3[points] AND !is_admin($admin)){
            $pagetitle = "- "._ACCESSDENIED."";
            include("header.php");
            title("$sitename: "._ACCESSDENIED."");
            OpenTable();
            echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
                .""._MODULEUSERS."";
            echo ""._ADDITIONALYGRP.": <b>$row3[name]</b><br><br>";
            echo ""._GOBACK."";
            CloseTable();
            include("footer.php");
            die();
         }
          }


      $modpath .= "modules/$name/".$file.".php";
             if (file_exists($modpath)) {
                include($modpath);
             } else {
                die ("Sorry, such file doesn't exist...");
            }
          } elseif ($view == 1 AND !is_user($user) AND !is_admin($admin)) {
            $pagetitle = "- "._ACCESSDENIED."";
            include("header.php");
            title("$sitename: "._ACCESSDENIED."");
            OpenTable();
            echo "<center><b>"._RESTRICTEDAREA."</b><br><br>"
                .""._MODULEUSERS."";
            echo ""._GOBACK."";
            CloseTable();
            include("footer.php");
            die();


I made it so that if you choose a group which has access to a module all higher groups wil have it also.
There might be better ways to do this but the way it was programmed it was not working and I just looked for a quick solution which works for me.

Hope this helps someone


Back to top Reply with quote
#7   re: Points Mod & User Groups
infinity8x3
CZ Newbie
infinity8x3 has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Jul 25, 2006
0.00 posts per day
Posts: 2
Points: 25
   
icon_biggrin.gif cool yes it helped me alot and im not even useing a mod im useing the base groups system in php-nuke 7.8 and before i used that code it didnt work i would let you view the modules no matter what group you were in but now it works thanks i even found some blocks that work with the points system icon_biggrin.gif



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