Author |
Topic  |
|
Chuck McB
Junior Member
 
WooYay
196 Posts |
Posted - 05 June 2001 : 19:53:09
|
Hi
Any pointers on the code change needed to restrict moderators to just adding polls to their own forums?
Using poll code last modified - May 26, 2001
TIA
Chuck
--- DNA.styx DNA Games |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 06 June 2001 : 01:01:47
|
in topic.asp change this:
<% ' ################ Poll Mod ###################
if (strUserPolls = "1") and (mlev = 4 or mlev = 3) then %> <a href="post.asp?poll=1&method=Topic&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>"><img src="pin.gif" alt="Add Poll" border=0></a> <a href="post.asp?poll=1&method=Topic&FORUM_ID=<% =Request.QueryString("FORUM_ID") %>&CAT_ID=<% =Request.QueryString("CAT_ID") %>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>">new poll</a><br> <% end if ' ############################################
and in forum.asp change this:
<% ' #################### Poll Mod ##################### if (strUserPolls = "1") and (mlev = 4 or mlev = 3) then %> <a href="post.asp?poll=1&method=Topic&FORUM_ID=<% =Request.QueryString("FORUM_ID")%>&CAT_ID=<% =Request.QueryString("CAT_ID")%>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>"><img src="pin.gif" alt="Add Poll" border=0></a> <a href="post.asp?poll=1&method=Topic&FORUM_ID=<% =Request.QueryString("FORUM_ID")%>&CAT_ID=<% =Request.QueryString("CAT_ID")%>&Forum_Title=<% =ChkString(Request.QueryString("FORUM_Title"),"urlpath") %>">new poll</a> <% end if ' ###################################################
the boolean OR should be AND
Dayve |
 |
|
Chuck McB
Junior Member
 
WooYay
196 Posts |
Posted - 06 June 2001 : 10:17:00
|
that would seems to mean that anyone can now post polls?
Chuck
--- DNA.styx DNA Games |
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 06 June 2001 : 10:26:53
|
nope, incorrect statement... read the logic...
if (strUserPolls = "1") and (mlev = 4 or mlev = 3) then %>
means, if poll feature is ON and the user is a moderator or admin then display the option for creating polls. this means the poll feature has to be on AND the user must be an admin or moderator. now look at this logic...
if (strUserPolls = "1") or (mlev = 4 or mlev = 3) then %>
means, if poll feature is ON then disply option for creating polls or if user is moderator or admin display option for creating polls. this allows EVERYONE to create polls...
Dayve
Edited by - dayve on 06 June 2001 10:28:24 |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 06 June 2001 : 11:01:32
|
Yep. That's correct. Good going Dayve. 
|
 |
|
Chuck McB
Junior Member
 
WooYay
196 Posts |
Posted - 06 June 2001 : 12:15:07
|
Yup, with you on the logic 
...but #1 When I made the changes anyone logged in can make polls....
...but #2 if I change
if (strUserPolls = "1") and (mlev = 4 or mlev = 3) then %> to
if (strUserPolls = "1") and (AdminAllowed = 1) then %>
This only allows the Moderator of that forum to add new polls....
Chuck
--- DNA.styx DNA Games |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 06 June 2001 : 13:03:52
|
Ahh. Yes, the AdminAllowed variable should be used instead of the mLev. Because it checks the mLev at the begining of the file and stores that in the AdminAllowed variable.
Don't know why the mLev didn't work. But I will need to change that in files. Make sure you make the same changes in the forum.asp file.
|
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 06 June 2001 : 16:24:45
|
I didn't know you wanted to restrict moderators to creating polls in their own section so that is a better edit. As for this:
quote:
but #1 When I made the changes anyone logged in can make polls
I don't see how that could happen. if (strUserPolls = "1") and (mlev = 4 or mlev = 3) then %> will only allow moderators and admins to create polls in ALL categories. I tested this and you should NOT see the link for New Poll for regular members. Am I misunderstanding what you are saying?
Dayve
Edited by - dayve on 06 June 2001 16:26:21 |
 |
|
Chuck McB
Junior Member
 
WooYay
196 Posts |
Posted - 07 June 2001 : 15:56:18
|
quote: I don't see how that could happen.
Yup, sorry it didn't happen I tried it again now, worked fine....must have had finger trouble the other day.
Thanks guys.
Chuck
--- DNA.styx DNA Games |
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 07 June 2001 : 19:51:13
|
quote:
quote: I don't see how that could happen.
Yup, sorry it didn't happen I tried it again now, worked fine....must have had finger trouble the other day.
Thanks guys.
Chuck
--- DNA.styx DNA Games
...placing the prozac back in the medicine cabinet...
cool...
Dayve |
 |
|
Chuck McB
Junior Member
 
WooYay
196 Posts |
Posted - 08 June 2001 : 15:55:46
|
quote: ...placing the prozac back in the medicine cabinet...
;)
Now if only I could figure out why when I post a topic:
quote:
Posted - 08 Jun 2001 : 20:54:50 test
Chuck HL Admin Mod Player Manager
and then lock it I get the poll apearing then there...
quote: Posted - 08 Jun 2001 : 20:54:50
test
Chuck HL Admin Mod Player Manager Poll Question: test
Chuck HL Admin Mod Player Manager Results:
Total of 1 votes counted so far
LINK <-- Dead link - Problem was solved.
/me wonders how hard it is to copy/paste :)
Chuck
--- DNA.styx DNA Games
Edited by - chuck mcb on 09 June 2001 05:23:55 |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 08 June 2001 : 16:05:34
|
Aaaaaaah!!! Bug bug bug!!!!! Somebody get the bug spray, quick!!!
Chuck you must keep a messy forum, why the bugs crawl around in there. hehe 
It's a bug chuck. I'll check it why it's doing that. 
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 08 June 2001 : 19:07:04
|
Chuck, if you send me your topic.asp file, I will fix that for you.
|
 |
|
Chuck McB
Junior Member
 
WooYay
196 Posts |
Posted - 09 June 2001 : 05:20:18
|
Workin' fine.
Cheers Davio.
Chuck
--- DNA.styx DNA Games |
 |
|
|
Topic  |
|