Advanced search  

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]

Pages: [1]   Go Down

Author Topic: PHP code for "lastadditions"  (Read 5879 times)

0 Members and 1 Guest are viewing this topic.

Frederick

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
PHP code for "lastadditions"
« 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


« Last Edit: November 27, 2005, 02:28:59 am by Nibbler »
Logged

Nibbler

  • Guest
Re: PHP code for "lastadditions"
« Reply #1 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.
Logged

Frederick

  • Coppermine newbie
  • Offline Offline
  • Posts: 16
Re: PHP code for "lastadditions"
« Reply #2 on: November 27, 2005, 01:36:18 am »

Ahaaah ... thanks for the help!
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.