NAVIGATION
Öffnet einen externen Link in einem neuen Pop-Up Fenster. (Angaben: Link, Fensterbreite, Fensterhöhe).
Tag: [EXT_POPUP:link, width, height]link_text[/EXT_POPUP]
E.g. [EXT_POPUP:http://example.com, 800, 600]link_text[/EXT_POPUP]
Forum: [EXT_POPUP:link, width, height]link_text[/EXT_POPUP]
Dateiname: rt_ext_popup.php
Verzeichnis: /template/inc_script/frontend_render/
Bedingung: $phpwcms['allow_ext_render'] = 1; → /config/phpwcms/conf.inc.php
Update KH 07.05.2010: Linkausführung <a href=”…..” bei Klick unterdrückt
Location: /template/inc_script/frontend_render/rt_ext_popup.php
[EXT_POPUP:link, width, height]link_text[/EXT_POPUP]
<?php /****************************************************************************** REPTAG CODE: [EXT_POPUP:link, width, height]link_text[/EXT_POPUP] E.g. [EXT_POPUP:http://example.com, 800, 600]link_text[/EXT_POPUP] Developer: k.Heermann (flip-flop) http://planmatrix.de phpWCMS Version: >= 1.3.3 modified: KH 01.11.2008 last modified: KH 07.05.2010: Suppressed link execution <a href="....." Description: Open a extern link in a new pop up window who is e.g. 800px wide and 600px high. From: http://www.phpwcms.de/forum/ ------------------------------------------------------------------------------- Installation: Put the code in frontend_render (for example in a file called rt_ext_popup.php) Enable in /config/phpwcms/conf.inc.php: $phpwcms['allow_ext_render'] = 1; Mod version: none Support: http://forum.phpwcms.org/viewtopic.php?p=110785#p110785 *******************************************************************************/ // ------------------------------------------------------------------ // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); } // ------------------------------------------------------------------ if( ! (strpos($content["all"],'[EXT_POPUP:')===false)) { // inject the js function into head (since 1.3.3 ================ // If you are using an earlier version, please comment or kill this lines // and put the JS function into your template head section. // <script type="text/javas .............. //--> </script> $GLOBALS['block']['custom_htmlhead']['OpenWindow'] = ' <script type="text/javascript" language="javascript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); return false; } //--> </script>'; // END inject the js function into head ================= /* A little help ************ custom_link = $1; custom_win_width = $2; custom_win_height = $3; custom_link_text = $4; *****************************/ // Search parameter ********* $my_search = '/\[EXT_POPUP:(.*?),(.*?),(.*?)\](.*?)\[\/EXT_POPUP\]/s'; // The replace parameter **** $my_replace = '<a href="#" onClick="return MM_openBrWindow(\'$1\',\'New_window\',\'scrollbars=yes,resizable=yes,width=$2,height=$3\')">$4</a>'; // And do it ====== $content["all"] = preg_replace($my_search, $my_replace, $content["all"]); } // END Only if [EXT_POPUP: exists ==================================== ?>
— Knut Heermann (flip-flop) 2009/01/23 16:16