[pLog-svn] r3821 - in plugins/trunk: . badbehavior

Paul Westbrook paul at westbrooks.org
Fri Jul 28 20:24:54 GMT 2006


Hello,
    I changed false to FALSE to be consistant with the definition of  
the function.

The problem with the $prefix is that bb2_write_settings will write  
$prefix . table_name to the config, since settings returned by  
bb2_read_settings has appended the prefix to the settings array.

Now when bb2_write_settings reads the config, it will append the  
prefix again.


This causes all of the sql to fail, as it is attempting to use a  
table that doesn't exist.

--Paul


On Jul 28, 2006, at 12:40 PM, Mark Wu wrote:

> Hi Paul:
>
> I just revert the $prefix part. Thanks for the bug fix.
>
> But, I still don't get it. What's the different between FALSE and  
> false?
>
> Mark
>
>> -----Original Message-----
>> From: plog-svn-bounces at devel.lifetype.net
>> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of
>> mark at devel.lifetype.net
>> Sent: Saturday, July 29, 2006 3:03 AM
>> To: plog-svn at devel.lifetype.net
>> Subject: [pLog-svn] r3821 - in plugins/trunk: . badbehavior
>>
>> Author: mark
>> Date: 2006-07-28 19:03:02 +0000 (Fri, 28 Jul 2006) New Revision: 3821
>>
>> Modified:
>>    plugins/trunk/bad-behavior-lifetype.php
>>    plugins/trunk/badbehavior/pluginbadbehavior.class.php
>> Log:
>> Revert the $prefix part that modified by Paul in SVN rev. 3820.
>>
>> To separate the table and prefix is to avoid the trouble that
>> caused by user if he/she change his/her db prefix in some day
>> future for some reason.
>>
>> Modified: plugins/trunk/bad-behavior-lifetype.php
>> ===================================================================
>> --- plugins/trunk/bad-behavior-lifetype.php	2006-07-28
>> 17:34:27 UTC (rev 3820)
>> +++ plugins/trunk/bad-behavior-lifetype.php	2006-07-28
>> 19:03:02 UTC (rev 3821)
>> @@ -95,13 +95,13 @@
>>  	    include_once(
>> PLOG_CLASS_PATH."class/config/config.class.php" );
>>  		$config =& Config::getConfig();
>>  		$prefix = Db::getPrefix();
>> -		$logTable = $config->getValue( 'bb2_log_table',
>> $prefix . 'bad_behavior' );
>> +		$logTable = $config->getValue( 'bb2_log_table',
>> 'bad_behavior' );
>>  		$displayStats = $config->getValue(
>> 'bb2_display_stats', true );
>>  		$strict = $config->getValue( 'bb2_strict', false );
>>  		$verbose = $config->getValue( 'bb2_verbose', false );
>>  		$isInstalled = $config->getValue(
>> 'bb2_installed', false );
>>  		
>> -		return array('log_table' => $logTable,
>> +		return array('log_table' => $prefix . $logTable,
>>  					 'display_stats' =>
>> $displayStats,
>>  					 'strict' => $strict,
>>  					 'verbose' => $verbose,
>> @@ -157,4 +157,4 @@
>>  	$bb2_mtime = explode(" ", microtime());
>>  	$bb2_timer_stop = $bb2_mtime[1] + $bb2_mtime[0];
>>  	$bb2_timer_total = $bb2_timer_stop - $bb2_timer_start;
>> -?> \ No newline at end of file
>> +?>
>>
>> Modified: plugins/trunk/badbehavior/pluginbadbehavior.class.php
>> ===================================================================
>> --- plugins/trunk/badbehavior/pluginbadbehavior.class.php	
>> 2006-07-28 17:34:27 UTC (rev 3820)
>> +++ plugins/trunk/badbehavior/pluginbadbehavior.class.php	
>> 2006-07-28 19:03:02 UTC (rev 3821)
>> @@ -20,9 +20,10 @@
>>  			$this->author = "Mark Wu";
>>  			$this->locales = Array( "en_UK" , "zh_TW" );
>>  			$this->db =& Db::getDb();
>> -			
>> +		
>>  			$config =& Config::getConfig();
>> -			$this->_logTable = $config->getValue(
>> 'bb2_log_table' );
>> +			$prefix = Db::getPrefix();
>> +			$this->_logTable = $prefix .
>> $config->getValue( 'bb2_log_table' );
>>  			$this->_displayStatus =
>> $config->getValue( 'bb2_display_stats' );
>>  		}
>>
>> @@ -73,4 +74,4 @@
>>  			return $locale->pr( 'bb2_status',
>> $row['counter'] );
>>          }
>>  	}
>> -?>
>> \ No newline at end of file
>> +?>
>>
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>

--
Paul Westbrook
paul at westbrooks.org
<http://www.westbrooks.org>




More information about the pLog-svn mailing list