Esempio n. 1
0
function userpro_sc_setup($rebuild = 0)
{
    global $userpro;
    $pages = get_option('userpro_sc_pages');
    /* Rebuild */
    if ($rebuild) {
        // reset/default slugs
        $userpro->set_defaults(array('slug_followers', 'slug_following'), $extension = 'social');
        // delete existing pages for userpro
        if (isset($pages) && is_array($pages)) {
            foreach ($pages as $page_id) {
                wp_delete_post($page_id, true);
            }
        }
        // delete from DB
        delete_option('userpro_sc_pages');
    }
    /* Create pages if they do not exist */
    if (!isset($pages['following'])) {
        $slug_following = userpro_sc_get_option('slug_following');
        $slug_followers = userpro_sc_get_option('slug_followers');
        $following = array('post_title' => __('Following', 'userpro'), 'post_content' => '[userpro template=following]', 'post_name' => $slug_following, 'comment_status' => 'closed', 'post_type' => 'page', 'post_status' => 'publish', 'post_author' => 1);
        $following = wp_insert_post($following);
        $pages['following'] = $following;
        $post = get_post($following, ARRAY_A);
        userpro_sc_set_option('slug_following', $post['post_name']);
        $followers = array('post_title' => __('Followers', 'userpro'), 'post_content' => '[userpro template=followers]', 'post_name' => $slug_followers, 'comment_status' => 'closed', 'post_type' => 'page', 'post_status' => 'publish', 'post_author' => 1);
        $followers = wp_insert_post($followers);
        $pages['followers'] = $followers;
        $post = get_post($followers, ARRAY_A);
        userpro_sc_set_option('slug_followers', $post['post_name']);
        update_option('userpro_sc_pages', $pages);
        /* Rewrite rules */
        $slug_following = userpro_sc_get_option('slug_following');
        $slug_followers = userpro_sc_get_option('slug_followers');
        add_rewrite_rule("{$slug_following}/([^/]+)/?", 'index.php?pagename=' . $slug_following . '&up_username=$matches[1]', 'top');
        add_rewrite_rule("{$slug_followers}/([^/]+)/?", 'index.php?pagename=' . $slug_followers . '&up_username=$matches[1]', 'top');
        flush_rewrite_rules();
    } else {
        // pages installed
        $slug_following = userpro_sc_get_option('slug_following');
        $slug_followers = userpro_sc_get_option('slug_followers');
        add_rewrite_rule("{$slug_following}/([^/]+)/?", 'index.php?pagename=' . $slug_following . '&up_username=$matches[1]', 'top');
        add_rewrite_rule("{$slug_followers}/([^/]+)/?", 'index.php?pagename=' . $slug_followers . '&up_username=$matches[1]', 'top');
    }
}
Esempio n. 2
0
function userpro_sc_hide_users($array)
{
    global $userpro;
    foreach ($array as $k => $arr) {
        if (userpro_sc_get_option('hide_admins')) {
            if ($userpro->is_admin($arr['user_id'])) {
                unset($array[$k]);
                // hide admin
            }
        }
        if (!$userpro->user_exists($arr['user_id'])) {
            unset($array[$k]);
            // hide deleted user
        }
    }
    return $array;
}
Esempio n. 3
0
/**
	logged action: new post / update post
	**/
