![]() |
User Optional Word Censorship
User Optional Word Censorship
What this hack does The default censorship options in VB are all or nothing, in other words it is either enabled or disabled for all users regardless of their personal preference. Without any additional SQL calls and an extremely low runtime impact (on top of the resource usage required when using the censor in the first place), this hack gives the user the option to view your forum with the AdminCP configured censor switched on if you have it enabled. How to install In summary the install requires:
So this is what you need to do: First create a custom user profile field:
* These options set the text that is displayed to the user, feel free to customise/change these to whatever you want. All the AdminCP work is done now, so if you want logout. The next step is to make a small file edit, to check this field value when VB calls the censor code.
The last, and most critically important step is:
Footnotes By default the censor will be off for all users, so they will have to change their profile in order to enabled this. I could not find a way to create a profile checkbox field that is checked by default, and describing how to run SQL scripts to set the field value is more complicated than I wanted to go with this simple hack. So if anybody knows how to do this post the details and I will update the article. In the meantime a simpler option (rather than playing with the DB) is to use "Yes" / "No" radio buttons and set the default value to Yes (or no if you prefer). If you do this you will also have to subtly change the code above from: Code:
if ((isset($vbulletin->userinfo['field5'])) && ($vbulletin->userinfo['field5'] != "Yes")) Code:
if ((isset($vbulletin->userinfo['field5'])) && ($vbulletin->userinfo['field5'] != "Yes")) |
Because you just never know ;)
|
I've been wanting this! Thanks!
|
Nominated!
although I'm in favor of free speech :p |
Even without queries, parsing the post every display can really rack up resource usage. Formatting and displaying the post is more intensive than pulling it from the database. How do you work around this?
|
Quote:
|
Yeah, but it prevents you from using the postcache which is created on edit of the post and stores the post in its parsed state to be shown on the screen without running BBCode and censor parsing at runtime.
|
In which case take the issue up your VB development team as the issue you have is with default VB code/architecture and is most certainly beyond the scope of this 2 minute hack.
|
Dosn't work, just makes the screen go white and nothing else.
This is my code, i might of missed something obvious.. PHP Code:
|
Anyone?
|
All times are GMT. The time now is 08:51 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|