' . __('Notifications settings','attention-bar') . '

'; echo '
'; settings_fields( 'pd_nb_settings' ); echo '

' . __('Settings','attention-bar') . '

'; echo '
' . __('Inline = scrolls with the page, Fixed = stays on top of the screen also when scrolling the page','attention-bar') . '
' . __('Can contain # color codes (for ex: #ffffff = white) or simply white, red','attention-bar') . '
' . __('Display in milliseconds (for ex: 2000 = 2 seconds)','attention-bar') . '
' . __('Height of the bar in pixels','attention-bar') . '
' . __('Height of the button in pixels (button is visible when the bar is colapsed)','attention-bar') . '
' . __('When the site is visited the bar is colapsed by default, it will be expanded after this delay (in milliseconds)','attention-bar') . '
' . __('Enabled','attention-bar') . ' ' . __('Disabled','attention-bar') . ' ' . __('When enabled, the colapsed or expanded position of the bar will be saved in a cookie, for future visits','attention-bar') . '
' . __('Can contain # color codes (for ex: #ffffff = white) or simply white, red','attention-bar') . '

'; } // entries page function nb_sub_entries() { if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } echo '

' . __('Notifications entries','attention-bar'); if (isset($_REQUEST['edit'])) { echo ' ' . __('New entry','attention-bar') . '

'; } else { echo ''; } if ( !empty($_POST) && check_admin_referer('nb_submit','nb_nonce') ){ if($_POST['notbar_hidden_post'] == 'Y') { if($_POST['notbar_hidden_edit'] == 'Y') { nb_edit_entry($_POST['nb_id']); echo '

' . __('Updated:','attention-bar') . ' ' . $_POST['nb_name'] . '

'; } else { nb_insert_entry($_POST['nb_name'],$_POST['nb_content'],$_POST['nb_status'], $_POST['nb_timebegin'], $_POST['nb_timeend']); echo '

' . __('Saved:','attention-bar') . ' ' . $_POST['nb_name'] . '

'; } } } if (isset($_REQUEST['delete'])) { nb_delete_entry($_REQUEST['id']); echo '

' . __('Deleted:','attention-bar') .' ' . $_REQUEST['id'] . '

'; } if (isset($_REQUEST['changestatus'])) { nb_change_status($_REQUEST['id'],$_REQUEST['status']); echo '

' . __('Status changed:','attention-bar') . ' ' . $_REQUEST['id'] . '

'; } global $wpdb; $table_name = $wpdb->prefix . "nb_data"; $myrows = $wpdb->get_results( "SELECT * FROM " . $table_name ); echo ''; echo ''; echo ''; foreach ($myrows as $myrows) { if ($myrows->status == 1) { $status = __('Enabled','attention-bar'); $changestatus = 0; } else { $status = __('Disabled','attention-bar'); $changestatus = 1; } if ($myrows->timebegin == null) { $timebegin = __('Not set','attention-bar'); } else { $timebegin = $myrows->timebegin; } if ($myrows->timeend == null) { $timeend = __('Not set','attention-bar'); } else { $timeend = $myrows->timeend; } $deletelink = 'admin.php?page=pd_nb_entries&delete&id=' . $myrows->id; $changestatuslink = 'admin.php?page=pd_nb_entries&changestatus&id=' . $myrows->id . '&status=' . $changestatus; $editlink = 'admin.php?page=pd_nb_entries&edit&id=' . $myrows->id; if ($myrows->status == 1) { echo ''; } else { echo '"; } } echo '
ID ' . __('Time to display','attention-bar') . ' ' . __('Name','attention-bar') . ' ' . __('Content','attention-bar') . ' ' . __('Time created','attention-bar') . ' ' . __('Status','attention-bar') . '
ID ' . __('Time to display','attention-bar') . ' ' . __('Name','attention-bar') . ' ' . __('Content','attention-bar') . ' ' . __('Time created','attention-bar') . ' ' . __('Status','attention-bar') . '
' . $myrows->id . 'B: ' . $timebegin . '
E: ' . $timeend . '
' . $myrows->name . '' . esc_html(stripslashes($myrows->content)) . '' . $myrows->timecreated . '' . $status . '
' . $myrows->id . "B: " . $timebegin . "
E: " . $timeend . '
' . $myrows->name . "" . esc_html(stripslashes($myrows->content)) . "" . $myrows->timecreated . '' . $status . "
'; // reset values $beginvalue = ''; $endvalue = ''; $namevalue = ''; $contentvalue = ''; $edithidden = 'N'; $statusenabledvalue = "checked"; $statusdisabledvalue = ""; $idhidden = ''; // check if we are in edit mode if (isset($_REQUEST['edit'])) { $table_name = $wpdb->prefix . "nb_data"; $editrow = $wpdb->get_results( "SELECT * FROM " . $table_name . ' WHERE id = ' . $_REQUEST['id'] ); foreach ($editrow as $editrow) { $beginvalue = $editrow->timebegin; $endvalue = $editrow->timeend; $namevalue = $editrow->name; $contentvalue = $editrow->content; $edithidden = "Y"; $idhidden = $editrow->id; if ($editrow->status == 0) { $statusdisabledvalue = "checked"; $statusenabledvalue = ""; } else { $statusdisabledvalue = ""; $statusenabledvalue = "checked"; } } } echo '

New / edit entry

'; echo ' '; wp_nonce_field('nb_submit','nb_nonce'); echo '
' . __('Enabled','attention-bar') . '
' . __('Disabled','attention-bar') . '

'; } if ( is_admin() ) { add_action("admin_init", "nb_admin_init"); add_action('admin_menu', 'nb_init_admin_menu'); } add_action("plugins_loaded", "nb_widget_init"); add_action('init', 'nb_init_scripts'); add_action('wp_print_styles', 'nb_init_stylesheets'); ?>