2
Hmm, maybe i was too drunk that night...
Anyway found it.
Just change this:
$sql = "SELECT t.topic_title, s.storyid, s.topicid, s.title, s.comments, s.counter
FROM ".$xoopsDB->prefix("stories")." s, ".$xoopsDB->prefix("topics")." t
WHERE s.topicid=t.topic_id
ORDER BY s.storyid DESC LIMIT $limit";
Into this:
$sql = "SELECT t.topic_title, s.storyid, s.topicid, s.title, s.comments, s.counter, s.published, s.expired
FROM ".$xoopsDB->prefix("stories")." s, ".$xoopsDB->prefix("topics")." t
WHERE s.topicid=t.topic_id AND s.published < ".time()." AND s.published > 0 AND (s.expired = 0 OR s.expired > ".time().")
ORDER BY s.storyid DESC LIMIT $limit";
Happy xooping!