Displaying album description on thumbnail page Displaying album description on thumbnail page
 

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

Main Menu

Displaying album description on thumbnail page

Started by Jack76, August 16, 2004, 02:43:57 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Jack76

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

Jack76

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
// Return the name of a user
function get_username($uid)

Add:
// 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:
// HTML template for title row of the thumbnail view (album title + sort options)
Add:
$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 :-\\

Joachim Müller

The function make_clickable is your friend ;D

GauGau

Jack76

Quote from: GauGau on August 18, 2004, 08:46:16 AM
The function make_clickable is your friend ;D
Could you exlpain?
I'm not good in php :-[

myprado

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

PandaSorn

QuoteThen, 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?

MLKE

i've done the steps, and i can display the description, but the bbcode is not working

Joachim Müller

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.

anajka

Have anyone a working solution for this problem?

best regards anajka

xplicit

Quote from: 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
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:

return $row['description'];

by:

return bb_decode ($row['description']);

That will solve all problems
Don't ask me: Can you do this .... or Give me that...or I need Quick help in PM's. I'm not Santaclaus so post your questions on the board so it will be in the benefit for everyone.