    File: $Id: Theme_Upgrades.txt,v 1.4 2002/03/16 21:31:45 niceguyeddie Exp $ $Name:  $

    Change History
    2002/03/03  --  v. 1.01 Border removed from Admin Messages in CVS
    2002/03/03  --  v. 1.02 Changed banners statement per hdonner
    2002/03/07  --  v. 1.03 Added a couple of useful vars and got rid of
    $timezone
    2002/03/10  --  v. 1.04 Found out where the Anonymous user was set
    2002/03/11  --  v. 1.05 Modified this file so it can be displayed correctly
    as plain text

    * Quick and Dirty Guide Version 1.05

    * Upgrading Postnuke .70x themes to .71

    By  fredb86@hotmail.com

    If you understand .70x themes, then you can use this guide to
    quickly port your theme to the new .71 features.  If you don't
    understand .70x themes, you can figure out what to do by
    reading through and then looking at the sample theme.php
    file that’s at the end of this document.

    Good Luck!
    =========================================================
    STEP 1:  Add themes_get_language() function

    ...
    $textcolor1 = "#CCCCCC";
    $textcolor2 = "#CCCCCC";
    $postnuke_theme = true;

    themes_get_language();
    =========================================================
    STEP 2: Major changes to the themeheader() function

    //Remove $sitename, $slogan, $banners, $user, and $cookie from the global
    statement.
    global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $index;

    //Use pnConfigGetVar to retrieve useful parameters
        $slogan = pnConfigGetVar('slogan');
        $sitename = pnConfigGetVar('sitename');
        $banners = pnConfigGetVar('banners');
        $startpage = pnConfigGetVar('startpage');
        $currentlang = pnConfigGetVar('language');

    //New way to get current user
       if (!pnUserLoggedIn()) {
            $username = pnConfigGetVar('anonymous');
            } else {
            $username = pnUserGetVar('uname');
        }

    //Banners are managed by calling this function
    pnBannerDisplay();

    =========================================================
    STEP 3:  If you have a user login form in your theme, you need to add this
    hidden field to your form:

    if (!pnUserLoggedIn()) {

    $urivalue=getenv("REQUEST_URI");
    ..........
    ."
    \n"

    }
    else
    {
       [Welcome Fredb....blah blah]
    }
    =========================================================
    STEP 4:  To show the Admin Messages (e.g. Welcome to Postnuke...) on
    your home page, you need to add this to your theme. This is generally the
    very, very last statement in your themeheader() function:

    if ($index == 1) {
    blocks('centre');
      }
    =========================================================
    STEP 5: Useful variables for themeindex() and maybe elsewhere.
    Remove them from the global variables statement.

    //Remove $tipath and $anonymous from the global statement
    global $thename, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4,  $sepcolor;

    //The name of the anonymous user is set in the Comments
    //area of Postnuke Administration. The variable tipath is the
    //pathname to the topics images.

    $anonymous = pnConfigGetVar('anonymous');
    $tipath = pnConfigGetVar('tipath');

    =========================================================
    STEP 6: Changes to themearticle(). This code  replaces the old
    authorisation stuff:

    if (pnSecAuthAction(0, 'Stories::', "$info[aid]:$info[cattitle]:$info[sid]",
    ACCESS_EDIT)) {
                 echo "
[ "._EDIT."
    ";
                 if (pnSecAuthAction(0, 'Stories::',
    "$info[aid]:$info[cattitle]:$info[sid]", ACCESS_DELETE)) {
                 echo "|
"._DELETE." ]"; } echo "
\n"; } ========================================================= STEP 7: changes to themesidebox(). Admin messages are displayed using themesidebox. Admin messages are essentially blocks without titles. So, you first check to see if the block has a title. If not, it must be an Admin message, so display it. Otherwise, it must be a real block, so just use your usual themesidebox code: function themesidebox($block) { // If no title, then it must be an Admin message. if (empty($block['title'])) { echo "$block[content]
    ";
            }
            else
            {
                    [your old themesidebox code goes here]
            }
    }
    =========================================================
    STEP 8:  To avoid warning messages in PHP 4.1x, make sure that your
    blocks parameters are enclosed in single quotes:

    blocks('right')
    blocks('left')
    blocks('centre')

    =========================================================
    STEP 9:  Remove the variable $timezone from your theme (if it’s in there).
    It is no longer used.
    =========================================================
    =========================================================
    =========================================================
    =========================================================
    =========================================================
    =========================================================

    SAMPLE THEME.PHP FILE!!!!!!
\n"; echo "

\n"; } function CloseTable() { echo "

    \n";
    }

    function OpenTable2() {
        global $bgcolor1, $bgcolor2;
        echo "

\n"; echo "
\n"; } function CloseTable2() { echo "

    \n";
    }

    /************************************************************/
    /* Function themeheader()                                   */
    /*                                                          */
    /* Control the header for your site. You need to define the */
    /* BODY tag and in some part of the code call the blocks    */
    /* function for left side with: blocks(left);               */
    /************************************************************/

    function themeheader() {
        global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $index;

        $slogan = pnConfigGetVar('slogan');
        $sitename = pnConfigGetVar('sitename');
        $banners = pnConfigGetVar('banners');
        $startpage = pnConfigGetVar('startpage');
        $currentlang = pnConfigGetVar('language');

        if (!pnUserLoggedIn()) {
            $username = pnConfigGetVar('anonymous');
        } else {
            $username = pnUserGetVar('uname');
        }

        echo "
\n\n\n"; echo "
    \n\n\n";

          pnBannerDisplay();

        echo "\n";
        echo "\n";
        echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";

    // Top Images
        echo "

\n" ."
\n" ."\n" ." | \n" ."
\n" ."

\n"; // Top Image Swap Navigation Bar - customize links to your specs echo "

\n" ."
\n" ."\n" ." | \n" ." | \n" ." | \n" ." | \n" ." | \n" ." | \n" ." | \n" ."
\n" ."

\n\n\n\n"; // Forms Bar echo "

\n" ."
\n" ."\n" ." | \n" ." |
    \n";
        if (!pnUserLoggedIn()) {
        $urivalue=getenv("REQUEST_URI");
            echo "
\n" ." User: \n" ."\n" ." Pass: \n" ."\n" ."\n" ."\n" ."\n" ."\n" ." Join\n" ."\n"; } else { echo " Hello $username! logout"; } echo "\n" ." | \n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n" ." \n" ."\n" ."\n" ."\n" ." | \n" ."
\n" ."

\n"; // Begin of Main Content Table echo "

\n" ."
\n" ."\n" ." | \n" ." | \n" ." | \n"; blocks('left'); echo "\n" ." | \n" ." |
    \n";
        if ($index == 1) {
        blocks('centre');
          }

    }

    /************************************************************/
    /* Function themefooter()                                   */
    /*                                                          */
    /* Control the footer for your site. You don't need to      */
    /* close BODY and HTML tags at the end. In some part call   */
    /* the function for right blocks with: blocks(right);       */
    /* Also, $index variable need to be global and is used to   */
    /* determine if the page your're viewing is the Homepage or */
    /* and internal one.                                        */
    /************************************************************/

    function themefooter() {
        global $index, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4;
        if ($index == 1) {
            echo "
\n" ." | \n" ." | \n"; blocks('right'); } echo "\n" ." | \n" ." | \n" ."\n" ."
\n" ."

\n\n\n"; // Bottom Image Swap Navigation Bar echo "

\n" ."
\n" ."\n" ." | \n" ." | \n" ." | \n" ." | \n" ." | \n" ." | \n" ." | \n" ."
\n" ."

\n\n\n\n"; // Begin Footer Table echo "

\n" ."
\n" ."\n"; footmsg(); echo "\n" ."
\n" ."

    \n\n\n";
    }

    /************************************************************/
    /* Function themeindex()                                    */
    /*                                                          */
    /* This function format the stories on the Homepage         */
    /************************************************************/

    function themeindex ($_deprecated, $_deprecated, $_deprecated, $_deprecated,
    $_deprecated, $_deprecated, $_deprecated, $_deprecated, $_deprecated,
    $_deprecated, $_deprecated, $_deprecated, $info, $links, $preformat) {
        global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4;

    $anonymous = pnConfigGetVar('anonymous');
    $tipath = pnConfigGetVar('tipath');

    // Story Box Title Table
        echo "

\n" ."
\n" ."$preformat[catandtitle]\n" ." \n" .""._POSTEDBY.": $info[informant] "._ON." $info[longdatetime] ($info[counter] "._READS.")\n" ." \n" ."\n" ."
\n" ."

\n\n\n" // Story Box Content ."

\n" ."
\n" ."\n" ."$preformat[searchtopic]\n" ."$info[hometext]\n" ." $preformat[notes]\n" ."\n" ."
\n" ."

\n\n\n" // Story Box Posted By, Morelink, Print ."

\n" ."
\n" ."\n" ." $preformat[more]\n" ."\n" ."
\n" ."

\n" ."
    \n\n\n";
    }

    /************************************************************/
    /* Function themeindex()                                    */
    /*                                                          */
    /* This function format the stories on the story page, when */
    /* you click on that "Read More..." link in the home        */
    /************************************************************/

    function themearticle ($_deprecated, $_deprecated, $_deprecated,
    $_deprecated, $_deprecated, $_deprecated, $_deprecated, $_deprecated,
    $_deprecated, $info, $links, $preformat) {
        global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4;

    // Read More Title Area
        echo "

\n" ."
\n" ."\n" ."$preformat[catandtitle]\n" ." \n" ."
    "._POSTEDBY.": $info[informant] ";

    if (pnSecAuthAction(0, 'Stories::', "$info[aid]:$info[cattitle]:$info[sid]",
    ACCESS_EDIT)) {
                 echo "
[ "._EDIT."
    ";
            if (pnSecAuthAction(0, 'Stories::',
    "$info[aid]:$info[cattitle]:$info[sid]", ACCESS_DELETE)) {
                   echo "|
"._DELETE." ]"; } echo " \n"; } echo "\n" ."
\n" ."

\n\n\n" ."
\n\n\n" // Read More Content ."

\n" ."
\n" ."\n"; echo "$preformat[searchtopic]\n"; echo "$preformat[fulltext]\n"; echo "\n" ."
\n" ."

\n\n\n" ."
    \n\n\n";
    }

    /************************************************************/
    /* Function themesidebox()                                  */
    /*                                                          */
    /* Control look of your blocks. Just simple.                */
    /************************************************************/

    function themesidebox($block) {

    if (empty($block['title']))   {
             echo "
$block[content]"; } else { // Side Box Title echo "

\n" ."
\n" ."\n" ."$block[title]\n" ."\n" ."
\n" ."

\n" // Side Box Content ."

\n" ."
\n" ."\n" ."$block[content]\n" ."\n" ."
\n" ."

\n\n\n" ."
\n\n\n"; } } ?>