The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
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 /><
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 /><
Last edited by Shaggy on 02 November 2005, 05:49
Posted
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?<
Posted
I enjoy reading through your posts Shaggy and AnonJr, but my head is spinning....boolean, FormatStr()to ReplaceImageTags()...I have no idea what you guys are talking about.
I'm glad you guys know what you are doing!
The reason I would like to get this to work is because my forum is being used for a middle school. The teachers are the mods. I'd like to be able to allow the teachers to post images that may be used for examples for the questions they are discussing. I just don't want the middle school students (normal users) to be able to post...you never know what they'll put up.
<
I'm glad you guys know what you are doing!
The reason I would like to get this to work is because my forum is being used for a middle school. The teachers are the mods. I'd like to be able to allow the teachers to post images that may be used for examples for the questions they are discussing. I just don't want the middle school students (normal users) to be able to post...you never know what they'll put up.
Posted
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.”
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 thefact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
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.<
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.<
Last edited by AnonJr on 02 November 2005, 13:26
Posted
Great minds and all that
let me get some coffee and see what can be put together...<
Posted
I've not had a chance to test this, but I think this will give you what you want:
Change in inc_func_common.asp:
On (or about) Line 114 change:
to:
On (or about) Line 126 change:
to:
You will need to find all instances where FormatStr is called and add either True or False depending on if you want images or not.
For instance, in topic.asp around line 663 you will need to change
to
Let me know how it goes. (or if I goofed
)<
Change in inc_func_common.asp:
On (or about) Line 114 change:
Code:
function FormatStr(fString)Code:
function FormatStr(fString, bAllowImages)On (or about) Line 126 change:
Code:
if strIMGInPosts = "1" thenCode:
if strIMGInPosts = "1" And bAllowImages thenYou will need to find all instances where FormatStr is called and add either True or False depending on if you want images or not.
For instance, in topic.asp around line 663 you will need to change
Code:
if qsSearchTerms <> "" then
Response.Write SearchHiLite(formatStr(Reply_Content))
else
Response.Write formatStr(Reply_Content)
end ifCode:
if qsSearchTerms <> "" then
If mLev >= 3 Then
Response.Write SearchHiLite(formatStr(Reply_Content,True))
Else
Response.Write SearchHiLite(formatStr(Reply_Content,False))
End If
else
If mLev >= 3 Then
Response.Write formatStr(Reply_Content,True)
Else
Response.Write formatStr(Reply_Content,False)
End If
end ifLet me know how it goes. (or if I goofed
Last edited by AnonJr on 03 November 2005, 10:21
Posted
And don't forget the other files I mentioned above, as well. If you don't amend all occurences of FormatStr in your files, you're going to get some errors.
<
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.”
<
Search is your friend
“I was having a mildly paranoid day, mostly due to thefact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Now that I think about it, I believe that there is a second place in topic.asp too....<
Posted
does anyone have this working?<
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...