Possible to show Album owner in description? Possible to show Album owner in description?
 

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

Possible to show Album owner in description?

Started by ib2loud, April 21, 2011, 03:57:17 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ib2loud

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.

ib2loud

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

Αndré

Quote from: ib2loud on April 21, 2011, 03:57:17 PM
the main home page category list when expanded and the album list
Do you mean the following views?

If not, please post links and maybe also screenshots if it's hard to explain.

ib2loud

Those are the links I was wanting it to show on. Thanks.

Αndré

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.

ib2loud

perfect! thank you so much. It worked like a charm

ib2loud

One more question and sorry to bug but is it possible to make the uploader's name link to their profile?

Αndré

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.

ib2loud

Again, thank you so much. That worked just right

doppler

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?

Αndré

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.