I use a newslisting snippet om my homepage. This snippet shows the 6 most recent documents in a folder. The first 3 with an intro of 200 characters and the next 3 only the title.
But in the intro it shows also the title, that i put on the first line of my newsitems between <h1> - tags.
I would like to change the snippet so that the intro it shows only starts after the </h1>- closing tag, so the titles of the 3 most recent newsitems will not display in the intro...
Who can help me?
The code of the snippet:
$resourceparent = isset($newsid) ? $newsid : $etomite->documentIdentifier;
// the folder that contains blog entries
$output = '';
// initialise the blog variable
$nrblogs = 3;
// nr of blogs to show a short portion of
$nrblogstotal = 6;
// total nr of blogs to retrieve
$lentoshow = 200;
// how many characters to show of blogs
$resource = $etomite->getActiveChildren($resourceparent, 'createdon', 'DESC', $fields='id, pagetitle, description, content, createdon, createdby');
$limit=count($resource);
if($limit<1) {
$output .= "No newsitems.<br />";
}
$nrblogs = $nrblogs<$limit ? $nrblogs : $limit;
if($limit>0) {
for ($x = 0; $x < $nrblogs; $x++) {
$tbl = $this->dbConfig['dbase'].".".$this->dbConfig['table_prefix']."manager_users";
$sql = "SELECT username FROM $tbl WHERE $tbl.id = ".$resource[$x]['createdby'];
$rs2 = $etomite->dbQuery($sql);
$limit2 = $etomite->recordCount($rs2);
if($limit2<1) {
$username .= "anonymous";
} else {
$resourceuser = $etomite->fetchRow($rs2);
$username = $resourceuser['username'];
// strip the content
if(strlen($resource[$x]['content'])>$lentoshow) {
$rest = substr($resource[$x]['content'], 0, $lentoshow);
$rest .= "...";
} else {
$rest = $resource[$x]['content'];
}
$output .= "<fieldset><legend><b>".$resource[$x]['pagetitle']."</b></legend>".$rest."<br /><br /><div style='text-align:right;'><a href='[~".$resource[$x]['id']."~]'>More on this story: '".$resource[$x]['pagetitle']."'</a> </div></fieldset><br />";
}
}
}
if($limit>$nrblogs) {
$output .= "<br /><br /><b>Older news</b><br />";
for ($x = $nrblogs; $x < $nrblogstotal; $x++) {
$output .= "> <a href='[~".$resource[$x]['id']."~]'>".$resource[$x]['pagetitle']."</a><br />";
}
}
return $output;