Open links in a new window

From PunBB Resource Wiki

Jump to: navigation, search

This is just a small hack to open links in a new window even if it is against PunBB's philosophy :P!

Open parser.php, find line 273 or thereabouts

return '<a href="'.$full_url.'">'.$link.'</a>';

Replace with

return '<a href="'.$full_url.'" onclick="window.open(this.href); return false;">'.$link.'</a>';

Find line 284 or thereabouts

$img_tag = '<a href="'.$url.'">&lt;'.$lang_common['Image link'].'&gt;</a>';

replace with

$img_tag = '<a href="'.$url.'" onclick="window.open(this.href); return false;">&lt;'.$lang_common['Image link'].'&gt;</a>';

There you go, valid even if incorrect links in new windows :)!

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox