diffrent class for thumbnails views,date,comments,uploader name diffrent class for thumbnails views,date,comments,uploader name
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

diffrent class for thumbnails views,date,comments,uploader name

Started by allvip, December 09, 2013, 12:37:56 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

allvip

I made changes to include/functions.inc.php to have diffrent class for thumbnails views,date,comments:

before the thumb title and the number users viewed a image had the same class:thumb_title,date and comments had class thumb_capption like thumb description.

for thumbnails views find:


if ($CONFIG['views_in_thumbview'] || in_array('hits', $must_have)) {
            $views = ($mode == 'albums') ? $row['alb_hits'] : $row['hits'];
            $caption .= '<span class="thumb_title">' . sprintf($lang_get_pic_data['n_views'], $views) . '</span>';
        }



replace thumb_title with your class (ex:thumb_view) :


for thumbnails date find:


if (in_array('msg_date', $must_have)) {
            $caption .= '<span class="thumb_caption">' . localised_date($row['msg_date'], $lang_date['lastcom']) . '</span>';



find:


if (in_array('ctime', $must_have)) {
            $caption .= '<span class="thumb_caption">' . localised_date($row['ctime'], $lang_date['lastup']) . '</span>';


find:


if (in_array('mtime', $must_have)) {

            $caption .= '<span class="thumb_caption">' . localised_date($row['mtime'], $lang_date['lasthit']);


replace thumb_caption for all 3 codes with your class (ex: thumb_date)

for thumbnails comments in last comments page find:


if ($row['author_id']) {
                $caption .= '<span class="thumb_caption"><a href="profile.php?uid=' . $row['author_id'] . '">' . $row['msg_author'] . '</a>: ' . $msg_body . '</span>';
            } else {
                $caption .= '<span class="thumb_caption">' . $row['msg_author'] . ': ' . $msg_body . '</span>';


replace thumb_caption with your class (ex:thumb_comments)

add thumb_view,thumb_date and thumb_comments to your your_theme_name/style.css and style it like you want.

for thumbnails uploader name just add .thumb_title a class to your_theme_name/style.css.

allvip

Can I have diffrent class for thumbnails views,date,comments without editing coppermine files?
just to add some code to theme.php?

Αndré

I haven't checked the code but it's probably tricky or even not possible, as the title is created dynamically as you can see. You'd need to find out or guess which span contain which data. As we already added new CSS classes to the development version of cpg1.5.25, I don't mind to add further additional CSS classes. I'll have a look at it.

Αndré

Added CSS classes "thumb_title_title", "thumb_title_views", "thumb_title_owner", "thumb_caption_caption", "thumb_caption_msg_date", "thumb_caption_author", "thumb_caption_ctime", "thumb_caption_rating", "thumb_caption_mtime" to thumbnail meta data on thumbnails.php pages in SVN revision 8623. Will be part of cpg1.5.26 and later.


allvip


phill104

Even if you make a mistake, simply correct it in another post rather than deleting. We are all human and make mistakes.
It is a mistake to think you can solve any major problems just with potatoes.