function userpro_sc_new_post($new_status, $old_status, $post)
{
    global $userpro_social;
    $exclude = userpro_sc_get_option('excluded_post_types');
    if ($exclude != '') {
        $exclude_types = explode(',', $exclude);
    } else {
        $exclude_types = array('nav_menu_item');
    }
    if (!in_array($post->post_type, $exclude_types)) {
        // new post
        if ($new_status == 'publish' && $old_status != 'publish') {
            $user = get_userdata($post->post_author);
            $userpro_social->log_action('new_post', $user->ID, $post->ID, $post->post_title, $post->post_type);
        }
        // updated post
        if ($new_status == 'publish' && $old_status == 'publish') {
            $user = get_userdata($post->post_author);
            $userpro_social->log_action('update_post', $user->ID, $post->ID, $post->post_title, $post->post_type);
        }
    }
}
function userpro_sc_setup($rebuild = 0)
{
    /* Create optional pages */
    if ($rebuild) {
        delete_option('userpro_sc_pages');
    }
    /* Find pages */
    $pages = get_option('userpro_sc_pages');
    /* Create pages if they do not exist */
    if (!isset($pages['following'])) {
        $slug_following = userpro_sc_get_option('slug_following');
        $slug_followers = userpro_sc_get_option('slug_followers');
        $following = array('post_title' => __('Following', 'userpro'), 'post_content' => '[userpro template=following]', 'post_name' => $slug_following, 'comment_status' => 'closed', 'post_type' => 'page', 'post_status' => 'publish', 'post_author' => 1);
        $following = wp_insert_post($following);
        $pages['following'] = $following;
        $post = get_post($following, ARRAY_A);
        userpro_sc_set_option('slug_following', $post['post_name']);
        $followers = array('post_title' => __('Followers', 'userpro'), 'post_content' => '[userpro template=followers]', 'post_name' => $slug_followers, 'comment_status' => 'closed', 'post_type' => 'page', 'post_status' => 'publish', 'post_author' => 1);
        $followers = wp_insert_post($followers);
        $pages['followers'] = $followers;
        $post = get_post($followers, ARRAY_A);
        userpro_sc_set_option('slug_followers', $post['post_name']);
        update_option('userpro_sc_pages', $pages);
        /* Rewrite rules */
        $slug_following = userpro_sc_get_option('slug_following');
        $slug_followers = userpro_sc_get_option('slug_followers');
        add_rewrite_rule("{$slug_following}/([^/]+)/?", 'index.php?pagename=' . $slug_following . '&up_username=$matches[1]', 'top');
        add_rewrite_rule("{$slug_followers}/([^/]+)/?", 'index.php?pagename=' . $slug_followers . '&up_username=$matches[1]', 'top');
        flush_rewrite_rules();
    } else {
        // pages installed
        $slug_following = userpro_sc_get_option('slug_following');
        $slug_followers = userpro_sc_get_option('slug_followers');
        add_rewrite_rule("{$slug_following}/([^/]+)/?", 'index.php?pagename=' . $slug_following . '&up_username=$matches[1]', 'top');
        add_rewrite_rule("{$slug_followers}/([^/]+)/?", 'index.php?pagename=' . $slug_followers . '&up_username=$matches[1]', 'top');
    }
}
Esempio n. 5
0
 function log_action($action, $user_id, $var1 = null, $var2 = null, $var3 = null)
 {
     global $userpro, $userpro_social;
     $activity = get_option('userpro_activity');
     $timestamp = isset($gmt) ? time() : time() + get_option('gmt_offset') * 3600;
     $status = '';
     switch ($action) {
         case 'verified':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
             $status .= '<span class="userpro-sc-i-info">';
             $status .= __('is now a verified account.', 'userpro');
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
             break;
         case 'new_post':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
             $status .= '<span class="userpro-sc-i-info">';
             $status .= sprintf(__('has published a <a href="%s">new %s</a>.', 'userpro'), get_permalink($var1), $var3);
             if ($var2 != '') {
                 $status .= '<span class="userpro-sc-i-sp">"' . $var2 . '"</span>';
             }
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
             break;
         case 'update_post':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
             $status .= '<span class="userpro-sc-i-info">';
             $status .= sprintf(__('has updated a <a href="%s">%s</a>.', 'userpro'), get_permalink($var1), $var3);
             if ($var2 != '') {
                 $status .= '<span class="userpro-sc-i-sp">"' . $var2 . '"</span>';
             }
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
             break;
         case 'new_comment':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
             $status .= '<span class="userpro-sc-i-info">';
             $status .= __('has posted a new comment on:', 'userpro');
             $status .= '<span class="userpro-sc-i-sp">"<a href="' . get_permalink($var1) . '">' . $var2 . '</a>"</span>';
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
             break;
         case 'new_follow':
             $dest = get_userdata($var1);
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
             $status .= '<span class="userpro-sc-i-info">';
             $status .= sprintf(__('has started following <a href="%s">%s</a>', 'userpro'), $userpro->permalink($dest->ID), userpro_profile_data('display_name', $dest->ID));
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
             /* notification */
             if (userpro_sc_get_option('notification_on_follow')) {
                 $this->new_notification($dest, $user_id, 'new_follow');
             }
             break;
         case 'stop_follow':
             $dest = get_userdata($var1);
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
             $status .= '<span class="userpro-sc-i-info">';
             $status .= sprintf(__('has stopped following <a href="%s">%s</a>', 'userpro'), $userpro->permalink($dest->ID), userpro_profile_data('display_name', $dest->ID));
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
             break;
         case 'new_user':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id);
             $status .= '<span class="userpro-sc-i-info">';
             $status .= __('has just registered!', 'userpro');
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">' . gmdate("d M Y H:i:s", $timestamp) . '</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status);
             break;
     }
     update_option('userpro_activity', $activity);
 }
