Hi,
I would like to put a <div></div> with different content depending on the album ID (e.g. ...../thumbnails-25.html something, ...../thumbnails-30.html something different).
I know is something like this for the admin:
<?php if (USER_IS_ADMIN) { ?> X <?php } else { ?> Y <?php } ?>
but, what is the
if (...... )
for albums ID?
Thank you
1) In function <<<theme_display_thumbnails>>> (if is not in your theme copy it from themes/sample/theme.php)
PASTE your div after
CPGPluginAPI::action('theme_thumbnails_wrapper_start', null);
if ($CURRENT_ALBUM_DATA['aid'] == 1) {
echo '<div class="your_custom_class">custom content</div>';
} elseif ($CURRENT_ALBUM_DATA['aid'] =2) {echo '<div class="your_custom_class">custom content</div>';}
elseif ($CURRENT_ALBUM_DATA['aid'] =3) {echo '<div class="your_custom_class">custom content</div>';}
and so on for all the albums you need.
Recopy the code above.
I edit it.
Had a small mistake.
You want everybody to see the custom divs or only you or registred users?
I would approach it in a different way by creating a plugin that does 2 things:
Adds an additional, editable field to album properties...
and displays that content in the appropriate place.
Hi allvip,
I don't know why, but my topic was moved from coppermine 1.5 support to coppermine 1.6 support (I have 1.5).
Maybe is for this that it's not working. It gives for all albums the same first custom content (in your exemple that for aid = 1) as if it were not the IF STATEMENT at all..
Thanks
Hi,
it works perfectly, I only had to change = to ==.
I would like only registered users see that.
Thanks
Quote from: ron4mac on November 29, 2019, 02:25:41 PM
I would approach it in a different way by creating a plugin that does 2 things:
Adds an additional, editable field to album properties...
and displays that content in the appropriate place.
Maybe one day I will start making plugins.
Quote from: treret on November 29, 2019, 05:12:01 PM
Hi,
it works perfectly, I only had to change = to ==.
Hi.
I updated the code and I wanted to move the topic from cpg1.5 miscellaneous to cpg1.5 visual.
By mistake I moved it to 1.6, but the code works for both versions.
Quote from: treret on November 29, 2019, 05:12:01 PM
Hi,
I would like only registered users see that.
Thanks
Not possible.
The forum is even to help everybody learn from other users questions.
Sorry.