Differences

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

deutsch:ersetzer_rts:frontend_render:wrap-article-list [2010/02/23 23:14]
Knut Heermann (flip-flop)
deutsch:ersetzer_rts:frontend_render:wrap-article-list [2018/06/03 18:09] (current)
Line 7: Line 7:
Dazu werden im jeweiligen Template zwei neue Tags benötigt **%%<!--ARTICLEX_ENTRY//-->%%** und **%%<!--ARTICLEX_END//-->%%**. Dazu werden im jeweiligen Template zwei neue Tags benötigt **%%<!--ARTICLEX_ENTRY//-->%%** und **%%<!--ARTICLEX_END//-->%%**.
 +
 +Eingebaute Alternative //(seit V1.3.3 2007-05-18)//: [[deutsch/phpwcms-system/artikel#wrapper_fuer_artikellisten_-und_detaildarstellung|Wrapper für Artikellisten -und Detaildarstellung:]]
\\ \\
Line 133: Line 135:
if( ! (strpos($content["all"],'<!--ARTICLEX_ENTRY//-->') === false)) { if( ! (strpos($content["all"],'<!--ARTICLEX_ENTRY//-->') === false)) {
 + // -----CUSTOM------------------------------------
 +
$_prefix = '<div class="whow">'; // before articles-list $_prefix = '<div class="whow">'; // before articles-list
$_suffix = '</div>'; // behind articles-list $_suffix = '</div>'; // behind articles-list
 + $_a_entry = '<!--ARTICLEX_ENTRY//-->';
 + $_a_end   = '<!--ARTICLEX_END//-->';
 +
 + // -----------------------------------------------
- $content["all"] = preg_replace('/\<!--ARTICLEX_ENTRY\/\/--\>/im',$_prefix.LF,$content["all"],1); + // reverting for faster replace 
- $content["all"] = substr_replace($content["all"], $_suffix.LF, strripos ($content["all"],'&lt;!--ARTICLEX_END//--&gt;'), 21);+ $_a_end = strrev($_a_end); 
 + $_suffix = strrev($_suffix); 
 +  
 + // make a regex like pattern 
 + $_a_entry = preg_quote($_a_entry, '/'); 
 + $_a_end   = preg_quote($_a_end, '/'); 
 +  
 +  
 + // Only the first entry  
 + // ---------------------------------- 
 + $content["all"] = preg_replace('/'.$_a_entry.'/',$_prefix.LF,$content["all"],1); 
 +  
 + // Only the last entry (reverting is much faster as REGEX (last)) 
 + // ---------------------------------- 
 + $content["all"] = strrev($content["all"]); 
 + $content["all"] = preg_replace('/'.$_a_end.'/',$_suffix.LF,$content["all"],1); 
 + $content[&quot;all&quot;] = strrev($content["all"]); 
 +
} }
?> ?>
</code> </code>
deutsch/ersetzer_rts/frontend_render/wrap-article-list.1266963270.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