Album Description Album 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

Album Description

Started by SpookyDan, August 21, 2006, 05:03:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SpookyDan

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."

SpookyDan

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

Stramm

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

#3
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
    $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.

johndankey

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
Thank god for Coppermine!

Sami

‍I don't answer to PM with support question
Please post your issue to related board

johndankey

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
Thank god for Coppermine!

Sami

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 :)
‍I don't answer to PM with support question
Please post your issue to related board

johndankey

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
Thank god for Coppermine!