Advanced search  

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

Pages: [1]   Go Down

Author Topic: Album Description  (Read 5801 times)

0 Members and 1 Guest are viewing this topic.

SpookyDan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Album Description
« on: August 21, 2006, 05:03:58 pm »

Is there a way to:

1. Make the album description also show up at the top of the thumbnails page?

2. Make the description shown on the album list a shortened version of that?  Possibly cut off after a certain number of characters.

For example: 

On the album list my description would read:
"St. Mary’s College also known as “Hell House” was originally named Mount..."

On the top of the thumbnail page my description would read:
"St. Mary’s College also known as “Hell House” was originally named Mount Saint Clemens. The religious school for boys was started in the mid 1800s by a religious group calling themselves “The Redemptorists”. In 1882 a new chapel was built and encouragement from Pope Poious IX led the Redemptorists to change the name of the school to St. Mary’s College."
« Last Edit: September 15, 2006, 06:05:41 am by GauGau »
Logged

SpookyDan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: Album Description
« Reply #1 on: August 23, 2006, 08:30:34 pm »

Under the thumbnail view page options there is a check box for "Display album description" but it still doesnt display the album discription on the thumbnails page no matter what I have it set at.

Still looking for help with this.  I do have my theme pretty much dialed in tho: http://www.urbanatrophy.com/coppermine/index.php
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Album Description
« Reply #2 on: August 23, 2006, 09:14:59 pm »

for 1.3 ... http://forum.coppermine-gallery.net/index.php?topic=8946.0
you'll have to look for the mentioned function(s) in themes/sample/theme.php and copy them over to the theme you're using. Haven't tested if it works for 1.4 though

kit99

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Album Description
« Reply #3 on: September 14, 2006, 06:20:44 am »

It works on 1.48. I am working on my wedding website and very new to php so took me a while to figure it out and it is actually very simple. I modify the code a bit by Jack76 and xplicit http://forum.coppermine-gallery.net/index.php?topic=8946.0 then  in /themes/myfavoritetheme/theme.php

Find
Code: [Select]
    $result = db_query("SELECT description from {$CONFIG['TABLE_ALBUMS']} WHERE aid='$aid'");

Change to
Code: [Select]
    $result = cpg_db_query("SELECT description from {$CONFIG['TABLE_ALBUMS']} WHERE aid='$aid'");

Then add
Code: [Select]
// HTML template for title row of the thumbnail view (album title + sort options)

<td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2><P><h3>[b]${album_desc}[/b]</h3></p></td>


Thanks all for sharing your code.
« Last Edit: September 14, 2006, 06:47:29 pm by kit99 »
Logged

johndankey

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Album Description
« Reply #4 on: October 02, 2006, 06:08:16 pm »

Thanks all for sharing your code.  When I did this from kit99,
Code: [Select]
<td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2><P><h3>[b]${album_desc}[/b]</h3></p></td>


{album_desc} shows up blank.  How would you define {album_desc}?

Thanks,

JD
Logged
Thank god for Coppermine!

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Album Description
« Reply #5 on: October 02, 2006, 06:13:28 pm »

It should be {$album_desc}
Logged
‍I don't answer to PM with support question
Please post your issue to related board

johndankey

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Album Description
« Reply #6 on: October 02, 2006, 08:48:02 pm »

Thanks, Sami.  Um, are you sure about that?  I grepped  {$album_desc} & found nothing.  But I grepped {album_desc} & found nothing either.  Oops.  Checked the boards again & found references here to {ALB_DESC} in the sample theme & theme.inc.php.  They are in function theme_display_album_list & function theme_display_album_list_cat.

The code works for the home page, but not for the album page.  Neither of those functions, when added to theme.php, make a difference.

Elsewhere in sample/theme.php it makes a reference to $album_name.  I grepped that & it seems to be defined in searchnew.php from $album_array.  $album_array is defined in function getallalbumsindb() in searchnew.php. 

Maybe we should have a hair-pulling smilie ???

JD
Logged
Thank god for Coppermine!

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Album Description
« Reply #7 on: October 03, 2006, 07:47:44 am »

okey lets do this again:
- open up themes/your theme/theme.php
- put this function
Code: [Select]
// Get the name of an album
function get_album_desc($aid)
{
    global $CONFIG;
    global $lang_errors;
    $result = cpg_db_query("SELECT description from {$CONFIG['TABLE_ALBUMS']} WHERE aid='$aid'");
    $count = mysql_num_rows($result);
    if ($count > 0) {
        $row = mysql_fetch_array($result);
        return $row['description'];
    } else {
        return "Album not found";
    }
}
- and add this to your theme.php after that function
Code: [Select]
$album_desc = get_album_desc($_GET[album]);
- and then if you don't have $template_thumb_view_title_row variable on theme.php copy it from include\theme.inc.php and add this to that variable where you want to show the description
Code: [Select]
{$album_desc}

I Hope it work for you :)
Logged
‍I don't answer to PM with support question
Please post your issue to related board

johndankey

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Album Description
« Reply #8 on: October 04, 2006, 01:53:15 am »

Thanks, Sami, that worked ;D

I included that function, put

Code: [Select]
$album_desc = get_album_desc($_GET[album]);
early on in my theme.php & included $album_desc in the $template_thumb_view_title_row variable, for those of you who may want to do this same thing.

Thanks again!

JD
Logged
Thank god for Coppermine!
Pages: [1]   Go Up
 

Page created in 0.038 seconds with 21 queries.