Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: slinouille on April 13, 2009, 01:43:14 PM

Title: Resize Images To Fit Screen
Post by: slinouille on April 13, 2009, 01:43:14 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1769)



Resize Images to Fit Screen v0.1
By Slinouille (http://custom.simplemachines.org/mods/index.php?action=search;author=68142)



Introduction
This mod permits to proportionally scale all images to fit the user's screen size.
This mod uses:
- jQuery javascript library : http://jquery.com/ (http://jquery.com/) - v1.3.2
- jQuery imagefit pluggin : http://www.ollicle.com/eg/jquery/imagefit/ (http://www.ollicle.com/eg/jquery/imagefit/) - v0.2

Features
o Ability to proportionally scale all embended images in messages to fit the user's screen size.
o Images are dynamically resized if user's screen is changing.
o Very simple ... just enable it and enjoy!

Installation
Simply install the package to install this modification on the SMF Default Core theme.
Manual edits will be required for other themes.

This mod is compatible with SMF 2.0 RC1 Public and above only.

Support
Please use the modification thread for support with this modification.

Changelog
0.1 - 09th April 2009
o Initial release
Title: Re: Resize Images To Fit Screen
Post by: edi67 on April 13, 2009, 02:33:22 PM
wow seems to be very intersting
Title: Re: Resize Images To Fit Screen
Post by: edi67 on April 13, 2009, 04:06:43 PM
Installed all ok but seem not work for me :) already enabled mod but...nothing appear image are always in same size
Title: Re: Resize Images To Fit Screen
Post by: slinouille on April 13, 2009, 04:20:42 PM
Hi!

Do you use a personal theme?
Do you use any other mod "working" on images?
Any url for an example of post with big images  that I could check?

SliN
Title: Re: Resize Images To Fit Screen
Post by: edi67 on April 13, 2009, 05:59:09 PM
Default theme core
no, i unistalled Ncode mod before install this
this is image i using: http://wallpapers.insanepwning.net/albums/Crowded_Wallpaper.jpg
Title: Re: Resize Images To Fit Screen
Post by: Raugturi on April 14, 2009, 05:55:26 PM
I too installed this and the images are not resizing at all.  I am using a custom theme though.  What modifications should I make to the files in that theme for this to work?

The only modification I made so far was to the Settings.english.php file to get the option to enable image resizing to show up.  That worked, so I checked the box to enable it, but the images still do not resize.
Title: Re: Resize Images To Fit Screen
Post by: chef4o on April 14, 2009, 06:25:05 PM
It's working great on my forum, causing the images... The problem is that it resizes my emoticons too... And this problem seems to be only with the IE and Opera... No problems under Firefox!
Title: Re: Resize Images To Fit Screen
Post by: Özgür on April 14, 2009, 08:16:55 PM
Quote from: edi67 on April 13, 2009, 05:59:09 PM
Default theme core
no, i unistalled Ncode mod before install this
this is image i using: http://wallpapers.insanepwning.net/albums/Crowded_Wallpaper.jpg
Slin asked your forum post url. =)
Title: Re: Resize Images To Fit Screen
Post by: timned88 on April 15, 2009, 12:23:30 AM
what type of images does this resize?   (attachments, linked images, all images, etc.)
Title: Re: Resize Images To Fit Screen
Post by: slinouille on April 15, 2009, 03:32:25 AM
Hello all!
Strange that you get all those problems and really sorry for that

Concerning the "noresizing" problem, I've experiment this trouble yesterday on installing mod "simpleportal" ... indeed this mod adds some new tables element which changes the name of the main container. For those who have troubles, do you have ths mod installed (I've got a solution)

@chef4o : I'll check that.

@timned88: It has been done only for image embedded in message using img tag.

@all: I'll take some time to found a better solution for defining the "reference container".

SLiN
Title: Re: Resize Images To Fit Screen
Post by: slinouille on April 15, 2009, 10:06:57 AM
Hello,

I've uploaded a release 0.1.5.
For those you have experimented some difficulties please use it, and tell me if it's better.
I've added the possibility to customize the theme elements on which the mod is activated. Please follow instructions ;)

SliN
Title: Re: Resize Images To Fit Screen
Post by: chef4o on April 18, 2009, 05:18:05 PM
Thanks a lot!!! It works just great now :) You're the best :P
Title: Re: Resize Images To Fit Screen
Post by: slinouille on April 19, 2009, 08:05:16 AM
Quote from: chef4o on April 18, 2009, 05:18:05 PM
Thanks a lot!!! It works just great now :) You're the best :P

