' . $messages . '
';
}
switch($options['type']){
case 'error':
$type = '';
break;
default:
$type = '
';
break;
}
$message = 'ATTENTION-BAR: ' . $message;
switch ($options['dismiss']) {
case 'version':
$notice = $type . $dismissversion . $message;
break;
case 'beta':
$notice = $type . $dismissbeta . $message;
break;
}
$notice .= '
';
echo $notice;
}
function nb_admin_notices() {
global $wp_version;
if(get_option('pd_nb_installnotification') != NB_VERSION) {
switch (NB_VERSION) {
case '0.7.1.1':
if (get_option('pd_nb_db_convertepoch') == 'true'){
nb_notice( __('All your existing time schedules have been converted to epoch timing, check your schedules asap!','attention-bar'),array('type'=>'notice','dismiss'=>'version'));
}
break;
}
}
if (version_compare($wp_version,"3.2",">") && version_compare(get_option('pd_nb_betanotification'),NB_VERSION,"<")){
if($_REQUEST['versioncheck'] != true) {
nb_notice(
__('You are using a beta version of WordPress: ','attention-bar') . $wp_version . __(' it is possible that there are problems with Attention bar in combination with this WordPress version!','attention-bar'),
array('type'=>'error','dismiss'=>'beta'));
}
}
}
function nb_get_time($request) {
$time = date(get_option('date_format') . ' ' . get_option('time_format'),(int)$request);
return $time;
}
function nb_get_current_time() {
return date('Y-m-d H:i:s',time());
}
function nb_get_tztime($request) {
if (function_exists('date_default_timezone_set')) {
$timezone = date_default_timezone_get();
date_default_timezone_set(get_option('timezone_string'));
$time = date(get_option('date_format') . ' ' . get_option('time_format'),(int)$request);
date_default_timezone_set($timezone);
} else {
$time = date(get_option('date_format') . ' ' . get_option('time_format'),(int)$request);
}
return($time);
}
function nb_get_edit_time($request) {
if (!empty($request)) {
return date('Y-m-d H:i:s',(int)$request);
}
}
function nb_get_tzepoch_time($request) {
if (function_exists('date_default_timezone_set')) {
$timezone = date_default_timezone_get();
date_default_timezone_set(get_option('timezone_string'));
$phptime = date('Y-m-d H:i:s',(int)$request);
date_default_timezone_set($timezone);
} else {
$phptime = date('Y-m-d H:i:s',(int)$request);
}
return strtotime($phptime);
}
function nb_get_info_box() {
$info = '
';
return $info;
}
?>