coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: MarianneC on August 27, 2008, 09:11:57 PM

Title: [Solved]: Custom User Fields on thumbnails.php
Post by: MarianneC on August 27, 2008, 09:11:57 PM
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
Title: Re: Custom User Fields on thumbnails.php
Post by: MarianneC on August 29, 2008, 05:20:03 AM
Am I missing something obvious about why build caption() does not work for all instances of caption?
Title: Re: Custom User Fields on thumbnails.php
Post by: Nibbler on August 29, 2008, 12:05:04 PM
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';
Title: Re: Custom User Fields on thumbnails.php
Post by: MarianneC on August 29, 2008, 02:04:38 PM
Thank you Nibbler!