Thanks ... :)
Title: Re: Resize Images To Fit Screen
Post by: ALEJO on April 19, 2009, 09:23:34 PM
Hi, im having this problem*see picture below - the pic its like compressed vertically*. (15" monitor at 1280x800)
This seems to have problems with the resoultion because with 1280x1024 it works fine, so if you can help me i would be thankful.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg222.imageshack.us%2Fimg222%2F1989%2Fproblem1.png&hash=f265f65eeaa8ae639e083d4da7d1761d5f24db50)
Title: Re: Resize Images To Fit Screen
Post by: slinouille on April 22, 2009, 01:26:31 PM
Really strange ... perhaps can you give an url where to found that, so that I can check by myself ;)
Title: Re: Resize Images To Fit Screen
Post by: ALEJO on April 22, 2009, 04:53:06 PM
Quote from: slinouille on April 22, 2009, 01:26:31 PM
Really strange ... perhaps can you give an url where to found that, so that I can check by myself ;)

It happens with all pictures of the forum (with that resolution)
I sent you the link by mp.
Title: Re: Resize Images To Fit Screen
Post by: miseryshining on April 26, 2009, 12:49:56 AM
works great out of the box, thanks!
Title: Re: Resize Images To Fit Screen
Post by: gourav on April 27, 2009, 08:34:13 AM
I am using v0.1.5 on beta2 RC1
but there is no chnage at all in Iamges?
Nither in iamges posted using [img ] tag
nor in images uploaded to smf??

1 more serous problem appeared after using this mod
that all new Images uploaded gets deleted :(
this mod was highly unsafe for me?? 
Title: Re: Resize Images To Fit Screen
Post by: gourav on April 27, 2009, 08:36:29 AM
Example of images deletd by this mod????
http://gstek.info/forum/software-games-wallpapers-zone/landscapes-flowers-3d-sky-scenarios-all-eye-catching-wallpapers-(must-visit)/114/

And example that it doesnt have any effect on images
http://gstek.info/forum/software-games-wallpapers-zone/landscapes-flowers-3d-sky-scenarios-all-eye-catching-wallpapers-(must-visit)/
Title: Re: Resize Images To Fit Screen
Post by: ArkServer on May 10, 2009, 04:26:02 PM
any chance to get this work on smf 1.1.x ? very useful mod :D!
Title: Re: Resize Images To Fit Screen
Post by: cityeyes on November 19, 2009, 02:55:54 PM
Quote from: ALEJO on April 19, 2009, 09:23:34 PM
Hi, im having this problem*see picture below - the pic its like compressed vertically*. (15" monitor at 1280x800)
This seems to have problems with the resoultion because with 1280x1024 it works fine, so if you can help me i would be thankful.

One of my users is having this same problem. So far, all I know is that he's running IE7. It also happens when I browse to the site on my cell phone (although that's not a big deal given the fact I only did it for experimental purposes).

I don't know if it has to do with the resolution of the user or the browser or what.

Edit: I think it's IE7. I switched my resolution to 1280x800 and ran my website on both IE8 and Firefox with no problems whatsoever. The guy having the problem in my forum is using IE7.
Title: Re: Resize Images To Fit Screen
Post by: butchs on November 30, 2009, 12:15:08 PM
Any chance of having the image resize working when you "View the most recent posts on the forum"?

:)
Title: Re: Resize Images To Fit Screen
Post by: ih8pavement on December 05, 2009, 11:30:16 PM
I thought this mod was working perfectly, but I am having the proportion problem.

My resolution is 1920x1200, and I'm running the same browser as my wife (IE 8.0.6001.18828).  The resolution on the other computer is 1280x800 I think.

On Google Chrome and Mozill Firefox it works fine.  For IE I have to make the window pretty small before it's the correct ratio.

Thanks!
Title: Re: Resize Images To Fit Screen
Post by: adbrad on January 08, 2010, 04:20:46 PM
does any one have working on rc 2 thanks
Title: Re: Resize Images To Fit Screen
Post by: HorTs on January 12, 2010, 04:08:01 AM
I too am having the problem with Internet Explorer and the vertically squashed images.
Title: Re: Resize Images To Fit Screen
Post by: sattninja on January 18, 2010, 12:18:38 PM
thanks man worked great on RC2

straight install
good job great mod
Title: Re: Resize Images To Fit Screen
Post by: nikan on January 22, 2010, 05:33:43 PM
Modifications to work on 1.1.11

Copy imagefit.jquery.js and imagefit.jquery.library.js to default theme directory and edit the following files

Sources/Load.php
Find:
// This determines the server... not used in many places, except for login fixing.

Add before:
//ResizeImagesToFitScreen mod
if ( isset($modSettings['enable_imageFit_mod']) && !empty($modSettings['enable_imageFit_mod']) ) {
//Load jQuery library
if ( empty($jQueryLoaded) || $jQueryLoaded != true ){
    $jQueryLoaded = true; //indicates that jQuery is loaded. This to prevent against several loadings of jquery.js
    $context['html_headers'] .= '
<script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/imagefit.jquery.js"></script>';
}
//Use JQuery in NoConflict mode => change $ by JQ
$context['html_headers'] .= '
<script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/imagefit.jquery.library.js"></script>
    <script language="JavaScript" type="text/javascript">
        if ( JQ == undefined) var JQ = jQuery.noConflict();
    </script>';
//Prepare options
if (isset($modSettings['imageFit_container']) && !empty($modSettings['imageFit_container'])) $imageFit_container = $modSettings['imageFit_container'];
else $imageFit_container = "#forumposts";
if (isset($modSettings['imageFit_included']) && !empty($modSettings['imageFit_included'])) $imageFit_included = 'elements_included:"'.$modSettings['imageFit_included'].'"';
else $imageFit_included = "";
if ( !empty($imageFit_excluded) ) $imageFit_options = "{".$imageFit_excluded."}";
else $imageFit_options = "";

$context['html_headers'] .= '
<script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/imagefit.jquery.library.js"></script>
<script language="JavaScript" type="text/javascript">
jQuery(window).load(function(){
  jQuery("'.$imageFit_container.'").imagefit('.$imageFit_options.');
});
</script>';
}
//End mod



