Multiple versions via little php-script
Posted: Fri 2. Jun 2006, 10:22
Hi,
maybe it's interesting for some people.
Yesterday, I played with the great multiple-language-script of pepe (http://www.phpwcms.de/forum/viewtopic.p ... sc&start=0) and made minor changings.
Now you can also use a suffix instead of prefix and cut it after "_"
Script is:
- save script for instance as version-change.php in /phpwcms_template/inc_script/
- use in phpwcms links like : <a href="index.php?{PHP:phpwcms_template/inc_script/version-change.php}v2" target="_self">Version 2</a>
- you have to use alias-names in phpwcms like "contact_v1" "contact_v2" ...
So, if you want to you can have a combination of a multiple-language and multiple-version site. It works here http://www.medikanto.de for switching between two languages and my different designs.
Regards
jojostg
maybe it's interesting for some people.
Yesterday, I played with the great multiple-language-script of pepe (http://www.phpwcms.de/forum/viewtopic.p ... sc&start=0) and made minor changings.
Now you can also use a suffix instead of prefix and cut it after "_"
Script is:
Code: Select all
<?PHP
// copyright by Manfred Peperkorn :: strip-prefix.php
// changings by Juergen Kraemer to :: version-change.php
// find alias-name - turn alias-name
// strip prefix (actually suffix) - turn alias-name again
// give back name
// alias: aliasname-example_v1
// strip: v1
// give back: aliasname-example_
$alias = $GLOBALS['content']['struct'][($GLOBALS['aktion'][0])]['acat_alias'];
$u = strrev($alias);
$search = "_";
$aliasNOsuffix = stristr($u,$search);
$t = strrev($aliasNOsuffix);
echo $t;
?>
- use in phpwcms links like : <a href="index.php?{PHP:phpwcms_template/inc_script/version-change.php}v2" target="_self">Version 2</a>
- you have to use alias-names in phpwcms like "contact_v1" "contact_v2" ...
So, if you want to you can have a combination of a multiple-language and multiple-version site. It works here http://www.medikanto.de for switching between two languages and my different designs.
Regards
jojostg