How to disable html on the posts?
-
Hi all,
I have been searching on this forum and on the plugins to find a way to disable html on the posts(by members). Although I found this post but it was not resolved –
The best would be admin can use html or lets say preferred members/senior members (which can be decided by admin, perhaps through post count plus control panel)
Is there any plugins to do these or is there any solution?
I would appreciate your input.
Thanks
-
Hi _ck_ any input on the above post?
Any other takers?
I have written a plugin that does what you want but isn’t released to the public.
The code that follow deactivate all HTML tags. Keep in mind that it’s not tested at all.
<?php
/*
Plugin Name: zaerl No HTML
Plugin URI: http://www.zaerl.com
Description: no HTML tags in posts
Author: zaerl
Author URI: http://www.zaerl.com
Version: 0.1
*/
function za_nh_allow_tag($tags)
{
return array();
}
function za_nh_initialize()
{
add_filter('bb_allowed_tags', 'za_nh_allow_tag');
}
add_action('bb_init', 'za_nh_initialize');
?>If you are interested contact me.
Thanks zaerl, where would you paste this?
Create a php file, paste the text and save it in the plugin folder.
Keep in mind that, obviously, it is not retroactive. Preexisting posts aren’t affected.
**Keep in mind that, obviously, it is not retroactive. Preexisting posts aren’t affected.**
Yap I know that, I posted few new posts (by non admin member) just to test it
I am not a professional programmer but I think if we can change the code (maybe on post.php file?) where it says “make” http:// and www. texts to hyperlink, maybe it will work?
Just a thought by the way
Ciao Amico
Hai trovato una soluzione?
Grazie
I am not a professional programmer but I think if we can change the code (maybe on post.php file?) where it says “make” http:// and www. texts to hyperlink, maybe it will work?
One question, one topic.
Unfortunately that plugin isn’t working in my bbPress 0.9.0.6
Does any one else have any other solutions?
You need to post far more details about what you are trying to do and what exactly is “not working”.
In theory that plugin should work fine and you can even make it conditional so admin can post html code but not members.
Not sure why he does it after bb_init, so try it plain like this.
<?php
/*
Plugin Name: zaerl No HTML
*/
function za_nh_allow_tag($tags) {return array();}
add_filter('bb_allowed_tags', 'za_nh_allow_tag',999);
?>Should be all you need.
Hi _CK_,
I am trying to make the forum as users can’t post html links i.e if they post a site link on their topic, it will become non click able plain text but only admin can post a html link on the topic.
After implementing Zaerl’s plugin it is still allowing html links on the post. I tested vigorously – all of the posts were made by different non admins (basic members)
I just tested your plugin as well but it is still the same. It is not converting the html links to plain text I’m afraid.
<?php
/*
Plugin Name: zaerl No HTML
*/
function za_nh_allow_tag($tags) {return array();}
add_filter('bb_allowed_tags', 'za_nh_allow_tag',999);
remove_filter('post_text', 'make_clickable');
?>Happy?
Ah, see that was your problem we didn’t know about because of how you weren’t explaining it – bbpress makes plain text links clickable.
Thanks for following up on that zaerl.
*Happy?*
Yap ! this time it’s working perfectly! Thanks a ton to both of you.
That means using this plugin, no html is supported at all on the topics?
Is it possible to improve this plugin a little bit as –
1. It will allow admin to post any clickable links(including outgoing) on the the topics
2. It will allow anyone to post clickable links ONLY when the link is from the same domain as the forum? (internal links)
To give an example, lets say this plugin is activated in bbpress.org.
A member post a topic saying
“Buy cheap Viagra from http://www.cheapest-vira-xyz.info” <– this link would be plain text.
“A member post a topic saying “Has any one got this working? https://bbpress.org/forums/topic/cant-switch-themes-in-081” <– this link would be clickable
again if any member post a topic saying “have you read this bbPress blog here ? https://www.bbpress.org/blog/latest/bla-bla-bla-bla” <– this link would be clickable as they are from the same domain as the forum
If the above functions can be implemented on this plugin, that would be a brilliant tool to put off most of the spammers.
minervaa, your post was blocked as spam because it looked … spammy. Rescued now
My last post also disappeared! It was a thank you to Chrishajer by the way
Is it possible to improve this plugin a little bit
Yes but it’s a personal request. Contact me if you need those changes. za AT zaerl.com.
another email sent.
Thanks zaerl, where would you paste this?
You need to copy paste those code in a text file then rename it as .php.After that it will become a plugin and you can opload it on your plugin folder.
If you want, you can download the same file from this link. I put some extra information (i.e. description, url etc) on the plugin.
http://www.mediafire.com/file/kx0ir4p71tmalpz/Zaerl-no-html.php
*****************************************************
Is it possible to improve this plugin a little bit as –
1. It will allow admin to post any clickable links(including outgoing) on the the topics
2. It will allow anyone to post clickable links ONLY when the link is from the same domain as the forum? (internal links)
To give an example, lets say this plugin is activated in bbpress.org.
A member post a topic saying
“Buy cheap Viagra from http://www.cheapest-vira-xyz.info” <– this link would be plain text.
“A member post a topic saying “Has any one got this working? https://bbpress.org/forums/topic/cant-switch-themes-in-081” <– this link would be clickable
again if any member post a topic saying “have you read this bbPress blog here ? https://www.bbpress.org/blog/latest/bla-bla-bla-bla” <– this link would be clickable as they are from the same domain as the forum
If the above functions can be implemented on this plugin, that would be a brilliant tool to put off most of the spammers.
******************************************************************
Any tips from anyone?
(You need to copy paste those code in a text file then rename it as .php.After that it will become a plugin and you can opload it on your plugin folder.
If you want, you can download the same file from this link. I put some extra information (i.e. description, url etc) on the plugin.)
thanks minervaa..
- You must be logged in to reply to this topic.