Sources/ModSettings.php
Find:
// Width/Height image reduction.
array('int', 'max_image_width'),
array('int', 'max_image_height'),


Add after:
array('check', 'enable_imageFit_mod'),
array('text', 'imageFit_container','30'),
array('text', 'imageFit_included','50'),



Sources/Subs.php
Find:
'content' => '<img src="$1" alt="{alt}"{width}{height} border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" border="0" />',


Replace with:
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" class="bbc_img" />',



Themes/default/style.css
Add at the end:
.bbc_img
{
border: 0;
}



Then in Admin -> Features and Options -> [ImageFit] Optional: enter reference container id/class of your theme field enter: .post
Title: Re: Resize Images To Fit Screen
Post by: Joker™ on January 25, 2010, 01:19:57 PM
thanx a lot man......mod got installed straight forward on RC2
Title: Re: Resize Images To Fit Screen
Post by: MaXiForum.cz on February 05, 2010, 03:28:41 AM
It´s very nice modification.
Thank you!
Title: Re: Resize Images To Fit Screen
Post by: Neverhurry on February 06, 2010, 03:12:35 PM
Quote from: sattninja on January 18, 2010, 12:18:38 PM
thanks man worked great on RC2

straight install
good job great mod

I use RC2 and I installed this mod but it doesn't do any resize to fit the screen.
Title: Re: Resize Images To Fit Screen
Post by: Joker™ on February 06, 2010, 03:16:12 PM
Quote from: neverhurry on February 06, 2010, 03:12:35 PM
Quote from: sattninja on January 18, 2010, 12:18:38 PM
thanks man worked great on RC2

straight install
good job great mod

I use RC2 and I installed this mod but it doesn't do any resize to fit the screen.

i wont work on images prior to the installation .... to test it get a big image n try to make the post

see the result urself ;)
Title: Re: Resize Images To Fit Screen
Post by: Neverhurry on February 07, 2010, 06:34:10 PM
Quote from: sid2varun on February 06, 2010, 03:16:12 PM
Quote from: neverhurry on February 06, 2010, 03:12:35 PM
Quote from: sattninja on January 18, 2010, 12:18:38 PM
thanks man worked great on RC2

straight install
good job great mod

I use RC2 and I installed this mod but it doesn't do any resize to fit the screen.

i wont work on images prior to the installation .... to test it get a big image n try to make the post

see the result urself ;)

No, i tried it, but it doesn't work. Very strange. But thank you man.
Title: Re: Resize Images To Fit Screen
Post by: nikan on March 03, 2010, 05:08:58 AM
I have updated the mod to latest jQuery v1.4.2 and added hack to solve the proportion problem with IE
The package is for SMF 2.0 RC2 and SMF 1.1.11
Title: Re: Resize Images To Fit Screen
Post by: MaXiForum.cz on March 03, 2010, 07:24:50 AM
Thank you nikan
I try it :-)
Title: Re: Resize Images To Fit Screen
Post by: neo2504 on April 08, 2010, 08:26:31 AM
great mod, can someone update it for RC3???
Title: Re: Resize Images To Fit Screen
Post by: adbrad on April 08, 2010, 08:32:18 AM
Quote from: neo2504 on April 08, 2010, 08:26:31 AM
great mod, can someone update it for RC3???

have you tried to install it on rc3 if you read the first post it says
QuoteThis mod is compatible with SMF 2.0 RC1 Public and above only.
which means it should work with any version after that one
Title: Re: Resize Images To Fit Screen
Post by: vgnapply on April 24, 2010, 10:07:29 PM
Hello,

I've installed the version modified by Nikan and works like a dream, but i have a question, is there anyway to open the original size image clicking on the resized one? like the nCode does

thanks in advance
Title: Re: Resize Images To Fit Screen
Post by: SSVertigo on May 01, 2010, 04:03:01 PM
Hi, i need some help, this mod is working perfect with posted images, but in the reply page, the posted images still big.
Using SMF 2.0 RC3.

forum: www.lbsh.com.br
Title: Re: Resize Images To Fit Screen
Post by: Salkiri on May 18, 2010, 04:06:51 PM
I have this mod along with Highslide 4 SMF http://custom.simplemachines.org/mods/index.php?mod=2518 (http://custom.simplemachines.org/mods/index.php?mod=2518) and it's working perfect as desired on SMF 2.0RC3.

