Differences

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

english:technics:system-variables [2010/03/14 09:28]
Knut Heermann (flip-flop)
english:technics:system-variables [2018/06/03 18:09] (current)
Line 5: Line 5:
===== index.php?id=0,0,0,0,0,0 ===== ===== index.php?id=0,0,0,0,0,0 =====
 +**System-oriented link representation** of category, article, print. \\
 +This representation can be used actively to operate as a link or query the existing status.\\
<file> <file>
Line 10: Line 12:
1 = article ID 1 = article ID
2 = e.g. if 1 then print 2 = e.g. if 1 then print
-3 = if 1 then show cat +3 = if 1 then show category 
-4 = if a link to a article then show (1)+4 = if a link to an article then show (1)
5 = free use 5 = free use
</file> </file>
Line 23: Line 25:
$aktion[2] = isset($aktion[2]) ? intval($aktion[2]) : 0;                //  e.g. if 1 then print $aktion[2] = isset($aktion[2]) ? intval($aktion[2]) : 0;                //  e.g. if 1 then print
$aktion[3] = isset($aktion[3]) ? intval($aktion[3]) : 1;                //  if 1 then show cat $aktion[3] = isset($aktion[3]) ? intval($aktion[3]) : 1;                //  if 1 then show cat
-$aktion[4] = isset($aktion[4]) ? intval($aktion[4]) : 0;                //  if a link to a article then show (1)+$aktion[4] = isset($aktion[4]) ? intval($aktion[4]) : 0;                //  if a link to an article then show (1)
$aktion[5] = isset($aktion[5]) ? intval($aktion[5]) : 0;                //  free use $aktion[5] = isset($aktion[5]) ? intval($aktion[5]) : 0;                //  free use
</code> </code>
Line 29: Line 31:
\\ \\
 +
==== Examples: ==== ==== Examples: ====
** **
Line 36: Line 39:
\\ \\
**The article ID** //(Output only in article detail view)//: **The article ID** //(Output only in article detail view)//:
-<code php>echo 'Cat-ID: '.$GLOBALS['aktion']['1'];</code>+<code php>echo 'Article-ID: '.$GLOBALS['aktion']['1'];</code>
\\ \\
When we are in category view? [1=Yes|0=No] \\ When we are in category view? [1=Yes|0=No] \\
-<code php>echo 'Cat-ID: '.$GLOBALS['aktion']['3'];</code>+<code php>echo 'CatShow: '.$GLOBALS['aktion']['3'];</code>
\\ \\
When we are in article detail view? [1=Yes|0=No]: \\ When we are in article detail view? [1=Yes|0=No]: \\
-<code php>echo 'Cat-ID: '.$GLOBALS['aktion']['4'];</code>+<code php>echo 'Detail: '.$GLOBALS['aktion']['4'];</code>
\\ \\
**Assumption:** A category //(ID=7)// operating in simple article mode //(ID=26)//  //(Top article count: -1, or if the number of top articles: > 1 and article count = 1)// \\ **Assumption:** A category //(ID=7)// operating in simple article mode //(ID=26)//  //(Top article count: -1, or if the number of top articles: > 1 and article count = 1)// \\
Line 53: Line 56:
    [5] => 0     [5] => 0
</code> </code>
 +As a link: ''%%index.php?id=7,26,0,1,1,0%%''
 +
\\ \\
Line 64: Line 69:
    [5] => 0     [5] => 0
</code> </code>
 +As a link: ''%%index.php?id=2,0,0,1,0,0%%''
 +
  * In article detail view e.g. (article ID=6):<code>   * In article detail view e.g. (article ID=6):<code>
Line 72: Line 79:
    [4] => 1   // article detail view       [4] => 1   // article detail view  
    [5] => 0     [5] => 0
