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]: Thumbnail-view question about statistics  (Read 2801 times)

0 Members and 1 Guest are viewing this topic.

furiousweebee

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
[Solved]: Thumbnail-view question about statistics
« on: June 03, 2004, 06:56:57 am »

Man that was hard to word the subject of this topic.

But anyway, on the thumbnail gallery view (where all the photos of that album are displayed), it has the title of each image, in addition to the number of views. This is a ridiculously trivial thing, but I'd like to put some spacing between the title and the "-X Views" text underneath the images. I've looked through the English.php, theme.php and several other pages but can't seem to find it exactly. Any help finding this piece of code would be greatly appreciated. Thanks.
« Last Edit: June 09, 2004, 09:33:57 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Thumbnail-view question about statistics
« Reply #1 on: June 03, 2004, 07:11:52 am »

edit include/functions.inc.php and find
Code: [Select]
                // Set picture caption
                if ($set_caption) foreach ($rowset as $key => $row){
                        $caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title'].(($rowset[$key]['title'])?"-":"").sprintf($lang_get_pic_data['n_views'], $rowset[$key]['hits'])."</span>" : '';
                        if ($CONFIG['caption_in_thumbview']){
                           $caption .= $rowset[$key]['caption'] ? "<span class=\"thumb_caption\">".bb_decode(($rowset[$key]['caption']))."</span>" : '';
                        }
                        if ($CONFIG['display_comment_count']) {
                                $comments_nr = count_pic_comments($row['pid']);
                                if ($comments_nr > 0) $caption .= "<span class=\"thumb_num_comments\">".sprintf($lang_get_pic_data['n_comments'], $comments_nr )."</span>";
                        }
                        $rowset[$key]['caption_text'] = $caption;
                }

                return $rowset;
        }
Edit accordingly...

GauGau
Logged

furiousweebee

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Thumbnail-view question about statistics
« Reply #2 on: June 08, 2004, 06:17:11 am »

Thanks for the help, I've found that part but I'm by no means a PHP expert so I'm not sure which part I should be removing. I want to get rid of the dash, followed by the number of views. Could you possibly show me what I should change the code to? Sorry to be a pain... and thanks again.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Thumbnail-view question about statistics
« Reply #3 on: June 08, 2004, 08:29:18 am »

Replace
Code: [Select]
$caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title'].(($rowset[$key]['title'])?"-":"").sprintf($lang_get_pic_data['n_views'], $rowset[$key]['hits'])."</span>" : '';with
Code: [Select]
$caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title'];
GauGau
Logged

furiousweebee

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Thumbnail-view question about statistics
« Reply #4 on: June 09, 2004, 03:15:02 am »

Thanks for that. It ended up being slightly different to what you said. So in case anyone else wants to do this in future, here's what I changed it to:

Code: [Select]
$caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title']."</span>":"";
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 18 queries.