forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: Jack76 on August 16, 2004, 02:43:57 pm

Title: Displaying album description on thumbnail page
Post by: Jack76 on August 16, 2004, 02:43:57 pm
I would like to display the album description on the thumpnails page.
There was one topic about this problem but nobody posted working solution:
http://forum.coppermine-gallery.net/index.php?topic=5618.0
Could anybody help me? I tried to edit theme.php to do this but without success.

P.S. I have CPG 1.3.0
Title: Re: Displaying album description on thumbnail page
Post by: Jack76 on August 17, 2004, 11:20:38 pm
I just figured out how to do it.
I used the code of kguske from the old topic and modified it because there is no /themes/myfavoritetheme/thumb_view_title_row.inc file in CPG 1.3.0.
So before
Code: [Select]
// Return the name of a user
function get_username($uid)
Add:
Code: [Select]
// Get the name of an album
function get_album_desc($aid)
{
    global $CONFIG;
    global $lang_errors;
    $result = 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";
    }
}
Then, in /themes/myfavoritetheme/theme.php just after:
Code: [Select]
// HTML template for title row of the thumbnail view (album title + sort options)Add:
Code: [Select]
$album_desc = get_album_desc($_GET[album]);Then, wherever you want the description to appear, you can insert the $album_desc variable. But there is a BIG problem: bbcodes don't work in the album description displayed on thumbnail page >:(
Could anyone help me? How to enable bbcodes now?
It's really important to me :-\\
Title: Re: Displaying album description on thumbnail page
Post by: Joachim Müller on August 18, 2004, 08:46:16 am
The function make_clickable is your friend ;D

GauGau
Title: Re: Displaying album description on thumbnail page
Post by: Jack76 on August 18, 2004, 09:49:33 am
The function make_clickable is your friend ;D
Could you exlpain?
I'm not good in php :-[
Title: Re: Displaying album description on thumbnail page
Post by: myprado on December 04, 2004, 10:10:08 pm
I solved that problem using by function bb_decode($album_desc); (from file include/functions.inc.php).

Now I have album description on thumbnail page with bbcode.

Edit the theme.php
Code: [Select]
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb') {
//................
//.................
    if ($mode == 'thumb') {
        starttable('100%', $title, $thumbcols);
    } else {
        starttable('100%');
    }

    echo $header;
    echo bb_decode($album_desc);
//....................
//....................

}

Coders, Dont forget to make steps above posted by Jack76.
Regards.
Title: Re: Displaying album description on thumbnail page
Post by: PandaSorn on April 30, 2005, 06:07:28 pm
Quote
Then, wherever you want the description to appear, you can insert the $album_desc variable. But there is a BIG problem: bbcodes don't work in the album description displayed on thumbnail page >:(

I've done the two changes on functions.inc and theme.php, but I don't understand how to display the album description in the thumbnail page between the title of the ambum ad the images.
Also I don't want the album description on the categori page.

Can you help me?
Title: Re: Displaying album description on thumbnail page
Post by: MLKE on July 18, 2005, 07:37:18 am
i've done the steps, and i can display the description, but the bbcode is not working
Title: Re: Displaying album description on thumbnail page
Post by: Joachim Müller on July 18, 2005, 07:59:13 am
This thread has originally been posted on the "feature requests" board. Moving it to the support board, as it contains a solution and is not a real feature request.
Title: Re: Displaying album description on thumbnail page
Post by: anajka on August 02, 2005, 11:34:43 am
Have anyone a working solution for this problem?

best regards anajka
Title: Re: Displaying album description on thumbnail page
Post by: xplicit on May 07, 2006, 04:08:24 pm
I solved that problem using by function bb_decode($album_desc); (from file include/functions.inc.php).

Now I have album description on thumbnail page with bbcode.

Edit the theme.php
Code: [Select]
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb') {
//................
//.................
    if ($mode == 'thumb') {
        starttable('100%', $title, $thumbcols);
    } else {
        starttable('100%');
    }

    echo $header;
    echo bb_decode($album_desc);
//....................
//....................

}

Coders, Dont forget to make steps above posted by Jack76.
Regards.

The above is not the correct way to do this.

Instead use the code of Jack76 and change  the part:

Code: [Select]
return $row['description'];
by:

Code: [Select]
return bb_decode ($row['description']);
That will solve all problems