forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: ib2loud on April 21, 2011, 03:57:17 pm
-
I tried to see if this had been posted before but had no luck. I want to make the owner of the ablum's username show up in the album description both on the main home page category list when expanded and the album list. I am not a coding expert so I was unable to find the right spot to alter. If this is something simple to do, any help would be appreciated.
-
I've been trying to figure this out with no luck. I'm sure it's something very simple that I've overlooked but if someone can direct me to the right spot that would be awesome.
Here's a gallery link too in case it's needed
http://www.okshowpics.com/digital
-
the main home page category list when expanded and the album list
Do you mean the following views?
- http://www.okshowpics.com/digital/
- http://www.okshowpics.com/digital/index.php?cat=6 (example category '2011')
If not, please post links and maybe also screenshots if it's hard to explain.
-
Those are the links I was wanting it to show on. Thanks.
-
Copy the functions theme_display_album_list and theme_display_album_list_cat from themes/sample/theme.php to your theme's theme.php file, if they don't exist.
Then, find
'{ALB_DESC}' => $album['album_desc'],
and replace with
'{ALB_DESC}' => $album['album_desc'].mysql_result(cpg_db_query("SELECT user_name FROM {$CONFIG['TABLE_USERS']} AS u INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON u.user_id = a.owner WHERE aid = {$album['aid']}"), 0),
in both functions.
-
perfect! thank you so much. It worked like a charm
-
One more question and sorry to bug but is it possible to make the uploader's name link to their profile?
-
Undo the above changes. Then, find
$params = array('{COL_WIDTH}' => $column_width,
'{ALBUM_TITLE}' => $album['album_title'],
'{THUMB_CELL_WIDTH}' => $thumb_cell_width,
'{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}",
'{ALB_LINK_PIC}' => $album['thumb_pic'],
'{ADMIN_MENU}' => $album['album_adm_menu'],
'{ALB_DESC}' => $album['album_desc'],
'{ALB_INFOS}' => $album['album_info'],
'{ALB_HITS}' => $album['alb_hits'],
);
and replace with
$user = mysql_fetch_assoc(cpg_db_query("SELECT user_id, user_name FROM {$CONFIG['TABLE_USERS']} AS u INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON u.user_id = a.owner WHERE aid = {$album['aid']} LIMIT 1"));
$user_profile_link = "<a href=profile.php?uid={$user['user_id']}>{$user['user_name']}</a>";
$params = array('{COL_WIDTH}' => $column_width,
'{ALBUM_TITLE}' => $album['album_title'],
'{THUMB_CELL_WIDTH}' => $thumb_cell_width,
'{ALB_LINK_TGT}' => "thumbnails.php?album={$album['aid']}",
'{ALB_LINK_PIC}' => $album['thumb_pic'],
'{ADMIN_MENU}' => $album['album_adm_menu'],
'{ALB_DESC}' => $album['album_desc'].$user_profile_link,
'{ALB_INFOS}' => $album['album_info'],
'{ALB_HITS}' => $album['alb_hits'],
);
in both functions.
-
Again, thank you so much. That worked just right
-
I have similar problem, but I would like to show owner name just under middle pic (with some other information about picture). It is simple to show other information, but I cannot put owner name, because it not comes with picture information. There is only id of owner. So how to do this and where to place?
-
Just use the get_username function. Next time (or if you need further support) please start a new thread, as it differs from the initial question. Thanks.