coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: SpookyDan on August 21, 2006, 05:03:58 PM

Title: Album Description
Post by: SpookyDan 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."
Title: Re: Album Description
Post by: SpookyDan 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
Title: Re: Album Description
Post by: Stramm 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
Title: Re: Album Description
Post by: kit99 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 (http://forum.coppermine-gallery.net/index.php?topic=8946.0) then  in /themes/myfavoritetheme/theme.php

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


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


Then add
// 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.
Title: Re: Album Description
Post by: johndankey on October 02, 2006, 06:08:16 PM
Thanks all for sharing your code.  When I did this from kit99,
Quote from: kit99 on September 14, 2006, 06:20:44 AM

<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
Title: Re: Album Description
Post by: Sami on October 02, 2006, 06:13:28 PM
It should be {$album_desc}
Title: Re: Album Description
Post by: johndankey 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
Title: Re: Album Description
Post by: Sami on October 03, 2006, 07:47:44 AM
okey lets do this again:
- open up themes/your theme/theme.php
- put this function

// 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

$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

{$album_desc}


I Hope it work for you :)
Title: Re: Album Description
Post by: johndankey on October 04, 2006, 01:53:15 AM
Thanks, Sami, that worked ;D

I included that function, put

$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