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 can I add a second"Post Comment" form on the discussion page?

smoigecomsmoigecom New
edited July 2011 in Vanilla 2.0 - 2.8
I was trying to add a second form right after the title but I haven't figured it out. Please help.
Tagged:

Best Answer

  • lucluc ✭✭
    Answer ✓
    I think you should modify this one (in a theme)
    applications/vanilla/views/discussion/index.php

    Around line 66, you should have (I'm checking this on latest unstable, hence line numbers might not be the same).

    if ($Session->IsValid() && $Session->CheckPermission('Vanilla.Comments.Add', TRUE, 'Category', $this->Discussion->PermissionCategoryID)) {
    echo $this->FetchView('comment', 'post');
    }
    and add the same thing on the same file where you want it to go.
    I'd say around the Event "BeforeDiscussion"

    As there is an event, I'd say, maybe you can use a plugin too (hence no need to modify the view if you change themes).

Answers

  • lucluc ✭✭
    Answer ✓
    I think you should modify this one (in a theme)
    applications/vanilla/views/discussion/index.php

    Around line 66, you should have (I'm checking this on latest unstable, hence line numbers might not be the same).

    if ($Session->IsValid() && $Session->CheckPermission('Vanilla.Comments.Add', TRUE, 'Category', $this->Discussion->PermissionCategoryID)) {
    echo $this->FetchView('comment', 'post');
    }
    and add the same thing on the same file where you want it to go.
    I'd say around the Event "BeforeDiscussion"

    As there is an event, I'd say, maybe you can use a plugin too (hence no need to modify the view if you change themes).
  • It worked. Thank you so much.
  • smoigecomsmoigecom New
    edited July 2011
    @luc How can I give them individual styles? If I change the CSS it affects both. Nevermind ... got it. Maybe someone else will find this useful.

    echo str_ireplace("CommentForm","CommentForm newClass",$this->FetchView('comment', 'post'));
  • lucluc ✭✭
    Well, you might be better off copying the comment.php in your theme, to commentnew.php and modify the class there.
    With your change, it seems hacky, and if they change the global visual for the box, you will have the same one easily without breaking you. But if they change the class name, your display won't be OK and you will have to change the code again, something that will not be needed if you create your own view.
  • Ok ... I currently have a comment.php here themes/EmbedFriendly/views/discussion/ is that the one you're talking about?
  • lucluc ✭✭
    Are you using EmbedFriendly theme?
  • yes ... i shouldn't ?
  • lucluc ✭✭
    edited July 2011
    That's OK, that was just to know.
    Because otherwise, you should have used another comment file, the one in applications/vanilla/views/discussion/.

    But as you're using that theme, yes that's the one you should copy and modify, and obvisouly, if you call it comment_above.php, the FetchView should use comment_above instead of comment.
  • Cool. Thank you. I ll try it out and see how that goes.
  • Be sure that you have never had any regrets in chanel australia which only lasts for a few decades. Chanel online or cry as you like, and it is me aningless to oppress chanel australia online.

  • Apart from Borse hermes, only time could wear everything away. While feeling is being processed by hermes birkin, conflicts would be reconciled as time goes by, just like a cup of tea that is being continuously diluted.

Sign In or Register to comment.