Anti Troll
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Anti Troll
Hi!
when I experimented with removing COMMENTFORM (for the disqus plugin) I also experienced problems doing it the way I suggested here, which worked for you.
I am not quite sure why it would work on one installation. Could it be the order of your event plugins, or some different template?
Regards,
Garvin
when I experimented with removing COMMENTFORM (for the disqus plugin) I also experienced problems doing it the way I suggested here, which worked for you.
I am not quite sure why it would work on one installation. Could it be the order of your event plugins, or some different template?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Anti Troll
I tried everything from installing all live plugins to my sandbox to removing all plugins from the live blog. Both systems differ somehow, but I don’t know how. I makes me want to tear my hear out!
has content on frontend_display, but I can’t set it with or
Oh wait, I tried something while typing…
The comment form IS deleted but only if there are comments in the entry.
Example: With comment / without comments (you have to deactivate cookies to see it…)
Perhaps COMMENTFORM is only set (and editable) on the frontend_display events that output the comments?
Code: Select all
$serendipity['smarty']->get_template_vars('COMMENTFORM')
Code: Select all
$serendipity['smarty']->assign(array('COMMENTFORM'=>''))
Code: Select all
$serendipity['smarty']->assign('COMMENTFORM','')
The comment form IS deleted but only if there are comments in the entry.
Example: With comment / without comments (you have to deactivate cookies to see it…)
Perhaps COMMENTFORM is only set (and editable) on the frontend_display events that output the comments?
Re: Anti Troll
I haven't tried this myself, but maybe this could work?
Code: Select all
$name = 'COMMENTFORM';
if (isset($this->_tpl_vars[$name])) {
unset($this->_tpl_vars[$name]);
}
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Anti Troll
No, this doesn’t help.
I found out the reason:
Nearly no hook contains Smarty var $COMMENTFORM, only the frontend_display that shows the comments in an entry. This is the only chance to clear the $COMMENTFORM. If there are no comments, there is no comment frontend_display, so $COMMENTFORM can’t be cleared.
That’s sad, because the only other possibility is $eventData['allow_comments'] = 'false', but that shows an alert with "The author does not allow comments to this entry". I think that’s a bit too hard and noticeable for people that have cookies deactivated.
I found out the reason:
Nearly no hook contains Smarty var $COMMENTFORM, only the frontend_display that shows the comments in an entry. This is the only chance to clear the $COMMENTFORM. If there are no comments, there is no comment frontend_display, so $COMMENTFORM can’t be cleared.
That’s sad, because the only other possibility is $eventData['allow_comments'] = 'false', but that shows an alert with "The author does not allow comments to this entry". I think that’s a bit too hard and noticeable for people that have cookies deactivated.
Re: Anti Troll
What happens if you use
Code: Select all
$eventData['commentform'] = false; // we dont want the {$COMMENTFORM}
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Re: Anti Troll
There is no hook that contains the index 'commentform' in $eventData.
Re: Anti Troll
Sorry, but I don't really understand what you are trying to do....
As far as I understand, you don't want {$COMENTFORM} in special cases and want to set it back.
You are complaining that there is no commenform to set back. But this is what you want, why complain ...? Confusing....
Did you try and just set back the alert if this is the only problem with
As far as I understand, you don't want {$COMENTFORM} in special cases and want to set it back.
You are complaining that there is no commenform to set back. But this is what you want, why complain ...? Confusing....
Did you try and just set back the alert if this is the only problem with
Code: Select all
$eventData['allow_comments'] = 'false';
@define('COMMENTS_CLOSED', '');
Regards,
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Ian
Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Anti Troll
Hi!
In the disqus problem I solved that in the end with an ugly hack. I simply emit CSS that hides the .commentform thing....
In the disqus problem I solved that in the end with an ugly hack. I simply emit CSS that hides the .commentform thing....
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Anti Troll
@Timbalu:
$COMMENTFORM is a Smarty variable, it is not available in $eventData.
Surely $COMMENTFORM is defined in the core, but it is only shown in the hook frontend_display that shows comments. There it is possible to do $COMMENTFORM="". But if an entry has no comments, I have no access to $COMMENTFORM, so I can’t delete it.
Your code example is a nice idea, but you can't change a constant while runtime. That’s why they are called constants.
Even if it would work, the CSS box would be still visible.
@garvinhicking:
Nice idea, too. But the form would be visible in sourcecode. With todays browsers it's not that hard to change the CSS with developer tools.
I think I will add a Smarty variable that I can use in the entries.tpl to hide the comment form as another option. It’s not that nice and easy but it works.
$COMMENTFORM is a Smarty variable, it is not available in $eventData.
Surely $COMMENTFORM is defined in the core, but it is only shown in the hook frontend_display that shows comments. There it is possible to do $COMMENTFORM="". But if an entry has no comments, I have no access to $COMMENTFORM, so I can’t delete it.
Your code example is a nice idea, but you can't change a constant while runtime. That’s why they are called constants.
Even if it would work, the CSS box would be still visible.
@garvinhicking:
Nice idea, too. But the form would be visible in sourcecode. With todays browsers it's not that hard to change the CSS with developer tools.
I think I will add a Smarty variable that I can use in the entries.tpl to hide the comment form as another option. It’s not that nice and easy but it works.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Anti Troll
Hi!
Yeah, the sourcecode would be there, but since you can still/also handle and reject and submitted comments, this wouldn't help the people anything if they use dev tools to change the css...
Regards,
Garvin
Yeah, the sourcecode would be there, but since you can still/also handle and reject and submitted comments, this wouldn't help the people anything if they use dev tools to change the css...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Disqus Ever going to work?
I have followed the forums code by code regarding the Desqus plugin. Does it have a chance? Or should move shop to word press?
Thanks,
Jeri
Thanks,
Jeri
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Disqus Ever going to work?
Hi!
The disqus plugin should work...this thread is not really about disqus, did you read it?
Regards,
Garvin
The disqus plugin should work...this thread is not really about disqus, did you read it?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/