Customizing SMF > Now Available
Displaying only one Category
[Unknown]:
Why would you want to remove view of the other boards? To save like a kilobyte of bandwidth?
-[Unknown]
RicochetPeter:
Em, no, but to have the possibility to give away an URL that will show only that very section; to get the impression there were no other sections.
Trekkie101:
But then clicking home would display it?
You could make the other boards private to stop just anyone getting in and they wouldnt see it until they are premoted.
A.M.A:
In BoardIndex.template.php look for:
--- Code: --- foreach ($context['categories'] as $category)
{
echo '
<div class="tborder"><table border="0" width="100%" cellspacing="1" cellpadding="5">
--- End code ---
replace with:
--- Code: --- foreach ($context['categories'] as $category)
{
// if category's link is clicked, display that category only!
if (isset($_REQUEST['catogid']))
{
if ($_REQUEST['catogid'] == $category['id'])
echo '<div class="tborder">';
elseif ($_REQUEST['catogid'] != $category['id'])
echo '<div style="display:none;">';
}
else
{
echo '<div class="tborder">';
}
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="5">
--- End code ---
look for:
--- Code: ---', $category['link'], '
--- End code ---
replace with:
--- Code: ---<a href="' . $scripturl . '?catogid=', $category['id'], '">', $category['name'], '</a>
--- End code ---
This will enable you to display only one category by clicking on any category or typing its URL. This will only hide the unwanted categories. I made this quick, and did not test for errors proof!
RicochetPeter:
A.M.A, you rock soooo bad! Thanx very much for that hack. Looks absolutely...great. thanx.
PS: this could even go into the main dev tree, methinks.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version