NAVIGATION
This shows you the differences between two versions of the page.
|
deutsch:technik:systemvariablen [2010/10/16 07:18] Knut Heermann (flip-flop) |
deutsch:technik:systemvariablen [2018/06/03 18:08] (current) |
||
|---|---|---|---|
| Line 13: | Line 13: | ||
| 2 = z.B. wenn 1 dann Print | 2 = z.B. wenn 1 dann Print | ||
| 3 = wenn 1 dann zeig(e/t) Kategorie | 3 = wenn 1 dann zeig(e/t) Kategorie | ||
| - | 4 = wenn 1 dann Link zu Artikel | + | 4 = wenn 1 dann Modus Artikel-Detail |
| 5 = freie Nutzung | 5 = freie Nutzung | ||
| Line 25: | Line 25: | ||
| $aktion[2] = isset($aktion[2]) ? intval($aktion[2]) : 0; // z.B. wenn 1 dann Print | $aktion[2] = isset($aktion[2]) ? intval($aktion[2]) : 0; // z.B. wenn 1 dann Print | ||
| $aktion[3] = isset($aktion[3]) ? intval($aktion[3]) : 1; // wenn 1 dann zeige cat | $aktion[3] = isset($aktion[3]) ? intval($aktion[3]) : 1; // wenn 1 dann zeige cat | ||
| - | $aktion[4] = isset($aktion[4]) ? intval($aktion[4]) : 0; // wenn Link zu article zeige (1) | + | $aktion[4] = isset($aktion[4]) ? intval($aktion[4]) : 0; // Modus article detail (1) sonst article list (0) |
| $aktion[5] = isset($aktion[5]) ? intval($aktion[5]) : 0; // freie Nutzung | $aktion[5] = isset($aktion[5]) ? intval($aktion[5]) : 0; // freie Nutzung | ||
| </code> | </code> | ||
| Line 83: | Line 83: | ||
| ---- | ---- | ||
| ---- | ---- | ||
| + | \\ | ||
| + | ===== Artikeldaten (Datum): ===== | ||
| + | |||
| + | Alle Datumsangaben in einem Artikel direkt aus den Variablen generiert: | ||
| + | |||
| + | Im Template für den **Artikel-Detailmodus**: | ||
| + | <code php> | ||
| + | [PHP] | ||
| + | $aid=$GLOBALS['aktion'][1]; | ||
| + | echo 'Artikel-ID: '.$aid.'[BR]'; | ||
| + | echo 'Erstellt am: ' .date('d.m.Y H:i:s',$GLOBALS['content']["articles"][$aid]['article_created']) .'[BR]'; | ||
| + | echo 'Geändert am: '.date('d.m.Y H:i:s',$GLOBALS['content']["articles"][$aid]['article_date']) .'[BR]'; | ||
| + | echo 'Anzeigen von: ' .date('d.m.Y H:i:s',$GLOBALS['content']["articles"][$aid]['article_livedate']).'[BR]'; | ||
| + | echo 'Anzeigen bis: ' .date('d.m.Y H:i:s',$GLOBALS['content']["articles"][$aid]['article_killdate']).'[BR]'; | ||
| + | [/PHP] | ||
| + | </code> | ||
| + | |||
| + | \\ | ||
| + | Im Template für den **Artikel-Listenmodus**: | ||
| + | <code php> | ||
| + | [PHP] | ||
| + | $aid={ARTICLEID}; | ||
| + | echo 'Artikel-ID: '.$aid.'[BR]'; | ||
| + | echo 'Erstellt am: ' .date('d.m.Y H:i:s',$GLOBALS['content']["articles"][$aid]['article_created']) .'[BR]'; | ||
| + | echo 'Geändert am: '.date('d.m.Y H:i:s',$GLOBALS['content']["articles"][$aid]['article_date']) .'[BR]'; | ||
| + | echo 'Anzeigen von: ' .date('d.m.Y H:i:s',$GLOBALS['content']["articles"][$aid]['article_livedate']).'[BR]'; | ||
| + | echo 'Anzeigen bis: ' .date('d.m.Y H:i:s',$GLOBALS['content']["articles"][$aid]['article_killdate']).'[BR]'; | ||
| + | [/PHP] | ||
| + | </code> | ||
| + | |||
| + | |||
| + | |||
| \\ | \\ | ||
| Line 182: | Line 214: | ||
| \\ | \\ | ||
| - | ===== Keyword in Artikeln auslesen ===== | + | ===== Artikel-Keyword auslesen ===== |
| - | Die Variable ##$content['all_keywords']## oder ##$GLOBALS['content']['all_keywords']## wenn in Funktionen verwendet, liefert die Keywords von gerade anzuzeigenden Artikel. | + | Die Variable ##$content['all_keywords']## oder ##$GLOBALS['content']['all_keywords']## wenn in Funktionen verwendet, liefert die Keywords vom gerade anzuzeigenden Artikel. |
| - | Bsp.: //Forum [[http://forum.phpwcms.org/viewtopic.php?p=120863#p120863|Css eines Artikels ändern]]// | + | **Bsp.:** Die Keywords in ein Array schreiben: |
| + | |||
| + | <code php> | ||
| + | $keywords_array = convertStringToArray($GLOBALS['content']['all_keywords']); | ||
| + | </code> | ||
| + | |||
| + | \\ | ||
| + | |||
| + | **Bsp.:** //Forum [[http://forum.phpwcms.org/viewtopic.php?p=120863#p120863|Css eines Artikels ändern]]// | ||
| Eine spezielle CSS Formatierung für einen Artikel: | Eine spezielle CSS Formatierung für einen Artikel: | ||
| - | **Frage:** \\ | + | > **Frage:** \\ |
| - | //"Wenn ich für einen einzigen Artikel ein spezielles css angeben möchte, wo mache ich das? | + | > //"Wenn ich für einen einzigen Artikel ein spezielles css angeben möchte, wo mache ich das? |
| - | Zur Erklärung, ich möchte einzelne Artikel mit einem dunklen statt einem hellen Seitenhintergrund haben." // | + | > Zur Erklärung, ich möchte einzelne Artikel mit einem dunklen statt einem hellen Seitenhintergrund haben." // |
| - | **Antwort:** \\ | + | > **Antwort:** \\ |
| - | //"Ich würde mit einem speziellen Keyword arbeiten und mittels Frontend Render dann entsprechend darauf reagieren. | + | > //"Ich würde mit einem speziellen Keyword arbeiten und mittels Frontend Render dann entsprechend darauf reagieren. |
| Keyword "*CSS-dark*" beim Artikel ins entsprechende Feld setzen. Beim Rendering wird darauf geprüft und <body> Tag erhält die entsprechende Klasse. Das kann dann normaler per CSS definiert werden."// | Keyword "*CSS-dark*" beim Artikel ins entsprechende Feld setzen. Beim Rendering wird darauf geprüft und <body> Tag erhält die entsprechende Klasse. Das kann dann normaler per CSS definiert werden."// | ||
| Line 363: | Line 403: | ||
| ~~UP~~ | ~~UP~~ | ||
| + | |||
| + | ===== News CP in der Detailansicht ===== | ||
| + | |||
| + | |||
| + | |||
| + | Prüfen, ob sich ein News CP in der Detailansicht befindet: | ||
| + | |||
| + | <code PHP> | ||
| + | if(isset($_getVar['newsdetail'])) { ..... | ||
| + | </code> | ||
| + | |||
| + | |||
| + | \\ | ||
| + | ~~UP~~ | ||