Differences

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

deutsch:phpwcms-system:artikel:contentparts:news [2009/11/20 16:42]
Claus
deutsch:phpwcms-system:artikel:contentparts:news [2018/06/03 18:08] (current)
Line 235: Line 235:
\\ \\
 +
 +===== Workaround NEWS auf Index-Seite: =====
 +
 +**Nur für NEWs die auf der Indexseite des Systems verwendet werden:**
 +
 +Ist der Alias noch nicht sichtbar in der Browsereingabezeile //(z.B. http://example.com/ anstatt http://example.com/index.phtml)//, wird der Link auf die NEWs-Details nicht richtig geschrieben.
 +
 +Dieser CP-Trigger im Ordner /frontend_render/ beseitigt das Problem. //(Das sollte eigentlich im Core berücksichtigt werden).//
 +
 +----
 +Docu: -- \\
 +Forum: --
 +
 +**Autor:** K.Heermann (flip-flop) http://planmatrix.de \\
 +**CMS Version:** >= 1.4x \\
 +**Version:** V1.0 //(31.05.2010)// \\
 +
 +**Bedingung:**  -> [[http://www.phpwcms-docu.de/confincphp_de.phtml|/config/phpwcms/conf.inc.php]] \\
 +  * $phpwcms['allow_ext_init']  = 1;
 +
 +----
 +\\
 +
 +Datei: **/template/inc_script/frontend_init/cp_trig_news_detail_link_v10.php**
 +
 +
 +<code php>
 +<?php
 +/**
 + *********************************************************************************************
 + * 31.05.10 KH: http://planmatrix.de
 + * CP trigger: NEWS detail-link patch on root if there is no alias visible
 + *
 + * E.g. In Browserline you see: http://example.com/
 + * This can´t run: http://example.com/index.php&newsdetail=20100501-1_news01
 + * We need:        http://example.com/index.php?index&newsdetail=20100501-1_news01
 + *********************************************************************************************
 + */
 +// -------------------------------------------------------------------------------------------
 +// obligate check for phpwcms constants
 + if (!defined('PHPWCMS_ROOT')) {
 + die("You Cannot Access This Script Directly, Have a Nice Day."); }
 +// -------------------------------------------------------------------------------------------
 +
 +
 +function NEWS_DETAIL_LINK_ROOT($text, & $data) {
 +
 + // The right CP news (33) and we are located in the root directory
 + if ( $data['acontent_type'] == 33  AND ( $GLOBALS['content']['cat_id'] == 0 ) )
 + {
 + if ( strpos($text, 'index.php&amp;newsdetail') !== false)
 + $text = str_replace('index.php&amp;newsdetail','index.php?'.$GLOBALS['content']["struct"][$GLOBALS['content']["cat_id"]]["acat_alias"].'&amp;newsdetail',$text);
 + }
 +
 + return $text;
 +}
 +
 +register_cp_trigger('NEWS_DETAIL_LINK_ROOT');
 +
 +?>
 +
 +</code>
deutsch/phpwcms-system/artikel/contentparts/news.1258731744.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