Support > cpg1.6 themes (visuals)

Adding number of images under the title to the album

(1/2) > >>

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:


--- Code: ---/******************************************************************************
** 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
******************************************************************************/

--- End code ---

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:

--- Code: ---        $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);

--- End code ---

And in the template, add something like this:

--- Code: ---          <td style="vertical-align:top" class="statlink">
              <h2>{ALBUM_NAME}</h2>
              {PIC_COUNT} Photos     <!-- ADD THIS -->
          </td>

--- End code ---

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:

--- Code: ---        $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);

--- End code ---

And in the template, add something like this:

--- Code: ---          <td style="vertical-align:top" class="statlink">
              <h2>{ALBUM_NAME}</h2>
              {PIC_COUNT} Photos     <!-- ADD THIS -->
          </td>

--- End code ---

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

--- End quote ---

ron4mac:
In the same way you can add the album description.


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

--- End code ---
Then add {ALBUM_DESC} somewhere in the title template.

Navigation

[0] Message Index

[#] Next page

Go to full version