Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Check If First / Last Post in current page (Portal)
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #1
Check If First / Last Post in current page (Portal)
Hello,

Like the title, which condition I need to use if I want to check first or last post in the portal ?
06-10-2013 08:31 PM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #2
All about MyBB Portal again...
Hi, it's me again Frown

In the MyBB portal, I want to use template conditional to check if that announcement is first post or last post in the current page.

Because, when a new thread was created, it will be the first announcement!

For example:

PHP Code:
<div class="news-article <if $firstannouncement then>first-child</if>">
<div class="news-article-inner">
....
</div>
</div>


Which condition I need to use in this case ?


Is there any way to check if that announcement is sticky thread or not ?

Because I want to something like Featured Post... Biggrin

(This post was last modified: 07-04-2013 04:01 PM by Destro.)
07-04-2013 03:53 PM
Find all posts by this user Quote this message in a reply
Destro Offline
Junior Member
**
Posts: 39
Joined: Nov 2012
Post: #3
RE: All about MyBB Portal again...
Hello, I'm too fool when try to get the first post in portal.

The base of this is all about 'dateline' column in mybb_threads

And MyBB did that work for us, now we just need to compare between two query and we get the first post in portal as I want Biggrin


But how about to know that if that announcement is a superb thread or not ? (superb thread is a custom thread field)

How to get the custom thread field variable in portal.php ?
07-06-2013 02:21 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: All about MyBB Portal again...
I've merged your threads.

You can use $threadfields['key'] in the portal_announcement.

(This post was last modified: 07-06-2013 06:57 AM by RateU.)
07-06-2013 06:35 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: