Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Using language variables  (Read 2177 times)

0 Members and 1 Guest are viewing this topic.

meek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Using language variables
« on: October 25, 2008, 11:53:14 am »

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-
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Using language variables
« Reply #1 on: October 25, 2008, 12:18:49 pm »

{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 <<
Logged

meek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Using language variables
« Reply #2 on: October 25, 2008, 06:21:14 pm »

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:
Code: [Select]
// 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Using language variables
« Reply #3 on: October 25, 2008, 07:25:18 pm »

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.
Logged

meek

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Using language variables
« Reply #4 on: October 25, 2008, 10:10:08 pm »

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...
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Using language variables
« Reply #5 on: October 26, 2008, 12:25:21 pm »

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
find
Code: [Select]
$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
Code: [Select]
    $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'));
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 20 queries.