Adding number of images under the title to the album Adding number of images under the title to the album
 

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

Adding number of images under the title to the album

Started by Hanna., February 04, 2018, 06:01:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hanna.

I am requesting an unique feature to my gallery as I have above 100+ pictures average in each album. Is there any way to add a line or some sort of HTML that picks up the amount of pictures from the album and added into the td.thumbnails space. For instance "Album 1" (title), then another span class that counts the number of pictures in there right next to it or below "Total pictures: xx"

Hanna.

Good evening everyone, I spent about three hours to get to this result: https://kristincavallari.net/gallery/index.php?cat=39. The answer to that page is simply in theme.php move around the parameter "{ALB_DESC}".

However, when I want this parameter to show up on the album page with all the images, it does not seem to recognize it and it does not get displayed. https://kristincavallari.net/gallery/thumbnails.php?album=445 See my code from theme.php:

/******************************************************************************
** Section <<<$template_fav_thumb_view_title_row>>> - START
******************************************************************************/
// HTML template for title row of the fav thumbnail view (album title + download)
$template_fav_thumb_view_title_row = <<<EOT

                        <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2> {ALBUM_DESCRIPTION}</td>
                                <td><img src="images/spacer.gif" width="1" border="0" alt="" /></td>
                                <td class="sortorder_cell">
                                        <table cellpadding="0" cellspacing="0">
                                                <tr>
                                                        <td class="sortorder_options"><span class="statlink"><a href="zipdownload.php">{DOWNLOAD_ZIP}</a></span></td>
                                                </tr>
                                                </table>
                                </td>
                        </tr>
                        </table>

EOT;
/******************************************************************************
** Section <<<$template_fav_thumb_view_title_row>>> - END
******************************************************************************/


I need the album title in h1 as is, and then in addition, the album description to show up next to it or preferably below the album title. Please help.

ron4mac

( you do know it shows the number of pics at the bottom of the page, right? )

You'll need to copy the function theme_display_thumbnails into your theme.php from include/themes.inc.php.
In the same way, you'll also need to copy the template $template_thumb_view_title_row.

Then, in the function, find this and make the addition:
        $param['{ALBUM_NAME}'] = $album_name;
        $param['{PIC_COUNT}'] = $nbThumb;              // <<--- ADD THIS
        // Plugin Filter: allow plugin to modify or add tags to process
        $param = CPGPluginAPI::filter('theme_thumbnails_title', $param);
        $title = template_eval($template_thumb_view_title_row, $param);


And in the template, add something like this:
          <td style="vertical-align:top" class="statlink">
              <h2>{ALBUM_NAME}</h2>
              {PIC_COUNT} Photos     <!-- ADD THIS -->
          </td>

Hanna.

Quote from: ron4mac on February 06, 2018, 02:48:52 PM
( you do know it shows the number of pics at the bottom of the page, right? )

You'll need to copy the function theme_display_thumbnails into your theme.php from include/themes.inc.php.
In the same way, you'll also need to copy the template $template_thumb_view_title_row.

Then, in the function, find this and make the addition:
        $param['{ALBUM_NAME}'] = $album_name;
        $param['{PIC_COUNT}'] = $nbThumb;              // <<--- ADD THIS
        // Plugin Filter: allow plugin to modify or add tags to process
        $param = CPGPluginAPI::filter('theme_thumbnails_title', $param);
        $title = template_eval($template_thumb_view_title_row, $param);


And in the template, add something like this:
          <td style="vertical-align:top" class="statlink">
              <h2>{ALBUM_NAME}</h2>
              {PIC_COUNT} Photos     <!-- ADD THIS -->
          </td>


Initially what I needed, is the ALBUM DESCRIPTION to monitor right next to the title. Because in that parameter I use date, which is important to display next to the title. I am aware of the picture count at the bottom but I do want to add it somewhere on top, below the title would be OK as I have a lot of columns down the page.

So I need the {ALBUM_DESCRIPTION} and {PIC_COUNT} to work for me on this page https://kristincavallari.net/gallery/thumbnails.php?album=403

ron4mac

In the same way you can add the album description.

$param['{ALBUM_DESC}'] = $CURRENT_ALBUM_DATA['description'];

Then add {ALBUM_DESC} somewhere in the title template.

Hanna.

Quote from: ron4mac on February 06, 2018, 05:04:56 PM
In the same way you can add the album description.

$param['{ALBUM_DESC}'] = $CURRENT_ALBUM_DATA['description'];

Then add {ALBUM_DESC} somewhere in the title template.

Excellent! All thanks to you!