Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Resizing images in posts
 New Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

KC
Junior Member

USA
152 Posts

Posted - 20 December 2014 :  11:33:14  Show Profile  Visit KC's Homepage  Reply with Quote
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

Posted - 20 December 2014 :  16:23:16  Show Profile  Visit HuwR's Homepage
inc_func_common.asp

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 20 December 2014 :  17:49:55  Show Profile  Visit Webbo's Homepage
There is a mod out there already that does this - check SnitzBitz
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 20 December 2014 :  21:37:34  Show Profile  Visit bobby131313's Homepage
http://www.snitzbitz.com/mods/details.asp?Version=All&mid=137

Switch the order of your title tags
Go to Top of Page

KC
Junior Member

USA
152 Posts

Posted - 21 December 2014 :  11:54:47  Show Profile  Visit KC's Homepage
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
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 22 December 2014 :  04:21:53  Show Profile
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"">"
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 22 December 2014 :  10:35:48  Show Profile  Visit bobby131313's Homepage
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
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 December 2014 :  11:13:53  Show Profile  Visit HuwR's Homepage
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
Go to Top of Page

KC
Junior Member

USA
152 Posts

Posted - 22 December 2014 :  12:02:14  Show Profile  Visit KC's Homepage
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.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 December 2014 :  12:07:41  Show Profile  Visit HuwR's Homepage
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
Go to Top of Page

KC
Junior Member

USA
152 Posts

Posted - 23 December 2014 :  09:34:49  Show Profile  Visit KC's Homepage
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.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 December 2014 :  09:56:34  Show Profile  Visit HuwR's Homepage
KC,
I'll dig out some code for you later, I have some buried somewhere in one of my forum implementations

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 December 2014 :  10:00:02  Show Profile  Visit HuwR's Homepage
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
Go to Top of Page

KC
Junior Member

USA
152 Posts

Posted - 23 December 2014 :  11:00:38  Show Profile  Visit KC's Homepage
Thanks as I have to deal with large images all the time.
I suppose it would'nt hurt to implement it here either as the images I posted here destroyed the topic.
http://forum.snitz.com/forum/topic.asp?whichpage=-1&TOPIC_ID=70857&REPLY_ID=404237

I don't mind smaller images being enlarged, a click would set them back to original size.

Owner of vales.com and Elite Computers.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 December 2014 :  11:15:22  Show Profile  Visit HuwR's Homepage
On the .Net forum, images in posts are styled using
style="width: auto !important; max-width: 99% !important;"

This ensures they don't break your page width if too wide, and will also scale if someone reduces the width of their browser, see this topic for example http://snitz.reddiweb.com/Content/Forums/topic.aspx?TOPIC=70532

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 23 December 2014 :  17:07:46  Show Profile  Visit HuwR's Homepage
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
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07