Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - file upload max width size how to??
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

file upload max width size how to??

 Post Reply Post Reply Page  <123>
Author
BrownGhost View Drop Down
Groupie
Groupie


Joined: 26 November 2002
Status: Offline
Points: 193
Post Options Post Options   Thanks (0) Thanks(0)   Quote BrownGhost Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 10:02am

show me in this how to make whith 400 pixels..

<script language="Javascript">
     function checkText()
     {
           if (document.images.length > 0)         &nbs p;//Has images, validate sizes
           {
                var imgHeight;
                var imgWidth;
                for (var loop = 0; loop < document.images.length; loop++)
                 {
                      if (document.images[loop].name.substring(0,6) == 'chkImg')
                      {
                           imgWidth = document.images[loop].width;
                           imgHeight = document.images[loop].height;
                           
                           if (imgWidth > <% = intAvatarWidth %>)
                           {
                                 document.images[loop].width = <% = intAvatarWidth %>;
                                 //Proportionalize Height
                                 imgHeight = imgHeight / (imgWidth/<% = intAvatarWidth %>);
                                 document.images[loop].height = imgHeight;
                            }
                      }
                }
           }
     }
</script>

Back to Top
BrownGhost View Drop Down
Groupie
Groupie


Joined: 26 November 2002
Status: Offline
Points: 193
Post Options Post Options   Thanks (0) Thanks(0)   Quote BrownGhost Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 10:10am

also her: and then go on functions_format_post.asp and make it add the following to the <img src tags when formatting [IMG] tags: id="chkImg1" name="chkImg2"

Please say line number: and show me code to insert.. compleat:

like replase the on line bla bla whit this: bla bla..

:) thx

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 1:49pm

On my last post I explained how to set the pixels, just replace the <% = intAvatarWidth %> (both of them) with the pixels you want.

I can't tell you the line # on the file cuz mines have been highly modified but look for a line like this:

strTempMessageLink = Replace(strTempMessageLink, "[/IMG]", """>", 1, -1, 1)

and change it to something like this:

strTempMessageLink = Replace(strTempMessageLink, "[/IMG]", """ id='chkImg1' name='chkImg2'>", 1, -1, 1)

also add this line to functions_edit_post.asp on about line 67:

strMessage = Replace(strMessage, " id='chkImg1' name='chkImg2'", "", 1, -1, 1)

That should do it.

Back to Top
BrownGhost View Drop Down
Groupie
Groupie


Joined: 26 November 2002
Status: Offline
Points: 193
Post Options Post Options   Thanks (0) Thanks(0)   Quote BrownGhost Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 3:50pm

how should this look??

<% = intAvatarWidth %>

????? <% = 400 %> LOL

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2003 at 9:09pm

That might work but the way to do it is to replace the whole thing with the 400 like this:

document.images[loop].width = 400

There's two lines with the <% = intAvatarWidth %> so you got to replace them both.

Back to Top
JohnnySlotCar View Drop Down
Newbie
Newbie
Avatar

Joined: 15 September 2003
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote JohnnySlotCar Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2003 at 12:54pm

I've tried this - can't get it to work.  I've

1] added JS code to my header, replacing <&=avatar%> with 390

2] replaced strMessage code in fnc_frmt_post,asp

3] added new strMessage line to fnc_edit_post.asp

No dice.  Any ideas? 

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2003 at 5:42pm
my bad, forgot something again, add onLoad="checkText();" to the <body> tag on your header.asp, that should do it.
Back to Top
JohnnySlotCar View Drop Down
Newbie
Newbie
Avatar

Joined: 15 September 2003
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote JohnnySlotCar Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2003 at 6:23pm

Of course!  I should of known that one...

Thanks - good script/mod!

  Johnny

Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.