[SUBMITTED] Large Images MOD

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke »

Anyone?

Silverhawk060
Registered User
Posts: 237
Joined: Mon Jun 16, 2003 4:40 am
Contact:

Post by Silverhawk060 »

actually, sian's code is slow because it calls the function preg_match_all, if that function can swapped for something else it will be alot faster

i got another idea on how to work an image resize.. unfortunately i do not know how phpbb's bbcode parsing works to write the code, so if anyone knows enough maybe you can make it happen

The idea :

The width of the image is checked, if its smaller than the specified maximum width value do nothing.

If its bigger.. we take the maximum width value divided with the image's width and multiply it by 100 to get a percentage. We then use this percentage on both the width and height of the image so it is reduced proportionately.

the <img> output would look something like this
<img src="link" height="scaled_height" width="scaled_width" />

then we can further enhance it by making it output something like this <a href="link" target="_blank"><img src="link" height="scaled_height" width="scaled_width" border="0" /><br />This image has been reduced by $scale. Click on it to see the full size</a>

This should work very nicely

User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke »

Still looking for a way to get rid of those vertical scrollbars on Tuna's mod. ;)

User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke »

I have also noticed that with Tuna's method (didn't try it with the other, but I assume it works the same), if you quote an image, even if it's not more than the value you have it set it, it will stretch the quote box out..

For example, my message area is 490 pixels wide. I have my image max set to 475. The quote box width is 90% of 490, so if you quote an image using the quote BBCode, it stretches the forum out, regardless if the image is only 200 pixels wide, or more, or less.

Any suggestions?

User avatar
L0cke
Registered User
Posts: 426
Joined: Sat Aug 24, 2002 7:57 pm
Location: Missouri

Post by L0cke »

Cripes..

timbercrawler
Registered User
Posts: 99
Joined: Mon Jul 21, 2003 1:25 am
Location: Seattle
Contact:

Post by timbercrawler »

Can someone help me with the SQL part of this? I have used sql a lot but these directions make no sense. Say my database is called "myname_forumdb" and i go to the phpMyAdmin query box and enter...

INSERT INTO `myname_forumdb` (`config_name`, `config_value`) VALUES ('image_max_width', '0');

right? I get an error stating that myname_forumdb.myname_forumdb doesn't exist...

what am i doing wrong?

timbercrawler
Registered User
Posts: 99
Joined: Mon Jul 21, 2003 1:25 am
Location: Seattle
Contact:

Post by timbercrawler »

hello?

timbercrawler
Registered User
Posts: 99
Joined: Mon Jul 21, 2003 1:25 am
Location: Seattle
Contact:

Post by timbercrawler »

nevermind, got it.

anyone ever get this working with the attachment mod? I am using the FIPlain template and it gets all messed up when i try to edit viewtopic_body.tpl. The tables are different I guess. Ideas? I really want to use this mode. My view_topic_body code is below, any ideas on getting this to work?

Code: Select all

