From dc0fb9445e8a3ede8bc33d6779fadd89b7ea6893 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sat, 3 Oct 2009 10:30:17 -0400 Subject: Created Theme Switcher Also rewrote the way layouts work. Now, each layout requires a "layout.tpl" file (which contains the header and footer for the layout) and a "style.php" file (which contains and can include other files that contain the CSS for the layout). Each layout has it's own folder in theme/layouts and you can switch between them using a combo box in the Hatbar. Layouts 6.2 and 4.5 have been modified to work with new Layout 7 features such as AJAX, and they should be relatively free of bugs. Layout 3 has not yet been transferred because since it is pre-The New Four Island, it will be very difficult to do so. This changeset requires manual external code changes: * The line below must be added above the functions.php include in The Fourm's funnctions.php require('/svr/www/hatkirby/fourisland/main/includes/session.php'); * The block of Four Island code in The Fourm's page_header() function should be replaced with: global $fi_pagetitle; $fi_pagetitle = $page_title; ob_start(); * The block of Four Island code in The Fourm's page_footer() function should be replaced with: global $fi_pagetitle; $content = ob_get_contents(); ob_end_clean(); $noRightbar = 1; $onFourm = 1; $pageCategory = 'fourm'; if ($fi_pagetitle == 'Index page') { $title = 'The Fourm'; } else if (strpos($fi_pagetitle, 'View topic') !== FALSE) { $title = str_replace('View topic - ', 'Topic: ', $fi_pagetitle) . ' - The Fourm'; } else if (strpos($fi_pagetitle, 'View forum') !== FALSE) { $title = str_replace('View forum - ', 'Fourm: ', $fi_pagetitle) . ' - The Fourm'; } else if (strpos($fi_pagetitle, 'Viewing profile') !== FALSE) { $title = str_replace('Viewing profile - ', 'Member: ', $fi_pagetitle) . ' - The Fourm'; } else { $title = $fi_pagetitle . ' - The Fourm'; } if ($_GET['view'] != 'print') { include('/svr/www/hatkirby/fourisland/main/includes/layout.php'); } else { echo $content; } Closes #117 --- includes/header.php | 96 ----------------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100755 includes/header.php (limited to 'includes/header.php') diff --git a/includes/header.php b/includes/header.php deleted file mode 100755 index 003e002..0000000 --- a/includes/header.php +++ /dev/null @@ -1,96 +0,0 @@ -add('CATEGORY',(isset($pageCategory)) ? $pageCategory : 'none'); -$headerTemp->add('AID',(isset($pageAID)) ? $pageAID : 'none'); -$headerTemp->add('EXTRATITLE',isset($title) ? ($title . ' - ') : ''); -$headerTemp->add(strtoupper($pageCategory) . 'ACTIVE', ' class="active"'); - -if (($pageCategory != 'fourm') && ($pageCategory != 'wiki')) -{ - $headerTemp->add('REDIRPAGE',rawurlencode($_SERVER['REQUEST_URI'])); - $headerTemp->add('LOGDATA',echoLogData()); - $headerTemp->add('SID',getSessionID()); - $headerTemp->adds_block('MEMBERS',array('exi' => 1)); - - if (isAdmin()) - { - $headerTemp->adds_block('ADMIN',array('exi' => 1)); - } -} - -if (isset($hatNav) && is_array($hatNav)) -{ - $headerTemp->adds_block('CREATE_HATNAV', array('exi'=>1)); - - foreach ($hatNav as $item) - { - $headerTemp->adds_block('HATNAV',array('TITLE' => $item['title'], 'URL' => $item['url'], 'ICON' => $item['icon'])); - } -} - -$headerTemp->add('POTW', getPollOfTheWeek()); - -$gethits = "SELECT * FROM config WHERE name = \"hits\""; -$gethits2 = mysql_query($gethits); -$gethits3 = mysql_fetch_array($gethits2); -$headerTemp->add('HITS', $gethits3['value']); - -$gethits = "SELECT * FROM config WHERE name = \"todayHits\""; -$gethits2 = mysql_query($gethits); -$gethits3 = mysql_fetch_array($gethits2); -$headerTemp->add('TODAY', $gethits3['value']); - -$headerTemp->add('DATEFINDER', sd_dateFinder()); - -if ($usingIE) -{ - $headerTemp->add('FLASH', 'It appears you are using Internet Explorer. Four Island is not likely to work properly in IE due to a huge bug in it. There are better browsers out there, why not try one?'); -} - -$getaffs = "SELECT * FROM links WHERE type = \"affiliates\" ORDER BY id ASC"; -$getaffs2 = mysql_query($getaffs); -$i=0; -while ($getaffs3 = mysql_fetch_array($getaffs2)) -{ - $headerTemp->adds_block('AFFILIATES', array( 'COLOR' => getTagColor($i++), - 'TITLE' => htmlentities($getaffs3['title']), - 'URL' => $getaffs3['url'])); -} - -$getwebps = "SELECT * FROM links WHERE type = \"webprojs\" ORDER BY id ASC"; -$getwebps2 = mysql_query($getwebps); -$i=0; -while ($getwebps3 = mysql_fetch_array($getwebps2)) -{ - $headerTemp->adds_block('WEBPROJS', array( 'COLOR' => getTagColor($i++), - 'TITLE' => htmlentities($getwebps3['title']), - 'URL' => $getwebps3['url'])); -} - -$headerTemp->display(); - -?> -- cgit 1.4.1