{{indexmenu_n>10}}
====== System variables ======
===== 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.\\
$aktion = array(0,0,0,0,1,0);
$aktion = explode(',', $_GET["id"], 6);
$aktion[0] = intval($aktion[0]); //$aktion[0] will be always available // structure ID
$aktion[1] = isset($aktion[1]) ? intval($aktion[1]) : 0; // article ID
$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[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
Request using **$GLOBALS['aktion']**
\\
==== Examples: ====
**
The category ID:**
echo 'Cat-ID: '.$GLOBALS['aktion']['0'];
\\
**The article ID** //(Output only in article detail view)//:
echo 'Article-ID: '.$GLOBALS['aktion']['1'];
\\
When we are in category view? [1=Yes|0=No] \\
echo 'CatShow: '.$GLOBALS['aktion']['3'];
\\
When we are in article detail view? [1=Yes|0=No]: \\
echo 'Detail: '.$GLOBALS['aktion']['4'];
\\
**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)// \\
[0] => 7 // category-ID
[1] => 26 // article-ID
[2] => 0
[3] => 1 // category view
[4] => 1 // article detail view
[5] => 0
As a link: ''%%index.php?id=7,26,0,1,1,0%%''
\\
**Assumption:** A category //(ID=2)// operating in article list mode //(ID=26,6,5,3)// //(Top article count: > 1, article count > 1)// \\
[0] => 2 // category-ID
[1] => 0
[2] => 0
[3] => 1 // category view
[4] => 0
[5] => 0
As a link: ''%%index.php?id=2,0,0,1,0,0%%''
* In article detail view e.g. (article ID=6):
[0] => 2 // category-ID
[1] => 6 // article-ID
[2] => 0
[3] => 0
[4] => 1 // article detail view
[5] => 0
As a link: ''%%index.php?id=2,6,0,0,1,0%%''
\\
----
----
\\
===== Var Dump =====
Be shure you have set in conf.inc.php$phpwcms['allow_cntPHP_rt'] = 1; //allow PHP replacement tags and includes in content parts
\\
[PHP]
echo '
----
----
~~UP~~
\\
===== Read keyword from article =====
The variable ##$content['all_keywords']## //(or ##$GLOBALS['content']['all_keywords']## if used in functions )// supplies the Keywords of the current article.
**E.g.:** Write the keywords into an array:
LEVEL ID
';
dumpVar($GLOBALS['LEVEL_ID']);
echo 'LEVEL KEY
';
dumpVar($GLOBALS['LEVEL_KEY']);
echo 'LEVEL STRUCT
';
dumpVar($GLOBALS['LEVEL_STRUCT']);
echo '======================
';
dumpVar($GLOBALS['content']["articles"]); // article-structure
dumpVar($GLOBALS['content']["struct"]); // category-structure
// article list mode: if more then one article available and in site structure -> category -> top article count: > 1
dumpVar($GLOBALS['content']["list_mode"]); // (true|false)
// top article count for article list mode in site structure -> category -> top article 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]
$keywords_array = convertStringToArray($GLOBALS['content']['all_keywords']);
\\
**E.g.:** //Forum [[http://forum.phpwcms.org/viewtopic.php?p=120863#p120863|Css eines Artikels ändern]]// [DE]
A special CSS formatting for an article:
> **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:** \\
> //"I would work with a special keyword by using a frontend_render script to trigger it accordingly.
Set the keyword "*CSS-dark*" into the appropriate fiel dof the article. When rendering is checked out the
if(strpos($content['all_keywords'], '*CSS-dark*') !== false) {
$template_default['body']['class'] = 'dark level-';
$content['all_keywords'] = str_replace('*CSS-dark*', '', $content['all_keywords']);
}
?>
**
CSS:**
body.dark {
background-color: #666666;
}
**Attention** - the class(es) "dark level-" were selected intentionally in such a way, since still additionally the level ID is given.
~~UP~~
----
----
\\
===== New tag {LEVELX_ID} =====
Update 25.06.2009: [[http://code.google.com/p/phpwcms/source/detail?r=317|Revision: r317]]
Now it is possible to select the current category ID related to the level.
Old Level-Ids:
---------------------------
[PHP] // Old Level-Ids
echo ( (isset($GLOBALS['LEVEL_ID'][1])) ? ( 'Level 1 ID='. $GLOBALS['LEVEL_ID'][1]) : 'no level 1' ) . '
';
echo ( (isset($GLOBALS['LEVEL_ID'][2])) ? ( 'Level 2 ID='. $GLOBALS['LEVEL_ID'][2]) : 'no level 2' ) . '
';
echo ( (isset($GLOBALS['LEVEL_ID'][3])) ? ( 'Level 3 ID='. $GLOBALS['LEVEL_ID'][3]) : 'no level 3' ) . '
';
echo ( (isset($GLOBALS['LEVEL_ID'][4])) ? ( 'Level 4 ID='. $GLOBALS['LEVEL_ID'][4]) : 'no level 4' ) . '
';
[/PHP]
New Level-Ids (since r317):
---------------------------
{LEVEL1_ID:} {LEVEL1_ID}
{LEVEL2_ID:} {LEVEL2_ID}
{LEVEL3_ID:} {LEVEL3_ID}
{LEVEL4_ID:} {LEVEL4_ID}
---------------------------
~~UP~~
----
----
===== FE output {LEVCATID} =====
**Actual level No. / Actual category alias / Actual category-ID**
**Autor:** K.Heermann (flip-flop) http://planmatrix.de //2009/05/14 // \\
**CMS-Version:** >= V1.2.7 \\
**Tag:** {LEVCATID} \\
**File:** template/inc_script/frontend_render/rt_levcatid.php \\
**Condition:** -> [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml|/config/phpwcms/conf.inc.php]] \\
* $phpwcms['allow_ext_render'] = 1;
'.LEV_CAT_ID().'',
$content['all']);
?>
----
----
\\
Have a look: [[:english:phpwcms_replacer_rts:frontend_render:standard_tags_assembled|Standard tags assembled]]
~~UP~~
\\
===== GET variable set and read =====
Example: The variable is called "cpimage" and is containing an integer value.
=== Preparing the address: ===
$site = $GLOBALS['phpwcms']['site'].$GLOBALS['phpwcms']['root'];
$cat_alias = $GLOBALS['content']["struct"][$GLOBALS['content']["cat_id"]]["acat_alias"];
$href_str = $site.'index.php?'.$cat_alias;
$get_str = 'cpimage=';
\\
=== Set variable: ===
z.B. ##http://my_site.tld/index.php?active_category&**cpimage=34** ##
$my_number = 34;
$my_complete_link = $href_str.'&'.$get_str.$my_number; // http://my_site.tld/index.php?active_category&cpimage=34
\\
=== Read variable: ===
// Is there a GET var?
if (isset($GLOBALS['_getVar']['cpimage'])) {
$GLOBALS['_getVar']['cpimage'] = intval($GLOBALS['_getVar']['cpimage']); // Convert to integer
$cpImgNr = $GLOBALS['_getVar']['cpimage'];
}
else $cpImgNr = false; // if there is no GET var set it to false
The integer value in **$cpImgNr** can be processed now, but should be checked prior to "false".
\\
=== Use as tag: ===
{PHPVAR:$GLOBALS['_getVar']['cpimage']}
\\
~~UP~~
===== CP News in Detail View =====
Check if a news CP is in the detail view:
if(isset($_getVar['newsdetail'])) { .....
\\
~~UP~~