MyBB Hacks

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

I'm curious can XThreads make custom front page for my forum? I want to change my default portal of my forum.

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.

Thanks for the responses...
XThreads is designed to extend threads, not create custom pages like that.
Also be aware that XThreads was designed to be more confusing than Page Manager.
(04-09-2012 05:56 PM)ZiNgA BuRgA Wrote: [ -> ]XThreads is designed to extend threads, not create custom pages like that.
Also be aware that XThreads was designed to be more confusing than Page Manager.

Really? Ouch But honestly this plugin is so powerful.
I look at RateU site on http://www.14.mynie.co.cc/
did he/she make that page with XThreads?
I want to make similar like that
Can I know where exactly I can find tutorial to make a page like that

Anyway, thanks for your fast response Yes
Yeah,as @Yumi said,XThreads isn't made for custom pages,but for custom threads.
That site http://www.14.mynie.co.cc is made with XThreads plugin & there are tutorial links on every pages.
But,if You meant for its index page,I think it is made with custom index template.

Because You have installed Page Manager plugin,I assume You use it & know about its htaccess rules to make the default index for Your forum.
- Make new page.
- Don't use MyBB template.
- Fill its content with this:

PHP Code:
<?php
// Key to enter MyBB core files.
define("IN_MYBB", 1);
//define("THIS_SCRIPT", "test.php");
require_once("./global.php");
global $headerinclude, $header, $theme, $footer/*, $lang*/;
// If want to use custom language file.
//$lang->load("test");
// If want to limit only to member.
/*
if ($mybb->user['uid'] != 0) {
	// Write something in here.
} else {
	error_no_permission();
}
*/
// Make breadcrumb.
//add_breadcrumb("Test");
add_breadcrumb($pages['name']);
// Header template.
$template = '
<html>
<head>
<title>' . $pages['name'] . '</title>
{$headerinclude}
</head>
<body>
{$header}
';
/*
Main template.
Change this as much as You want.
This is only sample.
*/
// Announcement template.
$template .= '
<table border="3px" width="100%"><tr>
	<td width="25%"><strong>Announcement</strong></td>
	<td width="75%">
';
$annoid = 2; // ID of announcement forum.
$annolimit = 1; // Limit announcement to 1.
$annoquery = $db->query("SELECT * FROM " . TABLE_PREFIX . "threads WHERE fid='$annoid' ORDER BY `tid` DESC LIMIT $annolimit"); // Query DB from announcement forum.
while ($annofetch = $db->fetch_array($annoquery)) {
$template .= '<a href="./showthread.php?tid=' . $annofetch['tid'] . '">' . $annofetch['subject'] . '</a><br />';
}
$template .= '
	</td>
</tr></table><br />
';
// Latest thread template.
$template .= '
<table border="0px" width="100%"><tr>
	<td><table border="3px" width="100%">
		<tr><td><strong>Latest Threads</strong></td></tr>
		<tr><td>
';
$lastlimit = 5; // Limit latest threads to 5.
$lastquery = $db->query("SELECT * FROM " . TABLE_PREFIX . "threads ORDER BY `tid` DESC LIMIT $lastlimit"); // Query DB from latest thread.
while ($lastfetch = $db->fetch_array($lastquery)) {
$template .= '
<ul style="list-style: none;">
	<li style="list-style: none;"><a href="./showthread.php?tid=' . $lastfetch['tid'] . '">' . $lastfetch['subject'] . '</a><br /></li>
</ul>
';
}
$template .= '
		</td></tr>
	</table></td>
';
// Specify forum template.
$template .= '
	<td><table border="3px" width="100%">
		<tr><td><strong>Specify Forum</strong></td></tr>
		<tr><td>
';
$f4id = 4; // ID of specify forum.
$f4limit = 5; // Limit specify forum threads to 5.
$f4query = $db->query("SELECT * FROM " . TABLE_PREFIX . "threads WHERE fid='$f4id' ORDER BY `tid` DESC LIMIT $f4limit"); // Query DB from specify forum.
while ($f4fetch = $db->fetch_array($f4query)) {
$template .= '
<ul style="list-style: none;">
	<li style="list-style: none;"><a href="./showthread.php?tid=' . $f4fetch['tid'] . '">' . $f4fetch['subject'] . '</a><br /></li>
</ul>
';
}
$template .= '
		</td></tr>
	</table></td>
</tr></table><br />
';
/*
End editing.
*/
// Footer template.
$template .= '
<br />
{$footer}
</body>
</html>
';
// Replace single quote.
$template = str_replace("\'", "'", addslashes($template));
// Make template.
eval("\$page = \"" . $template . "\";");
// Make page.
output_page($page);
?>

- Except those 2,fill the other fields up to You.

That script is only for sample.
You can learn & modify it.
Be creative. Smile
The table tag for easy to learn (beginner). Biggrin If You can use div tag,use it. Smile
Furthermore,table tag is ancient/old way to make a web page. Rules

(04-09-2012 05:37 PM)lenkbreak Wrote: [ -> ]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
Most of them is just an usual plugin?

(04-09-2012 06:39 PM)lenkbreak Wrote: [ -> ]Really? Ouch But honestly this plugin is so powerful.
Who said that XThreads is not a powerful tool?
What Yumi/ZiNgA means is, the main purpose of XThreads is not for creating a custom page.

