Differences

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

english:phpwcms_replacer_rts:frontend_render [2009/08/20 10:56]
Knut Heermann (flip-flop)
english:phpwcms_replacer_rts:frontend_render [2018/06/03 18:09] (current)
Line 1: Line 1:
{{indexmenu_n>20}} {{indexmenu_n>20}}
-===== /fronten_render/ =====+===== /frontend_render/ ===== 
 + 
 + 
 +**Requirement:** ##<$phpwcms['allow_ext_render']  = 1;## -> [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml|/config/phpwcms/conf.inc.php]]
-**Requirement:** Setting in [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml|conf.inc.php]] 
-<code php>$phpwcms['allow_ext_render']  = 1;        //allow including of custom external scripts at frontend rendering</code> 
\\ \\
**Description:** **Description:**
-\\ 
-In the folder /frontend_render/ you can be put down php scripts, which during parsing //(simplified: Internal processing)// the side to be processed, before the page is delivered to the browser. 
-All files with the ending *.php are loaded and implemented from the system. The file names are freely selectable // (recommended sample: rt_mein_dateiname.php). // +Into the folder **template/inc_script/frontend_render/** you can install own php scripts, which are processed while parsing //(simplified: Internal processing)// the site, before the page is delivered to the browser. 
 + 
 +All files ending with *.php are loaded and implemented by the system. The file names are freely selectable // (recommended sample: rt_mein_dateiname.php). //
The sequence of processing is not assignable without special programming. The sequence of processing is not assignable without special programming.
-The principal item is usually the variable **$content ["all"]**, which holds the content of the side // (between **<body>** and **</body>**). // +The principal item is usually the variable **$content ["all"]**, which is holding the content of the page // (between **<body>** and **</body>**). //
\\ \\
Line 23: Line 24:
Naturally also different system external functions can be implemented. Naturally also different system external functions can be implemented.
 +\\
 +Folder:  ** template/inc_script/frontend_render/ **
 +
 +**Condition:**  -> [[http://www.phpwcms-docu.de/conf_inc_php_en.phtml|/config/phpwcms/conf.inc.php]] \\
 +  * ##$phpwcms['allow_ext_render'] = 1;##
 +
 +\\
 +
 +===== Important =====
 +
 +**In all files in these folders should be for security reasons at the beginning of each file, the following sequence:**
 +<file>
 +<?php
 +// ----------------------------------------------------------------
 +// obligate check for phpwcms constants
 +if (!defined('PHPWCMS_ROOT')) {
 +   die("You Cannot Access This Script Directly, Have a Nice Day."); }
 +// ----------------------------------------------------------------
 +...
 +...
 +</file>
 +
 +\\
==== Single example: ==== ==== Single example: ====
Line 29: Line 53:
-The file content of a very simple procedure, which writes simply only the text // " That is an unreasonable text" // to the end of page at each side:+The file content of a very simple procedure, which simply will write only the text // " That is an unreasonable text" // to the end of page at each page:
<code php> <code php>
Line 48: Line 72:
==== Example 1: ==== ==== Example 1: ====
-The file content from a very simple example:+The file content of a very simple example:
<code php> <code php>
<?php <?php
Line 69: Line 93:
 at frontend.  at frontend.
-The tag is replaced from the result out of the /frontend_render/ file. //(The system tag [[http://www.phpwcms-docu.de/system_tags.phtml|{DATE_LONG}]] is also in use). //+The tag is replaced by the result of the /frontend_render/ file. //(The system tag [[http://www.phpwcms-docu.de/system_tags.phtml|{DATE_LONG}]] is in use also). //
~~UP~~ ~~UP~~
Line 144: Line 168:
  var3= third mad text   var3= third mad text
-Like that it is possible to solve very special problems.+This way it is possible to solve very special problems.
 --- //[[flip-flop@myrealbox.com|Knut Heermann (flip-flop)]] 2009/01/23 15:19//  --- //[[flip-flop@myrealbox.com|Knut Heermann (flip-flop)]] 2009/01/23 15:19//
Line 154: Line 178:
-If you have more then one file in frontend_render and the results of the routines are to each other dependent, there is a fundamental problem of the processing sequence. \\ + 
-We can´t determine direct the processing sequence of the files in this folder.+If you have more than one file within frontend_render and the results of the routines are depending on each other, a fundamental problem of the processing sequence is arising. \\ 
 +We can´t determinethe processing sequence of the files in this folder directly. 
 + 
 +==== Solution 01 ====
**Explained by the example NAV_HORIZ_DD and the FE language switch.** **Explained by the example NAV_HORIZ_DD and the FE language switch.**
Line 161: Line 188:
--> [[http://forum.phpwcms.org/viewtopic.php?p=119117#p119117|Forum]] --> [[http://forum.phpwcms.org/viewtopic.php?p=119117#p119117|Forum]]
-  - We uses a custom navigation like [[english/navigation/dropdown-flyout/nav_horiz_dd|{NAV_HORIZ_DD:xx,yy}]] +  - We use a custom navigation like [[english/navigation/dropdown-flyout/nav_horiz_dd|{NAV_HORIZ_DD:xx,yy}]] 
-  - We uses the custom frontend_render language switch. +  - We use the custom frontend_render language switch.
-If the frontend_render language switch is processing before the NAV_HORIZ_DD script, all language tags in this navigation file are not processed.+If the frontend_render language switch is processed before the NAV_HORIZ_DD script, all language tags in this navigation file are not processed.
[de]Das Haus[/de][en]The Hotel[/en][de]Urlaub & Familie[/de][en]Holidays & Family[/en] [de]Das Haus[/de][en]The Hotel[/en][de]Urlaub & Familie[/de][en]Holidays & Family[/en]
**The simplest solution:** \\ **The simplest solution:** \\
-Shift the concerned  files into another folder and manufacture the correct order of the concerned files  with the help of a third file. +Shift the concerning files into another folder and define the correct processing order of the these files  with the help of a third file.
  - Create a folder e.g. /frontend_render/special   - Create a folder e.g. /frontend_render/special
Line 193: Line 220:
\\ \\
-Thats it, we have determine the processing order. :-D \\ //(You can do this with all other php snippets in /frontend_render/ if you have similar problems).//+==== Solution 02 ==== 
 + 
 +To optimize  the script's runtime on your server you can put the content of all /frontend_render/* files in the right order into one file e.g. called /frontend_render/master.php. 
 +Disable all other files of this folder by extending the suffix like e.g. *.php_ 
 + 
 +Thats it, we have determined the processing order. :-D \\ //(You can do this with all other php snippets in /frontend_render/ if you have similar problems).//
english/phpwcms_replacer_rts/frontend_render.1250758562.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