Author |
Topic |
leatherlips
Senior Member
USA
1838 Posts |
Posted - 24 October 2005 : 21:35:37
|
With my other post on how to only allow moderators and admins to use the reply with quote function, I was wondering if I could do the same with images. The reply with quote alteration was pretty simple, would it be just as simple with the images?
I'd like to only allow moderators and admins to be able to post images. However, I can't find where this code is. It doesn't seem to appear in the topic.asp file. Where would I look?
Would it be as simple as adding the parts below in green around the correct section of code?
If mlev >= 3 then Section of code here End If
Thanks.
< Moved to MOD Add-On Forum (W/O Code) by Shaggy />< |
Mangione Magic Forum - The Music of Chuck Mangione
My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD |
Edited by - Shaggy on 02 November 2005 05:49:05 |
|
weeweeslap
Senior Member
USA
1077 Posts |
Posted - 25 October 2005 : 02:23:29
|
I am assuming the ability to use
[ img] [/img ]
hmm if so I'll see if I can look through the files and see what I can come up with.< |
coaster crazy |
Edited by - weeweeslap on 25 October 2005 02:23:54 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
leatherlips
Senior Member
USA
1838 Posts |
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 01 November 2005 : 13:46:22
|
I know I know where to put the check, but I've been having some "memory issues" of the sort that an extra stick of RAM can't help.... Lemme dig through the code and see what I can come up with.< |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 01 November 2005 : 14:06:30
|
Around line 1165 in inc_func_common.asp is a function called 'ReplaceImageTags(fString)'. If I'm reading this right, this is the function that replaces [img] with the image.
You could probably add an If mLev > 3 Then .. to the end so that if they can post images, it returns the properly formatted string, and if not it returns the original string.
Its a start...< |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 02 November 2005 : 05:48:09
|
That wouldn't work as ReplaceImageTags() is called by the FormatStr() function which a post is passed through when it is pulled from the database, not inserted. Using the above method would mean that only moderators and admins would see images posted by any member of your forums.
< |
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.” |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 02 November 2005 : 09:18:12
|
Ah. Where would it go then?< |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 02 November 2005 : 09:28:44
|
It'd be tricky, you'd have to pass the member level of the poster down through FormatStr() to ReplaceImageTags().
< |
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.” |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 02 November 2005 : 09:32:36
|
Hmm... I'll look at it as I wait for the class to finish ...< |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 02 November 2005 : 10:26:19
|
Actually, you'd only need to pass it through to FormatStr and then use it to check whether or not to call ReplaceImageTags. Problem is, FormatStr is used elsewhere besides topic.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.” |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 02 November 2005 : 11:09:01
|
Ah. I wonder if it would be worth adding a boolean field for allowing images... that way you could be more particular in where images are allowed and where they are not... or do you think it would be more work than it would be worth?< |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 02 November 2005 : 12:35:54
|
I wouldn't say there's a need for a field (I assume you mean database field), Anon, unless you want to make it an admin option. Although, you could use an additional boolean argument when calling the FormatStr function which would specify whether or not to call ReplaceImageTags. Would be easier, in the long run, than passing M_LEVEL.
Other files where FormatStr is used, off the top of my head: pop_preview, pop_previe_sig, pop_profile, default, default_group, pop_printer_friendly.
< |
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.” |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 02 November 2005 : 13:25:38
|
I was thinking more along the lines of an extra argument passed along in the call...
FormatStr([...normalArgs...],blnAllowImages)
And then check if blnAllowImages is true or not to allow images. It would be more work up front, but it would ultimately make the function more flexible by giving more control over where images are allowed and where they aren't.< |
Edited by - AnonJr on 02 November 2005 13:26:17 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 03 November 2005 : 05:30:22
|
We're thinking the same thing, dude
< |
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 |
|