The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Prevent Censored Words From Being Striped From Custom Fields?
Prevent Censored Words From Being Striped From Custom Not Visible Fields?
Is it possible to remove some code that strips the censored words we enter in the "Censored Words" field in the vbAdminCP. I need the censored words to NOT be stripped from our not visible custom fields. Example: I do not want my members to be able to post their last names. So I enter their last names in the Censored Words list and that works great. However... their last names are now lost in their custom fields in their profile that only admins were set to see. How can I stop the censored words from striping none visible custom fields? The site is running vb3.7x |
#2
|
||||
|
||||
BUMP! Lynn anyone please help.
|
#3
|
||||
|
||||
I know there's a 3.8 mod to disable the word censor per user... I know this isn't what you need but you could probably look at the code and get a good idea of where to start.
There's also this old one to disable per forum: https://vborg.vbsupport.ru/showthread.php?t=98269 |
#4
|
||||
|
||||
No sure that code helps at all. I have looked already. I need the censored words to not strip private fields. Nothing to do with forums or usergroups.
|
#5
|
|||
|
|||
I think you can edit includes/class_dm_user.pm. Around line 1208 or so, add the 'hidden' column to the query (scroll right to see what I changed):
Code:
// check extra profile fields $profilefields = $this->dbobject->query_read_slave(" SELECT profilefieldid, required, size, maxlength, type, data, optional, regex, def, editable, hidden FROM " . TABLE_PREFIX . "profilefield $all_fields_sql ORDER BY displayorder "); Then just below that around line 1235, I added the first two red lines and made a change in the line below that: Code:
if (in_array($profilefield['profilefieldid'], $field_ids) AND ($all_fields != 'register' OR $profilefield['editable'])) { if (!$profilefield['hidden']) $value = fetch_censored_text($value); $value = trim(substr($value, 0, $profilefield['maxlength'])); $value = (empty($value) AND $value != '0') ? false : $value; } Of course this doesn't bring back any data that's already been censored. |
#6
|
||||
|
||||
Ok I am trying this right now... I will report back.... THANKS!
I am sure you meant to edit the file: class_dm_user.php --------------- Added 29 Nov 2010 at 17:45 --------------- My code is a little different on vb3.7x Code:
if (in_array($profilefield['profilefieldid'], $field_ids) AND ($all_fields != 'register' OR $profilefield['editable'])) { if (!$profilefield['hidden']) $value = fetch_censored_text($value); $value = trim($value, substr(fetch_censored_text($value), 0, $profilefield['maxlength'])); $value = (empty($value) AND $value != '0') ? false : $value; --------------- Added [DATE]1291078374[/DATE] at [TIME]1291078374[/TIME] --------------- BINGO it looks like it worked perfectly! Added new censored word, rebuilt post cache, typed the word and its blocked but the private field still has the data! I run a very large international classroom website. The kids are not allowed to post their last names anywhere on the site. We collect the last names at registration time and then add their last names to the censored words. MUCH THANKS! |
#7
|
|||
|
|||
It could be different because mine came from v3.8.3, but it could also be that I made it confusing by not including before/after code, just the "after". Here's before/after:
Code:
if (in_array($profilefield['profilefieldid'], $field_ids) AND ($all_fields != 'register' OR $profilefield['editable'])) { $value = trim(substr(fetch_censored_text($value), 0, $profilefield['maxlength'])); $value = (empty($value) AND $value != '0') ? false : $value; } Code:
if (in_array($profilefield['profilefieldid'], $field_ids) AND ($all_fields != 'register' OR $profilefield['editable'])) { if (!$profilefield['hidden']) $value = fetch_censored_text($value); $value = trim(substr($value, 0, $profilefield['maxlength'])); $value = (empty($value) AND $value != '0') ? false : $value; } ETA: Posted that before you repsonded. Kind of surprised that works - you may want to make sure it matches what I posted, I think your "trim" has too many params to it and might work by accident. |
#8
|
||||
|
||||
A larger chunk of my code around these lines is:
Code:
if (in_array($profilefield['profilefieldid'], $field_ids) AND ($all_fields != 'register' OR $profilefield['editable'])) { if (!$profilefield['hidden']) $value = fetch_censored_text($value); $value = trim($value, substr(fetch_censored_text($value), 0, $profilefield['maxlength'])); $value = (empty($value) AND $value != '0') ? false : $value; } else if ($all_fields == 'register' AND $profilefield['data'] !== '') { $value = unhtmlspecialchars($profilefield['data']); } else { continue; } $customfields .= "$profilefield[title] : $value\n"; $regex_check = true; You said: Quote:
|
#9
|
|||
|
|||
I think this line:
Code:
$value = trim($value, substr(fetch_censored_text($value), 0, $profilefield['maxlength'])); Should be: Code:
$value = trim(substr($value, 0, $profilefield['maxlength'])); ETA: ...but it's not a big deal, I'm pretty sure it will be OK the way it is. |
#10
|
||||
|
||||
Quote:
The Next Step: My next step that I have to get solved is how to code a php file so I can pull from my database that one private field which would generate a list of my members last names... any takers on this one??? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|