Restrict Module access by User Level and/or Forum Posts

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   re: Restrict Module access by User Level and/or Forum Posts
zerocool
CZ Super Newbie
zerocool has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Mar 04, 2006
0.01 posts per day
Posts: 40
Points: 495
   
I AM SO SORRY, I GOT IT POINTS.



What if I want users to have 30 points to view my Blogs page, and 45 points to view my Gallery page.


Thanks you guys are the best



Back to top Reply with quote
#2   
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 
We could change the function in the mainfile.php to require a couple variables (post count and points for example) then call the function from any module passing those two variables.

I'll try and get something packaged and available for download on my site.




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#3   
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
   
Here ya go...

Change this:


function extra_auth_points($user_id, $points) {
global $db, $prefix, $sitename, $module_name;
$min_points = 350;


To this:


function extra_auth_points($user_id, $points, $min_points = '') {
global $db, $prefix, $sitename, $module_name;
if (!isset($min_points)) { $min_points = 350; }


Change this:


global $userinfo;
extra_auth_points($userinfo['user_id'], $userinfo['points']);


To this:


global $userinfo;
$points_to_use_this_module = 200;
extra_auth_points($userinfo['user_id'], $userinfo['points'], $points_to_use_this_module);



Attached Files
ChangeablePointsAccess.txt (3.33 KB, Downloaded: 5239 Time(s))



_________________
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
#4   
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 
Okay, I've got a new version ready to go at my website. Go here to download it:
[ Register or login to view links on this board. ]

Membership required - free registration.




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#5   
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
   
I guess mine wouldn't work? icon_scratch.gif




_________________
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
#6   
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 
Na, it would work fine. My original code was a bit sloppy...just wanted to pretty it up a bit.

I separated each of the functions so either or could be called from Mainfile.php while passing appropriate variables for customization per module.




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#7   re: Restrict Module access by User Level and/or Forum Posts
zerocool
CZ Super Newbie
zerocool has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Mar 04, 2006
0.01 posts per day
Posts: 40
Points: 495
   
I was wanted to say thank you both of you. Everything works the way I wanted.

But when the access denied page appears, at the bottom, my right block shows up, and with different background and font style.


thank you



Back to top Reply with quote
#8   
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 20 year's 20 Year Member
usa.gif illinois.gif
Age: 61
Gender: Male
Website:
Status: Offline
Joined: Mar 17, 2004
0.06 posts per day
Posts: 426
Points: 15,917
   
Just a thought. Why not add the points and posts access to the CZModules? It sure would be a handy addon.




_________________
[ Register or login to view links on this board.]
Vivere disce, cogita mori
Back to top Reply with quote
#9   
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 
Sounds like a good idea. That's Telli's baby, so that's his call.




_________________
"The pursuit of easy things makes men weak."
-David O. McKay
Back to top Reply with quote
#10   re: Restrict Module access by User Level and/or Forum Posts
zerocool
CZ Super Newbie
zerocool has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Mar 04, 2006
0.01 posts per day
Posts: 40
Points: 495
   
Any Ideas how to fix this.

When the access denied page appears, at the bottom, my right block shows up, and with different background and font style.

thank you



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