Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Image Resize
Andyb
Posted on 02 Feb 2010, 22:38:20

Access: Member
Total Posts: 18
Joined: 2008-05-16

When I add an image and include the max height and width variables on the relevant page the image is included and resized but is just a black box and not the actual photo ?

When I click the image I get the proper full size version ?

Any ideas ?

AndyB
#1810
Chris
Posted on 03 Feb 2010, 09:38:46

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

This would mean that the system is unable to grab the image then resize it. It could be a permissions problem or a path problem. Could it be something to do with the previous thread you made here?
#1811
Andyb
Posted on 15 Feb 2010, 18:39:34

Access: Member
Total Posts: 18
Joined: 2008-05-16

Thanks for the hint Chris,

I seem to be getting somewhere.
I have changed the Image Uploads Path in Options - System Configuration to:

/home/sites/mysitename.co.uk/public_html/content/uploads/ and this now works for scaling the image in the news, however, the image link to enlarge now does not work as it has a link of :

http://www.mysitename.co.uk/home/sites/mysitename.co.uk/public_html/content/uploads/myimage.jpg

I assume that I can edit the coded link to compensate (I would also like to change the 'Image' alt or title tag, please can you point me in the right direction,

Thanks.

Andy B.
#1883
Chris
Posted on 15 Feb 2010, 18:48:51

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

bbparser.php, towards the top you'll see this code

Code:
    global $image_maxheight, $image_maxwidth, $adminpath;
    $str = str_replace(" ", "%20",$str);
    $caption = stripslashes($caption);
    list($width, $height, $type, $attr) = getimagesize("$str");
    if(!$image_maxheight){ $image_maxheight = $height; }
    if(!$image_maxwidth){ $image_maxwidth = $width; }


Below that add this line of code which should hopefully fix it.

Code:
$str = str_replace("home/sites/mysitename.co.uk/public_html/content", "news", $str);


This will replace "/home/sites/mysitename.co.uk/public_html/content" with "news", "news" is the actual news directory so if you've named it something else you change it to that.
#1884
Andyb
Posted on 15 Feb 2010, 19:03:53

Access: Member
Total Posts: 18
Joined: 2008-05-16

Thanks Chris,

I tried that but it stops the thumnail from showing again, changing the thumbnail path and it becomes black again ! but the linked larger image shows if I click the thumbnail.

Andy B.
#1885
Chris
Posted on 15 Feb 2010, 19:27:08

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Try this, the same line I said to add in my previous post, change it to this

Code:
$fullpath = str_replace("home/sites/mysitename.co.uk/public_html/content", "news", $str);


then if you scroll down a few lines until you see this

Code:
return "<div class=\"image_container\" style=\"width: $new_width" . "px\"><a href=\"$str\"><img class=\"fullnewsimage\" alt=\"image\" src=\"" . $adminpath . "?action=options&mod=imageuploads&width=$new_width&height=$new_height&thumb=$str\" /></a><br style=\"clear: both\" /><span class=\"image_caption\">$caption</span></div>";


change that to

Code:
return "<div class=\"image_container\" style=\"width: $new_width" . "px\"><a href=\"$fullpath\"><img class=\"fullnewsimage\" alt=\"image\" src=\"" . $adminpath . "?action=options&mod=imageuploads&width=$new_width&height=$new_height&thumb=$str\" /></a><br style=\"clear: both\" /><span class=\"image_caption\">$caption</span></div>";
#1886
Andyb
Posted on 15 Feb 2010, 19:53:55

Access: Member
Total Posts: 18
Joined: 2008-05-16

Brilliant ! That sorted it.

I also changed:

Code:
 
alt=\"image\"


to:

Code:

title=\"Click to Enlarge\"


as alt doesn't work in Firefox,

Thanks,

Andy B.
#1892
Last edited by Andyb at 2010-02-15 19:54:37 Reason:
Chris
Posted on 15 Feb 2010, 20:03:22

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

For firefox use title, title="Click to enlarge"
#1893
Network-13.com © 2013