Support Forum Project Downloads FAQ Documentation About Demo Tutorials Blog Plugins
November 21, 2009, 04:57:14 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: cpg1.5.2 beta released
The brand new cpg1.5.x series that comes with a lot of new features finally has reached the release stage: a first public beta release cpg1.5.2 has been released that is mainly aimed at translators, testers and community members that have contributed in the past. The beta release is not meant to be used in a production environment, but only on testbeds and for evaluation purposes. There is currently no support for cpg1.5.x yet!
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: [Done]: Enhance Pic Manager with thumbnails  (Read 1455 times)
0 Members and 1 Guest are viewing this topic.
Gene-2008 Topic starter
Contributor
***
United States United States

Posts: 119


« on: August 23, 2009, 02:31:55 am »

Don't know whether to post this here, but here goes.

I'd like to suggest adding thumbnails to the sort pictures.

I changed picmgr.php in the following ways:
Find this
Code:
$result = cpg_db_query("SELECT aid, pid, filename, title FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = $aid ORDER BY position ASC, pid");

And changed it to this:
Code:
$result = cpg_db_query("SELECT aid, pid, filepath, filename, title, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} WHERE aid = $aid ORDER BY position ASC, pid");

Find this
Code:
           if($get_pohoto_name == ''){
                $get_pohoto_name = $picture['filename'];    
            }

And add this after it:
Code:
if ($picture['pheight'] < $picture['pwidth'] ) { //landscape
$thb_width = $CONFIG['thumb_width'] ;
$thb_height = round($CONFIG['thumb_height'] * $picture['pheight'] / $picture['pwidth']);
} else {
$thb_width = round($CONFIG['thumb_width'] * $picture['pwidth'] / $picture['pheight']);
$thb_height = $CONFIG['thumb_height'] ;
}

Find this:
Code:
$lb .='<tr id=sort-'.$picture["pid"].' ><td class="dragHandle"></td><td width="96%">'.$get_pohoto_name.'</td></tr>';

And change it to this:
Code:
$lb .='<tr id=sort-'.$picture["pid"].' ><td class="dragHandle"></td><td width="96%">'.$get_pohoto_name.'&nbsp;&nbsp;&nbsp;&nbsp;'
             .'<img src="albums/'.$picture['filepath'].$CONFIG['thumb_pfx'].$get_pohoto_name
                .'" class="image" width="'.$thb_width
             .'" height="'.$thb_height
             .'" border="0" alt="'.$get_pohoto_name
             .'" /></td></tr>';

Attached is the result.

Hope you find this useful,
Gene
« Last Edit: August 23, 2009, 12:44:05 pm by Joachim Müller » Report to moderator   Logged
Joachim Müller
Administrator
*****
Gender: Male
Germany Germany

Posts: 45051


aka "GauGau"


WWW
« Reply #1 on: August 23, 2009, 11:30:29 am »

Valid suggestion. I'll look into this to see if this can still be added.
Report to moderator   Logged
Joachim Müller
Administrator
*****
Gender: Male
Germany Germany

Posts: 45051


aka "GauGau"


WWW
« Reply #2 on: August 23, 2009, 12:43:52 pm »

OK, this is in fact a bit more tricky than I originally anticipated, as you have to catter for non-images as well, but I came up with some code to accomplish this suggestion, went into rev6512. Marking as "done".
Report to moderator   Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.085 seconds with 15 queries.