Preview thumbnails when users uploading photos

This is a discussion on Preview thumbnails when users uploading photos within the v3.1 Modules & Modifications forums, part of the v3.1 Legacy Help & Support category; Hi there, I had a few users request this and got it working by shamelessly ripping off the administration\listinginfo.php file ...


Go Back   68 Classifieds Forums > v3.1 Legacy Help & Support > v3.1 Modules & Modifications

 
LinkBack Thread Tools Display Modes
  #1  
Old 08-31-2007, 04:42 PM
free2take's Avatar
Senior Member
 
Join Date: Mar 2006
Location: Ireland
Posts: 229
Rep Power: 16
Default Preview thumbnails when users uploading photos

Hi there,

I had a few users request this and got it working by shamelessly ripping off the administration\listinginfo.php file but it works ! although requires developer version.

Remember test on dev and backup your files on live before changing stuff !

In usercheckout.php add the following code for case 5 between just before the line //get the total number of images

PHP Code:
$prodID=$rs['oPackageID'];

//get the images info
$sSQL sprintf("SELECT id,pid,title,image FROM ".PREFIX."prodimages WHERE pid = %s ORDER BY rank ASC",$listingid );
$result=$db->query($sSQL);
$image=array();
while (
$rs=$result->fetch()) 
{
      
$rs['title']=safeStripSlashes($rs['title']);
      
$size = @getimagesize('../photos/'.$rs['image']);
      
$rs['width']=$size[0];
      
$rs['height'] = $size[1];
      
$image[]=$rs;
}
                
//get the total number of images 
This catches the image info.

Add the following before the line $class_tpl->assign('body','checkout/step4.tpl.php'); in the same section

PHP Code:
          $class_tpl->assign('data'$image);
        
$class_tpl->assign('body','checkout/step4.tpl.php'); 
This assigns the additional info to the 'checkout/step4.tpl.php' template.

You now need to modify you template to show the images, the file is 'checkout/step4.tpl.php'.
How you choose to display them is up to you now you have all the info in the template, I display them horizontally at the top and use lightbulb so in a cell my code looks like:

PHP Code:
<th colspan="2" valign="top" class="pformleft">        
{if 
$data<>""}
{
html_table_adv loop=$data cols=$numimages table_attr='width="100%"' td_attr='align="center"' td_attr='valign="bottom"'}        
<
a href="photos/[[image]]" rel="lightbox[image]" title="[[title]]"><img src="thumbs/small_[[image]]" hspace="5" vspace="5" class="image" border="0" /></a><br />[[title]]
{/
html_table_adv}
{/if}
</
th
You would have to remove the lighbulb references for your own if not being used. I also use the TH label instead of the TD as on my site it underlines for me.

Here's the result




You'll only ever see your max number of picture -1 in this screen as your automatically forwarded on when you hit your limit.

There you go hope its of use to someone else!
Mully
__________________
v4.08
Reply With Quote
  #2  
Old 09-01-2007, 07:48 PM
calaf6's Avatar
Senior Member
 
Join Date: Mar 2006
Location: UK
Posts: 332
Rep Power: 17
Default

Looks great, I may try that once I get a few other bits done
Reply With Quote
  #3  
Old 10-04-2007, 07:22 PM
Member
 
Join Date: Feb 2007
Posts: 64
Rep Power: 9
Default

Used this on my site, awesome!
Thanks.
__________________
Wayne
Reply With Quote
  #4  
Old 10-06-2007, 06:06 AM
CHRD's Avatar
Senior Member
 
Join Date: Nov 2006
Posts: 165
Rep Power: 12
Default

Nice job, hope to see this as standard in all new releases, I don't know why it wasn't
__________________
Costa del Sol
Spain
v3.1.10 Dev
V4.09 Dev sweeeet
�Powerful you have become, the dark side I sense in you.�
Reply With Quote
  #5  
Old 10-06-2007, 12:30 PM
Maffo's Avatar
The Master
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,402
Rep Power: 41
Default

Nice job Mully and thanks for sharing it with the board.

Quote:
Nice job, hope to see this as standard in all new releases, I don't know why it wasn't
Cos Mully only thought of it now one presumes.
__________________
Super Mod v4 Is out and ready for download. DEMO
Purchase V4 Super Mod BETA at Reduced Price

Visit Me @ Classified-Sofware.co.uk

**Important** - All modules with the exceptions of the Bulk Upload System will be removed from my modshop on Tuesday September 30th. If you require a module you must get it before that date.
Reply With Quote
  #6  
Old 10-10-2007, 08:48 PM
Member
 
Join Date: Oct 2007
Posts: 36
Rep Power: 5
Question awesome, but...?

can anyone tell me how to format the upload window to automaticall push photos to a new line or new row? I deal in large quantities of images, and after 6 or 8, the window keeps expanding off the right side of the page rather than new-lining and going to the next row. I have tried fooling with the table size, but can't get it to hold its width correctly.

Can someone give me a hand? Thanks -

by the way, this is an incredible addition to 68C !!!
Reply With Quote
  #7  
Old 10-11-2007, 10:28 PM
Member
 
Join Date: Feb 2007
Posts: 64
Rep Power: 9
Default

I changed: cols=$numimages
To: cols=4

This starts a new line after 4 images.
__________________
Wayne
Reply With Quote
  #8  
Old 10-12-2007, 01:31 PM
Member
 
Join Date: Oct 2007
Posts: 36
Rep Power: 5
Default

fantastic - thank you!!!

will this still bounce users ahead to the next step in listing an ad after they've used their allotted number of images?
Reply With Quote
  #9  
Old 10-12-2007, 09:29 PM
Member
 
Join Date: Feb 2007
Posts: 64
Rep Power: 9
Default

Yes, for me it does. It shows a preview for all except the last image, because it forwards you at that point.
__________________
Wayne
Reply With Quote
  #10  
Old 10-14-2007, 11:27 AM
Member
 
Join Date: Oct 2007
Posts: 36
Rep Power: 5
Default

Wow.... this is just an incredible help to users listing large quantity of images. Great work. Thanks so much!!
Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading photos page- change button name zman78 v3.0 Questions & Support 11 08-11-2007 02:33 AM
'Users Awating Email Confirmation� group. SkGold v3.1 Suggestions and Feedback 2 07-18-2006 05:30 PM
Users able to upload photos in excess of package limit civ v3.0 Questions & Support 2 06-02-2006 12:14 PM


All times are GMT -4. The time now is 04:08 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22