Home :: Forums :: Register :: Sign In :: Links :: Downloads :: Shop
You are not signed in. Please sign in. If you have not registered, please click here.

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   More...
#1Sat Jul 22, 2006 4:59 pm   re: Restrict Module access by User Level and/or Forum Posts
zerocool
CZ Super Newbie
zerocool has been a member for over 2 year's 2 Year Member
Status: Offline
Joined: Mar 04, 2006
0.04 posts per day
Posts: 36
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
#2Mon Jul 24, 2006 5:58 pm   
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 4 year's 4 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 31
Fav. Sports Team: Da Bears.
Website: www.GuitarVoice.com
Status: Offline
Joined: Jul 01, 2004
0.18 posts per day
Posts: 289
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
#3Mon Jul 24, 2006 6:45 pm   
Telli
Site Admin
Telli has been a member for over 5 year's 5 Year Member
usa.gif florida.gif
Occupation: Self Employed
Age: 37
Fav. Sports Team: Detroit Red Wings
Website: www.codezhost.com
Status: Offline
Joined: May 26, 2003
3.91 posts per day
Posts: 7841
Points: 492,205
   
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: 5076 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
#4Mon Jul 24, 2006 7:07 pm   
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 4 year's 4 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 31
Fav. Sports Team: Da Bears.
Website: www.GuitarVoice.com
Status: Offline
Joined: Jul 01, 2004
0.18 posts per day
Posts: 289
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
#5Mon Jul 24, 2006 8:20 pm   
Telli
Site Admin
Telli has been a member for over 5 year's 5 Year Member
usa.gif florida.gif
Occupation: Self Employed
Age: 37
Fav. Sports Team: Detroit Red Wings
Website: www.codezhost.com
Status: Offline
Joined: May 26, 2003
3.91 posts per day
Posts: 7841
Points: 492,205
   
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
#6Mon Jul 24, 2006 8:26 pm   
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 4 year's 4 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 31
Fav. Sports Team: Da Bears.
Website: www.GuitarVoice.com
Status: Offline
Joined: Jul 01, 2004
0.18 posts per day
Posts: 289
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
#7Sun Jul 30, 2006 12:30 pm   re: Restrict Module access by User Level and/or Forum Posts
zerocool
CZ Super Newbie
zerocool has been a member for over 2 year's 2 Year Member
Status: Offline
Joined: Mar 04, 2006
0.04 posts per day
Posts: 36
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
#8Mon Jul 31, 2006 11:28 am   
Dauthus
CZ Addict
 Codezwiz Site Donator
Dauthus has been a member for over 4 year's 4 Year Member
usa.gif illinois.gif
Age: 45
Website: www.bootleghollow.com
Status: Offline
Joined: Mar 17, 2004
0.25 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
#9Mon Jul 31, 2006 1:24 pm   
mjhufford
CZ Active Member
 Codezwiz Site Donator
mjhufford has been a member for over 4 year's 4 Year Member
usa.gif arkansas.gif
Occupation: IT Industry
Age: 31
Fav. Sports Team: Da Bears.
Website: www.GuitarVoice.com
Status: Offline
Joined: Jul 01, 2004
0.18 posts per day
Posts: 289
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
#10Wed Aug 02, 2006 12:08 pm   re: Restrict Module access by User Level and/or Forum Posts
zerocool
CZ Super Newbie
zerocool has been a member for over 2 year's 2 Year Member
Status: Offline
Joined: Mar 04, 2006
0.04 posts per day
Posts: 36
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   More...
<< 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