Introduce yourself here! In order to avoid spam, new users must first comment on the discussion in the 'Introductions' before they become 'full members'
Is it possible to disable comments?
  • I have had a look at the Wiki, done a search, etc. but can't find an answer to this.

    I want to be able to create entries but I will NEVER have a use for comments, so can I remove/disasble this functionality globally?

    At the least, I'd like to not have an "add a comment" link associated with each entry and to have the "Comments Locked" option checked by default.

    Ideally, this functionality would be disabled.

    Suggestions/comments gratefully accepted.

    Cheers,

    Alph
  • First of all, I'm not sure what you mean, but try this:

    Remove in the theme you use in file "entry-default.tpl" these lines like in static.tpl:


    <li class="link-comments">
    <a href="{$id|link:comments_link}#comments">{$comments|tag:comments_number}
    {if isset($views)}(<strong>{$views}</strong> views){/if}</a>
    </li>

    So there is no comment link under each entry. How to disable the comments globaly, I also don't know.
  • Ahh..I see it, thanks.

    This prevents DISPLAY of comments, but I worry that someone familiar with FlatPress could still hit the comments page directly and ENTER them...then I would have a lot of useless, unreadable comments lying around.

    Thanks.

    Alph
  • I didn't try this code, but I think it should work:
    save this as fp-plugins/locker/plugin.locker.php then enable Locker from the plugin panel
    Note: this does not actually flag a post as locked. Should you disable this plugin, every entry would become again unlocked.

    <?php
    /*
    Plugin Name: Locker
    Plugin URI: http://www.flatpress.org/
    Description: Locks comments globally
    Author: NoWhereMan (E.Vacchi)
    Version: 1.0
    Author URI: http://www.nowhereland.it
    */

    function plugin_locker_entry() {
    global $smarty;
    $smarty->assign('entry_commslock', true);
    }

    add_action('entry_block', 'plugin_locker_entry');




    as a bonus, this should lock comments after a defined amount of days (useful to fight spam)
    save this as fp-plugins/expire/plugin.expire.php then enable Expire in the plugin panel

    <?php
    /*
    Plugin Name: Expiring Entries
    Plugin URI: http://www.flatpress.org/
    Description: Locks comments globally after a defined amount of days
    Author: NoWhereMan (E.Vacchi)
    Version: 1.0
    Author URI: http://www.nowhereland.it
    */

    function plugin_expire_entry() {
    $MAX_DAYS = 10;
    global $post, $smarty;
    $now = time();
    $date = $post['date'];
    $smarty->assign('entry_commslock', $now-$date > $MAX_DAYS*3600*24);
    }

    add_action('entry_block', 'plugin_expire_entry');

  • I've added the link to the wiki! :)
  • I'll try it.

    MANY, many thanks for the quick reply.

    Cheers,

    Alph
  • Posted By: marcoverga86I've added the link to the wiki! :)


    but are they working? :D
  • I don't know! I've written (Not tested)...
  • fixed expire: days have 24 hours :p btw working and ass-kicking :D
  • Great plugin, I was having some trouble with an old entry attracting spam comments. Could the expire plugin be made to change or exclude the "Leave a comment" text, or, when someone clicks on it, show "commenting has been disabled for this post" or something similar?
  • I tried to use this plugin (fp-plugins/locker/plugin.locker.php written above by NoWhereMan) to disable all comments on my website:

    <?php<br />/*
    Plugin Name: Locker
    Plugin URI: http://www.flatpress.org/
    Description: Locks comments globally
    Author: NoWhereMan (E.Vacchi)
    Version: 1.0
    Author URI: http://www.nowhereland.it
    */

    function plugin_locker_entry() {
    global $smarty;
    $smarty->assign('entry_commslock', true); }

    add_action('entry_block', 'plugin_locker_entry');



    But once activated it and entered on one article on my website, I got this error:

    Warning: fopen(/view_counter.txt) [function.fopen]: failed to open stream: Permission denied in /home/mhd-01/www.guerrenelmondo.it/htdocs/fp-includes/core/core.fileio.php
    on line 10

    At moment I've disabled plugin, however above I've written the error.
    Can someone help me ?
    Thanks

  • It's not this plugin, it's the views counter plugin, but now I don't know why it tries to save in /.
  • Now I've big problem. If I'm login and clicking on any article, it's all ok. Instead, if I'm not logged in and I click on an article, above appear an error:
    Warning: fopen(/view_counter.txt) [function.fopen]: failed to open stream: Permission denied in /home/mhd-01/www.warsintheworld.com/htdocs/fp-includes/core/core.fileio.php on line 10

    You can try to go on my website, www.warsintheworld.com and click on some article, you'll see the error.
    I've already gone on Mantain and clicked on Rebuild index, Purge theme and templates cache and Restore file permissions but without resolving. I've updated version of FlatPress, but I've not seen any error, maybe only when I've used plugin.locker.php or plugin.expire.php (that I've already deleted these plugin).
    Someone can help me ?
  • I've answered already in the other discussion, btw disable PostViews plugin
  • Hi all, I'm testing FlatPress for my school, but teachers and students editors team ask me to add a plugin that (1) can make comments visible only (2) after a 'check/flag' added by administrators/editors which (3) receive an e-mail on every new comment posted on the blog. The (3) part is already available in Options, I've positively tested it. For the (2) and (1) part I suppose that I need to modify the 'entry-default' and 'commedit' functions to add a flag to make a comment as 'visible' or 'not visible' so administrator can check or uncheck it. Any idea or suggestion, I'm relatively new to php.
    Thanks in advance, Paolino
  • I'm try to use 'loggedin' flag in comments as a flag to make visible or not comments. I've activated notification by e-mail when a user write a comment, the comment will be saved with 'loggedin'=false tha make it 'invisible', when admin receive e-mail notification check 'loggedin' flag in 'commedit' (I've already activated it, but it wan't save the flag :-( at this time). I've not found where FlatPress save the comments.
    Where is that 'function' ? in which .php files ?
    Anybody can help ?
    Thanks in advance...
    Paolino
  • The only way to get what you ask is by mean of a plugin. There isn't any plugin available for that, though. (At least, not that I'm aware of)
  • To add a function to make comments visible only after approval by admin and also a function to disable comments generally (maybe for a while) would be more than a great feature. For me it would be a killer feature, because i like this wonderful lightweighted and flatpress cms a lot, but without these features it is useless for me. Especially in Germany a webmaster has an increased responsability by law for everything that is on his site and who wants to get in trouble because of some unteachable morons if it should not be necessary?
  • I've solved the question hacking a bit flatpress data. I've used the flag loggedin to make comments visible or not. This was my start idea: when a common user (not admin/logged) write a post FP store it as without the flag loggedin, so if I activate the notify by email and when the admin log into FP to watch for new comments he can edit the comment (because I've hacked a bit the commedit function) and make it visibile by change the loggedin status of the comment.
    I'll post soon every changes I've made in some .php and .tpl files of FP to obtain the solution. If you want to see how it work visit www.lcbs.it, here a brief list of my hacking (I know that this is NOT THE solution, it will must be a plugin or perahps something else, but for now it works...):
    /fp-interface/sharedtpls/commentadminctrls.tpl
    > modified the link that apeear above comments to permit edit it by admin when logged
    /fp-interface/lang/it-it/lang.admin.entry.php
    > added translation strings for 'commedit' function
    /admin/panels/entry/admin.entry.commentlist.tpl
    > hided delete link and added an edit link on the right for every comment
    /admin/panels/entry/admin.entry.commedit.php
    > modified redirect to related post with comments after saved comment
    /admin/panels/entry/admin.entry.commedit.tpl
    > made readonly every input except for loggedin flag to make comment visible
    /fp-interface/themes/lilliput_2/comments.tpl
    > modified to make comments not visible if tey haven't loggedin flag
    /fp-interface/sharedtpls/comment-form.tpl
    > added a comment to explain that comments are moderate by admin and to clear data after comment is posted by user
  • a little more efforts and this could go in a plugin... if only I had the time...
    (a plugin is way better, because it's more maintainable!)
  • 1) Has been implemented this feature in the plugin?
    2) Can you add in the plugin the ability to change the number of days from the admin panel?
    3) Can the administrator continues to put the comments after the expiration date?
  • Paolino, could you post a diff file so someone else (e.g. me) can start from your work and develop a "real" plugin?
  • SVN access from SourceForge is very slow, at least from my location, so I mirrored the source code repository on Bitbucket: https://bitbucket.org/alexandrul/flatpress

    Feel free to fork it or send patches.
  • hey that's nice. Is that an actual mirror, or you have to update it all the time?
  • I'll update it from time to time (at least once a week). Did you think about a DVCS migration? I prefer Mercurial instead of Git because of the better Windows support: http://stackoverflow.com/questions/2550091/best-support-now-on-windows-mercurial-or-git/2575991#2575991
  • I prefer Mercurial over Git for the same reason, but I'm not sure about migrating
  • Well, the mirror is there anyway. If you make an Bitbucket account, I'll be happy to give you admin rights on the repo, or mail you the local imported repo from SVN in order to quickly create your own repo on Bitbucket (or if you want to mirror it yourself, the import from SVN works faster if done in 50 revs steps).
  • Is the function to make comments visible only after approval by admin realized or ist it still in programming process. As an Austrian I have the same problem than the guy from Germany!
    Best regards,
    G.
  • Hi,

    I used this coding and found error, then I corrected that error and now my all comments locked.
    First you need to create one folder in fp-plugins with name of locker and inside that create one PHP file with the name of plugin.locker.php
    it should be look like this fp-plugins/locker/plugin.locker.php then enable Locker from the plugin panel
    you can use this coding

    <?php
    /*
    Plugin Name: Locker
    Plugin URI: http://www.flatpress.org/
    Description: Locks comments globally
    Author: NoWhereMan  (E.Vacchi)
    Version: 1.0
    Author URI: http://www.nowhereland.it
    */

    function plugin_locker_entry() {
      global $smarty;
      $smarty->
    assign('entry_commslock', true);
      }
     
      add_action('entry_block', 'plugin_locker_entry');
    ?>

  • The plugin doesn't work, in fact on article:

    http://www.guerrenelmondo.it/index.php/2010/04/13/ogaden-united-western-somali-liberation-front-uwslf-accetta-di-deporre-le-armi-dopo-30-anni-di-guerra/

    Spam create always directory called "comments" inside article and is full of spam.
    In the article I've disable the code where to insert commnets, is not visible, but, seems that is possible to write spam inside. So, do you have an urgent solution ??
    I could rename name of article or (disable comments like I've done now with option inside article), it is visible badly.
    Any way to resolve it ?
    Thanks.
  • I've watched, even I've plungin locker enabled, my website is full of comments spam, hundres even thousands of files of comments. What I've to do to stop comments, I can delete part of files where is possible to write comments ?
    Thanks you

    VERY URGENT !!!
    Also enabling locker for no comments, also renaming file comments.tpl (in all themes I have), I've always comments. I've zipped all website, put in my computer and searched for virus or malware, but there are not in all website. So where is the problem ??? How I can't prevent to write comments by spam and create subdirectory comments in many articles I write ??  Thanks you. Answer me please !!!



    Update:
    I've enabled all, also anti-spam, seems woorks for now. But I've received thousands of comments for 8 mega in less than 30 minutes on my website. However, now if you go on every article and click on "Aggiungi un commento ", webpage  is visibile very badly, left column vanished and right column goes down. How can I resolve this problem ?

    Thank you
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion