Author |
Topic  |
PackYakcouk
New Member

United Kingdom
59 Posts |
Posted - 01 January 2009 : 14:33:17
|
Ok so i have enabled images, everytime i try to reply or start a topic i get the following error:
Microsoft VBScript compilation error '800a03f4'
Expected 'If'
/forum/inc_func_posting.asp, line 397
end function ----^
Here is my current code
if strAllowForumCode = "1" then
if mLev > 2 then
if strIMGInPosts = "1" then
fString = replace(fString, "<img src=""","", 1, -1, 1)
fString = replace(fString, """ id=right border=0>","[/img=right]", 1, -1, 1)
fString = replace(fString, """ id=left border=0>","[/img=left]", 1, -1, 1)
'##
fString = replace(fString, "<img align=""right"" src=""","[img=right]", 1, -1, 1)
fString = replace(fString, "<img align=""left"" src=""","[img=left]", 1, -1, 1)
fString = replace(fString, """ border=""0"">","", 1, -1, 1)
fString = replace(fString, """ id=""right"" border=""0"">","[/img=right]", 1, -1, 1)
fString = replace(fString, """ id=""left"" border=""0"">","[/img=left]", 1, -1, 1)
end if
end if
end if
fString = Replace(fString, "'", "'")
CleanCode = fString
end function
%> < |
Edited by - PackYakcouk on 01 January 2009 14:39:28 |
 |
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
Posted - 01 January 2009 : 16:33:20
|
looks leik u need at add another end if.
so inbetween these lines
end if
fString = Replace(fString, "'", "'")
add end if so it looks liek this
end if
end if
fString = Replace(fString, "'", "'")
< |
© 1999-2010 MaD2ko0l |
 |
|
PackYakcouk
New Member

United Kingdom
59 Posts |
Posted - 01 January 2009 : 16:54:55
|
Thanks MaD2ko0l, i have added that and there is now no error message but it is still alowing normal members to insert images.
I have "Allow Images in posts" turned on in admin options.
This is my current code
if strAllowForumCode = "1" then
if mLev > 2 then
if strIMGInPosts = "1" then
fString = replace(fString, "<img src="""," ", 1, -1, 1)
fString = replace(fString, """ id=right border=0>","[/img=right]", 1, -1, 1)
fString = replace(fString, """ id=left border=0>","[/img=left]", 1, -1, 1)
'##
fString = replace(fString, "<img align=""right"" src=""","[img=right]", 1, -1, 1)
fString = replace(fString, "<img align=""left"" src=""","[img=left]", 1, -1, 1)
fString = replace(fString, """ border=""0"">","", 1, -1, 1)
fString = replace(fString, """ id=""right"" border=""0"">","[/img=right]", 1, -1, 1)
fString = replace(fString, """ id=""left"" border=""0"">","[/img=left]", 1, -1, 1)
end if
end if
end if
end if
fString = Replace(fString, "'", "'")
CleanCode = fString
end function
%>
I hope some one can help, we seem to be getting some where!< |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 01 January 2009 : 17:15:19
|
OK - there's another bit in "inc_func_common.asp" that needs to be modified. Look for the following (appx lines 128-130): Change that to read:< |
 |
|
PackYakcouk
New Member

United Kingdom
59 Posts |
Posted - 01 January 2009 : 17:25:02
|
Carefree, that has worked somewhat, i can now insert and see images in posts as an admin/mod.
The only problem is they dont show up in posts for normal members they just show up as text links.
I need the normal members to see the image but not be able to post them themselves.
Were getting so close im excited lol < |
Edited by - PackYakcouk on 01 January 2009 17:27:12 |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 01 January 2009 : 17:50:10
|
OK - let's eliminate the image button in the post form, while we're at it.
In "inc_post_buttons.asp", look for the following (appx 61-63)
Replace it with
Now, let's change that "inc_func_common.asp" routine. Instead of this:
Since the RqMethod wasn't being kept, we'll change the variable. Make it say this:
Now, we have to grab the value of the method before it disappears. Search for this line (appx line 287):
Immediately after it, add the following:
Also, I added the strMType variable to "config.asp". Look for this line (appx 123):
After that, add the following:
Now, that SHOULD work .... but I must be missing something obvious. This does keep the value of the MType variable and read it before processing the image tags ... but it processes them anyhow.< |
Edited by - Carefree on 02 January 2009 20:42:40 |
 |
|
PackYakcouk
New Member

United Kingdom
59 Posts |
Posted - 01 January 2009 : 18:18:22
|
Wow so ok that is amazing! ur a star!
Ok admins/mods can see and post images, members can see but not post images...
unless they know the [ img ][ /img ] tags. (I dont know if snitz image tags are universal on all forums?)
Im probably pushing my luck now but is there a way to stop members using them if they know them, maby changing the tags to something random eg:
So you used to use [ img ][ /img ] to insert an image. now [ 5658 ][ /5658 ] will insert an image.
Thanks for all this help by the way!< |
Edited by - PackYakcouk on 01 January 2009 18:18:42 |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 01 January 2009 : 19:32:41
|
Even if they know the tags, they shouldn't be able to post them.< |
 |
|
PackYakcouk
New Member

United Kingdom
59 Posts |
Posted - 01 January 2009 : 19:38:41
|
Ive got a test "Normal Member" and it can still post images using the [ img ][ /img ] tags.
The "insert image" button does not show up when posting a new topic/post for "Normal Members" but if they know the tags they can post images and they do show up to all users.
< |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 02 January 2009 : 20:57:38
|
I packaged this on SnitzBitz with the latest changes. If anyone can spot what I missed, I'd be greatful.< |
 |
|
HuwR
Forum Admin
    
United Kingdom
20595 Posts |
Posted - 03 January 2009 : 04:29:43
|
from a quick glance, this is what I think would happen after making those changes.
Anyone could post an image in a topic/reply regardless of whether they are admin or not (if they guess the tag, infact they don't even need to guess it, simply quoting your message should give them the tag ) this is because tags are replaced at the time of viewing not posting.
as has been noted previously, if you prevent users posting images you must also prevent people from quoting your messages or you need to process the message and parse the img tags prior to storing it in the post in the database < |
 |
|
PackYakcouk
New Member

United Kingdom
59 Posts |
Posted - 03 January 2009 : 04:36:08
|
Ok so can any of this be done?
Or am i hitting my head agains a wall? < |
 |
|
HuwR
Forum Admin
    
United Kingdom
20595 Posts |
Posted - 03 January 2009 : 04:39:57
|
yes it can be done, but it is a lot of effort for something that you could control fairly easily by just imposing a no image policy and then enforcing it by removing images and warning people who post them.
so, just remove the img button from post.asp, change the img tags default name and then strictly enforce a no img policy against members who try to bypass the changes.< |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 03 January 2009 : 11:02:20
|
quote: Originally posted by Carefree
I packaged this on SnitzBitz with the latest changes. If anyone can spot what I missed, I'd be greatful.
Carefree,
Maybe the problem is with the approach you took, no? It really doesn't matter what you do while posting, since the tags are not changed when posting, but it does matter when viewing the topics, so what you need to do is make sure the tags are not interpreted when the author of the post being shown is not an admin, right?
This means that the check must be done for each post while the post is being viewed and only posts from an admin can have the image tags converted.< |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 03 January 2009 : 13:36:05
|
Let me take a look at it from that direction, then. Thanks< |
 |
|
Topic  |
|
|
|