[feature request] add optional file inclusion AFTER cms.php

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
manu
Posts: 822
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

[feature request] add optional file inclusion AFTER cms.php

Post by manu » Fri Sep 11, 2015 6:59 am

Since 1.6.5 prelude.php has been introduced to include code before cms.php.
How about to have a possibility to include code AFTER cms.php, like epilogue.php? Why? In several installation I use bbclone as web statistics. The easiest way to include is to alter index.php like, because all the environment is established and the script at the very end cannot harm anything else:

Code: Select all

...
include('./cmsimple/cms.php');

if(!XH_ADM){	//suppress stat im admin mode
 if ($s >= 0 )  define("_BBC_PAGE_NAME",  $h[$s]); else   define("_BBC_PAGE_NAME",  $h[0]);
 define("_BBCLONE_DIR", "bbclone/");
 define("COUNTER", _BBCLONE_DIR."mark_page.php");
 if (is_readable(COUNTER)) include_once(COUNTER);
} 
Even the fact that index.php is modified very rarely it still belongs to the core. And from time to time it comes along witch updates even there is no modification on it. And the there go my statistics...
regards
manu

Holger
Site Admin
Posts: 3209
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany
Contact:

Re: [feature request] add optional file inclusion AFTER cms.

Post by Holger » Tue Sep 29, 2015 10:24 pm

What about such a userprelude.php?

Code: Select all

<?php
//do something before cms.php
...

//include cms.php
include('cms.php');

//do something AFTER cms.php
if(!XH_ADM){   //suppress stat im admin mode
    if ($s >= 0 )  define("_BBC_PAGE_NAME",  $h[$s]); else   define("_BBC_PAGE_NAME",  $h[0]);
    define("_BBCLONE_DIR", "bbclone/");
    define("COUNTER", _BBCLONE_DIR."mark_page.php");
    if (is_readable(COUNTER)) include_once(COUNTER);
}

//stop further parsing of index.php
exit;
 
Should work without one more include.

Holger

manu
Posts: 822
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: [feature request] add optional file inclusion AFTER cms.

Post by manu » Wed Sep 30, 2015 2:08 pm

This is true.
I pray for not any update in index.php in future :) .

Post Reply