Author |
Topic |
VodkaFish
Average Member
USA
654 Posts |
Posted - 04 September 2003 : 00:51:21
|
html and images are turned off on my forums, but I want myself and my mods to be able to use them. I've hacked my forum to allow this, but realized I was just going about it the wrong way.
I simply want to add
if mLev = 4 or mLev = 3 then
strIMGInPosts = "1"
end if
Where's the best place for this? On the top in inc_func_common.asp? |
v ø d k â f ï § h |
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 04 September 2003 : 01:49:40
|
I usually just chuck it into inc_header.asp or config.asp personally |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 04 September 2003 : 10:27:34
|
config.asp is where the application variable is set for this so that is where I personally would start. |
|
|
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 04 September 2003 : 10:47:27
|
Cool - but is mlev set there? If not, it might cause an error somewhere else.
What I decided I'm going to do tonight is make a field in the members table and read from there, and just give members access manually (some non-mods should get it); but that might take me some time to interface, so for now I'll just chuck this line in.
Oh - and IMO something like this, although another trigger in the asp, is extremely useful rather then a global on or off. I think something should be built in: Overall no images Only admin can post images Only admins and mods Only members with #posts + W/manual override (and also do this with html)
Yes, another set of options, but one I think would be very valued. Not too much for the if thens, and I doubt it would add much time at all since whatever variable we're calling can just be included in a sql statement already present. Just my 2c for whoever's listening. |
v ø d k â f ï § h |
Edited by - VodkaFish on 04 September 2003 10:52:23 |
|
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 04 September 2003 : 15:39:36
|
Actually, putting this in config or (the top of) inc_func_common yields no results, probably because it's before mlev is defined. If I put this in inc_header, it let's me post fine, and I can see the image fine - however I'm the only one!
Suggestions? |
v ø d k â f ï § h |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 05 September 2003 : 05:32:16
|
Yeah sorry, the couple of times I've put it in config.asp I've done an IP based check (I have a static IP at home so do a lot of my conditional code based on my IP so that other admins don't get the same "special features" that I do :), if i want all my admins to have the feature then it normally goes into inc_header.asp with an Mlev check. |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 05 September 2003 : 08:38:30
|
Yes, but when I put it in inc_header.asp I wind up being the only one to see the image. Everyone else just sees the code. Is it positioning inside it? |
v ø d k â f ï § h |
Edited by - VodkaFish on 05 September 2003 08:39:09 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 05 September 2003 : 10:02:31
|
Probably a stupid question but are you using the board tag or the HTML tag for the images? If you're using the [img] tag then the images won't show to non-admins/mods becuase of the check for strIMGInPosts being 1 in the FormatStr function of inc_func_common.asp.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
VodkaFish
Average Member
USA
654 Posts |
Posted - 05 September 2003 : 14:58:29
|
Yeah, I saw that afterwards :/
I was testing with the [img] tag - because my mods won't have html access, only [img] rights (and inevitably more members on the site), but most still won't. I guess I'll have to turn it on overall, and then disallow it only in the code posting? |
v ø d k â f ï § h |
|
|
jfitz
Junior Member
USA
345 Posts |
Posted - 09 September 2003 : 23:05:24
|
VodkaFish
I've been puzzling over the same thing (I think) - how to allow only Admins and Moderators to post images and html, yet allow all viewers to see the result.
Have you had any luck so far? |
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 10 September 2003 : 05:22:21
|
How to get this to work:
1) Turn board code & images on and turn HTML off.
2) After the mlev variable is created, turn HTML on for admins.
3) In post_info.asp you'll need to strip out the [img] tags in the message if mlev < 3
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
jfitz
Junior Member
USA
345 Posts |
Posted - 10 September 2003 : 10:52:46
|
Thanks, MeTV. I'll give it a try. |
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 10 September 2003 : 11:10:52
|
You're welcome, Jfitz, let me know how you get on.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
jfitz
Junior Member
USA
345 Posts |
Posted - 11 September 2003 : 12:44:16
|
I think the actual code (function CleanCode) is in inc_func_posting.asp, and it's called from post.asp
What I want to do is allow the IMG tag for users with three or more stars, so what I think I need to do is to pick up the number of posts along with the member level whenever the MEMBERS table is checked, and then compute the star level, and pass that on to the CleanCode routine.
Does that sound about right? |
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
|
|
jfitz
Junior Member
USA
345 Posts |
Posted - 13 September 2003 : 22:23:21
|
Well, I got it pretty much to work the way I wanted it to. It was (for me, anyway) to difficult to strip out the [img] tags, but it was easy to change them to [xxx] tags. I was wrong about CleanCode - that's not the place to make the changes. MeTV had it right all along - thanks for the hints!!
My goal was to have images in posts available to everyone EXCEPT those with fewer than two stars. Because I already have the New User Moderation Mod, I have the numMPostCount variable already defined as part of every page, so I was able to use that to compare against intRankLevel2. If you just want to restrict images to moderators and admins, it's even easier because the mLev variable is already there.
Here's what I did (all changes made to POST_INFO.ASP):
Change (8 places)
txtMessage = ChkString(Request.Form("Message"),"message")
to
txtMessage = ConditionalImages(ChkString(Request.Form("Message"),"message"))
Add code for the new function, ConditionalImages. I placed it right after this line:
Response.End
function ConditionalImages (mstring)
if (cint(numMPostCount) < cint(intRankLevel2)) then
mString = replace(mstring, "[img", "[xxx",1, -1, 1)
mString = replace(mstring, "img]", "xxx]",1, -1, 1)
end if
ConditionalImages = mstring
end function
You can change the if condition to something else to alter the behaviour of the function.
There are a couple of interesting behavioral characteristics of this approach -
1. an image defined with [img] tags will still appear in Preview, prior to posting, but it will be changed into [xxx] tags after posting
2. any [img] tags present in a reply with quote will be changed to [xxx] in the quotation, so they cannot be displayed after posting.
Actually I like this behavior, as it prevents a new member from changing an existing image into something undesirable. Once a member has two stars, we figure they aren't likely to post objectionable material, which is the reason for the restriction in the first place (in addition, it provides another "member benefit" for reaching two stars).
|
--Jördan It's a wasted day if you don't spend at least part of it flying upside down. |
Edited by - jfitz on 13 September 2003 22:26:59 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 15 September 2003 : 08:11:37
|
Nice workaround there, Jfitz. Although, to keep posts cleaner and not have [xxx]s turning up all over the place you might want to edit the ConditionalImages function so the replace functions look like this:
mString = replace(mstring, "[img]", "",1, -1, 1) mString = replace(mstring, "[/img]", "",1, -1, 1) mString = replace(mstring, "[image]", "",1, -1, 1) mString = replace(mstring, "[/image]", "",1, -1, 1) mString = replace(mstring, "[img=right]", "",1, -1, 1) mString = replace(mstring, "[/img=right]", "",1, -1, 1) mString = replace(mstring, "[image=right]", "",1, -1, 1) mString = replace(mstring, "[/image=right]", "",1, -1, 1) mString = replace(mstring, "[img=left]", "",1, -1, 1) mString = replace(mstring, "[/img=left]", "",1, -1, 1) mString = replace(mstring, "[image=left]", "",1, -1, 1) mString = replace(mstring, "[/image=left]", "",1, -1, 1)
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
|
|
Topic |
|
|
|