.
*/
if (!class_exists('WPGreetBox')) {
class WPGreetBox {
var $homepage = 'http://omninoggin.com/wordpress-plugins/wp-greet-box-wordpress-plugin/';
var $name = 'wp_greet_box';
var $version = '5.5.5';
var $visit_delta = null;
function WPGreetBox() {
// Version check
global $wp_version;
$this->handle_load_domain();
if (version_compare($wp_version,"2.7","<"))
exit(__('WP Greet Box '.$version.' requires WordPress 2.7 or newer. Please update!', $this->name));
}
// Localization support
function handle_load_domain()
{
// get current language
$locale = get_locale();
if(!empty($locale)) {
// locate translation file
$mofile = $this->get_plugin_dir().'lang/'.str_replace('_', '-', $this->name).'-'.$locale.'.mo';
// load translation
if(@file_exists($mofile) && is_readable($mofile)) load_textdomain($this->name, $mofile);
}
}
function get_default_options() {
return array(
'version' => $this->version,
'before_greet' => '
',
'after_greet' => '
',
'before_icon' => '
',
'after_icon' => '
',
'before_text' => '
',
'after_text' => '
',
'exclude_referrer' => 'friendfeed.com'.chr(10).'google.com/reader',
'can_close' => 1,
'regex_rules' => 0,
'show_post' => 1,
'show_page' => 0,
'position' => 'before',
'show_link' => 1,
'show_advanced_options' => 0,
'show_related' => 1,
'show_related_excerpt' => 1,
'target_blank' => 0,
'open_related' => 0,
'enable_css' => 1,
'enable_js' => 1,
'cache_compatible' => 1,
'show_logged_in' => 0,
'related_limit' => 5,
'related_excerpt_len' => 20,
'related_position' => 'after',
'rss_link' => get_bloginfo('rss_url'),
'email_link' => '',
'message_default' => array(
'disable' => 0,
'icon' => $this->get_plugin_url().'images/rss_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 1,
'timeout' => 14400,
'text' => 'Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.'
),
'message_noscript' => array(
'disable' => 0,
'icon' => $this->get_plugin_url().'images/rss_icon.png',
'icon_link' => '[[rss-link]]',
'text' => 'Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.'
),
'messages' => array(
array(
'referrer' => 'del.icio.us, delicious.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/delicious_icon.png',
'icon_link' => 'http://delicious.com/save?jump=yes&url=[[escaped-permalink]]&title=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello fellow Delicious user! Feel free to bookmark this page for future reference if you like it!'
),
array(
'referrer' => 'digg.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/digg_icon.png',
'icon_link' => 'http://digg.com/submit?url=[[escaped-permalink]]&title=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello fellow Digger! If you like this article, please help me out by giving me some digg love!'
),
array(
'referrer' => 'google.*',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/google_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 1,
'timeout' => 1440,
'text' => 'Welcome Googler! If you find this page useful, you might want to subscribe to the RSS feed for updates on this topic.'
),
array(
'referrer' => 'stumbleupon.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/stumbleupon_icon.png',
'icon_link' => 'http://www.stumbleupon.com/submit?url=[[escaped-permalink]]&title=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello fellow Stumbler! Don\'t forget to give me a thumbs up and subscribe to the RSS feed if you like this page!'
),
array(
'referrer' => 'technorati.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/technorati_icon.png',
'icon_link' => 'http://technorati.com/faves?add=[[escaped-permalink]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello fellow Technorati user! Don\'t forget to favorite this blog if you like it!'
),
array(
'referrer' => 'twitter.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/twitter_icon.png',
'icon_link' => 'http://twitthis.com/twit?url=[[escaped-permalink]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello fellow Twitter user! Don\'t forget to Twit this post if you like it, or follow me on Twitter if you find me interesting.'
),
array(
'referrer' => 'search.yahoo.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/yahoo_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 1,
'timeout' => 1440,
'text' => 'Welcome fellow Yahooligan! If you find this page useful, you might want to subscribe to the RSS feed for updates on this topic.'
),
array(
'referrer' => 'search.live.com, search.msn.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/live_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 1,
'timeout' => 1440,
'text' => 'Hello there Live-ly searcher! If you find this page useful, you might want to subscribe to the RSS feed for updates on this topic.'
),
array(
'referrer' => 'blinklist.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/blinklist_icon.png',
'icon_link' => 'http://blinklist.com/blink?u=[[escaped-permalink]]&t=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there fellow Blinklist user! Feel free to bookmark this page for future reference if you like it!'
),
array(
'referrer' => 'blogmarks.net',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/blogmarks_icon.png',
'icon_link' => 'http://blogmarks.net/my/new.php?mini=1&url=[[escaped-permalink]]&title=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Blogmarks user! Feel free to bookmark this page for future reference if you like it!'
),
array(
'referrer' => 'diigo.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/diigo_icon.png',
'icon_link' => 'http://secure.diigo.com/post?url=[[escaped-permalink]]&title=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Diigo user! Feel free to bookmark this page for future reference if you like it!'
),
array(
'referrer' => 'facebook.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/facebook_icon.png',
'icon_link' => 'http://www.facebook.com/share.php?u=[[escaped-permalink]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Facebook friend! If you like this article, please help spread the word by sharing this post with your friends.'
),
array(
'referrer' => 'furl.net',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/furl_icon.png',
'icon_link' => 'http://www.furl.net/items/new?r=&v=1&c=&u=[[escaped-permalink]]&t=[[escaped-title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Furl user! Please feel free to bookmark this page for future reference if you like it.'
),
array(
'referrer' => 'ma.gnolia.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/magnolia_icon.png',
'icon_link' => 'http://ma.gnolia.com/bookmarklet/add?url=[[escaped-permalink]]&title=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Magnolia user! Please feel free to bookmark this page for future reference if you like it.'
),
array(
'referrer' => 'mister-wong.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/mrwong_icon.png',
'icon_link' => 'http://www.mister-wong.com/index.php?action=addurl&bm_url=[[escaped-permalink]]&bm_description=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Mister Wong user! Please feel free to bookmark this page for future reference if you like it.'
),
array(
'referrer' => 'myspace.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/myspace_icon.png',
'icon_link' => 'http://www.myspace.com/Modules/PostTo/Pages/?l=3&u=[[escaped-permalink]]&t=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there friend of MySpace! If you like this article, please help spread the word by sharing this post with your friends.'
),
array(
'referrer' => 'newsvine.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/newsvine_icon.png',
'icon_link' => 'http://www.newsvine.com/_tools/seed?popoff=0&u=[[escaped-permalink]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Newsvine user! If you find this article useful, please remember to vote for this article on Newsvine.'
),
array(
'referrer' => 'reddit.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/reddit_icon.png',
'icon_link' => 'http://www.reddit.com/submit?url=[[escaped-permalink]]&title=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there fellow Reddit user! If you like this article, please remember to vote for this article on Reddit.'
),
array(
'referrer' => 'simpy.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/simpy_icon.png',
'icon_link' => 'http://www.simpy.com/simpy/LinkAdd.do?href=[[escaped-permalink]]&title=[[title]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Simpy user! Please feel free to bookmark this page for future reference if you like it.'
),
array(
'referrer' => 'example.com',
'disable' => 1,
'icon' => $this->get_plugin_url().'images/favorite_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there! If you are new here, you might want to subscribe to the RSS feed for updates on this topic.'
),
array(
'referrer' => 'netvibes.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/netvibes_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Netvibes user! If you find this article useful, then you should consider subscribing to the RSS feed in your feed reader.'
),
array(
'referrer' => 'youtube.com',
'disable' => 1,
'icon' => $this->get_plugin_url().'images/youtube_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there YouTuber! If you like my videos, feel free to subscribe to my RSS feed for more of my video updates.'
),
array(
'referrer' => 'flickr.com',
'disable' => 1,
'icon' => $this->get_plugin_url().'images/flickr_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Flickr user! If you like my photo, you might want to subscribe to my RSS feed to receive regular photo updates.'
),
array(
'referrer' => 'wordpress.org',
'disable' => 1,
'icon' => $this->get_plugin_url().'images/wordpress_icon2.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there WordPress lover! If you are new here, you might want to subscribe to my RSS feed to receive regular WordPress updates.'
),
array(
'referrer' => 'tumblr.com',
'disable' => 1,
'icon' => $this->get_plugin_url().'images/tumblr_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Tumblr user! If you are new here, you might want to subscribe to my RSS feed to receive regular updates.'
),
array(
'referrer' => 'friendfeed.com',
'disable' => 1,
'icon' => $this->get_plugin_url().'images/friendfeed_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there FriendFeed user! If you are new here, you might want to subscribe to my RSS feed. Also, feel free to follow me on FriendFeed.'
),
array(
'referrer' => 'plurk.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/plurk_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there fellow Plurker! If you are new here, you might want to subscribe to my RSS feed. Also, feel free to follow me on Plurk.'
),
array(
'referrer' => 'linkedin.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/linkedin_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there LinkedIn user! If you are new here, you might want to subscribe to my RSS feed for more updates on this topic or read more about me on the about page.'
),
array(
'referrer' => 'bing.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/bing_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 1,
'timeout' => 1440,
'text' => 'Hello there Bing decision maker! If you find this page interesting, you might want to subscribe to the RSS feed for updates on this topic.'
),
array(
'referrer' => 'wikio.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/wikio_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Wikio user! If you find this article useful, then you should consider subscribing to the RSS feed in your feed reader.'
),
array(
'referrer' => 'scoopeo.com',
'disable' => 0,
'icon' => $this->get_plugin_url().'images/scoopeo_icon.png',
'icon_link' => '[[rss-link]]',
'show_till_close' => 0,
'timeout' => 0,
'text' => 'Hello there Scoopeo user! If you find this article useful, then you should consider subscribing to the RSS feed in your feed reader.'
)
)
);
}
function activate() {
global $wpdb;
$wpdb->hide_errors();
$wpdb->query('ALTER TABLE '.$wpdb->posts.' ENGINE = MYISAM;');
$wpdb->query('ALTER TABLE '.$wpdb->posts.' ADD FULLTEXT '.$this->name.'_post_related (post_title, post_content);');
$wpdb->show_errors();
$this->upgrade_options();
}
function need_upgrade() {
$wpgb_options = get_option($this->name);
if ( array_key_exists('version', $wpgb_options ) ) {
$old_version_arr = split('\.', $wpgb_options['version']);
$new_version_arr = split('\.', $this->version);
for($i = 0; $i < 3; $i++)
{
if ( (int)$new_version_arr[$i] > (int)$old_version_arr[$i] ) {
return true;
}
elseif ( (int)$new_version_arr[$i] < (int)$old_version_arr[$i] ) {
return false;
}
}
return false;
}
return true;
}
function check_version() {
// check WP version
global $wp_version;
if (!empty($wp_version) && is_admin() && version_compare($wp_version,'2.7','<')) {
_e('
You are using WordPress version ', $this->name);
echo $wp_version;
_e('. WP Greet Box recommends that you use WordPress 2.7 or newer. Please update!
', $this->name);
}
// check WP Greet Box version
if ( $this->need_upgrade() ) {
$this->upgrade_options();
_e('