Differences

This shows you the differences between two versions of the page.

deutsch:ersetzer_rts:frontend_render:wrap_show_content [2010/04/04 12:22]
Knut Heermann (flip-flop)
deutsch:ersetzer_rts:frontend_render:wrap_show_content [2018/06/03 18:09] (current)
Line 4: Line 4:
Der Tag **SHOW_CONTENT** wird von einem div Container umschlossen. \\ Der Tag **SHOW_CONTENT** wird von einem div Container umschlossen. \\
-Wenn der/die eingschlossene(n) CP/CPs leer oder unsichtbar ist, wird keine Ausgabe generiert, auch kein div wrapper.+Wenn der/die eingschlossene(n) CP/CPs leer oder unsichtbar ist/sind, wird keine Ausgabe generiert und auch kein div wrapper.
Line 10: Line 10:
Bsp.: \\ Bsp.: \\
**{WRAP_SHOW_CONTENT:CP, 19:my_class}** \\ **{WRAP_SHOW_CONTENT:CP, 19:my_class}** \\
-or without a class \\  +oder ohne eine  class \\  
-**{WRAP_SHOW_CONTENT:CP, 19}** -> fallback to the default class //WRAP_SHOW_CONTENT//+**{WRAP_SHOW_CONTENT:CP, 19}** -> Rückfall zur voreingestellten class //WRAP_SHOW_CONTENT// 
 +\\
-File name: /template/inc_script/frontend_render/rt_wrap_show_content.php+**Update**  
 + 
 +**- 04.04.2010 KH:** Verbesserung gegenüber dem Original: \\ 
 +Wenn SHOW_CONTENT aus [PHP]…. aufgerufen wird, ist nun ein zweites mal [PHP-Code] in den Artikeln/CPs möglich die mit diesem Tag angesprochen werden. \\ 
 +**- 19.01.2011 KH:** Parsen aller System RTs, spam -mailto: Umwandlung für JS-eMailadresse wird eingebunden.\\ 
 +**- 19.01.2011 KH:** Parsen von SHOW_CONTENT, wenn in den eingebundenen CPs dieser RT wiederholt auftaucht. 
 + 
 +\\ 
 +**File name:** /template/inc_script/frontend_render/rt_wrap_show_content.php
Line 25: Line 34:
// //
// E.g.: {WRAP_SHOW_CONTENT:CP, 19: my_class} // E.g.: {WRAP_SHOW_CONTENT:CP, 19: my_class}
-//    or {WRAP_SHOW_CONTENT:CP, 19}  -> fallback default class +//    or {WRAP_SHOW_CONTENT:CP, 19}  -> fallback default class
// //
// Default class: WRAP_SHOW_CONTENT // Default class: WRAP_SHOW_CONTENT
Line 34: Line 43:
// (c) 07.11.08 Knut Heermann (flip-flop) http://planmatrix.de // (c) 07.11.08 Knut Heermann (flip-flop) http://planmatrix.de
//     08.11.08 Updated for a better handling //     08.11.08 Updated for a better handling
 +//     11.01.11 Update parse SHOW_CONTENT a second time
// ================================================================== // ==================================================================
// ------------------------------------------------------------------ // ------------------------------------------------------------------
Line 40: Line 50:
   die("You Cannot Access This Script Directly, Have a Nice Day."); }    die("You Cannot Access This Script Directly, Have a Nice Day."); }
// ------------------------------------------------------------------ // ------------------------------------------------------------------
 +
