[Solved]: Custom User Fields on thumbnails.php [Solved]: Custom User Fields on thumbnails.php
 

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

[Solved]: Custom User Fields on thumbnails.php

Started by MarianneC, August 27, 2008, 09:11:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MarianneC

Trying in a separate thread in case this is viewed as a separate issue.

Using the help in another thread with a code chunk provided by Nibbler, I modified functions.inc.php intending that my custom user fields would show up in each thumbnail view as part of the caption.

It is showing up on thumbnail views in the search function, but it is not showing up on thumbnails.php.  In other words,

I can see the custom fields here:

http://www.useaboston.com/2008a/thumbnails.php?album=search&type=full&search=Fabric

But not here:

http://www.useaboston.com/2008a/thumbnails.php?album=1&page=1&sort=na

I thought that the build caption() function would be used in both places.  Is there some other place that I need to modify to have the fields show up on thumbnails.php?

Here is the code as it is right now:


        if ($CONFIG['caption_in_thumbview']){


            $caption .= $row['caption'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['caption']))."</span>" : '';


        }

// MBC modifications to show custom fields on thumbnail view

        if ($CONFIG['user_field4_name']){
            $caption .= $row['user4'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['user4']))."</span>" : '';
        }

        if ($CONFIG['user_field1_name']){
            $caption .= $row['user1'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['user1']))."</span>" : '';
        }

        if ($CONFIG['user_field2_name']){
            $caption .= $row['user2'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['user2']))."</span>" : '';
        }

        if ($CONFIG['user_field3_name']){
            $caption .= $row['user3'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['user3']))."</span>" : '';
        }


Many thanks for the guidance!

Marianne

MarianneC

Am I missing something obvious about why build caption() does not work for all instances of caption?

Nibbler

You need to edit include/functions.inc.php

if($select_columns != '*') $select_columns .= ', title, caption,hits,owner_id,owner_name';

Change to

if($select_columns != '*') $select_columns .= ', title, caption,hits,owner_id,owner_name, user1, user2, user3, user4';

MarianneC