It's handling existing large images perfectly. 

Thank you.
Title: Re: Resize Images To Fit Screen
Post by: Salkiri on May 19, 2010, 03:41:44 PM
Tried to install ENotify Mod (http://custom.simplemachines.org/mods/index.php?mod=2198) and it breaks this mod.

This is the error I get:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; GTB0.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30729; .NET CLR 3.5.30729; InfoPath.1; InfoPath.2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Wed, 19 May 2010 19:36:02 UTC


Message: Object doesn't support this property or method
Line: 34
Char: 7
Code: 0


This is what is on Line 34: jQuery("#forumposts").imagefit();

Any help on getting these to mods working together would be great.
Title: Re: Resize Images To Fit Screen
Post by: HunterP on November 25, 2010, 08:51:54 AM
Quote from: nikan on March 03, 2010, 05:08:58 AMI have updated the mod to latest jQuery v1.4.2 and added hack to solve the proportion problem with IE

The proportion problem still exists within quoted images, any solution?
Title: Re: Resize Images To Fit Screen
Post by: HunterP on November 28, 2010, 12:58:42 PM
Quote from: HunterP on November 25, 2010, 08:51:54 AMThe proportion problem still exists within quoted images, any solution?

It's not only quoted images :

http://www.hulpverleningsforum.nl/forum/index.php/topic,2318.msg821196.html#msg821196

That posting contains 3 pictures. Some people report the images not being resized at all, and in my FireFox 3.6.12 te pictures only get resized horizontally, so it gets 'squeezed'.

Does anyone else experience this? I've already updated to v0.1.6

Cheers, Peter
Title: Re: Resize Images To Fit Screen
Post by: Joazo on January 29, 2011, 04:16:18 AM
How do I make it work on the theme - Surf&Turf 2.0 RC4?
Title: Re: Resize Images To Fit Screen
Post by: MaXiForum.cz on January 29, 2011, 08:31:57 AM
Quote from: Joazo on January 29, 2011, 04:16:18 AM
How do I make it work on the theme - Surf&Turf 2.0 RC4?

It works on Surf&Turf - 2.0 RC4 ...
Try www.maxiforum.cz ;)
Title: Re: Resize Images To Fit Screen
Post by: alanmcg on February 01, 2011, 07:09:33 PM
Another one experiencing people complaining of squashed images when using IE7. I noticed that the jquery.imagefit plugin used doesn't mention support for image resizing in IE.
Title: Re: Resize Images To Fit Screen
Post by: comedorsamus on February 19, 2011, 08:19:36 AM
From what I've been testing this mod works great, thanks so much!

Here's a few suggestions:

- When a user clicks on the image, the full-sized one is opened in a new window
- Resize images in the Topic Summary (when replying)

And...

Quote from: butchs on November 30, 2009, 12:15:08 PM
Any chance of having the image resize working when you "View the most recent posts on the forum"?

:)
I second that! :)
Title: Re: Resize Images To Fit Screen
Post by: Robin1989 on March 14, 2011, 11:37:30 PM
Quote from: comedorsamus on February 19, 2011, 08:19:36 AM
From what I've been testing this mod works great, thanks so much!

Here's a few suggestions:

- When a user clicks on the image, the full-sized one is opened in a new window
- Resize images in the Topic Summary (when replying)

And...

Quote from: butchs on November 30, 2009, 12:15:08 PM
Any chance of having the image resize working when you "View the most recent posts on the forum"?

:)
I second that! :)

i like all these suggestions was just comeing here to make the same
Title: Re: Resize Images To Fit Screen
Post by: helike13 on May 03, 2011, 12:52:45 PM
Does it support 2.0RC5?
Title: Re: Resize Images To Fit Screen
Post by: Grosraisin on May 03, 2011, 03:30:21 PM
Works well on SMF RC5.
Title: Re: Resize Images To Fit Screen
Post by: helike13 on May 03, 2011, 03:49:04 PM
Good. ;D

It would be good to mention the RC5 compatibility in the description of the mod.
Title: Re: Resize Images To Fit Screen
Post by: helike13 on May 19, 2011, 06:59:08 AM
This mod is cool.

But 2 little things:

How to enable it to fit images in the "Topic summary" while posting a new reply and how to enable it to fit images at the "Search results"?
Title: Re: Resize Images To Fit Screen
Post by: helike13 on May 28, 2011, 02:28:33 PM
Anyone?
Title: Re: Resize Images To Fit Screen
Post by: Txema on August 23, 2011, 05:26:55 AM
Nice mod, how can i make it works on the Orangline theme?


Forum: http://www.gofansub.net/smf_prueba/index.php (http://www.gofansub.net/smf_prueba/index.php)
Title: Re: Resize Images To Fit Screen
Post by: imaxorz on December 04, 2011, 03:25:40 PM
This doesn't work with spoilers.

When previewing a topic it does show images inside a spoiler, but however when the topic is posted and you look inside the spoiler, images don't show.

Anyone got a fix for that?
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 11:55:43 AM
Hey everybody. I am having a problem with this mod and any help would be great. I am not a coder in any way shape or form and my experience with forum software, smf being the only one, is about 2 months

I installed resize to fit screen and it worked properly. I used the package manager as I am not confident enough yet to edit code unless the instruction with the mod is very very clear. As I stated, it was installed with no failed tests including my modified theme (br finale). Now the mod has ceased to function. I attempted to uninstall it with the intent to reinstall it and try again and this is what turned up

QuoteError in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Quote
Uninstall Actions "ResizeImagesToFitScreen"

Installing this package will perform the following actions:
Type

Action

Description

1.Execute Modification

./Themes/default/languages/Modifications.english.php

Test successful


2.Execute Modification

./Themes/default/languages/Modifications.french.php

Skipping file


3.Execute Modification

./Sources/Load.php

Test failed
     - 1.Replace

       ./Sources/Load.php

       Test failed


4.Execute Modification

./Sources/ManageSettings.php

Test successful


5.Delete File

./Themes/default/scripts/ImageFit.jquery.imagefit.js

I have installed a few other mods, I would have to verify which ones I installed and in what order. I don't know if there is a conflict with code that maybe more than one modification edited
I know this is not an active thread, but the mod worked fine and was the solution to the complaints that I was receiving about having to resize images before posting.
I may need you to hold my hand through this if you have an answer :)

-thanks
Mike
Title: Re: Resize Images To Fit Screen
Post by: Shambles on December 06, 2012, 12:11:18 PM
Quote from: Silvershark78 on December 06, 2012, 11:55:43 AM
Hey everybody

Hey back at you :)

Your single failure is the package manager trying to find the string "// This determines the server... not used in many places, except for login fixing." within the file Load.php.

If you can grab a copy of that file from your Sources folder, have a look and see if that string exists. Chances are it doesn't, though why not I find strange.

The rest of the uninstallation affecting Load.php is to remove a few lines after the string being sought, so even if you cannot locate the string it wouldn't be too hard to remove it manually (similarly with the other two files that need amending).

At the end of the day though, besides it getting dark, you could always plant your Load.php into this thread and someone could edit it for you.

Yeah, I know, too generous by half :D
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 12:34:37 PM
cool. ill mess with it and see what I can find. thanks for the tips
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 01:01:42 PM
OK...so over my head. I downloaded a copy of the load.php file to my PC. Would it be just a matter of attaching the file? I opened the file to see if i could learn how to edit it. O want to learn how to help myself in these situations. but I opened the file and it may as well be ancient egyption becaue I have NO idea where to start.
Title: Re: Resize Images To Fit Screen
Post by: Shambles on December 06, 2012, 01:14:32 PM
Download an application called notepad++, which can recognise .php files and format them nicely for you, to assist editing.

But yes, if you're not comfortable, attach the file to your next post if you wish.

The choice you're faced with is to either insert the missing string of characters, such that the package manager can find it and complete the uninstallation, or manually remove the lines that need removing. If the latter, you'd then upload the Load.php file back to your Sources folder then go through the uninstall procedure again, ignoring the error issued by the package manager.
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 01:19:26 PM
Quote from: Shambles™ on December 06, 2012, 12:11:18 PM
Quote from: Silvershark78 on December 06, 2012, 11:55:43 AM
Hey everybody

Hey back at you :)

Your single failure is the package manager trying to find the string "// This determines the server... not used in many places, except for login fixing." within the file Load.php.

If you can grab a copy of that file from your Sources folder, have a look and see if that string exists. Chances are it doesn't, though why not I find strange.

The rest of the uninstallation affecting Load.php is to remove a few lines after the string being sought, so even if you cannot locate the string it wouldn't be too hard to remove it manually (similarly with the other two files that need amending).

At the end of the day though, besides it getting dark, you could always plant your Load.php into this thread and someone could edit it for you.

Yeah, I know, too generous by half :D

Why is it trying to replace that comment in the code. I don't quite understand. That string doesn't really affect the actual code, correct? If I use the package manager and get to the point where it shows the failed test, and I click the icon to show the error to replace it, it brings up a box that displys the code. it give me the option to find then select and replace then select. Can this be used to fix the error?
If I can't find the string when I try to edit the code on my own, how do I know what code to remove? you have me puzzled there. And short of reading through the entir PHP file, what is the best way to find that string? I am not using FTP. I am using the file manager through my control panel

sorry for being such a newb. I am trying my best to learn from this experience as much as possible. I just need a little push getting up the hill