if( strpos($content['all'], '{WRAP_SHOW_CONTENT:') !== FALSE ) { if( strpos($content['all'], '{WRAP_SHOW_CONTENT:') !== FALSE ) {
 + 
 + 
 +    function func_wrap_show_content($my_param) {
 + 
 +        $my_param = str_replace(' ','',$my_param); // kill all spaces
 + 
 +        // explode parameter for SHOW_CONTENT and the optional class name
 +        // $my_arr[0] = SHOW_CONTENT parameter
 +        // $my_arr[1] = optional own class name
 +        $my_arr = explode(":",$my_param);
 + 
 +        if (!empty($my_arr[1])) { $my_class = $my_arr[1]; }     // custom class name = yes
 +        else {$my_class = 'WRAP_SHOW_CONTENT'; }                // custom class name = no -> default name
 + 
 +        // set the wrapper code
 +        $div_before = '<div class="'.$my_class.'">'.LF;
 +        $div_behind = LF.'</div>';
 + 
 +        $string = '';
 +        $string = showSelectedContent($my_arr[0]);     // same as SHOW_CONTENT
 + 
 +        // +KH 19.01.11 parse SHOW_CONTENT a second time
 +        while (strpos($string, '{SHOW_CONTENT:') != false)
 +           $string = preg_replace('/\{SHOW_CONTENT:(.*?)\}/e', 'showSelectedContent("$1");', $string);
- +        // include external PHP script (also normal HTML snippets) or return PHP var value +KH: 04.04.2010 
- function func_wrap_show_content($my_param) +        if(!empty($phpwcms["allow_cntPHP_rt"])
-  +            $string = render_PHPcode($string); 
- $my_param = str_replace(' ','',$my_param); // kill all spaces +         
-  +        // parses all system RTs 
- // explode parameter for SHOW_CONTENT and the optional class name +        $string = html_parser($string); 
- // $my_arr[0] = SHOW_CONTENT parameter +         
- // $my_arr[1] = optional own class name +        // Special for eMail mailto:.... 
- $my_arr = explode(":",$my_param);  +        if ( ($phpwcms["allow_ext_render"]) AND (strpos($string, 'mailto:') != false) ) { 
-  +  
- if (!empty($my_arr[1])) { $my_class = $my_arr[1]; } // custom class name = yes +           // try to include custom functions and replacement tags or what you want to do at this point of the script 
- else {$my_class = 'WRAP_SHOW_CONTENT'; } // custom class name = no -&gt; default name +           // default dir: &quot;phpwcms_template/inc_script/frontend_render"; only *.php files are allowed there 
- +           if ( is_file(PHPWCMS_TEMPLATE.'inc_script/frontend_render/makeEmailSpamSave.php') ) { 
- // set the wrapper code +            
- $div_before = '<div class="'.$my_class.'";'.LF; +              include_once(PHPWCMS_TEMPLATE.'inc_script/frontend_render/makeEmailSpamSave.php'); 
- $div_behind = LF.'</div>'; +              $string = replaceEmailAddress($string); 
-  +           } 
- $string = ''; +        } 
- $string = showSelectedContent($my_arr[0]); // same as SHOW_CONTENT +  
-  +        // Set the wrapper around 
- // include external PHP script (also normal HTML snippets) or return PHP var value +KH: 04.04.2010 +        if (!$string == '') { $my_replace  = $div_before.$string.$div_behind; } 
- if(!empty($phpwcms[";allow_cntPHP_rt"]))  +        else { $my_replace = ''; } 
- $string = render_PHPcode($string); +  
-  +    return $my_replace;
- // Set the wrapper around  +
- if (!$string == '') { $my_replace  = $div_before.$string.$div_behind; }  +
- else { $my_replace = ''; } +
-  +
- return $my_replace;+
} }
 +
// And do it ====== // And do it ======
$content["all"] = preg_replace('/{WRAP_SHOW_CONTENT:(.*?)}/e', 'func_wrap_show_content("$1")', $content["all"]); $content["all"] = preg_replace('/{WRAP_SHOW_CONTENT:(.*?)}/e', 'func_wrap_show_content("$1")', $content["all"]);
 +
} }
?> ?>
</code> </code>
deutsch/ersetzer_rts/frontend_render/wrap_show_content.1270376525.txt.gz · Last modified: 2018/06/03 18:07 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0