prefix . "g_aths_plugin"); define('WP_g_aths_FAV', 'http://www.gopiplus.com/work/2010/07/18/announcement-ticker-highlighter-scroller/'); if ( ! defined( 'WP_g_aths_PLUGIN_BASENAME' ) ) define( 'WP_g_aths_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); if ( ! defined( 'WP_g_aths_PLUGIN_NAME' ) ) define( 'WP_g_aths_PLUGIN_NAME', trim( dirname( WP_g_aths_PLUGIN_BASENAME ), '/' ) ); if ( ! defined( 'WP_g_aths_PLUGIN_DIR' ) ) define( 'WP_g_aths_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . WP_g_aths_PLUGIN_NAME ); if ( ! defined( 'WP_g_aths_PLUGIN_URL' ) ) define( 'WP_g_aths_PLUGIN_URL', plugins_url() . '/' . WP_g_aths_PLUGIN_NAME ); if ( ! defined( 'WP_g_aths_ADMIN_URL' ) ) define( 'WP_g_aths_ADMIN_URL', admin_url() . 'options-general.php?page=announcement-ticker-highlighter-scroller' ); function g_aths_announcement() { global $wpdb; $g_aths = ""; $data = $wpdb->get_results("select g_aths_text from ".WP_g_aths_TABLE." where g_aths_status='YES' ORDER BY g_aths_order"); if ( ! empty($data) ) { $count = 0; foreach ( $data as $data ) { $g_athscontent = $data->g_aths_text; $g_aths = $g_aths . "g_aths_contents[$count]='$g_athscontent';"; $count++; } ?> get_var("show tables like '". WP_g_aths_TABLE . "'") != WP_g_aths_TABLE) { $wpdb->query(" CREATE TABLE IF NOT EXISTS `". WP_g_aths_TABLE . "` ( `g_aths_id` int(11) NOT NULL auto_increment, `g_aths_text` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `g_aths_order` int(11) NOT NULL default '0', `g_aths_status` char(3) NOT NULL default 'No', `g_aths_date` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`g_aths_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; "); $sSql = "INSERT INTO `". WP_g_aths_TABLE . "` (`g_aths_text`, `g_aths_order`, `g_aths_status`, `g_aths_date`)"; $sSql = $sSql . "VALUES ('This is sample text for announcement ticker highlighter scroller by gopiplus.com', '1', 'YES', '0000-00-00 00:00:00');"; $wpdb->query($sSql); } add_option('g_aths_title', "Announcement"); add_option('g_aths_title_display', "YES"); add_option('g_aths_width', "175"); add_option('g_aths_height', "85"); add_option('g_aths_css', "font: Verdana; color:black"); add_option('g_aths_delay', "3000"); add_option('g_aths_speed', "2"); add_option('g_aths_highlightcolor', "#F0EFEE"); add_option('g_aths_textcolor', "#DD4B39"); } function g_aths_admin_options() { global $wpdb; $current_page = isset($_GET['ac']) ? $_GET['ac'] : ''; switch($current_page) { case 'edit': include('pages/content-management-edit.php'); break; case 'add': include('pages/content-management-add.php'); break; case 'set': include('pages/widget-setting.php'); break; default: include('pages/content-management-show.php'); break; } } function g_aths_add_to_menu() { add_options_page( __('Announcement ticker highlighter scroller', 'announcement-ticker-highlighter-scroller'), __('Announcement ticker', 'announcement-ticker-highlighter-scroller'), 'manage_options', 'announcement-ticker-highlighter-scroller', 'g_aths_admin_options' ); } if (is_admin()) { add_action('admin_menu', 'g_aths_add_to_menu'); } function g_aths_widget($args) { extract($args); echo $before_widget . $before_title; echo get_option('g_aths_title'); echo $after_title; g_aths_announcement(); echo $after_widget; } function g_aths_control() { echo '

'; _e('Announcement ticker highlighter scroller', 'announcement-ticker-highlighter-scroller'); echo '. '; _e('Check official website for more information', 'announcement-ticker-highlighter-scroller'); ?>