Multiple versions via little php-script

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
jojostg
Posts: 10
Joined: Fri 9. Sep 2005, 09:21
Contact:

Multiple versions via little php-script

Post by jojostg »

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:

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;
?>
- 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
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

hi jojostg is great but realy what is new to thi script? it will be great to do one that give you the posibility to switch between 3 or 4 languages.

just a sugestion
ImagePackging design,labels, catalogs,postcards,
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post by pepe »

Hi culda_a,


there is no limit of the used languages... take 5 and it will work fine :idea:
culda_a
Posts: 521
Joined: Tue 28. Feb 2006, 01:39
Contact:

Post by culda_a »

Hi pepe, thanks for notification, I did not know that I have belive that your script works for 2 languages only ...my mistake :wink:
ImagePackging design,labels, catalogs,postcards,
Post Reply