[Solved]: Thumbnail-view question about statistics [Solved]: Thumbnail-view question about statistics
 

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]: Thumbnail-view question about statistics

Started by furiousweebee, June 03, 2004, 06:56:57 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

furiousweebee

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.

Joachim Müller

edit include/functions.inc.php and find                // 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

furiousweebee

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.

Joachim Müller

Replace $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$caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title'];

GauGau

furiousweebee

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:

$caption = ($rowset[$key]['title']||$rowset[$key]['hits']) ? "<span class=\"thumb_title\">".$rowset[$key]['title']."</span>":"";