Hi
I am getting the following error message when I try to browse to the page whose code I have included below:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/vsniozee/public_html/page17/page17.php on line 115
where line 115 is:
$inputs = array('–', '—', ''', ''', '"', '"', '…', '[', ']');
Can anyone suggest what I could do to get this working?
Thanks
Nick
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>recent</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="all" />
<meta name="generator" content="RapidWeaver" />
<link rel='stylesheet' type='text/css' media='all' href='../rw_common/plugins/stacks/stacks.css' />
<!--[if IE]>
<link rel='stylesheet' type='text/css' media='all' href='../rw_common/plugins/stacks/stacks_ie.css' />
<![endif]-->
<script type="text/javascript" src="../rw_common/themes/splash/javascript.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/styles.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/colourtag-theme-default.css" />
<link rel="stylesheet" type="text/css" media="print" href="../rw_common/themes/splash/print.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/layout/size/width/92pc.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/layout/size/height/92pc.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/image_size/noresize.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/font/family/verdana.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/content_border/width/none.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/breadcrumb/hide.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/footer/show.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/bgimage/none.css" />
<!-- compliance patch for microsoft browsers -->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/ie7fix.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="../rw_common/themes/splash/css/iefix.css" />
<script type="text/javascript" src="../rw_common/themes/splash/pngfix.js"></script>
<![endif]-->
<!-- This page was created with the Splash 2.0.1 theme from Rapid Ideas. http://www.rapid-ideas.com -->
<!-- Theme Name: Splash, Version: 2.0.1 -->
</head>
<body>
<div id="container">
<div id="pageHeader">
<h1></h1>
<h2></h2>
</div>
<div id="mainContent">
<div id="sidebar">
<div id="sidecontainer">
<div id="navcontainer">
<ul><li><a href="../index.php" rel="self">home</a></li><li><a href="../news/news.php" rel="self">news</a></li><li><a href="../articles/articles.html" rel="self">articles</a></li><li><a href="../books/books.php" rel="self">books</a></li><li><a href="../bradford/bradford.html" rel="self">bradford</a></li><li><a href="../links/links.html" rel="self">links</a></li><li><a href="../joinsoteria/joinsoteria.php" rel="self">join soteria</a></li><li><a href="../donations/donations.html" rel="self">donations</a></li><li><a href="../contactus/contactus.php" rel="self">contact us</a></li></ul>
</div>
<div id="side_plus">
</div>
</div>
</div>
<div id="content">
<div id="breadcrumbcontainer">
</div>
<div id="content_text">
<!-- Stacks v1.1.2 -->
<div class='stacks_top'>
<div class='stacks_out' style='width: 100%;' >
<div class='stacks_in' style='margin-top: 0px;margin-bottom: 0px;margin-left: 0px;margin-right: 0px;padding-top: 0px;padding-bottom: 0px;padding-left: 0px;padding-right: 0px;' >
<h3>Recent posts</h3>
<?php
function shortdesc($string, $length)
{
$suffix = '...';
$short_desc = trim(str_replace(array("\r","\n", "\t"), ' ', strip_tags(StupefyEntities($string))));
$desc = trim(substr($short_desc, 0, $length));
$lastchar = substr($desc, -1, 1);
if ($lastchar == '.' || $lastchar == '!' || $lastchar == '?') $suffix='';
$desc .= $suffix;
return $desc;
}
function StupefyEntities($s = '') {
$inputs = array('–', '—', ''', ''', '"', '"', '…', '[', ']');
$outputs = array('-', '--', "'", "'", '"', '"', '...', '[', ']');
$s = str_replace($inputs, $outputs, $s);
return $s;
}
require_once('assets/simplepie.inc');
// Copy and past the URL of your RSS feed here (currently defaults to seyDesigns RSS feed)
$feed = new SimplePie('http://www.seydesign.com/news/files/blogRSS.php');
$feed->handle_content_type();
$new = array();
// to limit the number of posts that appear, add a number sequence like 0,5 between the brackets. This will get you 5 posts, 0,8 will get you 8, and so on...
foreach ($feed->get_items(0,5) as $item) {
// Calculate 7 days ago where 168 represents the hours, the rest is a bit of a mystery to me
$thisweek = time() - (168*60*60);
if ($item->get_date('U') > $thisweek) {
$new[] = $item;
}
}
foreach($new as $item) {
echo '<div class="blog-entry">';
echo '<div class="blog-entry-title">';
echo '<a href=' . $item->get_permalink() . '>';
echo $item->get_title() . '</a>';
echo '</div>';
echo '<div class="blog-entry-date">' . $item->get_date('j M Y') . '</div>';
echo '<div class="blog-entry-body">';
echo shortdesc($item->get_description(), 150); // Change 150 to the length of your choice
echo '<a href=' . $item->get_permalink() . '>';
echo 'Read more.' . '</a>';
echo '</div>';
echo '</div>';
}
?>
<div class='stacks_clearer'></div>
</div>
</div>
<div class='stacks_clearer'></div>
</div>
<!-- End of Stacks Content -->
</div>
</div>
<br style="clear: both;"/>
</div>
<div id="footer">© 2010 Soteria Network UK</div>
</div>
</body>
</html>