Using language variables Using language variables
 

News:

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.
[more]

Main Menu

Using language variables

Started by meek, October 25, 2008, 11:53:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

meek

Hi.

I'm using a hack to display a << and >> after the page navigation tabs in the thumbnail page. It works great, but I would like the opportunity to use the "Prev" and "Next" variables as well. If I insert the variables {NEXT} or {PREV} in my theme.php they are not rendered. Can I use these variables already in the language files or how do I go about it?

Thanks in advance.

- Meek-

Joachim Müller

{PREV} and {NEXT} are placeholder tokens, not variables. You can't use them outside of theme.php. Not sure what you're actually trying to accomplish - post details. Posting a link to your gallery might help as well.

Joachim

P.S. You should use &lt; instead of < and you should use &laquo; instead of <<

meek

Hi.

I'll explain a little better. I have applied a hack to make "previous" and "next" tabs in the thumbnail page. I would like to display "Previous" and "Next" when hovering the mouse on the back and forward arrows (yep, I have used &laquo; and &raquo;) or maybe change << and >> with the actual words "Previous" and "Next".

The code in my theme.php is the following:// Template used for tabbed display
if (!isset($template_tab_display)) { //{THEMES}
$template_tab_display = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>{LEFT_TEXT}</b></td>' . "\n",
    'tab_header' => '',
    'tab_trailer' => '',
    'active_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>',
    'inactive_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="{LINK}"><b>%d</b></a></td>' . "\n",
    'inactive_prev_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="{LINK}" [b]title="{PREV}"[/b]><big><b>&laquo;</b></big></a></td>' . "\n",
    'inactive_next_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="{LINK}" [b]title="{NEXT}"[/b]><big><b>&raquo;</b></big></a></td>' . "\n",
);
}

The gallery isn't online yet, so I can't post a link, but I have attached a screen dump. What happens is that instead of displaying "Next" it displays {NEXT} - why is that? The hack itself works fine.

Joachim Müller

I'm not really familiar with the hack you refer to, but if the placeholder tokens shine through, it's very likely that you haven't applied the hack properly. Hard to advise anything without being able to see the code. The code you posted below is being "infested" with bbcode tags (you probably did that in an attempt to highlight stuff here on the board). I suggest taking one step at a time: post a link to the announcement thread of the hack you're trying to apply. Zip your changed files and attach them.

meek

Hi.

Thanks for your time.
It's this hack.
The two edited files are attached below. The hack works perfectly, except for the placeholders {PREV} and {NEXT}. I could just hardcode the names but I would the local translations...

Joachim Müller

Looks to me like you haven't applied the mod properly. Read the entire thread, starting from the very first page. Imo you failed to apply the step
Quote from: yoshikiwei on July 22, 2004, 10:11:18 AM
find
$theme_alb_list_tab_tmpl['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
add after
    $theme_alb_list_tab_tmpl['inactive_next_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
    $theme_alb_list_tab_tmpl['inactive_prev_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));