NewsListing
#31
Posted 01 January 2005 - 05:06 PM
I finally got fed up with IE/Win, and went back to a table-based layout for my template. Even then it managed to f&*#k it up and I had to hack at the css to make it work right. What a pain.
#32
Posted 05 January 2005 - 08:39 AM
In the page where the [[NewsListing]] tag is found and the short stories are being displayed, the snippet seems to just cut of the text at the given length. It doesn't check for any html tags to be open or not.
I ran into this problem quite soon. The text got cut of where a link (<a href) was still open. This messed up the result.
It might help if the script checked if at the place where the text is being cut of any tags are open, which are being closed later on in the document. This eliminates the need of listing all tags that should be closed. When the source text is correct every tag should get closed as is should.
Unfortunately I don't have a clue how to implement this... Anybody does?
#33
Posted 05 January 2005 - 02:29 PM
miels, on Jan 5 2005, 04:39 AM, said:
In the page where the [[NewsListing]] tag is found and the short stories are being displayed, the snippet seems to just cut of the text at the given length. It doesn't check for any html tags to be open or not.
I ran into this problem quite soon. The text got cut of where a link (<a href) was still open. This messed up the result.
It might help if the script checked if at the place where the text is being cut of any tags are open, which are being closed later on in the document. This eliminates the need of listing all tags that should be closed. When the source text is correct every tag should get closed as is should.
Unfortunately I don't have a clue how to implement this... Anybody does?
#34
Posted 05 January 2005 - 02:45 PM
If you are willing to step away from truncated body text and look at using the description instead, then you have more snippet options available for use.
#35
Posted 05 January 2005 - 03:03 PM
jaredc, on Jan 5 2005, 10:45 AM, said:
If you are willing to step away from truncated body text and look at using the description instead, then you have more snippet options available for use.
#36
Posted 20 January 2005 - 02:11 PM
example :
->news_content (20) (unpublished)
--->article1 (21)
--->article2 (22)
->news (23)
what should i do with news (23) to show the content of news_content (20) ?
[[NewsListing?id=20]] doesnt work....
help me please ?
#37
Posted 20 January 2005 - 02:16 PM
noobalyzed, on Jan 20 2005, 09:11 AM, said:
[[NewsListing?newsid=20]]
#38
Posted 20 January 2005 - 02:52 PM
#39 Guest_madbadrob_*
Posted 26 January 2005 - 09:23 PM
Can someone explain in words that a novice site builder can understand how the news section of a site works and the code that would be required to activate it. I have on my site http://acorn.rootschat.net three news boxes one for the latest one for the previous latest and the third for and so on. I just don't understand the coding
Thanx
Rob
#40
Posted 26 January 2005 - 09:47 PM
The code to put the news items on the home page is generated by the NewsListing snippet itself.
#41 Guest_madbadrob_*
Posted 26 January 2005 - 10:04 PM
jaredc, on Jan 26 2005, 10:47 PM, said:
The code to put the news items on the home page is generated by the NewsListing snippet itself.
Rob
#42
Posted 26 January 2005 - 10:14 PM
#43
Posted 27 January 2005 - 11:54 AM
#44
Posted 27 January 2005 - 12:41 PM
#45
Posted 27 January 2005 - 01:27 PM
$resourceparent = isset($newsid) ? $newsid : $etomite->documentIdentifier;
    // the folder that contains blog entries
$output = '';
    // initialise the blog variable
$nrblogs = 10;
    // 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 .= "<font face=verdana size='2'><b>» <a href='index.php?id=".$resource[$x]['id']."' onmouseover=this.style.textDecoration='underline'
onmouseout=this.style.textDecoration='none'>".$resource[$x]['pagetitle']."</a></b> <div align=left>on ".strftime("%d-%m-%y %H:%M:%S", $resource[$x]['createdon'])."</div></font><br>";
   }
 }
}
return $output;
thats my NewsListing Snippet...
#46
Posted 28 January 2005 - 09:04 AM
#47
Posted 28 January 2005 - 09:04 AM
(I have no experience really with the snippet in question, otherwise I would help) - have you tried comparing yours to the original?
#48
Posted 28 January 2005 - 09:34 AM
i didnt mean to bump up the topic m8, i allways got help here, and im patient enough
#49
Posted 28 January 2005 - 02:23 PM
Quote
#50
Posted 28 January 2005 - 03:11 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users










