Fork me on GitHub

Watch

GitHub Core

Show your support for Zikula! Sign up at Github account and watch the Core project!




GitHub Modules

Forum Activity

Forum feed

» Visit forum | » View latest posts

PostNukeBlue100/Postnuke-V modifications - welcome problem  Bottom

  • Hi,

    I have been trying to modify the excellent PostNukeBlue100 theme, and mostly it is all easy to follow, and is working well.

    The one problem I seem to be having is that I am trying to include a personal welcome/message alert like the one in PostNuke-V, but it keeps displaying it as the PHP rather than the text that I think should be there.

    ie the message says:

    Quote

    _WELCOMETom! _YOUHAVE 2 _PRIVATEMSGS, 1 _UNREAD


    To do it, I just pasted the code across from one theme to the other.

    It displays fine when I select Postnuke-V as the theme, so I'm convinced I'm missing something, but I can't find it!

    Any help would be much appreciated.

    Thanks,

    Tom
  • It's due to the multilingual support in Postnuke, the themes like the system use special variables called Constants, because they can only be set once in the execution of a script and are available from any associated script (global). The system has a set of preset Constants found in the main language folder at language/eng/global.php (the subfolder depending on chosen language). So when a different language is enabled, the Constants are defined in a different language.

    The themes have their own language file, at lang/eng/global.php (again depending on language). Open up the one in PostNuke-V and you'll see at the top:

    Code

    define('_WELCOME','Welcome ');
    if (!defined("_YOUHAVE")) {
    define('_YOUHAVE','You have'); }
    if (!defined("_PRIVATEMSG")) {
    define('_PRIVATEMSG','message'); }
    if (!defined("_PRIVATEMSGS")) {
    define('_PRIVATEMSGS','messages'); }
    define('_UNREAD','unread');


    Copy-and-paste this portion into the PostNukeBlue100 global.php file, and when next you refresh your site, the text should come up right. In PostNuke-V there's a note in the theme near the top URLs to the same effect. Here you can define any constant you like and use it in the theme, provided it's not already used by the system. If it is, the system's version has precedence as it's defined first (being a Constant, it can't be redefined).

    Of course, if you have no intention of having other language support, you can just type it directly into the theme in place of the constants.

    Glad you like 'em!

    Martin :D
  • Thanks!

    Just the job! :D
  • 0 users

This list is based on users active over the last 60 minutes.