I love NewsListing. It is simple, understandable, and customizable. I've almost got it to do exactly what I need.
Here is my question.
How do you get it to stop putting a box around the text of each entry? Or better yet, how do you get it to put an <hr> at the bottom of each block of text instead of the box around the whole thing?
It would be wonderful if someone had the answer to this one.
Thanks
Gary
NewsListing Question
Started by The Bearded One, Nov 12 2004 05:42 PM
2 replies to this topic
#1
Posted 12 November 2004 - 05:42 PM
#2
Posted 12 November 2004 - 05:56 PM
Take a look at the following code compared to the original. Notice (on or about line 36) the Legend and Fieldset tags removed- and an <hr /> tag inserted. This should get you close to what you want, but I admit I didn't test this code because I'm on my way out the door...
$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 = 100;
// total nr of blogs to retrieve
$lentoshow = 150;
// 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 entries found.<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 .= "...<br /> <a href='".$resource[$x]['id'].".html'>More on this story ></a>";
} else {
$rest = $resource[$x]['content'];
}
$output .= "<div>".$resource[$x]['pagetitle']."</div><div".$rest."<div style='text-align:right;'>Author: <b>".$username."</b> on ".strftime("%d-%m-%y %H:%M:%S", $resource[$x]['createdon'])."</div><hr />";
}
}
}
if($limit>$nrblogs) {
$output .= "<br /><br /><b>Older news</b><br />";
for ($x = $nrblogs; $x < $limit; $x++) {
$output .= "> <a href='".$resource[$x]['id'].".html'>".$resource[$x]['pagetitle']."</a><br />";
}
}
return $output;
#3
Posted 12 November 2004 - 09:51 PM
Jared,
That did the trick.
Now it's exactly the way I wanted.
Thanks.
Gary
PS - I love Etomite. This is a great program.
That did the trick.
Now it's exactly the way I wanted.
Thanks.
Gary
PS - I love Etomite. This is a great program.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











