Here is the string:

$string"; EXIT; } return $return; } function advnote_get_string_between($string, $start, $end) { if (strstr($start,'%wildcard%')) { $start = str_replace("%wildcard%", ".*?", preg_quote($start, "/")); } else { $start = preg_quote($start, "/"); } if (strstr($end,'%wildcard%')) { $end = str_replace("%wildcard%", ".*?", preg_quote($end, "/")); } else { //echo $end;exit; $end = preg_quote($end, "/"); //echo $end; exit; } $regex = "/$start(.*?)$end/si"; if (preg_match($regex, $string, $matches)) return $matches[1]; else return false; } function advnote_template_dropdown($name, $tid) { $out = ""; $posts = get_posts( array( 'post_type' => 'advnote_templates', 'numberposts' => -1 ) ); if($posts ) { $out = ''; } else { $out = ''; } return $out; } function advnote_activate() { global $wpdb; if (function_exists('is_multisite') && is_multisite()) { $oldblog = $wpdb->blogid; $blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs")); $multisite = 1; } //print_r($blogids);exit; if (count($blogids)>1) { $count = count($blogids); } else { $count=1; } for ($i=0;$i<$count;$i++) { if ($multisite==1) { switch_to_blog($blogids[$i]); } //echo $wpdb->prefix; //echo "
"; $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}advnote_notifications ( id INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, post_id INT(20) NOT NULL, rules TEXT NOT NULL, styling TEXT NOT NULL, status INT(2) NOT NULL ) {$charset_collate};"; $result = $wpdb->get_results($sql, ARRAY_A); $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}advnote_ip ( id INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, notification_id INT(20) NOT NULL, rules TEXT NOT NULL, ip VARCHAR(20) NOT NULL, active INT(12) NOT NULL, count INT(12) NOT NULL ) {$charset_collate};"; $result = $wpdb->get_results($sql, ARRAY_A); $sql = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}advnote_options ( id INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, option_name VARCHAR(225) NOT NULL, option_value TEXT NOT NULL, status INT(12) NOT NULL ) {$charset_collate};"; $result = $wpdb->get_results($sql, ARRAY_A); $advnote_options['license_key'] = ""; $advnote_options['license_email'] = ""; $advnote_options['current_version'] = ADVNOTE_CURRENT_VERSION; //$advnote_options['permissions'] = "1.1.1.1.1.1.1"; //$advnote_options['popups_cookie_timeout'] = 7200; //print_r($advnote_options);exit; $advnote_options = json_encode($advnote_options); $sql = "INSERT INTO {$wpdb->prefix}advnote_options ( `id`,`option_name`,`option_value`,`status`) VALUES ('1','advnote_options','".mysql_real_escape_string($advnote_options)."','1')"; $result = $wpdb->get_results($sql, ARRAY_A); //if (!$result) { echo $query; echo mysql_error(); exit;} } //exit; if ($multisite==1) { switch_to_blog($oldblog); } } function advnote_remote_connect($url) { $method1 = ini_get('allow_url_fopen') ? "Enabled" : "Disabled"; if ($method1 == 'Disabled') { //do curl $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "$url"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_TIMEOUT, 60); $string = curl_exec($ch); } else { $string = file_get_contents($url); } return $string; } function advnote_activation_check() { global $table_prefix; global $advnote_options; global $wordpress_url; $global_advnote = $advnote_options['license_key']; $global_advnote_handle = $advnote_options['license_email']; $parse = parse_url($wordpress_url); $domain = $parse['host']; $url = "http://www.hatnohat.com/api/advanced-notifications/validate.php?key={$advnote_options['license_key']}&email={$advnote_options['license_email']}&domain={$domain}"; $return = advnote_remote_connect($url); if ($return=='1') { $advnote_options['permission'] =1; $advnote_options = json_encode($advnote_options); $sql = "INSERT INTO {$wpdb->prefix}advnote_options ( `id`,`option_name`,`option_value`,`status`) VALUES ('','advnote_options','".mysql_real_escape_string($advnote_options)."','1')"; $result = $wpdb->get_results($sql, ARRAY_A); $pm = 1; } else { $pm = 0; } } function advnote_activate_prompt() { $this_key = md5($wordpress_url.$_SERVER['REMOTE_ADDR']); //check for update echo "
"; ?>


License Key:
License Email:


Don't have a license key yet? Register Here!
Donate to Author  | "; //echo " Repair Tables  | "; //echo " Force Update  | "; echo " Support  | "; } function advnote_options_page() { ?> true, 'show_ui' => true, 'query_var' => true, )); $labels = array( 'name' => _x('Advanced Notifications', 'post type general name'), 'singular_name' => _x('Notifications', 'post type singular name'), 'add_new' => _x('Add New Notification', 'notification'), 'add_new_item' => __('Add New Notification'), 'edit_item' => __('Edit Notification'), 'new_item' => __('New Notification'), 'all_items' => __('All Notifications'), 'view_item' => __('View Notification'), 'search_items' => __('Search Notifications'), 'not_found' => __('No Notifications found'), 'not_found_in_trash' => __('No Notifications found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Notifications' ); $args = array( 'labels' => $labels, //'capabilities' => array('nothing'), 'capability_type' => 'post', 'public' => true, 'public_queryable' => true, 'query_var' => true, 'rewrite' => array('slug' => 'message'), 'has_archive' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_admin_bar' => true, 'menu_position' => null, 'taxonomies' => array('notification_cat'), 'menu_icon' => ADVANCEDNOTIFICATIONS_URLPATH.'images/notify.png', 'supports' => array('editor', 'title') ); register_post_type('notifications',$args); } add_action( 'init', 'advnote_init_my_template' ); function advnote_template_include($incFile) { global $wp; global $wp_query; //echo 1; exit; if ($wp->query_vars['post_type'] == 'advnote_templates') { if (have_posts()) { $file = ADVANCEDNOTIFICATIONS_PATH.'single-template.php'; $incFile = $file; } else { //echo 1; exit; $wp_query->is_404 = true; } } //echo $incFile; return $incFile; } //add_filter('template_include', 'advnote_template_include'); add_action('before_delete_post','advnote_delete_post'); add_action('trash_post','advnote_delete_post'); function advnote_delete_post($post_id) { global $table_prefix; $post_type = get_post_type( $post_id ); if ($post_type=='notifications') { $query = "UPDATE {$table_prefix}advnote_notifications SET status='0' WHERE post_id='$post_id' "; $result = mysql_query($query); if (!$result){ echo $query; echo mysql_error(); exit;} } } ?>