Advanced search  


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.

Pages: [1]   Go Down

Author Topic: How to add category title to album list section?  (Read 533 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine newbie
  • Offline Offline
  • Posts: 2
How to add category title to album list section?
« on: February 13, 2024, 11:55:49 am »

I'm new on this forum, but I use CPG successfully since 2009. :D

Two weeks ago I started to create completely new theme for my CPG gallery. The main concept is to add more space between tables in the gallery layout. Besause of that I was forced to add additional header bar to the albums section on Category page (red frame in attached screenshot).
I did it by creating new section in $template_album_list template:
Code: [Select]
<!-- BEGIN cat_row -->
                <td colspan="{COLUMNS}" class="tableh1" align="leftr">{TITLE}</td>
<!-- END cat_row -->

... and modifying theme_display_album_list function in theme.php:
Code: [Select]
    $cat_row = template_extract_block($template_album_list, 'cat_row');
    $columns = $CONFIG['album_list_cols'];
    $column_width = ceil(100 / $columns);
    $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2;

// new header bar
$params = array('{TITLE}' => $lang_cat_list['albums'],
'{COLUMNS}' => $columns,
echo template_eval($cat_row, $params);

    if ($STATS_IN_ALB_LIST) {
        $params = array('{STATISTICS}' => $statistics,
            '{COLUMNS}' => $columns,
        echo template_eval($stat_row, $params);

It works, but I would like to show more information in this bar, something like "Albums in 'My category'". I tried to use $cat parameter, but $cat is only numerical value (category id)  and it doesn't provide any category data.

And this is my question - How can I achieve category title (or other category data, such as image attached to category) from inside theme_display_album_list function?

My current gallery is located at , but my new theme is still "under construction" and available only on localhost.
Pages: [1]   Go Up

Page created in 0.025 seconds with 20 queries.