Author |
Topic |
KC
Junior Member
USA
152 Posts |
Posted - 20 December 2014 : 11:33:14
|
Can someone tell me the name of the file that does conversion of forum code to HTML?
I want to change the <IMG></IMG> code from just displaying the pic to:
[a Href=" *pic file URL* "] [IMG Src=" *pic file URL* " Width="750"] [/a]
I think 750 pixels is ideal for most peoples forum display and a click will show the pic in it's original size.
That should keep a huge pic from destroying a topic.
|
Owner of vales.com and Elite Computers. |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 20 December 2014 : 17:49:55
|
There is a mod out there already that does this - check SnitzBitz |
|
|
bobby131313
Senior Member
USA
1163 Posts |
|
KC
Junior Member
USA
152 Posts |
Posted - 21 December 2014 : 11:54:47
|
I finally found the page. inc_func_posting.asp
Thanks for the tip but I don't want to dink with JS or messing up other page functions.
I just want to edit the IMG tag to do it, and this is where the code is, just below where the Forum Code is for converting smiley text into imags.
fString = replace(fString, "<img src=icon_smile_dissapprove.gif border=0 align=middle>", "", 1, -1, 1)
fString = replace(fString, "<img src=icon_smile_kisses.gif border=0 align=middle>", "", 1, -1, 1)
fString = replace(fString, "<img src=icon_smile_kisses.gif border=0 align=middle>", "", 1, -1, 1)
'##
end if
if strAllowForumCode = "1" then
if strIMGInPosts = "1" then
fString = replace(fString, "<img src=""","", 1, -1, 1)
' --- KC MOD TO SIZE PICS TO 750 WITH ORIGINALS AS A CLICK ---
' something like this itdon't work.
'fString = replace(fString, "<a href=" """><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
Seems to me that whole chunk of code (under the smiles for reference) can be replaced with a simple line or two to pluck the with something simple like <a href="http:// to pic"><img src="http:// to pic" width="750"></a></code>
Now I just can't figure out how to take whats between the IMG tags, get ride of them, and use my new line.
|
Owner of vales.com and Elite Computers. |
Edited by - KC on 21 December 2014 11:58:14 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 22 December 2014 : 04:21:53
|
Wrong file, KD. HuwR is correct, it must be done in "inc_func_common.asp". Look for the function titled ReplaceImageTags(fString). Within it, look for these lines:
ImgTags(1,2,2) = """ border=""0"">"
ImgTags(3,2,2) = """ id=""right"" border=""0"">"
ImgTags(5,2,2) = """ id=""left"" border=""0"">"
Change each of them by adding width=""750"" just before the closing greater-than sign, like this:
ImgTags(1,2,2) = """ border=""0"" width=""750"">"
ImgTags(3,2,2) = """ id=""right"" border=""0"" width=""750"">"
ImgTags(5,2,2) = """ id=""left"" border=""0"" width=""750"">"
|
|
|
bobby131313
Senior Member
USA
1163 Posts |
Posted - 22 December 2014 : 10:35:48
|
I *think* there's code in inc_func_posting.asp you have to change also so it changes back if the post is edited. |
Switch the order of your title tags |
Edited by - bobby131313 on 22 December 2014 10:36:39 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 22 December 2014 : 11:13:53
|
yes, you will need to edit inc_func_posting look for the following
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"">","[/img]", 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)
change it to
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"" width=""750"">","[/img]", 1, -1, 1)
fString = replace(fString, """ id=""right"" border=""0"" width=""750"">","[/img=right]", 1, -1, 1)
fString = replace(fString, """ id=""left"" border=""0"" width=""750"">","[/img=left]", 1, -1, 1)
|
MVC .net dev/test site | MVC .net running on Raspberry Pi |
|
|
KC
Junior Member
USA
152 Posts |
Posted - 22 December 2014 : 12:02:14
|
That will re-size all images to 750, but it doesn't make them clickable for the original picture file in a new browser tab.
|
Owner of vales.com and Elite Computers. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 22 December 2014 : 12:07:41
|
you would need to wrap the image tags in a corresponding url tag for that, there are examples on the FAQ on how to make an image clickable, will dig out some sample code when I get home |
MVC .net dev/test site | MVC .net running on Raspberry Pi |
|
|
KC
Junior Member
USA
152 Posts |
Posted - 23 December 2014 : 09:34:49
|
quote: Originally posted by HuwR
you would need to wrap the image tags in a corresponding url tag for that
I know.
<a href="http://kcsbikes.com/bpics/2_Surley2SmuleR-2048.jpg"><imd src="http://kcsbikes.com/bpics/2_Surley2SmuleR-2048.jpg" width="750"></a>
I just want the forum to that on it's on with the simple IMG /IMG tages.
quote: there are examples on the FAQ on how to make an image clickable, will dig out some sample code when I get home
Thanks HuwR!
|
Owner of vales.com and Elite Computers. |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 23 December 2014 : 10:00:02
|
quote: [a Href=" *pic file URL* "] [IMG Src=" *pic file URL* " Width="750"] [/a]
I think 750 pixels is ideal for most peoples forum display and a click will show the pic in it's original size.
That should keep a huge pic from destroying a topic.
It would also enlarge small images so they are also 750px wide I would suggest rather than adding a width to the image tag, add a class, that way you can set a max-width so smaller images won't get enlarged |
MVC .net dev/test site | MVC .net running on Raspberry Pi |
|
|
KC
Junior Member
USA
152 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 23 December 2014 : 17:07:46
|
KC
Without using the javascript client based MOD that is on SnitzBitz, what you want to achieve would be very difficult because of the order in which tags are parsed by the forum code. |
MVC .net dev/test site | MVC .net running on Raspberry Pi |
|
|
Topic |
|
|
|