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: [Solved]: Custom User Fields on thumbnails.php  (Read 2559 times)

0 Members and 1 Guest are viewing this topic.

MarianneC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
[Solved]: Custom User Fields on thumbnails.php
« 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:

Code: [Select]
        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
« Last Edit: August 29, 2008, 03:30:39 pm by Nibbler »
Logged

MarianneC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: Custom User Fields on thumbnails.php
« Reply #1 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?
Logged

Nibbler

  • Guest
Re: Custom User Fields on thumbnails.php
« Reply #2 on: August 29, 2008, 12:05:04 pm »

You need to edit include/functions.inc.php

Code: [Select]
if($select_columns != '*') $select_columns .= ', title, caption,hits,owner_id,owner_name';
Change to

Code: [Select]
if($select_columns != '*') $select_columns .= ', title, caption,hits,owner_id,owner_name, user1, user2, user3, user4';
Logged

MarianneC

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: Custom User Fields on thumbnails.php
« Reply #3 on: August 29, 2008, 02:04:38 pm »

Thank you Nibbler!
Logged
Pages: [1]   Go Up
 

Page created in 0.013 seconds with 15 queries.