I'm not sure how to explain this really, but I just installed a board and would like to add some additional links to categories about the listing of threads.
I have my board set up like this.
http://imageshack.us/photo/my-images/543/screenor.png/I would like to add links/tabs/buttons to my 3-4 categories next to "All Discussions" and "My discussions".
Any ideas how I can do this. I'm not great with coding, but can figure it out with guidance. I couldn't find any info in the documentation about editing these buttons/tabs.
0 • •
Answers
My addons: NillaBlog | Vanoogle
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •422 Real Estate Australia , now open Check it out
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •http://formutantsonly.com/screen.png
Here's what I want
http://formutantsonly.com/screen2.png
I'd like to link my categories in those spots. I only have 4 categories and I like that the page shows them all at once, but if someone would like to sort them I would like that option too.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •422 Real Estate Australia , now open Check it out
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •My addons: NillaBlog | Vanoogle
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •i use Vanilla 2.0.18.1 and here is what i will do:
i will create a theme hook public function
public function DiscussionsController_AfterDiscussionTabs_Handler($Sender){
$CategoryModel = new CategoryModel();
$_CategoryData = $CategoryModel->GetFull();
foreach ($_CategoryData->Result() as $Category) {
// (will ignore root node)
if ($Category->Name <> 'Root') $CountDiscussions = $CountDiscussions + $Category->CountDiscussions;
}
// Fetch every single Category...
foreach ($_CategoryData->Result() as $Category)
{
if ($Category->Name <> 'Root')
{
echo '< li >< a href="/categories/'.$Category->Name .'">'.$Category->Name.''.$Category->CountDiscussions.'</ a></ li>';
}
}
}
there can be errors with opening and closing of some stuff meaning {} or ' ' or " " - but u can try this
Theme Charcha for great desktop and mobile experience! - drop me a message :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Theme Charcha for great desktop and mobile experience! - drop me a message :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Theme Charcha for great desktop and mobile experience! - drop me a message :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •http://vanillaforums.org/docs/theme-hooks
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I entered this code into a file called class.customthemehooks.php
class customThemeHooks implements Gdn_IPlugin {public function DiscussionsController_AfterDiscussionTabs_Handler($Sender){
$CategoryModel = new CategoryModel();
$_CategoryData = $CategoryModel->GetFull();
foreach ($_CategoryData->Result() as $Category) {
// (will ignore root node)
if ($Category->Name <> 'Root') $CountDiscussions = $CountDiscussions + $Category->CountDiscussions;
}
// Fetch every single Category...
foreach ($_CategoryData->Result() as $Category)
{
if ($Category->Name <> 'Root')
{
echo '< li >< a href="/categories/'.$Category->Name .'">'.$Category->Name.''.$Category->CountDiscussions.'</ a></ li>';
}
}
}
}
all I get is the code printed on the top of the page.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •<?php if (!defined('APPLICATION')) exit();to the begining (like I saw in other theme hooks) I get this error Line 19 is a
}If I remove that I get this error
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Theme Charcha for great desktop and mobile experience! - drop me a message :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •public function DiscussionsController_AfterDiscussionTabs_Handler($Sender){
$CategoryModel = new CategoryModel();
$_CategoryData = $CategoryModel->GetFull();
foreach ($_CategoryData->Result() as $Category) {
// (will ignore root node)
if ($Category->Name <> 'Root') $CountDiscussions = $CountDiscussions + $Category->CountDiscussions;
if ($Category->Name <> 'Root')
{
echo '<li><a class="TabLink" href="/categories/'.$Category->Name .'">'.$Category->Name.' '.$Category->CountDiscussions.'</a></li>';
}
}
}
Theme Charcha for great desktop and mobile experience! - drop me a message :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •class custom2ThemeHooks implements Gdn_Plugin Gdn_Plugin {
public function DiscussionsController_AfterDiscussionTabs_Handler($Sender){
$CategoryModel = new CategoryModel();
$_CategoryData = $CategoryModel->GetFull();
foreach ($_CategoryData->Result() as $Category) {
// (will ignore root node)
if ($Category->Name <> 'Root') $CountDiscussions = $CountDiscussions + $Category->CountDiscussions;
if ($Category->Name <> 'Root')
{
echo '<li><a class="TabLink" href="/categories/'.$Category->Name .'">'.$Category->Name.' '.$Category->CountDiscussions.'</a></li>';
}
}
}
}
Am I putting it in the wrong folder?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Theme Charcha for great desktop and mobile experience! - drop me a message :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •class custom2ThemeHooks implements Gdn_IPlugin {Theme Charcha for great desktop and mobile experience! - drop me a message :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •class custom2ThemeHooks implements Gdn_IPlugin {again nothing happens on the page.
I have the file called class.custom2themehooks.php and its in my theme's (titled custom2) main folder.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •If I remove it and keep in my custom theme hook it prints the customtheme hook code at the top of the page. If I remove class.embedfriendlythemehooks.php and my customethemehook the page displays correctly. I'm not sure what the class.embedfriendlythemehooks.php does...
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Theme Charcha for great desktop and mobile experience! - drop me a message :)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •