apply_filters ('__wps__friendaccepted_filter', $friend_to, $current_user->ID, $current_user->display_name);		

			// send email
			$friend_to_email = $wpdb->get_var($wpdb->prepare("SELECT user_email FROM ".$wpdb->base_prefix."users WHERE ID = %d", $friend_to));
			
			$body = "<h1>".sprintf(__("%s request accepted", WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend'))."</h1>";
			$body .= "<p>".sprintf(__("Your %s request to %s has been accepted", WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend'), $current_user->display_name)."</p>";
			
			$profile_url = __wps__get_url('profile');
			$profile_url .= __wps__string_query($profile_url)."uid=".$current_user->ID."&view=friends";
			$body .= "<p>".__("Go to", WPS_TEXT_DOMAIN)." <a href='".$profile_url."'>".get_bloginfo('name')."</a>...</p>";
			
			__wps__sendmail($friend_to_email, sprintf(__("%s request accepted", WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend')), $body);
			
			// Tell friends
			if (!get_option(WPS_OPTIONS_PREFIX.'_wps_lite') && __wps__is_plus()) {
				$userdata = get_userdata($friend_to);
				$profile_url = __wps__get_url('profile');
				$profile_url .= __wps__string_query($profile_url);
				$post = __('Has made friends with', WPS_TEXT_DOMAIN).' <a href="'.$profile_url."uid=".$current_user->ID.'">'.$current_user->display_name.'</a>';
				$post = '<br /><div style="float:left;">'.get_avatar($current_user->ID, 32).'</div>'.$post;
				__wps__add_activity_comment($friend_to, $userdata->display_name, $friend_to, $post, 'friend');
			}

			// Hook for further actions
			do_action('symposium_friend_request_accepted_hook', $friend_to, $current_user->ID);	
			
		}
	
		echo $friend_to;		
	} else {
function __wps__header() {

	if (__wps__required()) {

		include_once(dirname(__FILE__).'/styles.php');	
	
		$has_bronze_plug_actived = has_bronze_plug_actived();

		// Check activation code due to expire if Bronze member plugin activated
		// If you use Bronze features without an activation code, and remove this notice you are in breach of the licence		
		if ($has_bronze_plug_actived && !__wps__is_plus()) {
			echo '<div style="border:1px solid #000; text-align:center; background-color:white; color: black; font-size:12px; padding:6px 12px 6px 12px; margin-left:auto; margin-right:auto; margin-top:10px; margin-bottom:10px; border-radius:5px;">';
			echo sprintf(__('You have activated a <a href="'.get_admin_url().'admin.php?page=symposium_debug">Bronze+ %s feature</a>, but you have not entered your <a href="'.get_admin_url().'admin.php?page=symposium_debug">Activation Code</a>.', WPS_TEXT_DOMAIN), WPS_WL).' ';
			echo sprintf(__('Get one on the <a href="http://www.wpsymposium.com/membership" target="_blank">Membership page</a> on the %s website.', WPS_TEXT_DOMAIN), WPS_WL);
			echo '</div>';
		}		
	
		if (WPS_DEBUG) {
			echo '<div style="overflow:auto; border:1px solid #000; background-color:#ccc; color: black; font-size:12px; padding:6px 12px 6px 12px; margin-left:auto; margin-right:auto; margin-top:10px; margin-bottom:10px; border-radius:5px;">';
			echo '<input style="float:right" id="symposium_deactivate_debug" type="submit" value="'.__('De-activate', WPS_TEXT_DOMAIN).'" />';
			echo '<strong>'.sprintf(__('%s Debug Mode', WPS_TEXT_DOMAIN), WPS_WL).'</strong><br />';
	
			global $wp_rewrite;
			echo '<a href="javascript:void(0);" rel="rewrite_rules" class="symposium-dialog">Show rewrite rules</a><br />';
				echo '<div id="rewrite_rules" title="Rewrite rules" style="display:none;margin-top:10px;background-color:#fff;color:#000;padding:6px;border:1px solid #000; border-radius:3px;">';
				echo __wps__displayArray($wp_rewrite->rewrite_rules());
				echo '</div>';
	
			echo '</div>';
		}
		
	}
	
}
Exemple #3
0
function __wps__plugin_welcome() {

	update_option(WPS_OPTIONS_PREFIX.'_motd', '');

	if ($file = @file_get_contents(WPS_WELCOME_MESSAGE)) {
		// WPS_WELCOME_MESSAGE should defined in default-constants.php and is an absolute local path and filename
		echo $file;

	} else {
	
		?>
		<div id="wps-welcome-panel" class="welcome-panel" style="background-image: none; background-color: #dfd; margin: 30px 20px 0 0">
			<div id="motd" class="welcome-panel-content">

			    <h3><?php echo WPS_WL; ?></h3>		    
			    
				<p class="about-description">
				<?php echo sprintf(__( 'Thank you for installing %s v%s, welcome aboard! Go ahead and visit the <a href="%s">Installation page</a> to complete your installation/upgrade.', WPS_TEXT_DOMAIN ), WPS_WL, WPS_VER, "admin.php?page=symposium_debug"); ?>
			    <?php
			    $ver = str_replace('.', '-', WPS_VER);
			    if (strpos($ver, ' ') !== false) $ver = substr($ver, 0, strpos($ver, ' ')); 
			    echo '<br />'.sprintf(__('Please always read the <a href="%s" target="_blank">release notes</a> before upgrading %s.', WPS_TEXT_DOMAIN), 'http://www.wpsymposium.com/category/releases/', WPS_WL);
				echo ' '.__( 'And remember, drink tea, tea is good.' );
				echo ' <img style="width:20px;height:20px" src="'.get_option(WPS_OPTIONS_PREFIX.'_images').'/smilies/coffee.png" alt="Tea is good" />';
				echo '<br /><br />'.sprintf(__('If this is your first time with %s, the TwentyTen theme is probably best for now, <a href="%s">change it here</a>.', WPS_TEXT_DOMAIN), WPS_WL, 'themes.php');
				?>
			    </p>
	
				<div class="welcome-panel-column-container">
					<div class="welcome-panel-column" style="margin-left:5px;margin-right:-5px;width:33%;">
						<h4><?php _e( 'Getting Started' ); ?></h4>
						<ul>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-view-site" target="_blank" href="%s">%s</a>' ), "http://www.wpsymposium.com/get-started", __('Getting started', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-add-page" href="%s">%s</a>' ), esc_url( admin_url('admin.php?page=symposium_debug') ), __('Activate some features', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-add-page" href="%s">%s</a>' ), esc_url( admin_url('admin.php?page=symposium_debug') ), __('Add to your site pages', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-widgets-menus" href="%s">%s</a>' ), esc_url( admin_url('admin.php?page=symposium_settings') ), __('Check your settings', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-write-blog" href="%s">%s</a>' ), esc_url( admin_url('admin.php?page=symposium_styles') ), __('Pick a color scheme', WPS_TEXT_DOMAIN) ); ?></li>
							<?php if (!__wps__is_plus()) echo '<li>'.sprintf( __( '<a class="welcome-icon welcome-learn-more" href="%s" target="_blank">%s</a>' ), esc_url( 'http://www.wpsymposium.com/membership'), __('Upgrade to Bronze membership', WPS_TEXT_DOMAIN)).'</li>'; ?>
						</ul>						
					</div>
					<div class="welcome-panel-column">
						<h4><?php _e('Upgrading from previous version?', WPS_TEXT_DOMAIN) ?></h4>
						<?php echo __('You will need to:', WPS_TEXT_DOMAIN); ?>
						<ul>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-widgets-menus" href="%s">%s</a>' ), esc_url( admin_url('plugins.php') ), __('Ensure the plugin is activated', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-add-page" href="%s">%s</a>' ), esc_url( admin_url('admin.php?page=symposium_debug') ), __('Activate features on the Installation page', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-widgets-menus" href="%s">%s</a>' ), esc_url( admin_url('admin.php?page=symposium_templates') ), __('Reset your Templates', WPS_TEXT_DOMAIN) ); ?></li>
						</ul>
						<?php echo sprintf(__( 'It\'s <em>very important</em> that you read the <a href="%s" target="_blank">release notes</a>.', WPS_TEXT_DOMAIN ), "http://www.wpsymposium.com/category/releases/"); ?><br />
                    </div>
					<div class="welcome-panel-column welcome-panel-last">
						<h4><?php _e( 'Need a little extra help?', WPS_TEXT_DOMAIN ); ?></h4>
						<ul>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-view-site" href="%s" target="_blank">%s</a>' ), esc_url( 'http://www.wpsymposium.com/faqs' ), __('Frequently Asked Questions', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-learn-more" href="%s" target="_blank">%s</a>' ), esc_url('http://www.wpsymposium.com/trythisfirst'), __('Try this first!', WPS_TEXT_DOMAIN) ); ?></li>
                        	<li><?php echo sprintf( __( '<a class="welcome-icon welcome-learn-more" href="%s" target="_blank">%s</a>' ), esc_url( 'http://www.wpsymposium.com/admin-guide/' ), __('Read the admin guide', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-learn-more" href="%s" target="_blank">%s</a>' ), esc_url('http://www.wpsymposium.com/discuss'), __('Visit the Forum', WPS_TEXT_DOMAIN) ); ?></li>
							<li><?php echo sprintf( __( '<a class="welcome-icon welcome-learn-more" href="%s" target="_blank">%s</a>' ), esc_url('http://www.wpsymposium.com/tutorials'), __('Check out the tutorials', WPS_TEXT_DOMAIN) ); ?></li>
						</ul>
                	</div>
				</div>
	
			</div>
			
				<form action="index.php" method="post">
				<div style="float:right;margin-bottom:10px">
					<input type="submit" class="button-primary" value="<?php _e("Hide this now (it's available via the menu)", WPS_TEXT_DOMAIN); ?>" />
					<input type="hidden" name="symposium_hide_motd" value="Y" />
					<?php wp_nonce_field('symposium_hide_motd_nonce','symposium_hide_motd_nonce'); ?>
				</div>
				</form>
			
		</div>
	<?php
	}

}