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 to modify the button "start a new discussion" function?
The file called "newdiscussion.php" under the path "applications/vanilla/views/modules" , its code is
but now it tells me error
Fatal error: Call to a member function CheckPermission() on a non-object in /applications/vanilla/views/modules/newdiscussion.php on line 2
so what is the right way to do is? can anybody tell me? thanks
<?php if (!defined('APPLICATION')) exit();for the reason ,i want to the member can see the start button if he has the role permission, the member can not if he has no the role permission.
echo Anchor(T('Start a New Discussion'), '/post/discussion'.(array_key_exists('CategoryID', $Data) ? '/'.$Data['CategoryID'] : ''), 'BigButton NewDiscussion');</pre>
and I added some code into it.
<?php if (!defined('APPLICATION')) exit();
if ($Session->CheckPermission('Vanilla.Discussions.Add', TRUE, 'Category', $Discussion->PermissionCategoryID))
echo Anchor(T('Start a New Discussion'), '/post/discussion'.(array_key_exists('CategoryID', $Data) ? '/'.$Data['CategoryID'] : ''), 'BigButton NewDiscussion');
but now it tells me error
Fatal error: Call to a member function CheckPermission() on a non-object in /applications/vanilla/views/modules/newdiscussion.php on line 2
so what is the right way to do is? can anybody tell me? thanks
0
Comments
it would be nice to change the tittle of this discussion to a question... like: "how to...?" etc
if ($Session->CheckPermission('Vanilla.Discussions.Add', TRUE, 'Category', $Discussion->PermissionCategoryID))
but it still shows error ,so who can help me? thanks