From 224f9ee5014ae5c5399188afd8d38e3b620e2856 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Thu, 26 Nov 2009 14:21:20 -0500 Subject: Added Fouripedia compatibility Made many strutural changes to Four Island allowing for the reinclusion of Fouripedia. --- admin.php | 15 +++-------- includes/comments.php | 2 +- includes/common.php | 61 ++++++++++++++++++++++++++++++++++++++++++++ includes/functions.php | 7 ++++- includes/layout.php | 26 +++++++++---------- includes/session.php | 2 +- index.php | 36 +------------------------- pages/blog.php | 4 +-- pages/poll.php | 14 +++++----- pages/quotes.php | 2 +- pages/welcome.php | 4 +-- theme/css/blog.php | 2 +- theme/css/quotes.css | 2 -- theme/layouts/4.5/layout.tpl | 3 +++ theme/layouts/6.2/layout.tpl | 10 ++++++++ theme/layouts/6.2/night.css | 2 +- theme/layouts/6.2/style.php | 4 +-- theme/layouts/7/layout.tpl | 9 +++++++ 18 files changed, 123 insertions(+), 82 deletions(-) create mode 100644 includes/common.php diff --git a/admin.php b/admin.php index 5e002a6..6657983 100644 --- a/admin.php +++ b/admin.php @@ -20,27 +20,18 @@ require('headerproc.php'); -header('Content-type: application/xhtml+xml'); - include('../security/config.php'); include('includes/db.php'); -include('includes/template.php'); -include('includes/session.php'); -include('includes/parsers.php'); -include('includes/xmlrpc/xmlrpc.inc'); -include('includes/specialdates.php'); -include('includes/functions.php'); +include('includes/common.php'); if (!isAdmin()) { ob_start(); generateError('404'); - $doc = ob_get_contents(); + $content = ob_get_contents(); ob_end_clean(); - include('includes/header.php'); - echo($doc); - include('includes/footer.php'); + include('includes/layout.php'); exit; } diff --git a/includes/comments.php b/includes/comments.php index 0f48444..78353c1 100755 --- a/includes/comments.php +++ b/includes/comments.php @@ -72,7 +72,7 @@ while ($getcomments3[$i] = mysql_fetch_array($getcomments2)) 'USERNAME' => (($website != '') ? '' . $username . '' : $username), 'DATE' => date("F jS Y \a\\t g:i:s a",strtotime($getcomments3[$i]['posttime'])), 'ID' => $getcomments3[$i]['id'], - 'TEXT' => parseText($getcomments3[$i]['comment']))); + 'TEXT' => parseText(stripslashes($getcomments3[$i]['comment'])))); if (isLoggedIn()) { diff --git a/includes/common.php b/includes/common.php new file mode 100644 index 0000000..e4321d9 --- /dev/null +++ b/includes/common.php @@ -0,0 +1,61 @@ + diff --git a/includes/functions.php b/includes/functions.php index bc839df..dc5a549 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -390,7 +390,12 @@ function getRewriteURL() { if (!isset($_GET['area'])) { - return '/'; + if (strpos($_SERVER['PHP_SELF'], 'wiki') !== false) + { + return $_SERVER['PHP_SELF']; + } else { + return '/'; + } } else { if ($_GET['area'] == 'blog') { diff --git a/includes/layout.php b/includes/layout.php index ffe1aa6..b11c56f 100644 --- a/includes/layout.php +++ b/includes/layout.php @@ -28,19 +28,17 @@ $template->add('CATEGORY',(isset($pageCategory)) ? $pageCategory : 'none'); $template->add('AID',(isset($pageAID)) ? $pageAID : 'none'); $template->add('EXTRATITLE',isset($title) ? ($title . ' - ') : ''); $template->add(strtoupper($pageCategory) . 'ACTIVE', ' class="active"'); +$template->add('EXTRASIDEBAR', isset($extraSidebar) ? $extraSidebar : ''); -if (($pageCategory != 'fourm') && ($pageCategory != 'wiki')) -{ - $template->add('REDIRPAGE',rawurlencode($_SERVER['REQUEST_URI'])); - $template->add('LOGDATA',echoLogData()); - $template->add('LOWERLOGDATA','log' . strtolower(echoLogData())); - $template->add('SID',getSessionID()); - $template->adds_block('MEMBERS',array('exi' => 1)); +$template->add('REDIRPAGE',rawurlencode($_SERVER['REQUEST_URI'])); +$template->add('LOGDATA',echoLogData()); +$template->add('LOWERLOGDATA','log' . strtolower(echoLogData())); +$template->add('SID',getSessionID()); +$template->adds_block('MEMBERS',array('exi' => 1)); - if (isAdmin()) - { - $template->adds_block('ADMIN',array('exi' => 1)); - } +if (isAdmin()) +{ + $template->adds_block('ADMIN',array('exi' => 1)); } if (isset($hatNav) && is_array($hatNav)) @@ -274,11 +272,11 @@ foreach ($counts as $tag => $count) if (!isset($noRightbar)) { $template->adds_block('RIGHTBAR', array('exi'=>1)); -} - +} + $template->add('ME', getRewriteURL()); -$template->add('CONTENT', stripslashes($content)); +$template->add('CONTENT', $content); $template->display(); diff --git a/includes/session.php b/includes/session.php index 94c919a..2e0824a 100755 --- a/includes/session.php +++ b/includes/session.php @@ -22,7 +22,7 @@ if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);} require('headerproc.php'); -session_start(); +@session_start(); function getSessionID() { diff --git a/index.php b/index.php index 7a958ee..83cdd99 100755 --- a/index.php +++ b/index.php @@ -24,41 +24,7 @@ header('X-Pingback: http://fourisland.com/xmlrpc.php'); include('../security/config.php'); include('includes/db.php'); -include('includes/template.php'); -include('includes/session.php'); -include('includes/maintenance.php'); -include('includes/parsers.php'); -include('includes/xmlrpc/xmlrpc.inc'); -include('includes/specialdates.php'); -include('includes/functions.php'); -include('includes/hits.php'); -include('includes/updatePending.php'); - -if (isset($_GET['layout'])) -{ - if (!file_exists('theme/layouts/' . basename($_GET['layout']))) - { - $_GET['layout'] = '7'; - } - - setcookie('layout', $_GET['layout'], time()+60*60*24*30, '/', '.fourisland.com'); - - unset($_GET['layout']); - - header('Location: ' . getRewriteURL()); - exit; -} - -if (preg_match('|MSIE ([0-9].[0-9]{1,2})|', $_SERVER['HTTP_USER_AGENT'], $matched)) -{ - $usingIE = true; -} else { - if (getLayout() == '7') - { - header('Content-type: application/xhtml+xml'); - $xhtml = true; - } -} +include('includes/common.php'); if (strpos($_SERVER['REQUEST_URI'],'index.php')) { diff --git a/pages/blog.php b/pages/blog.php index 28fa759..31978f2 100755 --- a/pages/blog.php +++ b/pages/blog.php @@ -67,10 +67,10 @@ if (isset($_GET['post'])) 'MONTH' => date('M',strtotime($getpost3['pubDate'])), 'DAY' => date('d',strtotime($getpost3['pubDate'])), 'CODED' => $getpost3['slug'], - 'TITLE' => htmlentities($getpost3['title']), + 'TITLE' => htmlentities(stripslashes($getpost3['title'])), 'AUTHOR' => $getpost3['author'], 'RATING' => $getpost3['rating'], - 'TEXT' => parseText($getpost3['text']))); + 'TEXT' => parseText(stripslashes($getpost3['text'])))); $tags = getTags($getpost3['id']); foreach ($tags as $tag) diff --git a/pages/poll.php b/pages/poll.php index a9ab19f..3099e32 100755 --- a/pages/poll.php +++ b/pages/poll.php @@ -53,7 +53,7 @@ if (!isset($_GET['id'])) $question .= '....'; } $template->adds_block('POLL', array( 'ID' => $getpolls3[$i]['id'], - 'QUESTION' => htmlentities($question), + 'QUESTION' => htmlentities(stripslashes($question)), 'WEEK' => date('F jS Y', strtotime($getpolls3[$i]['week'])), 'EVEN' => (($i % 2 == 1) ? ' class="even"' : ''))); $i++; @@ -90,17 +90,17 @@ if (!isset($_GET['id'])) if ($getpoll3['id'] == $_GET['id']) { - $template->add('QUESTION', htmlentities($getpoll3['question'])); + $template->add('QUESTION', htmlentities(stripslashes($getpoll3['question']))); if ($getpoll3['text'] != '') { - $template->adds_block('COMPLETE', array( 'RSS' => parseText($getpoll3['text']), + $template->adds_block('COMPLETE', array( 'RSS' => parseText(stripslashes($getpoll3['text'])), 'AUTHOR' => $getrss3['author'], 'DATE' => date("F jS Y \a\\t g:i:s a",strtotime($getpoll3['week'])), - 'OPTION1' => $getpoll3['option1'], - 'OPTION2' => $getpoll3['option2'], - 'OPTION3' => $getpoll3['option3'], - 'OPTION4' => $getpoll3['option4'], + 'OPTION1' => stripslashes($getpoll3['option1']), + 'OPTION2' => stripslashes($getpoll3['option2']), + 'OPTION3' => stripslashes($getpoll3['option3']), + 'OPTION4' => stripslashes($getpoll3['option4']), 'CLICKS1' => $getpoll3['clicks1'], 'CLICKS2' => $getpoll3['clicks2'], 'CLICKS3' => $getpoll3['clicks3'], diff --git a/pages/quotes.php b/pages/quotes.php index 8c6958d..17057c2 100755 --- a/pages/quotes.php +++ b/pages/quotes.php @@ -70,7 +70,7 @@ if (isset($_GET['id']) && !(is_numeric($_GET['id']))) $template = new FITemplate('quotes/add'); if (isset($_GET['submit'])) { - $template->adds_block('SUBMITTED',array('QUOTE' => str_replace("\n","
",htmlentities($_POST['rash_quote'])))); + $template->adds_block('SUBMITTED',array('QUOTE' => str_replace("\n","
",htmlentities(stripslashes($_POST['rash_quote']))))); if (!isLoggedIn()) { $insquote = "INSERT INTO rash_queue (quote) VALUES(\"" . mysql_real_escape_string(htmlspecialchars($_POST['rash_quote'])) . "\")"; diff --git a/pages/welcome.php b/pages/welcome.php index 833af8a..819420b 100755 --- a/pages/welcome.php +++ b/pages/welcome.php @@ -77,12 +77,12 @@ while ($getpost3 = mysql_fetch_array($getpost2)) 'MONTH' => date('M',strtotime($getpost3['pubDate'])), 'DAY' => date('d',strtotime($getpost3['pubDate'])), 'CODED' => $getpost3['slug'], - 'TITLE' => htmlentities($getpost3['title']), + 'TITLE' => htmlentities(stripslashes($getpost3['title'])), 'AUTHOR' => $getpost3['author'], 'PLURALCOMMENT' => (isset($plural) ? $plural : ''), 'COMMENTS' => $comText, 'RATING' => $getpost3['rating'], - 'TEXT' => parseText($getpost3['text']))); + 'TEXT' => parseText(stripslashes($getpost3['text'])))); $tags = getTags($getpost3['id']); foreach ($tags as $tag) diff --git a/theme/css/blog.php b/theme/css/blog.php index b84db08..e19d7df 100644 --- a/theme/css/blog.php +++ b/theme/css/blog.php @@ -229,7 +229,7 @@ div.post-date-4 { span.post-vote { float: right; position: relative; - top: -2em; + top: -.5em; right: 1em; } diff --git a/theme/css/quotes.css b/theme/css/quotes.css index 5be0923..2d33e45 100644 --- a/theme/css/quotes.css +++ b/theme/css/quotes.css @@ -56,6 +56,4 @@ span.quote-update-result { float: right; text-transform: uppercase; font-size: 70%; - position: relative; - top: -1.2em; } diff --git a/theme/layouts/4.5/layout.tpl b/theme/layouts/4.5/layout.tpl index 0ce0e5b..a90bdf3 100644 --- a/theme/layouts/4.5/layout.tpl +++ b/theme/layouts/4.5/layout.tpl @@ -37,6 +37,7 @@
  • Home
  • Projects
  • Fourm
  • +
  • Wiki
  • Poll
  • Quotes
  • Log
  • @@ -87,6 +88,8 @@

    + +