Dragonfly CMS v9 ⇒ Coppermine ⇒ Add User Link to Meta Albums ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks Coppermine

Add User Link to Meta Albums Reply to topic


The topic i got this mod from was locked, so I will attach it. basically it adds User, Title, Views, Date and No of Comments under the meta generated thumbs, like lastadditions, top viewed etc. Like this.

www.junglewraiths.net/...coppermine

pretty cool except the user links don't work. here is the code if anyone wants to see whats up with it.

// Last uploads case 'lastup': list($count) = $db->sql_ufetchrow("SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON (p.aid = a.aid AND ".VIS_GROUPS." AND $thisalbum) WHERE approved=1 ORDER BY p.pid DESC", SQL_NUM, __FILE__, __LINE__); if (!$count) return array(); if ($select_columns == '*') { $select_columns = 'p.*'; } else { $select_columns = str_replace('pid', 'p.pid', $select_columns) . ', p.title, hits, owner_id, owner_name, hits, caption, description'; } $result = $db->sql_query("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON (p.aid = a.aid AND ".VIS_GROUPS." AND $thisalbum) WHERE approved=1 ORDER BY p.pid DESC $limit", false,__FILE__,__LINE__); $rowset = $db->sql_fetchrowset($result); $db->sql_freeresult($result); if ($set_caption) foreach ($rowset as $key => $row) { if ($row['owner_id'] && $row['owner_name']) { $user_link = '<span class="thumb_title"><a href="$CPG_PROFILE_URL">' . $row['msg_author'] . '</a></span>'; } else { $user_link = ''; } $caption = $user_link . '<span class="thumb_caption">' . localised_date($row['ctime'], LASTUP_DATE_FMT) . '</span>' . ($rowset[$key]['title'] || $rowset[$key]['hits']) ? "<span class=\"thumb_title\">" . $rowset[$key]['title'] . (($rowset[$key]['title'])?"-":"") . sprintf(N_VIEWS, $rowset[$key]['hits']) . "</span>" : ''; if ($CONFIG['caption_in_thumbview']) { $caption .= $user_link . '<span class="thumb_caption">' . localised_date($row['ctime'], LASTUP_DATE_FMT) . '</span>' . $rowset[$key]['caption'] ? "<span class=\"thumb_caption\">" . decode_bbcode($rowset[$key]['caption']) . "</span>" : ''; } if ($CONFIG['display_comment_count']) { $comments_nr = count_pic_comments($row['pid']); if ($comments_nr > -1) $caption .= $user_link . '<span class="thumb_caption">' . localised_date($row['ctime'], LASTUP_DATE_FMT) . '</span>' . "<span class=\"thumb_num_comments\">" . sprintf(N_COMMENTS, $comments_nr) . "</span>"; } $rowset[$key]['caption_text'] = $caption; } return $rowset;

And the original mod is atached.
Attachment: includes_426.zip
Description
Filename includes_426.zip
Filesize 12.19 KiB
Downloaded 1 Time(s)
You are not allowed to view/download this attachment

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0

All times are UTC


Jump to: