Blog's comments: always allowed

Hi, all!

I want to delete the form of choosing a blog's comment.

I find code in mod\blog\views\default\blog\forms\edit.php

<div id="blog_edit_sidebar">
<div id="content_area_user_title"><h2>
{$conversation}</h2>< /div> <div class="allow_comments">
<p><label>
<input type="checkbox" name="comments_select" {$comments_on_switch} /> {$allowcomments}
</label></p>
</div>
</div>

...and I delete it

Next...

I need to allow comments on the blog, when someone adds a new post or editing an old post.

I try editing these files:
mod\blog\views\default\object\blog.php
mod\blog\views\default\totem\forms\edit.php
mod\blog\actions\add.php
mod\blog\actions\edit.php

That codes:

$comments_on = get_input('comments_select','Off');

also

if ($vars['entity']->comments_on == 'Off') {
$comments_on = false;
} else {
$comments_on = true;
}

 

But..nothing :-(

How can I do the blog's comments will always be allowed without the form for allow/disallow its?
Need solution

Thanks

  • You could set it as a hidden input on the form that's always set to on. That might save you a bit of coding. That way users don't have control over the choice. I'll think about adding this as a feature to the robust blog plugin currently in production.

  • the robust_blog plugin currently has a bug where the comments field is set to off, even when it has been set to on previously and the form is then re-opened..

    i think it works best as defaulting to on and only being off when someone deliberately chooses off.

  • Or is that what you want? It is unclear to me from your post ...

  • Thanks very much for your answers, folks.

    But I don't search easy ways ;-)

    @Trajan If I create hidden input form then I can see the unneeded code's text in the source code of the blog's page . It's not correctly, imho

    @tunist I want to create the non-default form

    I think need to link in the file mod\blog\views\default\blog\forms\edit.php

    this code: 

    if($comments_on)
    $comments_on_switch = "checked=\"checked\"";
    else
    $comment_on_switch = "";

    with this code:

    <div id="blog_edit_sidebar">
    <div id="content_area_user_title"><h2>{$conversation}</h2></div>
    <div class="allow_comments">
    <p><label>
    <input type="checkbox" name="comments_select"  checked="checked"/> {$allowcomments}
    </label></p>
    </div>
    </div>

    then to pass into the code of other files

    $comments_on = get_input('comments_select','Off');

    option for allowed comments

    But how to do it? 

    Maybe, you know the simple solution?

  • @Kevin Jardine Thanks, I'm checking this plugin right now

    ...No it's not what I need. 

    This plugin makes comments editable. 

    I need to get the user can't disable comments on the blog posts. 

    I need to get all the comments allowed

  • Hi SubCrew:

    In English you would say "I want to prevent blog writers from disabling comments."

    This seems like a strange idea to me. Why shouldn't people be able to disable comments on their own blog posts? I would never sign up for a site where I couldn't do that.

    But yes, to do this you could just remove the form element to do this on the blog edit view.

  •  

    @Kevin Jardine Excuse me for my English :(

    Yes, it's a strange idea. You're right. But I need a solution.

    you could just remove the form element to do this on the blog edit view.

    If I delete the form, the comments are not allowed by default (Elgg 1.7.7)

    Need to change the code for $ comments_on.

    I'm looking for a solution. Welcome your advice )

    Thank you for your help

  • Hi, again!

    I know how do it!

    Into file

    elgg\mod\blog\views\default\blog\forms\edit.php

    change code

    if ($vars['entity']->comments_on == 'Off') {

    $comments_on = false;

    } else {

    $comments_on = true;

    }

    on

    if ($vars['entity']->comments_on == 'On') {

    $comments_on = true;

    delete code

    $conversation = elgg_echo('blog:conversation');

    delete code

    else

    $comment_on_switch = "checked=\"checked\";

    delete code

    <div id="blog_edit_sidebar">

    <div id="content_area_user_title"><h2>{$conversation}</h2></div>

    <div class="allow_comments">

    <p><label>

    <input type="checkbox" name="comments_select"  {$comments_on_switch} /> {$allowcomments}

    </label></p>

    </div>

    </div>

    Into file

    elgg\mod\blog\actions\edit.php

    and file

    elgg\mod\blog\actions\add.php

    change this code

    $comments_on = get_input('comments_select','Off');

    on

    $comments_on = get_input('comments_select','On');

    And in to this file

    elgg\mod\blog\views\default\object\blog.php

    need change also

    if ($vars['entity']->comments_on == 'Off') {

    $comments_on = false;

    } else {

    $comments_on = true;

    }

    as

    if ($vars['entity']->comments_on == 'On') {

    $comments_on = true;

    It's work for me very well!