Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla fatal error Call to undefined function AdminCheck()
steam
✭
Hello,
I think its an interesting plugin but the latest version of vanilla falls with:
Fatal error: Call to undefined function AdminCheck() in /planamigo.org/applications/vanilla/views/discussions/index.php on line 6
Can someone help me activate it?
Tagged:
0
Comments
This is an interesting plugin, but I wouldn't suggest using it. It depends on a view override that has changed significantly since this plugin was last updated.
I would suggest modifying the plugin to use a simple hook rather than a view override to add a category specific class. Something like:
That should remove the requirement of the view override.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Go to the dashboard and edit a category of yours: add a value in the field "Css Class". Then look at the html source of a discussion: the body element will look similar to this
<body id="vanilla_discussion_index" class="Vanilla Discussion Index Section-Discussion Section-CssClassValue">
That means that you do not have to use a plugin to style discussions. Now you can use the great plugin CSSEdit to add this code to your css:
Thanks for reply.
Does you mean override default.php with your code ?
class kCategoryColorsPluin extends Gdn_Plugin {
public function discussionsController_beforeDiscussionName_handler($sender) {
$sender->EventArguments['CssClass'] .= ' Category_' . $sender->EventArguments['Discussion']->CategoryID;
}
}
I'm a new on this framework, if you can explain in more detail will appreciated.
I have also seen that the class kCategoryColors uses a database connection. This class need?
I think this should be more simple ...
Thanks.
Thanks for reply.
R_J - Your solution seems to be perfect!
Does you mean like this ?
http://www.planamigo.org/discussions
Do you know how can I put color to all li discussion area ?
Thanks in advance.
Oops! Seems like I have misread what that plugin does! I thought you were trying to change the in a discussion like that: www.planamigo.org/discussion/2 but you try to color the list entries of the recent discussion page.
So the approach of @hgtonight is the way to go.
I have seen that I have category style on the database table - category.
Now using "hgtonight" function I could concatenate category style but I don't know how can I get
this value from $sender or something else...
I intended my modification to replace the view override you are asked to overwrite core files with.
Everything else should "just work".
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
It's not good idea to override core ... I'll think of some solution with styles by using your function.
Hope I made no error in there...
Save that as
/plugins/DiscussionsCategoryClass/class.discussionscategoryclass.plugin.php
and you can create a css file/plugins/DiscussionsCategoryClass/design/discussionscategoryclass.css
where you can save the custom css for your categories. You will be able to access them as - in your example - ".Category-catSelfBank {background-color: yellow}"I'll upload that one later - and when I tested it a little bit - to the addon section and to GitHub...
The plugin info is longer than the real code - a reason why I love Vanilla!
I will try your new plugin . Thanks.
Do you now how can I override urls ? /categories/categoria-test2 to /categorias/categoria-test2
inglish - categories spanish - categorias
The same problem en articles and activity
/article/2015/my-first-article
I need to change .htaccess o can localized properties or something else ?
Thanks.
I guess it is possible but not easy. That question has been asked several times, but I must admit I have no clue what the result has been...
Here's a start:
https://www.google.de/?gws_rd=ssl#safe=off&q=site:vanillaforums.org+change+discussions+url
And here are some random hits:
http://vanillaforums.org/discussion/13226/resolved-change-discussions-url-name
http://vanillaforums.org/discussion/16924/how-to-change-url-discussions-mine
http://vanillaforums.org/discussion/28492/creating-user-friendly-urls-throughout-whole-forum
http://vanillaforums.org/discussion/28400/how-to-change-category-slug-url
http://vanillaforums.org/discussion/11018/easy-ways-to-change-the-url-from-discussion
Look what I found!
http://vanillaforums.org/discussion/28382/is-it-possible-to-change-the-background-of-posts-in-recent-discussions
I have corrected a bit your code to work.
<?php if (!defined('APPLICATION')) exit(); $PluginInfo['DiscussionsCategoryClass'] = array( 'Name' => 'Discussions Category CSS Class', 'Description' => 'Adds categories css class to discussions in discussion lists.', 'RequiredApplications' => array('Vanilla' => '>= 2.1.10'), 'Version' => '0.1', 'Author' => 'R_J', 'MobileFriendly' => true, 'HasLocale' => false, 'AuthorUrl' => 'http://vanillaforums.org/profile/44046/R_J', 'License' => 'MIT' ); class DiscussionsCategoryClass extends Gdn_Plugin { public function base_beforeDiscussionName_handler($sender) { $categoryModel = new CategoryModel(); $category = $categoryModel->getID($sender->EventArguments['Discussion']->CategoryID); $cssClass = $category->CssClass; if ($cssClass != '') { $sender->addCssFile('discussionscategoryclass.css', 'plugins/DiscussionsCategoryClass'); $sender->EventArguments['CssClass'] .= " Category-$cssClass"; } } }
But for some reason does not pick up style ... I've seen that style is imported and created
I haven't seen your message )))
It's working now...!!! Thanks...
Thanx for the plugin @R_J .