Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Full Content of Most Recent Post on Front-Page?

@null

Member

Hi,

I am stuck again. I wanted to split the code to the php part and the template part. I did this:

In index.php I’ve added (right after require('./bb-load.php') ;:

$forum_id = 1;

$number_of_topics = 10;

$forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,$number_of_topics")

In front-page.php I’ve added:

<?php

foreach($forum_one_topics as $topic) :

$forum_one_topic_posts = get_thread( $topic->topic_id); ?>

<a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>

<?php echo $topic->topic_last_poster_name; ?><br/>

<?php echo $forum_one_topic_posts[0]->post_text;

endforeach;

?>

But this results in errors on the index.php file:

parse error, unexpected T_STRING on the first line after the code I’ve put in the index.php file.

What am I doing wrong?

Skip to toolbar