|
Author |
Message |
Sage

Member
Posts: 1040
Registered: Feb 2004

 |
Posted February 13th, 2008 12:15 AM IP  Compatible: FireFox, Opera
it does not work in Internet Explorer for some odd reason.
Preview: Click Here
If images are larger than the sizes set, they will be resized and linked to the original image.
Go into your Control Panel > Custom Templates > Thread
Place this at the very bottom of the HTML
Quote:
<script type="text/javascript">
<!--
//Restrict the size of images in posts
//Written by Dranew
//Place in "Custom Templates > Thread" at the bottom of the HTML
var maxWidth = "500";
var maxHeight = "400";
var post = document.getElementsByTagName('td')
for(p=0;p<post.length;p++) {
if((post[p].width == "100%" && post[p].colSpan == "2" && post[p].innerHTML.indexOf('Posts:' && 'Registered:' && 'Posted') != -1) || (post[p].width == "100%" && post[p].colSpan == "2" && post[p].innerHTML.indexOf('Posts:' && 'Joined:' && 'Posted') != -1)) {
var postImg = post[p].getElementsByTagName('img')
for(i=0;i<postImg.length;i++) {
if((postImg[i].width > maxWidth) || (postImg[i].height > maxHeight)) {
if(postImg[i].width > maxWidth) {
postImg[i].width = maxWidth;
}
if(postImg[i].height > maxHeight) {
postImg[i].height = maxHeight;
}
postImg[i].onmouseover = function() { this.style.cursor="pointer"; }
postImg[i].onclick = function() { window.location = this.src; }
}
}
}
}
//-->
</script>
|
Edit the blue parts ONLY
(Edited by Sage) - More Scripts and Mods at indexOf('ExCo')
|
|
sdn

Member
Posts: 2597
Registered: Feb 2004

|
Posted February 13th, 2008 12:21 AM IP  There aren't any blue parts. Blue looks like this, Sage.  My signature was here, but then the new rule came and sat on it.
(Spared No Expense - the fully modded ExCoboard) Currently kinda bland, so answer my thread and suggest stuff.
AmpleAdy makes awesome templates.
|
|
Sage

Member
Posts: 1040
Registered: Feb 2004

 |
Posted February 13th, 2008 12:28 AM IP  heh forgot to reinsert them thanks for telling me
you wouldn't happen to know why it's not completely cross-browser would you? - More Scripts and Mods at indexOf('ExCo')
|
|
sdn

Member
Posts: 2597
Registered: Feb 2004

|
Posted February 13th, 2008 01:31 AM IP  The demo thread doesn't look any different to me in IE than in Firefox. My signature was here, but then the new rule came and sat on it.
(Spared No Expense - the fully modded ExCoboard) Currently kinda bland, so answer my thread and suggest stuff.
AmpleAdy makes awesome templates.
|
|
|
|
sdn

Member
Posts: 2597
Registered: Feb 2004

|
Posted February 13th, 2008 01:58 AM IP  Now it works in Firefox and doesn't in IE (neither resizing nor clickiness). I'm not getting any errors, though. It's just not doing anything.
I would guess it isn't matching the posts, but I don't know why. My Javascript is pretty rusty, and I haven't really kept up with the changes. Maybe there's a browser quirk issue in there somewhere. My signature was here, but then the new rule came and sat on it.
(Spared No Expense - the fully modded ExCoboard) Currently kinda bland, so answer my thread and suggest stuff.
AmpleAdy makes awesome templates.
|
|
|
|
SivoxII

Member
Posts: 5991
Registered: Apr 2006

 |
Posted February 17th, 2008 08:51 PM IP  Tremendous script, even if IE is fussy on executing this one.
|
|
Intrepid Prez

Member
Posts: 187
Registered: Oct 2005

 |
Posted February 21st, 2008 11:42 PM IP 
Is the script working properly in both IE and Firefox yet ???
If so... I'll use it. 
|
|
|
|
SivoxII

Member
Posts: 5991
Registered: Apr 2006

 |
Posted February 22nd, 2008 02:25 AM IP  .. that's because IE = Internet Exhasperation (although it's like your favourite old jumper at the same time!!) 
|
|
Orpheas

Super Moderator
Posts: 2187
Registered: Sep 2004

 |
Posted February 23rd, 2010 12:39 PM IP  Quick question, will this work on a php board? I'm having issues with images being cut off and hidden behind the background if they run off the width of the thread. Excoboard Terms of Service
|
|
SivoxII

Member
Posts: 5991
Registered: Apr 2006

 |
Posted February 23rd, 2010 03:03 PM IP  Orpheas, image control in php is a breeze!!! ... on phpBB's, there are several default parameters within the ACP, although you can still add fixed widths or automatic scaling.
Also, along side this, if you want even more control than that, there are plugins like tinypic, which carry default parameters, one particular default being "Message Board", which If I recall, sets all pics to around 600px wide.
Hope this helps?
All the best,
Siv
|
|
Orpheas

Super Moderator
Posts: 2187
Registered: Sep 2004

 |
Posted February 23rd, 2010 03:09 PM IP  Yarp, it does. Thing is im not an admin on the forum, so im trying to find something simple for them to use. The server admin decided to update all boards and with it came new features, but it doesn't resize images, so they get cut off. Excoboard Terms of Service
|
|
SivoxII

Member
Posts: 5991
Registered: Apr 2006

 |
Posted February 23rd, 2010 03:19 PM IP  If you have contact with the admin of this phpBB ... ask them to look in the ACP > Attachment Settings ... then scroll down to the Image Settings, where you can set the maximum width of a thumbnail (image posting) ... which will automatically scale any image to that width (example 400px).
This is the default Image Control, which is simple, but effective. Otherwise, the tinypic option is a good secondary approach (with many more Mods available)
All the best,
Siv 
|
|
|
|
|
|