Heading Font:
selected value="Arial">Arial
selected value="Helvetica">Helvetica
selected value="sans-serif">sans-serif
selected value="Merriweather">Merriweather
selected value="Georgia">Georgia
?php>?php>?php>?php>?php>
Heading Color:
Text Font:
selected value="Arial">Arial
selected value="Helvetica">Helvetica
selected value="sans-serif">sans-serif
selected value="Merriweather">Merriweather
selected value="Georgia">Georgia
?php>?php>?php>?php>?php>
Text Color:
Today: ?php>
Yesterday: ?php>
This Week: ?php>
This Month: ?php>
Total: ?php>
Currently Online: ?php>
'.sprintf(__("%s: Widget class not found. Make sure this widget exists and the class name is correct"),''.$class.'').'
'; else: $class = $wp_class; endif; endif; ob_start(); the_widget($widget_name, array(), array('widget_id'=>'arbitrary-instance-visitorcounterplugin_widget', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '' )); $output = ob_get_contents(); ob_end_clean(); return $output; } add_shortcode('visitor_counter','visitor_counter_plugin_widget_shortcode'); //Log user add_action( 'init', 'vcp_log_user' ); function vcp_log_user() { if(!vcp_check_ip_exist($_SERVER['REMOTE_ADDR'])){ global $wpdb; $table_name = $wpdb->prefix . 'vcp_log'; $sqlQuery = "INSERT INTO $table_name VALUES (NULL,'".$_SERVER['REMOTE_ADDR']."',NULL)"; $sqlQueryResult = $wpdb -> get_results($sqlQuery); } } function vcp_get_visit_count($interval='D') { global $wpdb; $table_name = $wpdb->prefix . 'vcp_log'; if($interval == 'C') $condition = "`Time` > DATE_SUB(NOW(), INTERVAL 5 HOUR)"; else if($interval == 'T') $condition = "1"; elseif($interval == 'D') $condition = "DATE(`Time`)=DATE(NOW())"; else if($interval == 'W') $condition = "WEEKOFYEAR(`Time`)=WEEKOFYEAR(NOW())"; else if($interval == 'M') $condition = "MONTH(`Time`)=MONTH(NOW())"; else if($interval == 'Y') $condition = "DATE(`Time`)=DATE(NOW() - INTERVAL 1 DAY)"; $sql = "SELECT COUNT(*) FROM $table_name WHERE ".$condition; $count = $wpdb -> get_var($sql); return $count; } function vcp_check_ip_exist($ip) { global $wpdb; $table_name = $wpdb->prefix . 'vcp_log'; $sql = "SELECT COUNT(*) FROM $table_name WHERE IP='".$ip."' AND DATE(Time)='".date('Y-m-d')."'"; $count = $wpdb -> get_var($sql); return $count; } global $vcp_db_version; $vcp_db_version = ‘1’; function vcp_install() { global $wpdb; global $vcp_db_version; $vcp_log_table = $wpdb->prefix . 'vcp_log'; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); $sql = " CREATE TABLE IF NOT EXISTS $vcp_log_table ( `LogID` int(11) NOT NULL AUTO_INCREMENT, `IP` varchar(20) NOT NULL, `Time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`LogID`) );"; dbDelta( $sql ); add_option( 'vcp_db_version', $vcp_db_version ); } function vcp_uninstall(){ global $wpdb; $vcp_log_table = $wpdb->prefix."vcp_log"; //Delete any options that's stored also? delete_option('vcp_db_version'); $wpdb->query("DROP TABLE IF EXISTS $vcp_log_table"); } register_activation_hook( __FILE__, 'vcp_install' ); register_deactivation_hook( __FILE__, 'vcp_uninstall' ); ?>?php >?php >?php>
Very nice sms
ReplyDelete