(04-09-2012 06:39 PM)lenkbreak Wrote: [ -> ]I look at RateU site on http://www.14.mynie.co.cc/
did he/she make that page with XThreads?
Of course I use XThreads there Smile
I use the original MyBB index.php file. No core file edit at all there.
I use some plugins to load XThreads contents to my index page (you'll find most of them in this forum).

(04-09-2012 06:39 PM)lenkbreak Wrote: [ -> ]Can I know where exactly I can find tutorial to make a page like that
Unfortunately, no.
I don't know what tutorial I should create for it?
The contents of my index template is just some variables?
But feel free to ask. If I can help you, I will try to help Smile

(04-10-2012 03:12 AM)adisp007 Wrote: [ -> ]The table tag for easy to learn (beginner). Biggrin If You can use div tag,use it. Smile
Furthermore,table tag is ancient/old way to make a web page. Rules
Personally, I love a table tags Biggrin
@adisp007
Thanks a lot!!! in my language is Terimakasih!!
I will try your advice
I hope this not confusing me Tongue

@rateu
I want to make a page similar like yours
this is what I made before (only html codes)
I'm not using Page Manager plugin for this sample
I made an index page and new template in global template.

my forum url is http://lenkbreak.host56.com/forum/
and I want to make an index page at http://lenkbreak.host56.com/ similar like yours Smile

like you said, you use some plugin to load XThread contents to your index page
can I know what plugin is it?

I'm apologize about my misunderstanding about this plugin
but, If you can give me few step to make an index page like my concept, I'm really really appreciate that Smile
Oh, I thought you want to load  XThreads contents to your forum index.
If you want to load just the latest threads/posts title only, maybe you can find that kinds of plugins in MyBB Community. Or maybe you can start with the code given by adisp007.
(04-10-2012 06:52 AM)RateU Wrote: [ -> ]Personally, I love a table tags Biggrin

Oh,because it's easy? Same with me. Tongue
I just said what other people said http://www.1stwebdesigner.com/design/anc...http://www.1stwebdesigner.com/design/ancient-design-practices-t Rules

(04-10-2012 12:55 PM)lenkbreak Wrote: [ -> ]...
@RateU
like you said, you use some plugin to load XThread contents to your index page
can I know what plugin is it?
...

Maybe some of them:
- PHP In Templates http://mybbhacks.zingaburga.com/showthread.php?tid=260
- Thread Tooltip http://mybbhacks.zingaburga.com/showthread.php?tid=267
CMIIW Biggrin

(04-10-2012 12:55 PM)lenkbreak Wrote: [ -> ]...
Thanks a lot!!! in my language is Terimakasih!!
I will try your advice
I hope this not confusing me Tongue
...

So,You're Indonesian? Terima kasih kembali. Tongue
That code is easy to learn. Biggrin








Special Post (Indonesian Language) Tongue

Bro,coba tanya dg yg nge-post ini: http://komunitas.mybbindonesia.com/threa...http://komunitas.mybbindonesia.com/thread-1337-post-9410.ht
Sekalian u/ mmbuktikn kata2nya. Smile
Post-nya kelihatan asal2an sj tanpa bukti.Katanya bs CUMA klik kanan terus lihat & ambil source code-nya & langsung jd konten dinamis kayak gitu? Biggrin

(04-11-2012 03:09 AM)adisp007 Wrote: [ -> ]Oh,because it's easy?
Easy? Unfortunately, it's hard for me (I'm not a designer).

(04-11-2012 03:09 AM)adisp007 Wrote: [ -> ]Maybe some of them:
- PHP In Templates http://mybbhacks.zingaburga.com/showthread.php?tid=260
- Thread Tooltip http://mybbhacks.zingaburga.com/showthread.php?tid=267
PHP In Templates: I'm a fans of PHP In Templates plugin. The plugin is installed in all of "my" forums (actually it's funny for me for installing the plugin, because I have a zero knowledge about PHP).
Thread Tooltip: If all of the fields of the threads table loaded, Thread Tooltip gives me the snippet of a thread. So I don't need to load an additional query to get the post snippet.
The other plugins I use to load XThreads contents:
http://mybbhacks.zingaburga.com/showthread.php?tid=474
http://mybbhacks.zingaburga.com/showthread.php?tid=486
http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=292&pid=94
http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php?tid=286&pid=1047
But if lenkbreak installs the plugins (the plugins I use to load XThreads contents) in his forum, it will gives some errors because he doesn't have XThreads applications in his forum.

So, the backbone of the demo forum is XThreads. We only need to create a simple plugin to load XThreads contents to other pages (the hard things will be done by XThreads). Not only index or portal, we can load it to user profile page:
http://www.14.mynie.co.cc/member.php?act...http://www.14.mynie.co.cc/member.php?action=pro

Or, we can manipulate our showthread/postbit into a static or dynamic pages (not recommended):
http://www.14.mynie.co.cc/showthread.php?tid=167 (static)
http://www.14.mynie.co.cc/showthread.php?tid=296 (static)
Medal Owner (dynamic):
http://www.14.mynie.co.cc/showthread.php?tid=297
http://www.14.mynie.co.cc/showthread.php?tid=298
http://www.14.mynie.co.cc/showthread.php?tid=299
http://www.14.mynie.co.cc/showthread.php?tid=300

XThreads.... really, it's a powerful tool. Unfortunately, I only know a very basic usage of it Biggrin
@adisp007
aha..!! I've been thinking your Indonesian too from your username Biggrin
Terimakasih sangat bro! Perhaps I will ask you some more questions about mybb directly and I hope is not bothering you.

@rateu
you know what? this is what I like from community like this!!
people like you and adisp007 share their knowledge with noobs like me and never ask to be pay
I will try your suggestions and adisp007 suggestions also after this week

thanks a lot for both of you guys!
Pages: 1 2 3
Reference URL's