Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 241
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 246
Total: 246

Author Topic: Photos  (Read 14314 times)

0 Members and 1 Guest are viewing this topic.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16452
    • View Profile
Re: Photos
« Reply #15 on: January 23, 2009, 07:35:24 am »
Very busy at the moment. I could remove this feature in mean time if need be. Features take a long time to add/change months.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline vkot

  • Full Member
  • ***
  • Posts: 136
    • View Profile
Re: Photos
« Reply #16 on: October 23, 2009, 06:15:24 am »
In my installation I had modified the <img> tag of the remote images and added inside it:

Code: [Select]
width="' . $modSettings['class_set_thumb_width'] . '" height="' . $modSettings['class_set_thumb_height'] . '"
So that they have the max dimensions of the thumbnails and don't mess up the listing index, etc. But the problems were:
- The image most likely will be distorted because of different width/height ratio.
- There is no real thumbnail. The image is loaded in it's full file size, which can be slow.

So... I searched the internet and I found various scripts creating thumbnails on-the-fly, or/and saving to disk, and I did it :) Here are the instructions:

1) Download the script at http://www.zubrag.com/scripts/thumbnail-generator.php and upload the 2 files to the root path of your forum.

2) In thumb.php change the images folder to $images_folder = '';
(There are a couple of other parameters too, like image quality, etc.)

3) Comment out the following line because the script is refusing to work with remote filenames (but it can).
In thumb.php find
Code: [Select]
if (!file_exists($images_folder)) die('Images folder does not exist (update $images_folder in the script)');
and add // before it:
Code: [Select]
//if (!file_exists($images_folder)) die('Images folder does not exist (update $images_folder in the script)');
4) In classifieds.template.php
change:
Code: [Select]
echo '<a href="', $scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '"><img src="', $row['remotefilename'], '" alt="" /></a>'; to:
Code: [Select]
echo '<a href="', $scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '"><img src="/thumb.php?src=', $row['remotefilename'], '&x=' . $modSettings['class_set_thumb_width'] . '&y=' . $modSettings['class_set_thumb_height'] . '&f=0" alt="" /></a>';
change:
Code: [Select]
echo '<a href="', $row['remotefilename'], '" rel="lightbox[listing]"><img src="', $row['remotefilename'], '" alt="" /></a><br />';to:
Code: [Select]
echo '<a href="', $row['remotefilename'], '" rel="lightbox[listing]"><img src="/thumb.php?src=', $row['remotefilename'], '&x=' . $modSettings['class_set_thumb_width'] . '&y=' . $modSettings['class_set_thumb_height'] . '&f=0" alt="" /></a><br />';
change:
Code: [Select]
echo '<a href="' . $row['remotefilename']  . '" target="_blank" rel="lightbox[listing]"><img src="' . $row['remotefilename']  . '" alt="" /></a>';to:
Code: [Select]
echo '<a href="' . $row['remotefilename']  . '" target="_blank" rel="lightbox[listing]"><img src="/thumb.php?src=', $row['remotefilename'], '&x=' . $modSettings['class_set_thumb_width'] . '&y=' . $modSettings['class_set_thumb_height'] . '&f=0" alt="" /></a>';
change:
Code: [Select]
echo '<td align="center"><a href="' . $row['remotefilename'] . '" target="blank"><img src="' . $row['remotefilename'] . '" alt="" /></a></td>';to:
Code: [Select]
echo '<td align="center"><a href="' . $row['remotefilename'] . '" target="blank"><img src="/thumb.php?src=', $row['remotefilename'], '&x=' . $modSettings['class_set_thumb_width'] . '&y=' . $modSettings['class_set_thumb_height'] . '&f=0" alt="" /></a></td>';
change:
Code: [Select]
echo '<a href="', $scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '"><img alt="" src="', $row['remotefilename'], '" /></a><br />';to:
Code: [Select]
echo '<a href="', $scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '"><img alt="" src="/thumb.php?src=', $row['remotefilename'], '&x=' . $modSettings['class_set_thumb_width'] . '&y=' . $modSettings['class_set_thumb_height'] . '&f=0" /></a><br />';
change:
Code: [Select]
echo '<a href="', $scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '"><img src="',  $row['remotefilename'], '" alt="" /></a>';to:
Code: [Select]
echo '<a href="', $scripturl, '?action=classifieds;sa=view;id=', $row['ID_LISTING'], '"><img src="/thumb.php?src=', $row['remotefilename'], '&x=' . $modSettings['class_set_thumb_width'] . '&y=' . $modSettings['class_set_thumb_height'] . '&f=0" alt="" /></a>';
« Last Edit: October 23, 2009, 06:18:24 am by vkot »

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
4278 Views
Last post August 24, 2009, 09:19:02 pm
by SMFHacks
9 Replies
6303 Views
Last post May 11, 2010, 11:45:12 pm
by lego
7 Replies
6127 Views
Last post August 24, 2010, 08:10:40 am
by SMFHacks
18 Replies
10187 Views
Last post December 24, 2011, 10:41:25 pm
by RollingRock
10 Replies
9269 Views
Last post September 09, 2014, 08:56:53 am
by Jonas1975

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal