Hi all!
I thought I understood coppermine perfectly and have codes several functions but there is just one part in the theme.inc.php I just canīt fully understand.
Itīs this part.
if ($mode == 'thumb') {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
$theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&page=%d'));
$theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&page=%d'));
$theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&page=%d'));
} else {
$theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
$theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
$theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
$theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
}
which uses
$lang_thumb_view = array(
'pic_on_page' => '%d files ON %d page(s)',
'user_on_page' => '%d users ON %d pages(s)',
);
But how and where are these %d and the other %d determined? I played a bit with it but it seems I can not use these %d things in bolean equations... I wanted to determine if the %d of the pages was equal to 1 and than output page instead of page(s). I can put the %d things in variables but no matter what the number is it always sais the if statement is false and executes the else part all the time.. When I use them like this:
$theme_thumb_tab_tmpl = $template_tab_display;
if ($mode == 'thumb') {
$photopart = "%d";
$pagespart = "%d";
if ($pagespart == 1) {
$pagespart = $pagespart." PAGE";
} else {
$pagespart = $pagespart." PAGES";
}
What's up with these magic things?
Strangest part is that if I use the $pagespart and photopart is gives the numbers correctly... but it seems like these are not normal numbers since I cant compare with them...