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
-
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
-
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 :-\\
-
The function make_clickable is your friend ;D
GauGau
-
The function make_clickable is your friend ;D
Could you exlpain?
I'm not good in php :-[
-
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.
-
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?
-
i've done the steps, and i can display the description, but the bbcode is not working
-
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.
-
Have anyone a working solution for this problem?
best regards anajka
-
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