-</code>+</code>As a link: ''%%index.php?id=2,6,0,0,1,0%%''
\\ \\
---- ----
Line 103: Line 110:
// top article count for article list mode in site structure -> category -> top article count: // top article count for article list mode in site structure -> category -> top article count:
dumpVar($GLOBALS['content']['struct'][$content['cat_id']]['acat_topcount']; // (count) dumpVar($GLOBALS['content']['struct'][$content['cat_id']]['acat_topcount']; // (count)
 +
 +// Article title of the current article (detail mode)
 +dumpVar($GLOBALS['content']['article_title']);
 +
 +// Article subtitle of the current article (detail mode)
 +dumpVar($GLOBALS['content']['articles'][$GLOBALS['content']['article_id']]['article_subtitle']);
[/PHP] [/PHP]
Line 118: Line 131:
-The variable ##$content['all_keywords']## //(or ##$GLOBALS['content']['all_keywords']## if in functions used)// supplies the Keywords of the current article.+The variable ##$content['all_keywords']## //(or ##$GLOBALS['content']['all_keywords']## if used in functions )// supplies the Keywords of the current article.
-E.g.: //Forum [[http://forum.phpwcms.org/viewtopic.php?p=120863#p120863|Css eines Artikels ändern]]// [DE]+**E.g.:** Write the keywords into an array:
-A special CSS formatting for an article:+<code php> 
 +$keywords_array = convertStringToArray($GLOBALS['content']['all_keywords']); 
 +</code>
-**Question:** \\ +\\ 
-//"If I liked to indicate a special css for only one article , where I make that?+ 
 + 
 + 
 +**E.g.:** //Forum [[http://forum.phpwcms.org/viewtopic.php?p=120863#p120863|Css eines Artikels ändern]]// [DE] 
 + 
 +A special CSS formatting for an article:
-For explanation, I would like to have individual articles with a dark instead of a bright side background." //+> **Question:** \\ 
 +> //"If I liked to indicate a special css for only one article , where will I do that? 
 +
 +> For explanation, I would like to have individual articles with a dark instead of a bright page background." //
-**Answer:** \\ +> **Answer:** \\ 
-//"I would work with a special keyword by using a frontend_render script to react accordingly.+> //"I would work with a special keyword by using a frontend_render script to trigger it accordingly.
-Set the keyword "*CSS-dark*" with the article into the appropriate field. When rendering is checked out the <body> tag is enhanced by the corresponding class. This can normally be defined via CSS."//+Set the keyword "*CSS-dark*" into the appropriate fiel dof the article. When rendering is checked out the <body> tag is enhanced by the corresponding class. This normally can be defined via CSS."//
Line 154: Line 177:
</code> </code>
-**Attention** - the class(es) "dark level-" was selected consciously in such a way, since still additionally the level ID is given.+**Attention** - the class(es) "dark level-" were selected intentionally in such a way, since still additionally the level ID is given.
~~UP~~ ~~UP~~
Line 166: Line 189:
-Now it is possible to selecte the current category ID related to the level.+Now it is possible to select the current category ID related to the level.
<code html|h test snippet Level-Ids |h> <code html|h test snippet Level-Ids |h>
Line 254: Line 277:
===== GET variable set and read ===== ===== GET variable set and read =====
-Example: The variable is called "cpimage" and contains an integer value.+Example: The variable is called "cpimage" and is containing an integer value.
=== Preparing the address: === === Preparing the address: ===
Line 289: Line 312:
</code> </code>
-The integer value in **$cpImgNr** can now be processed, but should be checked prior to "false". +The integer value in **$cpImgNr** can be processed now, but should be checked prior to "false".
\\ \\
Line 299: Line 322:
</code> </code>
 +\\
~~UP~~ ~~UP~~
-===== Template: Embed the fields "header:", "footer:", "left:", "right:" in "main:" ===== 
-Normally these fields are no longer usefully, there these fields with the layout variant rendering: "custom" not to be queried. \\ 
-With a small replacer it is however possible to merge these input fields into the field "main:". \\ 
-We set the tags into the postions where the contents of these fields in the template "main:" will be merged. \\ 
-  * **{HEADERTEMP}** = Content from "header:" 
-  * **{FOOTERTEMP}** = Content from "footer:" 
-  * **{RIGHTTEMP}** = Content from "right:" 
-  * **{LEFTTEMP}** = Content from "left:" 
-<note> +===== CP News in Detail View =====
-It may happen that some functions in the alternative fields will be processed by the system before inserting in "main". If so, please place the instructions directly into the "main:"  field. Alternatively, the RT (SHOW_CONTENT :.....} could be used. +
-</note>+
-**Condition:**  -> [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml|/config/phpwcms/conf.inc.php]] \\ 
-  * $phpwcms['allow_ext_init']  = 1; 
 +Check if a news CP is in the detail view:
-Please insert into the folder **template/inc_script/frontend_init/** the file **template_inject.php** with the following content:  +<code PHP
- +    if(isset($_getVar['newsdetail'])) { .....
-<code php|h template_inject.php |h> +
-<?php +
-/********************************************************************************************* +
-* Backend Template field replacer +
-* Replaces the placeholder {HEADERTEMP}, {FOOTERTEMP}, {LEFTTEMP}, {RIGHTTEMP} in "main"  +
-* with the contents of the fields "header", "footer", "left", "right". +
-* KH 07.01.2010 +
-**********************************************************************************************/ +
- +
-// ------------------------------------------------------------------------------------------- +
-// obligate check for phpwcms constants +
-  if (!defined('PHPWCMS_ROOT')) { +
-    die("You Cannot Access This Script Directly, Have a Nice Day."); } +
-// ------------------------------------------------------------------------------------------- +
- +
-if (!empty($block['headertext']) )  +
- $block['maintext'] = str_replace('{HEADERTEMP}', $block['headertext'],$block['maintext']); +
-if (!empty($block['righttext']))  +
- $block['maintext'] = str_replace('{RIGHTTEMP}' , $block['righttext'], $block['maintext']); +
-if (!empty($block['footertext']))  +
- $block['maintext'] = str_replace('{FOOTERTEMP}', $block['footertext'],$block['maintext']); +
-if (!empty($block['lefttext'])) +
- $block['maintext'] = str_replace('{LEFTTEMP}'  , $block['lefttext'],  $block['maintext']); +
- +
-?>+
</code> </code>
- +\\ 
-<note important> +~~UP~~
-To make fast the query the presence of tags is not tested in the "main:" field. It is your responsibility to use only tags, although the corresponding content is available in alternative fields.  +
-</note> +
- +
- +
- +
- +
english/technics/system-variables.1268555291.txt.gz · Last modified: 2018/06/03 18:08 (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