SMF 2.0.6
Hi,
I already have this code, added below the signature:
if ($message['counter'] % 15 == 7) {
echo 'content'
}
How to hide the content if there are 8 posts in a page?
And display the content if there are >8 posts in a page?
Edit:
I want display the content for the 8th post, but it's only displayed if the total of posts in a page is >8 posts.
Thx.
Something like this -
if ($message['counter'] => 8)
{
what ever you want to happen after 8
} else {
what ever you want to happen before 8
}
@The Wizard,
Thanks for your answer.
I try this:
if ($message['counter'] => 8) {
if ($message['counter'] % 15 == 7) {
echo 'content';
}
}
But it's not what I looking for.
I want display the content for the 8th post, but it's only displayed if the total of posts in a page is >8 posts.
And sorry for my previous message, a little ambiguous, but I have edited it. :)
There was recently a similar question, regarding the 21st post. Can't find it now but it should solve your issue (considering the necessary adjustments)
@margarett,
Yes, that's my question too.
-> http://www.simplemachines.org/community/index.php?topic=516811.0
But now, I want to display "the content" in 8th post if the total of posts in a page is >8 posts.
Just OR you first condition with
(counter == 8)
(Sorry I'm on the phone now, it's not very good to write code :P )
@margarett,
Thanks for your answer.
I tried this:
if (($message['counter'] % 15 == 7) or (counter == 8)) {
echo 'content';
}
But "the content" in 8th post is still displayed in 8th post.
I want the "the content" in 8th post is displayed if the total of post in a page is 9 posts or more.
The Wizard's code should do it, just use > instead of >=
I thought that you want to show it in the 8th post as well.