PHP code for "lastadditions" PHP code for "lastadditions"
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

PHP code for "lastadditions"

Started by Frederick, November 25, 2005, 06:14:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Frederick

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



Nibbler

This code in include/functions.inc.php collects the data


        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.

Frederick