Only Moderators & Admins to Post Images? - نوشته شده در (2090 Views)
Senior Member
leatherlips
مطلب: 1838
1838
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 /><
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Senior Member
weeweeslap
مطلب: 1077
1077
I am assuming the ability to use
Code:

[ img] [/img ]
hmm if so I'll see if I can look through the files and see what I can come up with.<
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
Which file contains the code to be able to post images? I've looked in post.asp but it isn't in there.<
نوشته شده در
Senior Member
leatherlips
مطلب: 1838
1838
I've tried just inserting the [ img] [/img ] tag around the URL of the picture, but it will not work unless pictures are enable for the site. Is it at all possible to not allow normal users to post but allow mods and admins?<
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
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.<
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
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...<
نوشته شده در
Support Moderator
Shaggy
مطلب: 6780
6780
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.”
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
Ah. Where would it go then?<
نوشته شده در
Support Moderator
Shaggy
مطلب: 6780
6780
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.”
نوشته شده در
Forum Moderator
AnonJr
مطلب: 5768
5768
Hmm... I'll look at it as I wait for the class to finish ...<
نوشته شده در
Support Moderator
Shaggy
مطلب: 6780
6780
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.”
شما باید یک متن وارد کنید