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.
How enable in only one category
multplaneta
New
Comments
The "Ask a Question" button is displayed via the NewQuestionModule. In
/plugins/QnA/class.qna.plugin.php
, I created a new method called_AddNewQuestionModule()
like so:Then I replaced the following lines with
$this->_AddNewQuestionModule($Sender)
:Finally, I added the following to the
/conf/config.php
file: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.
@hgtonight Hi thanks answer. But now the QnA plugin dont enable.
here say: The addon could not be enabled because it generated a fatal error:
If you could post the error, I could help you debug it.
If someone else could try my changes for some more data points, I would appreciate it.
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.
Only appear that: The addon could not be enabled because it generated a fatal error:
Dont show the error, and another thing wen i edit the class.qna.plugin.php with
private function _AddNewQuestionModule($Sender) { $CategoryID = $Sender->CategoryID; if(C('Plugins.QnA.CategoryID') != $CategoryID) { return; } if(C('Plugins.QnA.UseBigButtons')) { $QuestionModule = new NewQuestionModule($Sender, 'plugins/QnA'); $Sender->AddModule($QuestionModule); } }
give a sintax error at Dreamweaver
@hgtonight i what line i add you method?
You can put it anywhere as long as it is in the class declaration and not in any other method.
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.
@hgtonight now i can enable the plugin, but i still see the button in all categories.
Sorry for the trouble! And tanks for the atention!
Please post your modified file.
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.
@hgtonight here the class.qna.plugin.php
Try this file here: http://pastebin.com/raw.php?i=0bPM3SXx
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.
@hgtonight Thanks, now i have to category ID in this:
$Configuration['Plugins']['QnA']['CategoryID'] = 2;
If I have, where i find the ID of the category?
Thanks for the patience!
Load up the category on your site. The URL should look something like:
http://forums.example.com/categories/the-watercooler
Once you have the category you like displayed, append
.json
to the controller to view the underlying data. E.g.http://forums.example.com/categories.json/the-watercooler
The CategoryID should be the first item.
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.
@hgtonight Thanks, is working, you are Awsome!!!!!!