1

Topic: Additional menu items and subfolders

I added new menu item like this:

4 = <a href="test.php">Test</a>

but when i go to admin panel (or other page in subfolder) it has this href:

example.com/admin/news.php

and this page not exists.

Simply solution for this problem:
Find in function generate_navlinks()

if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', $pun_config['o_additional_navlinks']."\n", $extra_links))

and replace it with:

if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', str_replace('href="', 'href="'.PUN_ROOT, $pun_config['o_additional_navlinks'])."\n", $extra_links))

(line 516, functions.php)

Re: Additional menu items and subfolders

It's your responsibility to make URLs work properly, not PunBB's.
A. I believe your solution kills non-relative URLs
B. You would also need to fix anything else that could potentially have a relative URL in it: src, embedded stylesheet stuff, etc.

3

Re: Additional menu items and subfolders

A. I believe your solution kills non-relative URLs

I forgot about this tongue

If href starts with http:// shouldn't be added PUN_ROOT at start