[Ask] Custom Front Page
lenkbreak Offline
Junior Member
**
Posts: 23
Joined: Apr 2012
Post: #1
[Ask] Custom Front Page
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...


Attached File(s) Thumbnail(s)
   
04-09-2012 05:37 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: [Ask] Custom Front Page
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.

My Blog
04-09-2012 05:56 PM
Find all posts by this user Quote this message in a reply
lenkbreak Offline
Junior Member
**
Posts: 23
Joined: Apr 2012
Post: #3
RE: [Ask] Custom Front Page
(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
04-09-2012 06:39 PM
Find all posts by this user Quote this message in a reply
adisp007 Offline
Junior Member
**
Posts: 26
Joined: Apr 2012
Post: #4
RE: [Ask] Custom Front Page
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?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


Best Regards,

Adi Sucipta Pratama
(This post was last modified: 04-10-2012 03:21 AM by adisp007.)
04-10-2012 03:12 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #5
RE: [Ask] Custom Front Page
(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

04-10-2012 06:52 AM
Find all posts by this user Quote this message in a reply
lenkbreak Offline
Junior Member
**
Posts: 23
Joined: Apr 2012
Post: #6
RE: [Ask] Custom Front Page
@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
04-10-2012 12:55 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #7
RE: [Ask] Custom Front Page
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-11-2012 02:34 AM
Find all posts by this user Quote this message in a reply
adisp007 Offline
Junior Member
**
Posts: 26
Joined: Apr 2012
Post: #8
RE: [Ask] Custom Front Page
(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


Best Regards,

Adi Sucipta Pratama
04-11-2012 03:09 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #9
RE: [Ask] Custom Front Page
(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

(This post was last modified: 04-11-2012 07:29 AM by RateU.)
04-11-2012 06:03 AM
Find all posts by this user Quote this message in a reply
lenkbreak Offline
Junior Member
**
Posts: 23
Joined: Apr 2012
Post: #10
RE: [Ask] Custom Front Page
@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!
04-11-2012 11:50 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: