Hi everyone... I have been trying to find a solution for this all night, and I now must ask for help.
I am working on a website that uses datetime to schedule the publish time of an article. The website also has like buttons. Everything works well except when one clicks the like button it throws the following error:" Deprecated: Non-static method MyEvent::start_date() should not be called statically...." I have narrowed down the problem to the following kfunctions code, but cant figure out a way to fix it. Any help you offer will be greatly cherished.
I am working on a website that uses datetime to schedule the publish time of an article. The website also has like buttons. Everything works well except when one clicks the like button it throws the following error:" Deprecated: Non-static method MyEvent::start_date() should not be called statically...." I have narrowed down the problem to the following kfunctions code, but cant figure out a way to fix it. Any help you offer will be greatly cherished.
- Code: Select all
class MyEvent{
function start_date( $field ){
global $FUNCS;
$start_date = trim($field->get_data());
if( !preg_match('/(?:19|20)\d\d-(?:0[1-9]|1[012])-(?:0[1-9]|[12][0-9]|3[01])/', $start_date ) ){
return KFuncs::raise_error( "Incorrect date format" );
}
// Set publish_date to value of this field
$f = &$field->siblings[3];
$publish_date = trim( $f->get_data() );
if( $publish_date != '0000-00-00 00:00:00' ){
$start_date = $FUNCS->make_date( $start_date );
if( $publish_date != $start_date ){
$f->store_posted_changes( $start_date );
}
}
unset( $f );
return true;
}
}