[Ask] Custom Front Page
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

« Next Oldest | Next Newest »

Messages In This Thread
[Ask] Custom Front Page - lenkbreak - 04-09-2012, 05:37 PM
RE: [Ask] Custom Front Page - ZiNgA BuRgA - 04-09-2012, 05:56 PM
RE: [Ask] Custom Front Page - lenkbreak - 04-09-2012, 06:39 PM
RE: [Ask] Custom Front Page - adisp007 - 04-10-2012 03:12 AM
RE: [Ask] Custom Front Page - RateU - 04-10-2012, 06:52 AM
RE: [Ask] Custom Front Page - lenkbreak - 04-10-2012, 12:55 PM
RE: [Ask] Custom Front Page - RateU - 04-11-2012, 02:34 AM
RE: [Ask] Custom Front Page - adisp007 - 04-11-2012, 03:09 AM
RE: [Ask] Custom Front Page - RateU - 04-11-2012, 06:03 AM
RE: [Ask] Custom Front Page - lenkbreak - 04-11-2012, 11:50 AM
RE: [Ask] Custom Front Page - lenkbreak - 04-11-2012, 12:30 PM
RE: [Ask] Custom Front Page - leefish - 04-11-2012, 12:58 PM
RE: [Ask] Custom Front Page - RateU - 04-12-2012, 08:08 AM
RE: [Ask] Custom Front Page - lenkbreak - 04-12-2012, 12:32 PM
RE: [Ask] Custom Front Page - lenkbreak - 04-12-2012, 05:41 PM
RE: [Ask] Custom Front Page - adisp007 - 04-12-2012, 08:20 PM
RE: [Ask] Custom Front Page - lenkbreak - 04-13-2012, 12:11 PM
RE: [Ask] Custom Front Page - RateU - 04-16-2012, 01:56 AM
RE: [Ask] Custom Front Page - lenkbreak - 04-20-2012, 02:52 PM
RE: [Ask] Custom Front Page - RateU - 04-22-2012, 05:02 AM
RE: [Ask] Custom Front Page - lenkbreak - 04-22-2012, 06:12 PM

 Standard Tools
Forum Jump: