forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Frederick on November 25, 2005, 06:14:48 pm

Title: PHP code for "lastadditions"
Post by: Frederick on November 25, 2005, 06:14:48 pm
Hi all,

I'm a bit puzzled about what .php scripts are involved when the "last addition" table is composed.
The problem I'm trying to solve is twofold:
1. the easy problem: instead of a linked uploader name below the thumbnail (e.g. Fred) I would like
to add two little words 'uploaded by' (e.g. uploaded by Fred, with Fred linked to the uid)
2. the hard problem:
in the config page I've added 4 "Custom fields for image description", of which I would like to use
2 below the thumbnail as info-text. The Gallery I made is for terrestrial orchids, and it would be nice
if the thumbnail also had the genus and species of the plant below it (as text, not clickable).

If anybody could point out in what php-file the html is composed, so I can add it there, I would
be very thankfull. I have basic knowledge of php, but it's not enough to digest the architecture
of Coppermine.

Thanks in advance,
Fred

http://cpcomp.mybesthost.com


Title: Re: PHP code for "lastadditions"
Post by: Nibbler on November 25, 2005, 06:21:52 pm
This code in include/functions.inc.php collects the data

Code: [Select]
        case 'lastup': // Last uploads
                if ($META_ALBUM_SET && $CURRENT_CAT_NAME) {
                        $album_name = $lang_meta_album_names['lastup'].' - '. $CURRENT_CAT_NAME;
                } else {
                        $album_name = $lang_meta_album_names['lastup'];
                }

                $query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET";
                $result = cpg_db_query($query);
                $nbEnr = mysql_fetch_array($result);
                $count = $nbEnr[0];
                mysql_free_result($result);


                //if($select_columns != '*' ) $select_columns .= ',title, caption, owner_id, owner_name, aid';
                $select_columns = '*'; //allows building any data into any thumbnail caption
                $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY pid DESC $limit";
                $result = cpg_db_query($query);

                $rowset = cpg_db_fetch_rowset($result);
                mysql_free_result($result);

                if ($set_caption) build_caption($rowset,array('ctime'));

                $rowset = CPGPluginAPI::filter('thumb_caption_lastup',$rowset);

                return $rowset;
                break;

The data is then sent to display_thumbnails() in the same file for processing, and the html output is generated by the theme in the theme_display_thumbnails() function using the template $template_thumbnail_view.
Title: Re: PHP code for "lastadditions"
Post by: Frederick on November 27, 2005, 01:36:18 am
Ahaaah ... thanks for the help!