Revisions NR. von phpwcms als "ReplacementTag" vorhanden ?

Hier bekommst Du deutschsprachigen Support. Keine Fehlermeldungen oder Erweiterungswünsche bitte!
Post Reply
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Revisions NR. von phpwcms als "ReplacementTag" vorhanden ?

Post by pepe »

Hallo phpwcms-Freunde,
wenn man in den Code von phpwcms-Sites blickt, findet man u.A. folgende automatisch generierte Zeile:

Code: Select all

<meta name="generator" content="phpwcms 1.5.4.2 (r492)" />
Liegt ggf. der content-Wert phpwcms 1.5.4.2 (r492) auch als ReplacementTag vor, sodass man die Versionsnummer im Inhalt der Site leicht verwenden könnte?
Oder wie bekomme ich die aktuelle Angabe anderweitig "ausgelesen" und im Content angezeigt?
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Revisions NR. von phpwcms als "ReplacementTag" vorhanden

Post by update »

Mit <?php echo PHPWCMS_VERSION ?> vielleicht?
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: Revisions NR. von phpwcms als "ReplacementTag" vorhanden

Post by pepe »

Meeeensch claus, klar geht das!
Hätt ich eigentlich selber drauf können... nein MÜSSEN :oops:

Und die Revision funktioniert dann natürlich auch mit :

Code: Select all

<?php echo PHPWCMS_REVISION ?>
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Revisions NR. von phpwcms als "ReplacementTag" vorhanden

Post by update »

Bei manchen Installationen wie bei mir geht allerdings nur

Code: Select all

[PHP] echo PHPWCMS_VERSION [/PHP][PHP] echo PHPWCMS_REVISION [/PHP]
Warum auch immer...
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Revisions NR. von phpwcms als "ReplacementTag" vorhanden

Post by flip-flop »

.... weil <?php ... ?> nicht direkt ausgeführt werden kann.

Ich würde immer einen Ersetzer dazu verwenden, z.B.

Code: Select all

<?php
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day."); }
// ----------------------------------------------------------------
 
if( ! (strpos($content["all"],'{PHPWCMS_')===false)) {
    $content["all"] = str_replace('{PHPWCMS_VERSION}',      PHPWCMS_VERSION,      $content["all"]);
    $content["all"] = str_replace('{PHPWCMS_RELEASE_DATE}', PHPWCMS_RELEASE_DATE, $content["all"]);
    $content["all"] = str_replace('{PHPWCMS_REVISION}',     PHPWCMS_REVISION,     $content["all"]);
}
?>
Die Konstanten sind hier zu finden: http://code.google.com/p/phpwcms/source ... lt.inc.php

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: Revisions NR. von phpwcms als "ReplacementTag" vorhanden

Post by pepe »

Jau, flip-flop, genau so habe ich's dann auch gemacht, danke für die RT-Lösung :D
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Revisions NR. von phpwcms als "ReplacementTag" vorhanden

Post by update »

:D
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Revisions NR. von phpwcms als "ReplacementTag" vorhanden

Post by flip-flop »

Hier eine etwas ausführlichere Variante, bei der das Datum formatiert werden kann: phpwcms-Version/Datum/Revision

Code: Select all

- {PHPWCMS_VERSION}  ==> 1.5.4
- {PHPWCMS_REVISION} ==> 490

- {PHPWCMS_RELEASE_DATE:l, j. F Y lang=DE}  =>  Dienstag, 29. Mai 2012
- {PHPWCMS_RELEASE_DATE:d.m.Y}              =>  29.05.2012
- {PHPWCMS_RELEASE_DATE}                    =>  2012/05/29    (Immer Y/m/d ...)
Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Post Reply