From 74db7a24d9c2230b104979f4e4981c57ff73de71 Mon Sep 17 00:00:00 2001
From: Starla Insigna
",htmlentities(stripslashes($quote['quote']))),
+ $template->adds_block('QUOTE', array( 'TEXT' => str_replace("\n","
",htmlspecialchars($quote['quote'])),
'ID' => $quote['id'],
'ODD' => ($j % 2 ? '' : ' class="odd"')));
}
diff --git a/admin/newLink.php b/admin/newLink.php
index 90313bd..abedb81 100755
--- a/admin/newLink.php
+++ b/admin/newLink.php
@@ -80,7 +80,7 @@ if (isset($_GET['submit']))
$template->add('TYPEDISABLED', ' readonly="readonly"');
}
- $template->add('TITLEVALUE', htmlentities($_POST['title']));
+ $template->add('TITLEVALUE', htmlspecialchars($_POST['title']));
$template->add('URLVALUE', $_POST['url']);
$template->add(strtoupper($_POST['type']) . 'SELECTED', ' checked="checked"');
} else {
diff --git a/admin/newPost.php b/admin/newPost.php
index 32e7aa2..60819b9 100755
--- a/admin/newPost.php
+++ b/admin/newPost.php
@@ -145,7 +145,7 @@ if (isset($_GET['submit']))
if ($type != 'drafts') $template->add('TAGSDISABLED', ' readonly="readonly"');
}
- $template->add('TITLEVALUE', htmlentities($_POST['title']));
+ $template->add('TITLEVALUE', htmlspecialchars($_POST['title']));
$template->add('TEXTVALUE', $_POST['text']);
$template->add('TAGSVALUE', $_POST['tags']);
$template->add(strtoupper($_POST['type']) . 'SELECTED', ' checked="checked"');
diff --git a/admin/pending.php b/admin/pending.php
index 6f1cfaf..39295d6 100755
--- a/admin/pending.php
+++ b/admin/pending.php
@@ -148,7 +148,7 @@ foreach ($pager->getPageData() as $post)
{
if (!empty($post))
{
- $template->add_ref($j, 'POST', array( 'TITLE' => htmlentities($post['title']),
+ $template->add_ref($j, 'POST', array( 'TITLE' => htmlspecialchars($post['title']),
'AUTHOR' => $post['author'],
'ID' => $post['id'],
'CODED' => $post['slug'],
diff --git a/admin/posts.php b/admin/posts.php
index d2e34c5..228a039 100755
--- a/admin/posts.php
+++ b/admin/posts.php
@@ -82,7 +82,7 @@ foreach ($pager->getPageData() as $post)
{
if (!empty($post))
{
- $template->adds_block('POST', array( 'TITLE' => htmlentities($post['title']),
+ $template->adds_block('POST', array( 'TITLE' => htmlspecialchars($post['title']),
'AUTHOR' => $post['author'],
'ID' => $post['id'],
'CODED' => $post['slug'],
diff --git a/admin/welcome.php b/admin/welcome.php
index 76b42b1..9ca13ce 100755
--- a/admin/welcome.php
+++ b/admin/welcome.php
@@ -46,11 +46,6 @@ $cntcomments2 = mysql_query($cntcomments);
$cntcomments3 = mysql_fetch_array($cntcomments2);
$template->add('COMMENTS', $cntcomments3['COUNT(*)']);
-$cntpolls = "SELECT COUNT(*) FROM polloftheweek";
-$cntpolls2 = mysql_query($cntpolls);
-$cntpolls3 = mysql_fetch_array($cntpolls2);
-$template->add('POLLS', $cntpolls3['COUNT(*)']);
-
$cntquotes = "SELECT COUNT(*) FROM rash_quotes";
$cntquotes2 = mysql_query($cntquotes);
$cntquotes3 = mysql_fetch_array($cntquotes2);
diff --git a/includes/comments.php b/includes/comments.php
index be48c02..5aa8993 100755
--- a/includes/comments.php
+++ b/includes/comments.php
@@ -71,7 +71,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(stripslashes($getcomments3[$i]['comment']))));
+ 'TEXT' => parseText($getcomments3[$i]['comment'])));
if (isLoggedIn())
{
diff --git a/includes/common.php b/includes/common.php
index 8ca6958..7442a18 100755
--- a/includes/common.php
+++ b/includes/common.php
@@ -22,6 +22,9 @@ if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
require('headerproc.php');
+$result = mysql_query('SET NAMES utf8');
+$result = mysql_query('SET CHARACTER SET utf8');
+
include('includes/template.php');
include('includes/session.php');
include('includes/maintenance.php');
diff --git a/includes/functions.php b/includes/functions.php
index aed4516..b42ca7d 100755
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -62,20 +62,6 @@ function dispIfNotOld($datTim)
}
}
-function getpercent($getpoll3,$num)
-{
- $maxper = ($getpoll3['clicks1'] + $getpoll3['clicks2'] + $getpoll3['clicks3'] + $getpoll3['clicks4']);
-
- if ($maxper == 0)
- {
- return 0;
- } else {
- $percent = round(($getpoll3['clicks' . $num] / $maxper) * 100);
- }
-
- return($percent);
-}
-
function generateSlug($title,$table)
{
$title = preg_replace('/[^A-Za-z0-9]/','-',$title);
@@ -110,7 +96,7 @@ function postBlogPost($title,$author,$tags,$content)
{
$slug = generateSlug($title,'updates');
- $inspost = "INSERT INTO updates (title,slug,author,text) VALUES (\"" . $title . "\",\"" . $slug . "\",\"" . $author . "\",\"" . mysql_real_escape_string($content) . "\")";
+ $inspost = "INSERT INTO updates (title,slug,author,text) VALUES (\"" . mysql_real_escape_string($title) . "\",\"" . $slug . "\",\"" . $author . "\",\"" . mysql_real_escape_string($content) . "\")";
$inspost2 = mysql_query($inspost);
$id = mysql_insert_id();
@@ -269,31 +255,6 @@ if (!function_exists('unique_id'))
}
}
-function displayRelated($title, $avoid = 0)
-{
- $getrelated = "SELECT *, MATCH (title, text) AGAINST (\"" . mysql_real_escape_string($title) . "\") AS score FROM updates WHERE MATCH (title, text) AGAINST (\"" . mysql_real_escape_string($title) . "\") AND id <> " . $avoid . " LIMIT 0,5";
- $getrelated2 = mysql_query($getrelated);
- $i=0;
- while ($getrelated3[$i] = mysql_fetch_array($getrelated2))
- {
- if ($i==0)
- {
- $template = new FITemplate('related');
- }
-
- $template->adds_block('POST', array( 'TITLE' => doAprilFoolsDay(htmlentities(stripslashes($getrelated3[$i]['title']))),
- 'CODED' => $getrelated3[$i]['slug'],
- 'AUTHOR' => $getrelated3[$i]['author'],
- 'DATE' => date('F jS Y',strtotime($getrelated3[$i]['pubDate']))));
- $i++;
- }
-
- if ($i > 0)
- {
- $template->display();
- }
-}
-
function getCommentUrl($getcomment3)
{
$page_id = $getcomment3['page_id'];
@@ -307,62 +268,12 @@ function getCommentUrl($getcomment3)
$getupdate3 = mysql_fetch_array($getupdate2);
return '/blog/' . $getupdate3['slug'] . '/';
- } else if ($comType == 'polloftheweek')
- {
- return '/poll/' . $comID . '.php';
} else if ($comType == 'quote')
{
return '/quotes/' . $comID . '.php';
}
}
-function getPollOfTheWeek($id = -1)
-{
- static $showed_form = false;
-
- $potw = new FITemplate('polloftheweek');
-
- if ($id == -1)
- {
- $getpoll = "SELECT * FROM polloftheweek ORDER BY id DESC LIMIT 0,1";
- } else {
- $getpoll = "SELECT * FROM polloftheweek WHERE id = " . $id;
- }
- $getpoll2 = mysql_query($getpoll);
- $getpoll3 = mysql_fetch_array($getpoll2);
-
- $potw->add('ID', $getpoll3['id']);
- $potw->add('QUESTION', doAprilFoolsDay(stripslashes(htmlentities($getpoll3['question']))));
- $potw->add('OPTION1', doAprilFoolsDay(stripslashes(htmlentities($getpoll3['option1']))));
- $potw->add('OPTION2', doAprilFoolsDay(stripslashes(htmlentities($getpoll3['option2']))));
- $potw->add('OPTION3', doAprilFoolsDay(stripslashes(htmlentities($getpoll3['option3']))));
- $potw->add('OPTION4', doAprilFoolsDay(stripslashes(htmlentities($getpoll3['option4']))));
-
- $getip = "SELECT * FROM didpollalready WHERE ip = \"" . $_SERVER['REMOTE_ADDR'] . "\"";
- $getip2 = mysql_query($getip);
- $getip3 = mysql_fetch_array($getip2);
-
- if (($getip3['ip'] != $_SERVER['REMOTE_ADDR']) && ($id == -1) && ($showed_form == false))
- {
- $potw->adds_block('FORM',array('exi'=>1));
- $showed_form = true;
- } else {
- $potw->adds_block('DISPLAY',array('exi'=>1));
-
- $potw->add('PERCENT1', getpercent($getpoll3,'1'));
- $potw->add('PERCENT2', getpercent($getpoll3,'2'));
- $potw->add('PERCENT3', getpercent($getpoll3,'3'));
- $potw->add('PERCENT4', getpercent($getpoll3,'4'));
- }
-
- ob_start();
- $potw->display();
- $result = ob_get_contents();
- ob_end_clean();
-
- return $result;
-}
-
function getTagColor($i)
{
switch ($i % 7)
@@ -417,14 +328,6 @@ function getRewriteURL()
} else {
return '/blog/';
}
- } else if ($_GET['area'] == 'poll')
- {
- if (isset($_GET['id']))
- {
- return '/poll/' . $_GET['id'] . '.php';
- } else {
- return '/poll/';
- }
} else if ($_GET['area'] == 'quotes')
{
if (isset($_GET['act']))
diff --git a/includes/layout.php b/includes/layout.php
index 9e94b69..22b87ea 100755
--- a/includes/layout.php
+++ b/includes/layout.php
@@ -74,7 +74,7 @@ $i=0;
while ($getaffs3 = mysql_fetch_array($getaffs2))
{
$template->adds_block('AFFILIATES', array( 'COLOR' => getTagColor($i++),
- 'TITLE' => doAprilFoolsDay(htmlentities(stripslashes($getaffs3['title']))),
+ 'TITLE' => doAprilFoolsDay(htmlspecialchars($getaffs3['title'])),
'URL' => $getaffs3['url']));
}
@@ -84,7 +84,7 @@ $i=0;
while ($getwebps3 = mysql_fetch_array($getwebps2))
{
$template->adds_block('WEBPROJS', array( 'COLOR' => getTagColor($i++),
- 'TITLE' => doAprilFoolsDay(htmlentities(stripslashes($getwebps3['title']))),
+ 'TITLE' => doAprilFoolsDay(htmlspecialchars($getwebps3['title'])),
'URL' => $getwebps3['url']));
}
@@ -129,7 +129,7 @@ while ($getcomments3[$i] = mysql_fetch_array($getcomments2))
'AREA' => 'blog',
'CODED' => $getpost3['slug'],
'ENDING' => '/',
- 'TITLE' => stripslashes(htmlentities($getpost3['title'])),
+ 'TITLE' => htmlspecialchars($getpost3['title']),
'AUTHOR' => (($website != '') ? '' . $username . '' : $username)));
$i++;
} else if (strpos($getcomments3[$i]['page_id'], 'quote') !== FALSE)
@@ -143,20 +143,7 @@ while ($getcomments3[$i] = mysql_fetch_array($getcomments2))
'TITLE' => 'Quote #' . $num,
'AUTHOR' => (($website != '') ? '' . $username . '' : $username)));
$i++;
- } else if (strpos($getcomments3[$i]['page_id'], 'polloftheweek') !== FALSE)
- {
- $getpotw = "SELECT * FROM polloftheweek WHERE id = " . substr($getcomments3[$i]['page_id'],strpos($getcomments3[$i]['page_id'],'-')+1);
- $getpotw2 = mysql_query($getpotw);
- $getpotw3 = mysql_fetch_array($getpotw2);
-
- $template->adds_block('COMMENTS', array( 'ID' => $getcomments3[$i]['id'],
- 'AREA' => 'poll',
- 'CODED' => $getpotw3['id'],
- 'ENDING' => '.php',
- 'TITLE' => 'Poll "' . htmlentities($getpotw3['question']) . '"',
- 'AUTHOR' => (($website != '') ? '' . $username . '' : $username)));
- $i++;
- }
+ }
}
$users = array();
@@ -233,7 +220,7 @@ $i=0;
while ($getpopular3[$i] = mysql_fetch_array($getpopular2))
{
$template->adds_block('POPULAR', array( 'CODED' => $getpopular3[$i]['slug'],
- 'TITLE' => doAprilFoolsDay(stripslashes(htmlentities($getpopular3[$i]['title'])))));
+ 'TITLE' => doAprilFoolsDay(htmlspecialchars($getpopular3[$i]['title']))));
$i++;
}
diff --git a/pages/archive.php b/pages/archive.php
index 024d3b5..73d0162 100755
--- a/pages/archive.php
+++ b/pages/archive.php
@@ -87,7 +87,7 @@ while ($getposts3[$i] = mysql_fetch_array($getposts2))
$template->adds_ref_sub($curID, 'SMALL',array( 'DATE' => date('m-d-Y',strtotime($getposts3[$i]['pubDate'])),
'CODED' => $getposts3[$i]['slug'],
- 'TITLE' => doAprilFoolsDay(htmlentities(stripslashes($getposts3[$i]['title'])))));
+ 'TITLE' => doAprilFoolsDay(htmlspecialchars($getposts3[$i]['title']))));
$i++;
}
if ($i==0)
diff --git a/pages/blog.php b/pages/blog.php
index e7163ce..72e96bf 100755
--- a/pages/blog.php
+++ b/pages/blog.php
@@ -46,7 +46,7 @@ if (isset($_GET['post']))
{
updatePop($getpost3['id'],'views');
- $title = stripslashes(htmlentities($getpost3['title'])) . ' - Blog Archive';
+ $title = htmlspecialchars($getpost3['title']) . ' - Blog Archive';
$getback = "SELECT * FROM updates WHERE id < " . $getpost3['id'] . " ORDER BY id DESC LIMIT 0,1";
$getback2 = mysql_query($getback);
@@ -54,7 +54,7 @@ if (isset($_GET['post']))
if (isset($getback3['title']))
{
$template->adds_block('BACK', array( 'CODED' => $getback3['slug'],
- 'TITLE' => doAprilFoolsDay(htmlentities(stripslashes($getback3['title'])))));
+ 'TITLE' => doAprilFoolsDay(htmlspecialchars($getback3['title']))));
}
$getnext = "SELECT * FROM updates WHERE id > " . $getpost3['id'] . " ORDER BY id ASC LIMIT 0,1";
@@ -63,7 +63,7 @@ if (isset($_GET['post']))
if (isset($getnext3['title']))
{
$template->adds_block('NEXT', array( 'CODED' => $getnext3['slug'],
- 'TITLE' => doAprilFoolsDay(htmlentities(stripslashes($getnext3['title'])))));
+ 'TITLE' => doAprilFoolsDay(htmlspecialchars($getnext3['title']))));
}
$template->add_ref(0, 'POST', array( 'ID' => $getpost3['id'],
@@ -72,10 +72,10 @@ if (isset($_GET['post']))
'MONTH' => date('M',strtotime($getpost3['pubDate'])),
'DAY' => date('d',strtotime($getpost3['pubDate'])),
'CODED' => $getpost3['slug'],
- 'TITLE' => doAprilFoolsDay(htmlentities(stripslashes($getpost3['title']))),
+ 'TITLE' => doAprilFoolsDay(htmlspecialchars($getpost3['title'])),
'AUTHOR' => $getpost3['author'],
'RATING' => $getpost3['rating'],
- 'TEXT' => parseText(stripslashes($getpost3['text']))));
+ 'TEXT' => parseText($getpost3['text'])));
$tags = getTags($getpost3['id']);
foreach ($tags as $tag)
@@ -121,8 +121,6 @@ if (isset($_GET['post']))
$page_id = 'updates-' . $getpost3['id'];
include('includes/comments.php');
-
- displayRelated($getpost3['title'], $getpost3['id']);
} else {
generateError('404');
}
@@ -171,12 +169,12 @@ if (isset($_GET['post']))
'MONTH' => date('M',strtotime($getpost3['pubDate'])),
'DAY' => date('d',strtotime($getpost3['pubDate'])),
'CODED' => $getpost3['slug'],
- 'TITLE' => doAprilFoolsDay(htmlentities(stripslashes($getpost3['title']))),
+ 'TITLE' => doAprilFoolsDay(htmlspecialchars($getpost3['title'])),
'AUTHOR' => $getpost3['author'],
'PLURALCOMMENT' => (isset($plural) ? $plural : ''),
'COMMENTS' => $comText,
'RATING' => $getpost3['rating'],
- 'TEXT' => parseText(stripslashes($getpost3['text']))));
+ 'TEXT' => parseText($getpost3['text'])));
$tags = getTags($getpost3['id']);
foreach ($tags as $tag)
diff --git a/pages/post.php b/pages/post.php
index 3f728c8..a5435c9 100755
--- a/pages/post.php
+++ b/pages/post.php
@@ -68,7 +68,7 @@ if (!isset($_POST['id']))
$template = new FITemplate('new-comment');
$template->add('ID', $cid);
$template->add('CODEDEMAIL', md5(strtolower($getanon3['email'])));
- $template->add('TEXT', stripslashes($_POST['comment']));
+ $template->add('TEXT', $_POST['comment']);
$template->add('USERNAME', $getanon3['username']);
$template->add('DATE', date("F jS Y \a\\t g:i:s a"));
$template->display();
@@ -108,7 +108,7 @@ if (!isset($_POST['id']))
$template = new FITemplate('new-comment');
$template->add('ID', $cid);
$template->add('CODEDEMAIL', md5(strtolower($getuser3['user_email'])));
- $template->add('TEXT', stripslashes($_POST['comment']));
+ $template->add('TEXT', $_POST['comment']);
$template->add('USERNAME', getSessionUsername());
$template->add('DATE', date("F jS Y \a\\t g:i:s a"));
$template->display();
diff --git a/pages/quotes.php b/pages/quotes.php
index 3b00878..f47dbd3 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","
",htmlspecialchars(stripslashes($_POST['rash_quote'])))));
+ $template->adds_block('SUBMITTED',array('QUOTE' => str_replace("\n","
",htmlspecialchars($_POST['rash_quote']))));
if (!isLoggedIn())
{
$insquote = "INSERT INTO rash_queue (quote) VALUES(\"" . mysql_real_escape_string(htmlspecialchars($_POST['rash_quote'])) . "\")";
@@ -236,7 +236,7 @@ function quote_generation($query, $origin, $page = 1, $quote_limit = 50, $page_l
$template->add_ref($curID,'QUOTES',array( 'NUMBER' => $getquotes3[$i]['id'],
'RATING' => $getquotes3[$i]['rating'],
'DATE' => ($getquotes3[$i]['date'] != 0 ? date('F jS Y \a\\t g:i:s a', $getquotes3[$i]['date']) : ''),
- 'QUOTE' => doAprilFoolsDay(str_replace("\n","
",htmlspecialchars(stripslashes($getquotes3[$i]['quote'])))),
+ 'QUOTE' => doAprilFoolsDay(str_replace("\n","
",htmlspecialchars($getquotes3[$i]['quote']))),
'COMMENTS' => $comments));
if (($gettrack3['ip'] != $_SERVER['REMOTE_ADDR']) || (array_search($getquotes3[$i]['id'],$trackArr) === FALSE))
diff --git a/pages/viewPost.php b/pages/viewPost.php
index 0d84df7..fa371cf 100755
--- a/pages/viewPost.php
+++ b/pages/viewPost.php
@@ -44,7 +44,7 @@ if (!isAdmin())
'TITLE' => $getpost3['title'],
'AUTHOR' => $getpost3['author'],
'RATING' => $getpost3['rating'],
- 'TEXT' => parseText(stripslashes($getpost3['text']))));
+ 'TEXT' => parseText($getpost3['text'])));
$tags = getTags($getpost3['id']);
foreach ($tags as $tag)
diff --git a/rss.php b/rss.php
index 2a72d8a..fddd631 100755
--- a/rss.php
+++ b/rss.php
@@ -59,9 +59,6 @@ if (isset($_GET['mode']))
case 'quotes':
?> Quotes Polls CommentsAn archive of all Four Island quotesAn archive of all of the Four Island POTWsAn archive of all of the comments people have left on Four Island $value)
http://fourisland.com/blog//
-
- There are polls. -
-There are quotes, including flagged quotes. There are also unmoderated quotes.
diff --git a/theme/header.tpl b/theme/header.tpl index 014e34b..bd1df91 100755 --- a/theme/header.tpl +++ b/theme/header.tpl @@ -53,12 +53,6 @@ - -