Changed at 13 July 05 / 15:37
I couldn't wait so I went ahead and patched a little bit. Hope this helps. By the way, "call_user_func" is used instead of "call_user_method" which is deprecated.
Filename: fields/class.Field.php
<?php
function isValid() {
// is a validator set?
if(isset($this->_sValidator) && $this->_sValidator != null) {
// if it's an array, it's a method
if (!is_array($this->_sValidator)) {
// is the validator a user-spicified function?
if( function_exists($this->_sValidator) ) {
$error = call_user_func( $this->_sValidator, $this->getValue() );
} else {
$v =& new Validator();
if(method_exists($v, $this->_sValidator)) {
// call the build in validator function
$error = $v->{$this->_sValidator}( $this->getValue() );
} else {
trigger_error("Unknown validator: '".$this->_sValidator."' used in field '".$this->_sName."'");
$error = false;
}
}
} else {
// check if the method exists
if(method_exists($this->_sValidator[0], $this->_sValidator[1])) {
$error = call_user_func(array($this->_sValidator[0], $this->_sValidator[1]), $this->getValue());
} else {
trigger_error(
"Error, the validator method '".$this->_sValidator[1]."' does not exists ".
"in object '".get_class($this->_sValidator[0])."'!",
E_USER_ERROR);
$error = false;
}
}
Changed at 13 July 05 / 15:38
I apologize that I had a typo and missed a line in the original post (I've already fixed both in the post above) -- I had a "$$" in line 103 and I missed $error = false in line 107.
For your information, a typical user validator application would be "check in the database to find duplications (e.g. user name)".
I apologize that I had a typo and missed a line in the original post (I've already fixed both in the post above) -- I had a "$$" in line 103 and I missed $error = false in line 107.
For your information, a typical user validator application would be "check in the database to find duplications (e.g. user name)".
Np, I had allready changed these faults so the code in the download is OK. Can I ask where your from?
I will give you two files for both Traditional and Simplified Chinese. Typically, they have different encoding schemes (BIG5 and GB2312) but I think I'll just use UTF-8.
Since your forum system doesn't use UTF-8, please give me your email address (you can find my email in your registration records) so I can send you the files.