Where to put own functions and how to call them?
Where to put own functions and how to call them?
Hello,
even the most perfect wcms cannot cover all the special needs one person could have. So for this reason one can write its own php functions and include them.
I know a way to call these functions by creating replacement tags and place the files which parse the content and have the necesarry function under /template/inc_script/frontend_render ...
But I realize the functions located there are loaded every time a page is shown. I guess there is a better way. Where to store those files and how to include them? E.g. in an article?
Thank you in advance.
even the most perfect wcms cannot cover all the special needs one person could have. So for this reason one can write its own php functions and include them.
I know a way to call these functions by creating replacement tags and place the files which parse the content and have the necesarry function under /template/inc_script/frontend_render ...
But I realize the functions located there are loaded every time a page is shown. I guess there is a better way. Where to store those files and how to include them? E.g. in an article?
Thank you in advance.
Do you mean like this:
If yes, you can use any everywhere you want...
claus
Code: Select all
[PHP]include("loadit.php");[/PHP]
claus
Code: Select all
{PHP:my_external_PHP_script.php}
Use: This tag supports complete external php scripts, ending with the *.php suffix. Phpwcms buffers output to enable these scripts to execute. Very robust including connections to remote databases. See forum for details and usage.
Thank you Dexxus,
this helped solving my little php problem in http://www.phpwcms.de/forum/viewtopic.php?p=89200#89200
claus
this helped solving my little php problem in http://www.phpwcms.de/forum/viewtopic.php?p=89200#89200
claus
hmmmm.... Thte reason why ... I'm asking that exact:
I handle a database on the ds5000 etch server with [PHP]...
No Pooblems with the extra database inside phpwcms, there are several tables with a million entries each, only problem are German umlauts
hmmmm.... and it is INSIDE Frontend login.... you know why I think before {PHP:4erveryone.php} ...
I handle a database on the ds5000 etch server with [PHP]...
No Pooblems with the extra database inside phpwcms, there are several tables with a million entries each, only problem are German umlauts
hmmmm.... and it is INSIDE Frontend login.... you know why I think before {PHP:4erveryone.php} ...
My very problem has been the following:
my db / conf.inc.php is utf-8
the php file pulled off of another server is something like iso...
when pulling it without options it arrived with the wrong charset because phpwcms did a rewrite into utf-8
so I tried to force it to be ISO-8859-1 even after the include...
its works...!
Only glitch seems to be that the particular page is changing to iso too - at least the content's title did so...
This works for just one page, not the following ones
Or did I get you wrong completely?
my db / conf.inc.php is utf-8
the php file pulled off of another server is something like iso...
when pulling it without options it arrived with the wrong charset because phpwcms did a rewrite into utf-8
so I tried to force it to be ISO-8859-1 even after the include...
its works...!
Only glitch seems to be that the particular page is changing to iso too - at least the content's title did so...
This works for just one page, not the following ones
Or did I get you wrong completely?
hmm, thks claus ....
Nearly same here, but with db : The original databses was oracle running on windows. Still alive, being tranported to my server.
My etch system hs everything on utf-8, now the iso (swedish-ci) Table is in the site and som strange things happen:
Outside frontend: All ok, reload goes through and same evreytime. Inside: every 2nd reload mixes up the utf-8 Umlauts.
The first part of the ISO Part is displayed well inside (list abt. 1400 Entries for a customer)
From there next mask with a link, half displayd ok, next half "L�nge 3"
This drives me NUTS
There were definitly no problems with the second db, even with 14 Tables and 180 MB of extra data. Only Umlauts
I'll make you customer to have a look
***********************
EDIT
**********************
Select Brain FROM df6ih where logic= true
this->problem solved
reversed phpwcms tables to latin1, changed config data .. et voila
Nearly same here, but with db : The original databses was oracle running on windows. Still alive, being tranported to my server.
My etch system hs everything on utf-8, now the iso (swedish-ci) Table is in the site and som strange things happen:
Outside frontend: All ok, reload goes through and same evreytime. Inside: every 2nd reload mixes up the utf-8 Umlauts.
The first part of the ISO Part is displayed well inside (list abt. 1400 Entries for a customer)
From there next mask with a link, half displayd ok, next half "L�nge 3"
This drives me NUTS
There were definitly no problems with the second db, even with 14 Tables and 180 MB of extra data. Only Umlauts
I'll make you customer to have a look
***********************
EDIT
**********************
Select Brain FROM df6ih where logic= true
this->problem solved
reversed phpwcms tables to latin1, changed config data .. et voila
for me (and other) dummy: could you provide a short line of howto just in case I'll need this too some time? Thank youreversed phpwcms tables to latin1, changed config data .. et voila
PS: There indeed is a difference sometimes between the frontend display and the backend one - but both have utf-8 in their headers -
Seems to be that the standard install of mysql is basically latin swedish But I don't know enough about the insights of dbs ...
PPS: !Select Brain FROM claus where logic= true
Ok, so I tell you what I did, there are several ways as even all the times.. :
utf-8 to latin1 or back:
1.) I copied structure of all phpwcms tables in phpmyadmin as Text, copy pasted it in
2.) Text Editor, where I changed all utf8 into latin1
3.) This step needs more than 1 database: Created a new database
4.) in new database-> Sql all the changed stuff.
5.) Back to old database CSV for all table entries in phpwcms
6.) Copy paste into Sql Section of the new database.
7.) Ready
There are !! wrong Umlauts after this "attack", but in CSV you can change them...as I did with text editor in 4000 cases
I took this method cause the reference database is left untouched on the server. I then changed the sql data in config file phpwcms .. and here we go.
For being shure this method went through, I can delete the old utf database.
//EDIT : Perhaps this all is possible with telnet, hmm I'm so glad thát this is ready, so I do not have to find out how
utf-8 to latin1 or back:
1.) I copied structure of all phpwcms tables in phpmyadmin as Text, copy pasted it in
2.) Text Editor, where I changed all utf8 into latin1
3.) This step needs more than 1 database: Created a new database
4.) in new database-> Sql all the changed stuff.
5.) Back to old database CSV for all table entries in phpwcms
6.) Copy paste into Sql Section of the new database.
7.) Ready
There are !! wrong Umlauts after this "attack", but in CSV you can change them...as I did with text editor in 4000 cases
I took this method cause the reference database is left untouched on the server. I then changed the sql data in config file phpwcms .. and here we go.
For being shure this method went through, I can delete the old utf database.
//EDIT : Perhaps this all is possible with telnet, hmm I'm so glad thát this is ready, so I do not have to find out how
- Oliver Georgi
- Site Admin
- Posts: 9907
- Joined: Fri 3. Oct 2003, 22:22
- Contact: