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: How to change Menu separator  (Read 4535 times)

0 Members and 1 Guest are viewing this topic.

apassio

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
    • Christine & Son's website
How to change Menu separator
« on: December 18, 2005, 07:16:15 pm »

Just upgraded to 1.4.2, and would like to customize again my template (waterdrop_son_test):

http://www.dophan.com/photos/

I see that the separator between the different menu items (e.g.  My gallery :: User mode :: Upload file) is "::".
I'd like to change that "::" into an image file (such as images/orange_carret.gif).

I tried to modify the theme.php file section:
  $template_sys_menu_spacer ="::";

with:
template_sys_menu_spacer = "<img src="http://www.dophan.com/photos/themes/water_drop_son_test/images/orange_carret.gif" border="0" vspace="12" hspace="12" />";

But this does not work, i get the following error message:
Parse error: parse error, unexpected T_STRING in /home/dophan2/public_html/photos/themes/water_drop_son_test/theme.php on line 102

Probably a silly question :-\, but help would be welcome.

Thanks
« Last Edit: December 18, 2005, 07:47:08 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: How to change Menu separator
« Reply #1 on: December 18, 2005, 07:18:10 pm »

Code: [Select]
template_sys_menu_spacer = "<img src=\"http://www.dophan.com/photos/themes/water_drop_son_test/images/orange_carret.gif\" border=\"0\" vspace=\"12\" hspace=\"12\" />";
or

Code: [Select]
template_sys_menu_spacer = '<img src="http://www.dophan.com/photos/themes/water_drop_son_test/images/orange_carret.gif" border="0" vspace="12" hspace="12" />';
Watch the quotes.
Logged

apassio

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
    • Christine & Son's website
Re: How to change Menu separator
« Reply #2 on: December 18, 2005, 07:41:56 pm »

Thanks for bothering.

Implemented, it works!

Regards ;D
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: How to change Menu separator
« Reply #3 on: December 18, 2005, 08:11:51 pm »

You need to prepend variables with "$" in PHP as well as paying attention to quoting as nibbler has posted.

Code: [Select]
$template_sys_menu_spacer = '<img src="http://www.dophan.com/photos/themes/water_drop_son_test/images/orange_carret.gif" border="0" vspace="12" hspace="12" />';

Quick PHP Lesson
Code: [Select]
$another_var='Hello World';
echo $another_var; // outputs: Hello World

$var = '$another_var';
echo $var; // outputs: $another_var

$var  = "$another_var";
echo $var; // outputs: Hello World

you're opening quotes determine whats need for your closing quotes, and once opened the context of the quotes don't change even if they are unbalanced.

$var = ' """ ';
echo $var; // outputs:  """

$var = " ''' ";
echo $var; // outputs:  '''

Newlines (character codes) are expanded like variables

$var = 'Hello World\n';
echo $var; // outputs: Hello World\n

$var = "Hello World\n";
echo $var; // outputs: Hello World  <with a newline character at the end>

If you are dealing with complex quoting I usually switch to using single quotes and appending each text subsection together as in.

$var = 'This is a "simple" program ' . $another_var . ' to test "Double Quoting" inside Strings.' . "\n";
echo $var; // outputs: This is a "simple" program Hello World to test "Double Quoting" inside Strings. <with a newline character at the end>

you can also escape double quotes in a double quoted section such as nibbler suggested, but it gets kinda ugly IMO.

$var = "This is a \"simple\" program $another_var to test \"Double Quoting\" inside Strings.\n";
echo $var; // outputs: This is a "simple" program Hello World to test "Double Quoting" inside Strings. <with a newline character at the end>

heredoc syntax does variable expansion but does not need double quotes to be escaped nor newlines to be expanded.
$var = <<<EOT
This is a "simple" program $another_var to test "Double Quoting" inside strings.

EOT;
echo $var; // outputs: This is a "simple" program Hello World to test "Double Quoting" inside Strings. <with a newline character at the end>


Array and object variable expansion can get tricky with syntax in double quoted strings and heredoc syntax, if something isn't working as expected then switch to single quotes and appending sections together with the "." char as I suggested before.
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.