aah cool your code is much cleaner thx alot
1 2008-03-30 20:36
Re: newsitem on my site ? (8 replies, posted in PunBB 1.2 modifications, plugins and integrations)
2 2008-03-30 20:35
Re: newsitem on my site ? (8 replies, posted in PunBB 1.2 modifications, plugins and integrations)
ok I know it's crappy PHP, but it works for now
$nieuwsid = $_GET['nieuwsid'];
$result = $db->query('
SELECT
* FROM '.$db->prefix.'posts
WHERE topic_id = '.$nieuwsid.'
ORDER BY id DESC LIMIT 1
') or error('Unable to fetch posts', __FILE__, __LINE__, $db->error());
if ($db->num_rows($result)) {
$cur_post = $db->fetch_assoc($result);
$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
$result = $db->query("SELECT * FROM ".$db->prefix."topics WHERE id = ".$nieuwsid."") or error('Unable to fetch topics', __FILE__, __LINE__, $db->error());
$cur_topic = $db->fetch_assoc($result);
$tpl->newBlock( "NIEUWS" );
$tpl->assign( "NIEUWS_TITLE", pun_htmlspecialchars($cur_topic['subject']) );
$tpl->assign( "NIEUWS_VIEWS", $cur_topic['num_views'] );
$tpl->assign( "NIEUWS_DATUM", format_time($cur_post['posted']) );
$tpl->assign( "BERICHT", $cur_post['message'] );
$tpl->gotoBlock( "_ROOT" );
} else {
$tpl->newBlock( "ERROR" );
$tpl->assign("ERROR", "Er is geen nieuwsitem gevonden.");
$tpl->gotoBlock( "_ROOT" );
}
3 2008-03-30 20:22
Re: newsitem on my site ? (8 replies, posted in PunBB 1.2 modifications, plugins and integrations)
actually no
the content of the first post (the content of the newsitem itself)
4 2008-03-30 20:08
Re: newsitem on my site ? (8 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Am trying a few query's but I took a look at the query's from the newsplugins and got confused and dazzled by the joins, and mixes of wheres in the querys..
it looks like its going to work but it just startled me with my limited experience with mysql :S
5 2008-03-30 19:57
Topic: newsitem on my site ? (8 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Hi everyone,
I have tried the newsplugins and am hapy with those, accept, they all work on a while loop with one or more forums.
I do not wish to display all the news on the frontpage, but only the title, date etc.. with a link to a new page wich in turn displays the newsitem itself.
but now I came to a stagering halt, because i got a little confused from al the joins and wheres in the query's :S
My question is...
If i have a topicid, how can I display the topic title, date and message in the new page ?
With regards,
Ronny Roethof
www.dcthoekje.nl