MyBB Community Forums

Full Version: [Ask] Custom Front Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all..
First I'm sorry if my English bad cause is not my native language.

I'm curious how to make custom front page for my forum like my attachment? I want to change my default portal of my forum.

I've read some tutorial like http://community.mybb.com/thread-116225.html
but when I tried to put some codes like {$lastthreads} it shown nothing. Sad

I'm tried using Page Manager plugin, but it was confusing me a lot cause I'm very new about PHP. So, to explain my concept I attach my design. My design is like on the attachment picture.

This is my concept:

1. For the announcement table, I want to show only thread title from specify forum. So, If I post new thread from specify forum, it automatically show there.

2. I Want to show 10 new threads on all forum and 10 new posts also automatically. But, can I make long title of thread to be shorten?

3. Can I automatically show 5 - 8 new threads from specify subforum. I've plan to make sports forum, so I wanna show 5 - 8 new threads from Football, Formula 1, Moto Gp, etc

for the rest, I think I can figure it from HTML and using this tutorial http://community.mybb.com/thread-116225.html to show my header and footer forum.

Thanks for the responses...
You have to have it evaluate the variable in the php file to use something like {$lastthreads.} You will need to use SQL Queries to get the information from your database.

Something like this should work for announcements:
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."announcements WHERE fid='$x'");
while($announcement = $db->fetch_array($query))
{
eval("\$announcements .= \"".$templates->get("sometemplate")."\";");
}

You would put the name of the template you want each announcement to use where I put sometemplate.

The second one is going to be a bit more complex as it has more queries. I think it could be done something like this:
$forumquery = $db->query("SELECT fid, name FROM ".TABLE_PREFIX."forums");
while($forum = $db->fetch_array($forumquery))
{
$fid = $forum['fid'];
$threadquery = $db->query("SELECT * FROM ".TABLE_PREFIX."threads WHERE fid=$fid ORDER BY dateline DESC LIMIT 10");
while($thread = $db->fetch_array($threadquery))
{
eval("\$threads .= \"".$templates->get("sometemplate")."\";"); // Put the template name that you want each thread to use.
} // Close thread loop
$postquery = $db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE fid=$fid ORDER BY dateline DESC LIMIT 10");
while($post = $db->fetch_array($postquery))
{
eval("\$posts .= \"".$templates->get("sometemplate")."\";"); // Put the template name that you want each post to use.
} // Close post loop
} // Close forum loop
waw cool man!!! I will give you +1
Thanks a lot, in my language is Terimakasih..!!!
I will try this..
If possible try out proportal plugin.
You can directly control what ever you want to show.
You can add multiple tables and columns with it,show or display the latest posts or threads as well. SmileSmileSmile

Link to it : http://community.mybb.com/thread-63463.html
hi lenkbreak, how the progress? Could you share the code? I try to achieve the same thing.

*makasih banyak bro..