phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Wide Pictures Breaking My Frames - I'm Sick of It !!!


 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
New Guy
Board Member



Joined: 27 Jul 2009

Posts: 78



PostPosted: Sun Jan 03, 2010 7:59 pm 
Post subject: Wide Pictures Breaking My Frames - I'm Sick of It !!!

I am so sick of guys posting pics wider than 640, (when they're not even needed) and breaking the frame, forcing everyone to scroll to read the text !!!

I Hate that !!! icon_twisted.gif


Can you guys please suggest a few ways in which I can limit the size/width of the pics posted on my site,
(I need to nip this problem in the bud once and for all) -

thanks
New Guy
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Sun Jan 03, 2010 9:24 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

Code:
##############################################################
## MOD Title: Easy Resize Posted Images
## MOD Author: kber < webmaster@phpbbegypt.com > (kber) http://www.phpbbegypt.com
## MOD Description:  This MOD resizes images within the posts . Images resized are made
## clickable and openable in a popup in full-size.
## MOD Version: 1.0.0
## PHPBB versions: 2.0.x
## Installation Level: (Easy)
## Installation Time: 1 Minute
## Files To Edit:
##    templates/SubSilver/viewtopic_body.tpl
## Included Files: n/a
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
templates/SubSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
         <table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
}
#
#-----[ BEFORE, ADD ]------------------------------------------
# note : you may change( 600px) to whatever you want
<script>
window.onload = resizeimg;
function resizeimg()
{
   if (document.getElementsByTagName)
   {
      for (i=0; i<document.getElementsByTagName('img').length; i++)
      {
         im = document.getElementsByTagName('img')[i];
         if (im.width > 600)
         {
            im.style.width = '600px';
            eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")");
            eval("im.onclick = pop" + String(i) + ";");
            if (document.all) im.style.cursor = 'hand';
            if (!document.all) im.style.cursor = 'pointer';
            im.title = 'Click here to view image in full size';
         }
      }
   }
}

</script>

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


The only drawback this MOD has is that when there are many large pictures in on topic it takes time for the whole topic to load.

_________________
phpBB2 will never die, I hope!
Back to top
New Guy
Board Member



Joined: 27 Jul 2009

Posts: 78



PostPosted: Sun Jan 03, 2010 9:36 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

Thank you very much, I will give it a whirl - icon_smile.gif
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Sun Jan 03, 2010 9:51 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

I just noticed a minor mistake in the code I posted, that is now corrected.
_________________
phpBB2 will never die, I hope!
Back to top
New Guy
Board Member



Joined: 27 Jul 2009

Posts: 78



PostPosted: Mon Jan 04, 2010 12:04 am 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

It didn't work -
I downloaded viewtopic_body.tpl and installed the script by pasting it before
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">

I looked at the post the member made using a 800px pic from photo bucket and it still was the same size -

Thinking that maybe it only works on new posts, I copied the url to the 800px photo and pasted it into a new post. It still wasn't re sized.

Here's that part of the edited file, what did I do wrong?



autoresizer.JPG
 Description:
 Filesize:  233.23 KB
 Viewed:  448 Time(s)

autoresizer.JPG


Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Mon Jan 04, 2010 11:23 am 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

From what I see in the pic I believe you didnīt place the code in the right place, it should be at the very top of viewtopic_body.tpl.

It could also be due to the fact that your
Code:
         if (im.width > 600)
         {
            im.style.width = '700px';
should be
Code:
         if (im.width > 700)
         {
            im.style.width = '700px';


Give it a try and see what happens.

Ah, it also works for old posts.

_________________
phpBB2 will never die, I hope!
Back to top
New Guy
Board Member



Joined: 27 Jul 2009

Posts: 78



PostPosted: Mon Jan 04, 2010 3:52 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

dogs and things wrote:
From what I see in the pic I believe you didnīt place the code in the right place, it should be at the very top of viewtopic_body.tpl.



Question - if it's supposed to be at the top of the file, why did the instructions tell me to find this, and paste the code before it?
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">



I had changed (both) of them number to 700, but when it didn't work, I changed it back to 600 before I took the screen shot, and made the post -

I will try pasting the code at the very top of the file, change both numbers to 700, and re upload the file - we'll see what happenes, thanks for the help on this - icon_smile.gif




--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


dogs and things wrote:


Give it a try and see what happens.

Ah, it also works for old posts.





OK, I changed things around, and it still doesn't work -
icon_redface.gif Here is the file I uploaded -

The Extension tpl is not allowed



I guess I'll have to paste the whole file - sorry -


<script>
window.onload = resizeimg;
function resizeimg()
{
if (document.getElementsByTagName)
{
for (i=0; i<document.getElementsByTagName('img').length; i++)
{
im = document.getElementsByTagName('img')[i];
if (im.width > 700)
{
im.style.width = '700px';
eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + " ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")");
eval("im.onclick = pop" + String(i) + ";");
if (document.all) im.style.cursor = 'hand';
if (!document.all) im.style.cursor = 'pointer';
im.title = 'Click aquí para ver imagen en tamaņo real';
}
}
}
}

</script>
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />
<span class="gensmall"><b>{PAGINATION}</b><br />
&nbsp; </span></td>
</tr>
</table>

<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left" valign="bottom" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&nbsp;&nbsp;&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a><!-- IF PARENT_FORUM --> -> <a class="nav" href="{U_VIEW_PARENT_FORUM}">{PARENT_FORUM_NAME}</a><!-- ENDIF -->
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
</tr>
</table>

<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0">
<tr align="right">
<td class="catHead" colspan="2" height="28"><span class="nav"><a href="{U_VIEW_OLDER_TOPIC}" class="nav">{L_VIEW_PREVIOUS_TOPIC}</a> :: <a href="{U_VIEW_NEWER_TOPIC}" class="nav">{L_VIEW_NEXT_TOPIC}</a> &nbsp;</span></td>
</tr>
{POLL_DISPLAY}
<tr>
<th class="thLeft" width="150" height="26" nowrap="nowrap">{L_AUTHOR}</th>
<th class="thRight" nowrap="nowrap">{L_MESSAGE}</th>
</tr>
<!-- BEGIN postrow -->
<tr>
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>
<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_POSTED}: {postrow.POST_DATE}<span class="gen">&nbsp;</span>&nbsp; &nbsp;{L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
<td valign="top" align="right" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td colspan="2"><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
</table></td>
</tr>
<tr>
<td class="{postrow.ROW_CLASS}" width="150" align="left" valign="middle"><span class="nav"><a href="#top" class="nav">{L_BACK_TO_TOP}</a></span></td>
<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="bottom" nowrap="nowrap"><table cellspacing="0" cellpadding="0" border="0" height="18" width="18">
<tr>
<td valign="middle" nowrap="nowrap">{postrow.PROFILE_IMG} {postrow.PM_IMG} {postrow.EMAIL_IMG} {postrow.WWW_IMG} {postrow.AIM_IMG} {postrow.YIM_IMG} {postrow.MSN_IMG}<script language="JavaScript" type="text/javascript"><!--

if ( navigator.userAgent.toLowerCase().indexOf('mozilla') != -1 && navigator.userAgent.indexOf('5.') == -1 && navigator.userAgent.indexOf('6.') == -1 )
document.write(' {postrow.ICQ_IMG}');
else
document.write('</td><td>&nbsp;</td><td valign="top" nowrap="nowrap"><div style="position:relative"><div style="position:absolute">{postrow.ICQ_IMG}</div><div style="position:absolute;left:3px;top:-1px">{postrow.ICQ_STATUS_IMG}</div></div>');

//--></script><noscript>{postrow.ICQ_IMG}</noscript></td>
</tr>
</table></td>
</tr>
<tr>
<td class="spaceRow" colspan="2" height="1"><img src="templates/BlackSoul/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<!-- END postrow -->
<tr align="center">
<td class="catBottom" colspan="2" height="28"><table cellspacing="0" cellpadding="0" border="0">
<tr><form method="post" action="{S_POST_DAYS_ACTION}">
<td align="center"><span class="gensmall">{L_DISPLAY_POSTS}: {S_SELECT_POST_DAYS}&nbsp;{S_SELECT_POST_ORDER}&nbsp;<input type="submit" value="{L_GO}" class="liteoption" name="submit" /></span></td>
</form></tr>
</table></td>
</tr>
</table>

<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&nbsp;&nbsp;&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="{U_INDEX}" class="nav">{L_INDEX}</a> <!-- IF PARENT_FORUM --> -> <a class="nav" href="{U_VIEW_PARENT_FORUM}">{PARENT_FORUM_NAME}</a><!-- ENDIF -->
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">{S_TIMEZONE}</span><br /><span class="nav">{PAGINATION}</span>
</td>
</tr>
<tr>
<td align="left" colspan="3"><span class="nav">{PAGE_NUMBER}</span></td>
</tr>
</table>

<table width="100%" cellspacing="2" border="0" align="center">
<tr>
<td width="40%" valign="top" nowrap="nowrap" align="left"><span class="gensmall">{S_WATCH_TOPIC}</span><br />
&nbsp;<br />
{S_TOPIC_ADMIN}</td>
<td align="right" valign="top" nowrap="nowrap">{JUMPBOX}<span class="gensmall">{S_AUTH_LIST}</span></td>
</tr>
</table>
Back to top
New Guy
Board Member



Joined: 27 Jul 2009

Posts: 78



PostPosted: Tue Jan 05, 2010 3:09 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

Hello ??????
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Jan 05, 2010 5:17 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

I donīt know what more to say.
_________________
phpBB2 will never die, I hope!
Back to top
New Guy
Board Member



Joined: 27 Jul 2009

Posts: 78



PostPosted: Tue Jan 05, 2010 6:13 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

dogs and things wrote:
I donīt know what more to say.



What do you mean?

That's it, I'm stuck? It's only one file to edit, why is it not working?

If you can't figure out what's wrong, can you at least point me in a direction where I might be able to get it fixed - please?
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Jan 05, 2010 6:28 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

I mean that I have no idea.

Wait and see if someone pops in and gives a hand.

_________________
phpBB2 will never die, I hope!
Back to top
New Guy
Board Member



Joined: 27 Jul 2009

Posts: 78



PostPosted: Wed Jan 06, 2010 4:48 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

I contacted Jim_UK and he provided me with a different re-size mod.
I made 2 sql querries, edited 6 files, and it works like a charm. icon_biggrin.gif

thanks dogs and things and Jim_UK for helping me out, I appreciate it. icon_biggrin.gif

New Guy icon_smile.gif
Back to top
Ram
Board Member



Joined: 23 Dec 2008

Posts: 100
Location: Somewhere over the rainbow


flag
PostPosted: Wed Jan 06, 2010 5:04 pm 
Post subject: Re: Wide Pictures Breaking My Frames - I'm Sick of It !!!

The best one : Resize Posted Images Based on Max Width
It is lighter (any sql querries to do) and have few changes (7 files to edit + 1 to add) icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0197 seconds using 17 queries. (SQL 0.0035 Parse 0.0027 Other 0.0136)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo