Jump to content


News problems


  • You cannot reply to this topic
4 replies to this topic

#1 barrel

    Etomite Forum Newbie

  • Member
  • 15 posts

Posted 09 November 2004 - 11:32 AM

Hi all,

I have a question concerning the news listing.

* I have deleted and unpublished some news items, but they still show up in the NewsListing snippet. How can I get rid of those items?
Decreasing the limit works, but this is not the desired way :-)

Any ideas?

Tx,
Barry

#2 jaredc

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,193 posts

Posted 09 November 2004 - 12:50 PM

Make sure the page that the newsListing shows up on isn't cached. You can also refresh the site from the admin panel. This option is under "Site" in the upper left corner.

#3 barrel

    Etomite Forum Newbie

  • Member
  • 15 posts

Posted 09 November 2004 - 01:05 PM

Hmm... I just notice that I am posting in the wrong forum? Apoligies for that :-/

Anyway, I found the problem.
I asked etomite to also retrieve the deleted field
$resource = $etomite->getAllChildren($resourceparent, 'createdon', 'DESC', $fields='id, pagetitle, description, content, createdon, createdby, deleted');
In stead of
$resource = $etomite->getAllChildren($resourceparent, 'createdon', 'DESC', $fields='id, pagetitle, description, content, createdon, createdby);

And afterwards checked if the deleted field was not set:

if (!$resource[$x]['deleted'])
{
         $output .= "<fieldset><legend>".$resource[$x]['pagetitle']."</legend>".$rest."<br /><div style='text-align:right;'>Author: <b>".$username."</b> on ".strftime("%d-%m-%y %H:%M:%S", $resource[$x]['createdon'])."</div></fieldset>"; 
}


and

if (!$resource[$x]['deleted'])
{
      $output .= "> <a href='[~".$resource[$x]['id']."~]'>".$resource[$x]['pagetitle']."</a><br />";          
}

That did the trick.

Barry

#4 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 09 November 2004 - 03:23 PM

If you only wanted the published and non-deleted items to show, you could have just changed:

$etomite->getAllChildren

to

$etomite->getActiveChildren


#5 barrel

    Etomite Forum Newbie

  • Member
  • 15 posts

Posted 09 November 2004 - 03:40 PM

deanstev, on Nov 9 2004, 04:23 PM, said:

If you only wanted the published and non-deleted items to show, you could have just changed:

$etomite->getAllChildren

to

$etomite->getActiveChildren

Thanks! Much better :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users