– You’d want to use forum_name( $topic->forum_id ).
– I think so. If you look at the code you’ll see an array of posts, and by using array_shift() you can detach the first one and have some special template code just for that. Be sure to check it’s the first post of the topic, though, not just the first post of the page. Maybe a better thing to do would be to add a class to each post giving it a topic-specific number, so you can style topic-post-1 or whatever individually.
– Where in your template I assume it says topic_posts(), replace that with echo( get_topic_posts() - 1 );
Thanks! 1st and 3rd things are resolved.
I’ve been trying hundreds of different things/syntaxes to get the second item to work, but to no avail yet. I’m sure it must be the way I’m trying to code it (Full disclosure: I’m still trying to learn PHP).
What I’m going for is as follows:
Run the foreach, and then using array_shift(), grab the first item in the array, and then display just the post_text() that is contained within that array (assuming this is an array within an array)
This what my code (stripped down) looks like:
INITIAL POST:
<? php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>
<?
php array_shift();
echo post_text();
?>
<?php endforeach; ?>
=====================================
and then later on, when the responses are displayed:
<? php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>
<?php echo post_text(); ?>
<?php endforeach; ?>
I was hoping the first initial post wouldn’t be displayed since array_shift() would have taken it out?
Any help would be greatly appreciated…
The documentation should help you understand how to use array_shift(): http://uk.php.net/manual/en/function.array-shift.php
Thanks much! Finally got it working the way I want to. For everyone’s reference here’s how to do the separation:
Where the first one is going to go:
<?php
foreach ($posts as $bb_post) : $del_class = post_del_class();
post_text(); // Other variables, etc
array_shift($posts);
break;
endforeach;
?>
Then, where the rest of them are going to appear:
<?php foreach ($posts as $bb_post) : $del_class = post_del_class();
php bb_post_template();
endforeach; ?>