Actually, it's not a bad idea.
And I think it's easy to do :
Open :
- Code: Select all
Includes/functions.php
Find :
- Code: Select all
function obtain_word_list(&$orig_word, &$replacement_word)
{
global $db;
//
// Define censored word matches
//
$sql = "SELECT word, replacement
FROM " . WORDS_TABLE;
//Begin sql cache
//if( !($result = $db->sql_query($sql)) )
if( !($result = $db->sql_query($sql, false, true)) )
//End sql cache
{
message_die(GENERAL_ERROR, 'Could not get censored words from database', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
do
{
$orig_word[] = '#\b(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')\b#i';
$replacement_word[] = $row['replacement'];
}
while ( $row = $db->sql_fetchrow($result) );
}
return true;
}
Replace with :
- Code: Select all
function obtain_word_list(&$orig_word, &$replacement_word)
{
global $db, $userdata;
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
// Only return the censoring to guests users
if( $userdata['session_logged_in'] ) {
//
// Define censored word matches
//
$sql = "SELECT word, replacement
FROM " . WORDS_TABLE;
//Begin sql cache
//if( !($result = $db->sql_query($sql)) )
if( !($result = $db->sql_query($sql, false, true)) )
//End sql cache
{
message_die(GENERAL_ERROR, 'Could not get censored words from database', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
do
{
$orig_word[] = '#\b(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')\b#i';
$replacement_word[] = $row['replacement'];
}
while ( $row = $db->sql_fetchrow($result) );
}
} else {
$orig_word = $replacement_word = array();
}
// www.phpBB-SEO.com SEO TOOLKIT END
return true;
}
But, this means there won't be any censoring for logged users. And, if for example a word is censored in a topic title, it will thus be replaced in URL for guests, and AdSense will see the logged in version of it if the page is loaded by a logged in user.
This mean the zero duplicate would be necessary to avoid duplicate content, even if the problem should not occur that often.
Another way to turn around this would be to set up your AdSense account to filter such bad adds.
Though, this make me think that we could use a separate censoring word list for anything injected in URLs, but this would mean many more changes.
++