Esempio n. 6
0
_e('"Following" Slug', 'userpro');
?>
</label></th>
		<td><input type="text" name="slug_following" id="slug_following" class="regular-text" value="<?php 
echo userpro_sc_get_option('slug_following');
?>
" /></td>
	</tr>
	
	<tr valign="top">
		<th scope="row"><label for="slug_followers"><?php 
_e('"Followers" Slug', 'userpro');
?>
</label></th>
		<td><input type="text" name="slug_followers" id="slug_followers" class="regular-text" value="<?php 
echo userpro_sc_get_option('slug_followers');
?>
" /></td>
	</tr>
	
</table>

<p class="submit">
	<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php 
_e('Save Changes', 'userpro');
?>
"  />
	<input type="submit" name="reset-options" id="reset-options" class="button" value="<?php 
_e('Reset Options', 'userpro');
?>
"  />
Esempio n. 7
0
" class="regular-text" />
			<span class="description"><?php 
_e('The number of items in activity stream to load per page.', 'userpro');
?>
</span>
		</td>
	</tr>
	
	<tr valign="top">
		<th scope="row"><label for="excluded_post_types"><?php 
_e('Exclude these post types from activity', 'userpro');
?>
</label></th>
		<td>
			<input type="text" name="excluded_post_types" id="excluded_post_types" value="<?php 
echo userpro_sc_get_option('excluded_post_types');
?>
" class="regular-text" />
			<span class="description"><?php 
_e('A comma seperated list of post types to hide from activity.', 'userpro');
?>
</span>
		</td>
	</tr>
	
</table>

<p class="submit">
	<input type="submit" name="submit" id="submit" class="button button-primary" value="<?php 
