MyBB Hacks

Full Version: Featured post in portal page?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi, there is a plugin or modification for "featured post" in portal page, as in Wordpress?

thanks
I don't know what is your requirement for the "featured post". There is an example plugin here (using XThreads) for displaying the selected threads on portal:
http://mybbhacks.zingaburga.com/showthread.php?tid=474
Maybe you can modify it as your needs.
Thank you RateU. I wish the post I chose to remain in first position in the first page of portal of my MyBB forum, displaying new posts after it, as in Wordpress.

For example:
- 1 August I created the thread in forum X
- 3 August I created the thread in forum Y
- 4 August I created the thread in forum X

So in first page of portal I'll have, on 4 august, in order:
- 4 August I created the thread in forum X
- 3 August I created the thread in forum Y
- 1 August I created the thread in forum X

I would like to have 3 August I created the thread in forum Y ever in first position, and after others threads, that is 4 August and 1 August.

I hope you understood me, I'm sorry Frown
What do you mean by the "first page"?
The "important post" to keep in evidence only on first page of Portal (portal.php) and not in portal.php?paged=1&page=2, portal.php?paged=1&page=3, portal.php?paged=1&page=4, etc.

If this is possible also in MyBB, thanks
Are you using a modified portal? By default, MyBB doesn't have paging in portal. The easiest way is, load the specified post and put it above the announcements. Wrap it inside a condition so it won't be displayed in other "page". Then modify the announcements query.
If it's just a single post, just hard code the thing into the template.
Didn't read the full thread, but are not WP feature posts similar to MyBB stickies?

If so, you can try to modify the portal.php, edit the while function.

Not right but the idea would be this (if somebody gets it -.-u):

PHP Code:
$threads = $stickies = '';
while($annoucment = $db->fetch_array($query))
{
...
if($annoucment['sticky'])
{
eval('$stickies .= "'.$templates->get('...').'";');
}
else
{
eval('$threads .= "'.$templates->get('...').'";');
}
}
$threads = $stickies.$threads;
unset($stickies);


That is pretty much what I did for my portal (since I already control what threads are shown in it, there is no way all stickies will appear as portal news even if there are in the same forum).

Hope that helps.

(08-12-2012 06:52 AM)RateU Wrote: [ -> ]Are you using a modified portal? By default, MyBB doesn't have paging in portal. The easiest way is, load the specified post and put it above the announcements. Wrap it inside a condition so it won't be displayed in other "page". Then modify the announcements query.

Thank you, this is perfect for me, I don't know why I never thought that first. I put this code in portal template:

Code:
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><strong>Title</strong></td>
</tr>
<tr>
<td class="trow2"><div align="center">Text</div></td>
</tr>
</table>
<br />{$announcements}</td>


Yes, I have edited a bit portal template with multipage, 3 column, avatars in latest threads (thanks leefish Biggrin ).

Could you say me what is the condition so Post won't be displayed in other pages? Thank you very much


(08-12-2012 05:42 PM)Sama34 Wrote: [ -> ]Didn't read the full thread, but are not WP feature posts similar to MyBB stickies?

If so, you can try to modify the portal.php, edit the while function.

Not right but the idea would be this (if somebody gets it -.-u):

PHP Code:
$threads = $stickies = '';
while($annoucment = $db->fetch_array($query))
{
...
if($annoucment['sticky'])
{
eval('$stickies .= "'.$templates->get('...').'";');
}
else
{
eval('$threads .= "'.$templates->get('...').'";');
}
}
$threads = $stickies.$threads;
unset($stickies);


That is pretty much what I did for my portal (since I already control what threads are shown in it, there is no way all stickies will appear as portal news even if there are in the same forum).

Hope that helps.


Hi, stickies posts are "important threads" in forumdisplay? Maybe I was wrong to put the word "featured", I think it is more appropriate "post in evidence"
ADD: there is a problem..if I add post in announcement I have to copy-paste all post, but so users can't click on title and go directly in post on forum and read all answers..
Pages: 1 2
Reference URL's