//ResizeImagesToFitScreen mod if ( isset($modSettings['enable_imageFit_mod']) && !empty($modSettings['enable_imageFit_mod']) ) { //Load jQuery library if ( empty($jQueryLoaded) || $jQueryLoaded != true ){     $jQueryLoaded = true; //indicates that jQuery is loaded. This to prevent against several loadings of jquery.js     $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.js"></script>'; } //Use JQuery in NoConflict mode => change $ by JQ $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.library.js"></script>     <script language="JavaScript" type="text/javascript">         if ( JQ == undefined) var JQ = jQuery.noConflict();     </script>'; //Prepare options if (isset($modSettings['imageFit_container']) && !empty($modSettings['imageFit_container'])) $imageFit_container = $modSettings['imageFit_container']; else $imageFit_container = "#forumposts"; if (isset($modSettings['imageFit_included']) && !empty($modSettings['imageFit_included'])) $imageFit_included = 'elements_included:"'.$modSettings['imageFit_included'].'"'; else $imageFit_included = ""; if (isset($modSettings['imageFit_excluded']) && !empty($modSettings['imageFit_excluded'])) $imageFit_excluded = 'elements_excluded:"'.$modSettings['imageFit_excluded'].'"'; else $imageFit_excluded = ""; if (empty($imageFit_excluded) && empty($imageFit_included)) { $imageFit_options = ""; }else if (empty($imageFit_excluded) && !empty($imageFit_included)) { $imageFit_options = "{".$imageFit_included."}"; }else if (!empty($imageFit_excluded) && empty($imageFit_included)) { $imageFit_options = "{".$imageFit_excluded."}"; }else{ $imageFit_options = "{".$imageFit_excluded.",".$imageFit_included."}"; } $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.library.js"></script> <script language="JavaScript" type="text/javascript"> jQuery(window).load(function(){   jQuery("'.$imageFit_container.'").imagefit('.$imageFit_options.'); }); </script>'; } //End mod // This determines the server... not used in many places, except for login fixing.



Is this what needs deleted
Title: Re: Resize Images To Fit Screen
Post by: Shambles on December 06, 2012, 01:23:58 PM
The package itself contains the data that is added after the string that is failing to be found (see install.xml within the mod contents). The package manager is using that comment string as a 'locator' to find the place in the code to install/uninstall the lines that are to be added or, in your case, removed.

Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 01:33:45 PM
did you catch my edit. I pasted some code, asking if thats what I need to manually delete. I used the code tags to insert the code to show you and it didnt disply right at all. But I think it is good enough for you to tell me yes or no if that is what needs deleted
Title: Re: Resize Images To Fit Screen
Post by: Shambles on December 06, 2012, 01:37:48 PM
Sorry I didn't catch your edit (I use the "show new" function on forums, which doesn't catch edited posts)

Yes, that's the code that needs to come out, upto and including the "// End mod" (but nothing after that).


Have to say, I do admire someone who's prepared to roll their sleeves up and have a go :)
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 01:41:04 PM
Like I said, I just need a push. Ill do the work, I just don't want to crash everything when a simple answer can guide me in the right direction at least
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 01:55:56 PM
OK...i just read the entire php file and I don't see that code anywhere
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 02:01:11 PM
Quote from: Shambles™ on December 06, 2012, 12:11:18 PM
Quote from: Silvershark78 on December 06, 2012, 11:55:43 AM
Hey everybody

Your single failure is the package manager trying to find the string "// This determines the server... not used in many places, except for login fixing." within the file Load.php.


I found this string but not the code that needs deleted



wait a minute...if this mod isnt working, which is why i am trying to uninstall and reinstall, and I found the  //this determines..., do I just need to add the "//resizeimagetofitscreen" code in place of the ///this determines. If I replace that small string of code with the code for the mod, will it work again. Am I thinking straight hereb  ***hold on this might not be right


ok...I opened up the xml file for the install file for the mod. It directs it to find the string you pointed out. then it says to <add> after that string. so if I find that string, insert from where it says <add> and all the code after it, will that fix the mod so that i don't even have to uninstall it. Sorry, im kind of making some educated guesses

What i don't understand is, if the mod was installed and working properly, it added the code after that string, and everything was ok, Why did that code dissapear? Why is it not in the PHP file? Obviously, I assume, that it wont uninstall because that code isnt even there anymore


file name="$sourcedir/Load.php"> -<operation> -<search position="after">
<![CDATA[ // This determines the server... not used in many places, except for login fixing.]]>
</search> -<add>
<![CDATA[ //ResizeImagesToFitScreen mod if ( isset($modSettings['enable_imageFit_mod']) && !empty($modSettings['enable_imageFit_mod']) ) { //Load jQuery library if ( empty($jQueryLoaded) || $jQueryLoaded != true ){ $jQueryLoaded = true; //indicates that jQuery is loaded. This to prevent against several loadings of jquery.js $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.js"></script>'; } //Use JQuery in NoConflict mode => change $ by JQ $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.library.js"></script> <script language="JavaScript" type="text/javascript"> if ( JQ == undefined) var JQ = jQuery.noConflict(); </script>'; //Prepare options if (isset($modSettings['imageFit_container']) && !empty($modSettings['imageFit_container'])) $imageFit_container = $modSettings['imageFit_container']; else $imageFit_container = "#forumposts"; if (isset($modSettings['imageFit_included']) && !empty($modSettings['imageFit_included'])) $imageFit_included = 'elements_included:"'.$modSettings['imageFit_included'].'"'; else $imageFit_included = ""; if (isset($modSettings['imageFit_excluded']) && !empty($modSettings['imageFit_excluded'])) $imageFit_excluded = 'elements_excluded:"'.$modSettings['imageFit_excluded'].'"'; else $imageFit_excluded = ""; if (empty($imageFit_excluded) && empty($imageFit_included)) { $imageFit_options = ""; }else if (empty($imageFit_excluded) && !empty($imageFit_included)) { $imageFit_options = "{".$imageFit_included."}"; }else if (!empty($imageFit_excluded) && empty($imageFit_included)) { $imageFit_options = "{".$imageFit_excluded."}"; }else{ $imageFit_options = "{".$imageFit_excluded.",".$imageFit_included."}"; } $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.library.js"></script> <script language="JavaScript" type="text/javascript"> jQuery(window).load(function(){ jQuery("'.$imageFit_container.'").imagefit('.$imageFit_options.'); }); </script>'; } //End mod ]]>
</add> </operation> </file> -<file name="$sourcedir/ManageSettings.php"> -<operation> -<search position="before">
<![CDATA[// Mod authors, add any settings UNDER this line. Include a comma at the end of the line and don't remove this statement!!]]>
</search> -<add>
<![CDATA[ array('check', 'enable_imageFit_mod'), array('text', 'imageFit_container','30'), array('text', 'imageFit_included','50'), '', ]]>
</add> </operation> </file> </modification>


OK. so like I said. it directs it to search for the string correct? Then it says <add>. So I assume if I copy and paste the proper parts of the code from this xml file, it will fix it, correct?

or is this all I should copy and paste after that string
//ResizeImagesToFitScreen mod if ( isset($modSettings['enable_imageFit_mod']) && !empty($modSettings['enable_imageFit_mod']) ) { //Load jQuery library if ( empty($jQueryLoaded) || $jQueryLoaded != true ){ $jQueryLoaded = true; //indicates that jQuery is loaded. This to prevent against several loadings of jquery.js $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.js"></script>'; } //Use JQuery in NoConflict mode => change $ by JQ $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.library.js"></script> <script language="JavaScript" type="text/javascript"> if ( JQ == undefined) var JQ = jQuery.noConflict(); </script>'; //Prepare options if (isset($modSettings['imageFit_container']) && !empty($modSettings['imageFit_container'])) $imageFit_container = $modSettings['imageFit_container']; else $imageFit_container = "#forumposts"; if (isset($modSettings['imageFit_included']) && !empty($modSettings['imageFit_included'])) $imageFit_included = 'elements_included:"'.$modSettings['imageFit_included'].'"'; else $imageFit_included = ""; if (isset($modSettings['imageFit_excluded']) && !empty($modSettings['imageFit_excluded'])) $imageFit_excluded = 'elements_excluded:"'.$modSettings['imageFit_excluded'].'"'; else $imageFit_excluded = ""; if (empty($imageFit_excluded) && empty($imageFit_included)) { $imageFit_options = ""; }else if (empty($imageFit_excluded) && !empty($imageFit_included)) { $imageFit_options = "{".$imageFit_included."}"; }else if (!empty($imageFit_excluded) && empty($imageFit_included)) { $imageFit_options = "{".$imageFit_excluded."}"; }else{ $imageFit_options = "{".$imageFit_excluded.",".$imageFit_included."}"; } $context['html_headers'] .= ' <script language="JavaScript" type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/imagefit.jquery.library.js"></script> <script language="JavaScript" type="text/javascript"> jQuery(window).load(function(){ jQuery("'.$imageFit_container.'").imagefit('.$imageFit_options.'); }); </script>'; } //End mod
Title: Re: Resize Images To Fit Screen
Post by: Shambles on December 06, 2012, 02:24:19 PM
The mod was not in the Load.php you attached earlier.

You must have special powers.

Check the other two files named in the install.xml file - see if the lines they mentioned have also disappeared.
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 02:48:37 PM
That would be the lanquage pack correct. and yes I am serious...lol...the entire portion of the code I pasted is absolutely not there. Check it out if you have time to look at the php file. Its about 5/8 of the way down
Title: Re: Resize Images To Fit Screen
Post by: Shambles on December 06, 2012, 02:51:39 PM
I did download and check out your Load.php, which is why I said this:

QuoteThe mod was not in the Load.php you attached earlier.

Also,

QuoteCheck the other two files named in the install.xml file - see if the lines they mentioned have also disappeared.

Those two files being Modifications.english.php and ManageSettings.php
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 02:55:25 PM
oh sorry i missed that. I have been editing the posts to avoid useless double posting and I must have read right over that...oh crap you did say that...sorry i didnt read it correctky
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 03:11:17 PM
No the code is not there. It is as if the mod was never installed. But it passed the test for the uninstall




Man I am very lost. I have a lot to learn apperently

**edit again
I have looked for every load.php file i can find and none of them have a modified date that isnt 2 or 3 weeks old. This is a real pain in the ass
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 03:29:59 PM
OK! I found it. so to clarify, since it cannot find the string, delete the MOD code and then try to uninstall it again

now actually I have found two. on modified yesterday at 2 on the morning. which sounds about right that is the one I attached.
But there is one dated for today at 530 am that is called load.php~
It has the string but not the mod
so do i rename the load.php~ to load.php and erase the one from yesterday?
or do I delete the code from the load.php from yesterday without the string and delete the entire file load.php~


****EDIT
to make it really confusing, do i take the one with the proper string, manually insert the code and delete the one with the code and not the string? would that fix just about all my problems. I would have the right code, with the right string
Title: Re: Resize Images To Fit Screen
Post by: Shambles on December 06, 2012, 03:42:04 PM
The file with the tilda ~ suffix is a backup made by your package manager - ignore it.

It's all getting very confusing.

If none of the three files contain any trace of the mod, why not just leave it at that? Consider it uninstalled?
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 03:48:38 PM
OK. to clear it up...sorry. I found load.php (wich is attached as load (2).php
It has the code for the mod. It does not have the string you originally told me to look for on the last page. I assume that is the reason for the error like you said.

The one with the tilda does not have the code. so it made a backup without the code (but with the string...IDK how)

so to go ALL the way back to what you originall said. manually delete the code from the php file. Will it then uninstall via the package manager. or do I delete the code and then entirely delete the mod from the package manager and start fresh by uploading an entirely new zip file to the package manager and reinstall

I really am trying hard. I'll PM you in a year and let you know how much i have learnered or not learned :)
I hope i cleared that up. It is hard to be clear when I am to confused by the entire issue
Title: Re: Resize Images To Fit Screen
Post by: Shambles on December 06, 2012, 04:10:58 PM
You're doing fine so far.

Probably the simplest way forward would be to get that search string back into the Load.php, which hopefully you got from the Sources folder. Then, reupload that file (overwriting what's there) and retry the uninstall sequence.

You automatically have backups here on sm.org but I recommend you keep a separate copy on your PC.

If you need help adding that string in, just call.
Title: Re: Resize Images To Fit Screen
Post by: Silvershark78 on December 06, 2012, 04:30:22 PM
I just backed up the forum and everything. Said screw it. uninstalled it anyways and clicked delete. Then I uploaded it, installed it and it works fine. Thanks you so much for your patience. I just refused to give up and let someone hand it to me...lol. So I took a risk and fortunately, after evaluating as much as I could by looking it over numerous times, it worked. Thank you for even taking the time to talk to me. I may not have got the issue done properly, but it gave me some understanding off what I was looking at and trying to accomplish.

have a good day

-Mike
Title: Re: Resize Images To Fit Screen
Post by: Jack_40k on January 30, 2013, 01:29:39 AM
Any chance of an update??
Title: Re: Resize Images To Fit Screen
Post by: HunterP on January 30, 2013, 05:39:55 AM
Quote from: Jack_40k on January 30, 2013, 01:29:39 AM
Any chance of an update??

What exactly needs to be updated?
Title: Re: Resize Images To Fit Screen
Post by: JoaoSatriano on May 02, 2013, 06:12:41 PM
Hello, I'm having trouble with this mod to work, I am already sick of the install and uninstall, and it does not work, and the most impressive is that the installation does not occur any error. sorry for my english :)
Title: Re: Resize Images To Fit Screen
Post by: mike1984 on May 09, 2013, 11:18:14 AM
Quote from: imaxorz on December 04, 2011, 03:25:40 PM
This doesn't work with spoilers.

When previewing a topic it does show images inside a spoiler, but however when the topic is posted and you look inside the spoiler, images don't show.

Anyone got a fix for that?

Does anyone have a fix for this, or any idea of what might be causing it? I tried looking at the code, but the main Javascript file is unreadable.

The problem seems to be that the image is being shown to have a maximum height and width of zero. Presumably this is down to how the image size is determined, but the code is too poorly-formatted to understand it myself, and I don't know much Javascript anyway.

This is causing a serious problem, because I need images to be spoilerable (for NSFW images, primarily), and I can't see how to fix it.
Title: Re: Resize Images To Fit Screen
Post by: NekoJonez on May 30, 2013, 07:24:03 AM
Well, this mod made visiting my forum with Chrome nearly impossible. :/
Title: Re: Resize Images To Fit Screen
Post by: 72 454 on July 05, 2013, 12:41:38 PM
Quote from: JonezJeA on May 30, 2013, 07:24:03 AM
Well, this mod made visiting my forum with Chrome nearly impossible. :/

What is this mod doing that slows browsing down?
Title: Re: Resize Images To Fit Screen
Post by: HunterP on July 05, 2013, 05:20:36 PM
Quote from: JonezJeA on May 30, 2013, 07:24:03 AM
Well, this mod made visiting my forum with Chrome nearly impossible. :/

Try this: http://www.simplemachines.org/community/index.php?topic=505050