_e('Save Changes', 'userpro');
?>
Esempio n. 8
0
function userpro_sc_shortcodes($args)
{
    global $userpro, $userpro_social;
    extract($args);
    if (!userpro_get_option('modstate_social')) {
        return false;
    }
    $query_id = userpro_get_view_user(get_query_var('up_username'));
    $user_id = get_current_user_id();
    // show activity
    if (isset($args['template']) && $args['template'] == 'activity') {
        // ALL ACTIVITY
        if ($args['activity_all'] == 1) {
            // ACTIVITY OPEN TO ALL
            if (userpro_sc_get_option('activity_open_to_all') == 1) {
                $activity = $userpro_social->activity(0, 0, $args['activity_per_page'], $args['activity_user']);
                if (locate_template('userpro/' . $template . '.php') != '') {
                    include get_template_directory() . '/userpro/' . $template . '.php';
                } else {
                    include userpro_sc_path . "templates/{$template}.php";
                }
            } else {
                if (userpro_is_logged_in()) {
                    $activity = $userpro_social->activity(0, 0, $args['activity_per_page'], $args['activity_user']);
                    if (locate_template('userpro/' . $template . '.php') != '') {
                        include get_template_directory() . '/userpro/' . $template . '.php';
                    } else {
                        include userpro_sc_path . "templates/{$template}.php";
                    }
                } else {
                    /* attempt to view profile so force redirect to same page */
                    $args['force_redirect_uri'] = 1;
                    $template = 'login';
                    $args['template'] = 'login';
                    if (locate_template('userpro/' . $template . '.php') != '') {
                        include get_template_directory() . '/userpro/' . $template . '.php';
                    } else {
                        include userpro_path . "templates/login.php";
                    }
                }
            }
            // FOLLOWED ACTIVITY
        } else {
            if (userpro_is_logged_in()) {
                if ($user_id == $query_id) {
                    $activity = $userpro_social->activity($user_id, 0, $args['activity_per_page'], $args['activity_user']);
                    if (locate_template('userpro/' . $template . '.php') != '') {
                        include get_template_directory() . '/userpro/' . $template . '.php';
                    } else {
                        include userpro_sc_path . "templates/{$template}.php";
                    }
                } else {
                    // show nothing
                }
            } else {
                /* attempt to view profile so force redirect to same page */
                $args['force_redirect_uri'] = 1;
                $template = 'login';
                $args['template'] = 'login';
                if (locate_template('userpro/' . $template . '.php') != '') {
                    include get_template_directory() . '/userpro/' . $template . '.php';
                } else {
                    include userpro_path . "templates/login.php";
                }
            }
        }
    }
    // show users I am following
    if (isset($args['template']) && $args['template'] == 'following') {
        if (userpro_is_logged_in()) {
            $user_id = $userpro->try_query_user($user_id);
            $following = $userpro_social->following($user_id);
            if (locate_template('userpro/' . $template . '.php') != '') {
                include get_template_directory() . '/userpro/' . $template . '.php';
            } else {
                include userpro_sc_path . "templates/{$template}.php";
            }
        } else {
            /* attempt to view profile so force redirect to same page */
            $args['force_redirect_uri'] = 1;
            $template = 'login';
            $args['template'] = 'login';
            if (locate_template('userpro/' . $template . '.php') != '') {
                include get_template_directory() . '/userpro/' . $template . '.php';
            } else {
                include userpro_path . "templates/login.php";
            }
        }
        $userpro->temp_id = $user_id;
    }
    // show followers
    if (isset($args['template']) && $args['template'] == 'followers') {
        if (userpro_is_logged_in()) {
            $user_id = $userpro->try_query_user($user_id);
            $followers = $userpro_social->followers($user_id);
            if (locate_template('userpro/' . $template . '.php') != '') {
                include get_template_directory() . '/userpro/' . $template . '.php';
            } else {
                include userpro_sc_path . "templates/{$template}.php";
            }
        } else {
            /* attempt to view profile so force redirect to same page */
            $args['force_redirect_uri'] = 1;
            $template = 'login';
            $args['template'] = 'login';
            if (locate_template('userpro/' . $template . '.php') != '') {
                include get_template_directory() . '/userpro/' . $template . '.php';
            } else {
                include userpro_path . "templates/login.php";
            }
        }
        $userpro->temp_id = $user_id;
    }
}
Esempio n. 9
0
File: api.php Progetto: Darciro/PPM
 function log_action($action, $user_id, $var1 = null, $var2 = null, $var3 = null)
 {
     global $userpro, $userpro_social;
     $activity = get_option('userpro_activity');
     $timestamp = current_time('timestamp');
     $status = '';
     switch ($action) {
         case 'verified':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
             $status .= '<span class="userpro-sc-i-info">';
             $status .= __('is now a verified account.', 'userpro');
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
             break;
         case 'new_post':
             $array = get_user_meta($user_id, '_userpro_followers_ids', true);
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
             $status .= '<span class="userpro-sc-i-info">';
             if ($var3 == "userpro_userwall") {
                 $status .= __("has published a {$var2} ", 'userpro');
             } else {
                 $status .= sprintf(__('has published a <a href="%s">new %s</a>.', 'userpro'), get_permalink($var1), $var3);
             }
             if ($var2 != '') {
                 $status .= '<span class="userpro-sc-i-sp">"' . $var2 . '"</span>';
             }
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
             if (userpro_sc_get_option('notification_on_follow_post') == 1) {
                 if (is_array($array)) {
                     foreach ($array as $key => $value) {
                         $user_info = get_userdata($key);
                         $headers = 'From: ' . userpro_get_option('mail_from_name') . ' <' . userpro_get_option('mail_from') . '>' . "\r\n";
                         $subject = "New Post";
                         $message = "Post Name {$var2}";
                         wp_mail($user_info->user_email, $subject, $message, $headers);
                     }
                 }
             }
             break;
         case 'update_post':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
             $status .= '<span class="userpro-sc-i-info">';
             $status .= sprintf(__('has updated a <a href="%s">%s</a>.', 'userpro'), get_permalink($var1), $var3);
             if ($var2 != '') {
                 $status .= '<span class="userpro-sc-i-sp">"' . $var2 . '"</span>';
             }
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
             break;
         case 'new_comment':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
             $status .= '<span class="userpro-sc-i-info">';
             $status .= __('has posted a new comment on:', 'userpro');
             $status .= '<span class="userpro-sc-i-sp">"<a href="' . get_permalink($var1) . '">' . $var2 . '</a>"</span>';
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
             break;
         case 'new_follow':
             $dest = get_userdata($var1);
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
             $status .= '<span class="userpro-sc-i-info">';
             $status .= sprintf(__('has started following <a href="%s">%s</a>', 'userpro'), $userpro->permalink($dest->ID), userpro_profile_data('display_name', $dest->ID));
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
             /* notification */
             $followers = get_user_meta($dest->ID, 'followers_email');
             if (userpro_sc_get_option('notification_on_follow') && (isset($followers[0]) && $followers[0] == "unsubscribed")) {
                 $this->new_notification($dest, $user_id, 'new_follow');
             }
             break;
         case 'stop_follow':
             $dest = get_userdata($var1);
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
             $status .= '<span class="userpro-sc-i-info">';
             $status .= sprintf(__('has stopped following <a href="%s">%s</a>', 'userpro'), $userpro->permalink($dest->ID), userpro_profile_data('display_name', $dest->ID));
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
             break;
         case 'new_user':
             $status .= '<div class="userpro-sc-img" data-key="profilepicture"><a href="' . $userpro->permalink($user_id) . '">' . get_avatar($user_id, '50') . '</a></div><div class="userpro-sc-i"><div class="userpro-sc-i-name"><a href="' . $userpro->permalink($user_id) . '" title="' . __('View Profile', 'userpro') . '">' . userpro_profile_data('display_name', $user_id) . '</a>' . userpro_show_badges($user_id, false, array('custom'));
             $status .= '<span class="userpro-sc-i-info">';
             $status .= __('has just registered!', 'userpro');
             $status .= '</span>';
             $status .= '</div><div class="userpro-sc-i-time">{timestamp}</div></div><div class="userpro-clear"></div>';
             $activity[$user_id][$timestamp] = array('user_id' => $user_id, 'status' => $status, 'timestamp' => $timestamp);
             break;
     }
     // If disable activity is turned off
     if (userpro_get_option('disable_activity_log') == 0) {
         update_option('userpro_activity', $activity);
     }
 }