<!-- BEGIN postrow -->
<tr>
<td valign="top" class="{postrow.ROW_CLASS}" rowspan="2"><span class="name"><a name="{postrow.U_POST_ID}" id="{postrow.U_POST_ID}"></a><strong>{postrow.POSTER_NAME}</strong></span><br />
<span class="postdetails">{postrow.POSTER_RANK}<br />
<br>
{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />
{postrow.POSTER_POSTS}<br />
{postrow.POSTER_FROM}</span><br />
<img src="images/spacer.gif" alt="" width="150" height="1" />
</td>
<td class="{postrow.ROW_CLASS}" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="postdetails"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" /></a>{L_POSTED}: 
{postrow.POST_DATE}</td>
<td align="right" valign="top" nowrap="nowrap">{postrow.QUOTE_IMG}{postrow.EDIT_IMG}<a href="#top"><img src="templates/fiplain/images/icon_up.gif" alt="{L_BACK_TO_TOP}" width="16" height="18" title="{L_BACK_TO_TOP}" class="imgtopic" /></a>{postrow.DELETE_IMG}{postrow.IP_IMG}</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" class="postbody">
<hr />
{postrow.MESSAGE}</td>
</tr>
<tr>
<td height="40" valign="bottom" class="genmed"></span>{postrow.ATTACHMENTS}<span class="postbody">{postrow.SIGNATURE}<span class="postdetails">{postrow.EDITED_MESSAGE}</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" class="{postrow.ROW_CLASS}">{postrow.PROFILE_IMG}{postrow.PM_IMG}{postrow.EMAIL_IMG}{postrow.WWW_IMG}{postrow.AIM_IMG}{postrow.YIM_IMG}{postrow.MSN_IMG}{postrow.ICQ_IMG}</td>
</tr>
<tr>
<td class="spacerow" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<!-- END postrow -->

User avatar
ScoX
Registered User
Posts: 2
Joined: Wed Mar 24, 2004 3:29 am

I need a mod

Post by ScoX »

I have a problem with the continuous text without spaces, that by its amount the wide one of the screen exceeds.
_________________________________________________________________________________________________________________________________________________________________________________________________


There is a problem with the design of viewtopic.php that allows the text to exceed its continuous size.

Please you could indicate the line numbers and their code to me corrected or improved for viewtopic.php

timbercrawler
Registered User
Posts: 99
Joined: Mon Jul 21, 2003 1:25 am
Location: Seattle
Contact:

Post by timbercrawler »

there is a mod either here or at phpbbhacks.com that fixes that. i think it counts letters until it finds a space and if it is more than a certain value it chops it and does a line break.

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers »

I also had to abandon the original javascript mod and switch to Tuna's simple version. The original was failing to display certain topics. I'd get the overall header and then nothing (although sometimes the rest of the post would appear like 15 minutes later!!! I have no idea what that javascript was doing during that time).

So far Tuna's seems to work fine.

Bryan

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers »

beggers wrote: I also had to abandon the original javascript mod and switch to Tuna's simple version. The original was failing to display certain topics. I'd get the overall header and then nothing (although sometimes the rest of the post would appear like 15 minutes later!!! I have no idea what that javascript was doing during that time).

So far Tuna's seems to work fine.

Bryan


Well, it looks like I have to eat my words. There is a major problem with Tuna's code, at least on my site. The code affects the signature section in a strange way. It forces everything (not just images) into a narrower column. I have no idea what's going on but I removed it.

So, I am STILL looking for a good solution to too-wide images. Any other suggestions?

falox
Registered User
Posts: 14
Joined: Thu Feb 12, 2004 7:32 am
Contact:

Post by falox »

Your best bet Beggers is to get the signature control mod and restrict the width 1 pixel under the width of the post mod. So this way, it shouldn't affect it.

example:

set your signature width to: 500px
set your image post width to: 501px

So when the image is over 501, it'll present the bars.

Do you understand?

falox
Registered User
Posts: 14
Joined: Thu Feb 12, 2004 7:32 am
Contact:

Post by falox »

L0cke wrote: Is there a way to stop Tuna's method having vertical scroll bars? I don't have the attachment mod.


Sure there is. It's quite simple actually. heres the code.

Using Tuna's code:
FIND:

Code: Select all

<!-- BEGIN img --><div style="width: 575px; overflow: auto;"><img src="{URL}" border="0" alt="Click to see full image" onclick="javascript:if(this.width > 575){window.open('{URL}')}"></div><!-- END img -->
REPLACE WITH:

Code: Select all

<!-- BEGIN img --><div style="width: 575px; overflow-x:auto; overflow-y: hidden;"><img src="{URL}" border="0" alt="Click to see full image" onclick="javascript:if(this.width > 500){window.open('{URL}')}"></div><!-- END img -->
Hope that helps ya'll. :D

*edit*
Sorry to double post. >_<

User avatar
Smokeydogg
Registered User
Posts: 240
Joined: Sat Dec 06, 2003 8:02 am
Contact:

Post by Smokeydogg »

great mod that solves my problem with large pictures making the page look like shit

now just to get it working with the attachment mod and there is another problem solved :)

also you think you can make it work with the sig in profile hack cause some people have sigs that wont make topics long but when you see the sig in profile it makes the shit longer i think be badass if the sig was too long in the profile it would have that little scroll bar but idk no big deal :)

http://www.skandalouz.net/profile.php?m ... ofile&u=46

thats what i mean by the profile thing

Locked

Return to “[2.0.x] MODs in Development”