Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Possible to show Album owner in description?  (Read 4470 times)

0 Members and 1 Guest are viewing this topic.

ib2loud

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 77
  • I <3 CPG!
    • OKShowPics.com
Possible to show Album owner in description?
« 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.
Logged

ib2loud

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 77
  • I <3 CPG!
    • OKShowPics.com
Re: Possible to show Album owner in description?
« Reply #1 on: April 25, 2011, 04:22:42 am »

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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Possible to show Album owner in description?
« Reply #2 on: April 26, 2011, 02:37:55 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.
Logged

ib2loud

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 77
  • I <3 CPG!
    • OKShowPics.com
Re: Possible to show Album owner in description?
« Reply #3 on: April 26, 2011, 02:41:57 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Possible to show Album owner in description?
« Reply #4 on: April 26, 2011, 03:44:00 pm »

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
Code: [Select]
'{ALB_DESC}' => $album['album_desc'],and replace with
Code: [Select]
'{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.
Logged

ib2loud

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 77
  • I <3 CPG!
    • OKShowPics.com
Re: Possible to show Album owner in description?
« Reply #5 on: April 26, 2011, 09:23:35 pm »

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

ib2loud

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 77
  • I <3 CPG!
    • OKShowPics.com
Re: Possible to show Album owner in description?
« Reply #6 on: April 27, 2011, 03:41:50 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Possible to show Album owner in description?
« Reply #7 on: April 27, 2011, 09:08:53 am »

Undo the above changes. Then, find
Code: [Select]
            $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
Code: [Select]
            $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.
Logged

ib2loud

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 77
  • I <3 CPG!
    • OKShowPics.com
Re: Possible to show Album owner in description?
« Reply #8 on: April 27, 2011, 03:08:58 pm »

Again, thank you so much. That worked just right
Logged

doppler

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Possible to show Album owner in description?
« Reply #9 on: October 28, 2011, 06:27:50 pm »

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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Possible to show Album owner in description?
« Reply #10 on: November 03, 2011, 04:17:32 pm »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.062 seconds with 19 queries.