function __wps__profile_body($uid1, $uid2, $post, $version, $limit_from, $exclude_info_box=true, $rel=false) { global $wpdb, $current_user; // How many new items should be shown (before and after clicking more...) // Note that this is more of a scale, than a precise value (although it's close to the same) // For example, doubling to 60 would, roughly, show about 60 posts (depending on privacy) $limit_count = ($rel) ? $rel : 30; $plugin = WPS_PLUGIN_URL; // if ($uid1 > 0) { if (get_option(WPS_OPTIONS_PREFIX.'_use_styles') == "on") { $bg_color_2 = 'background-color: '.get_option(WPS_OPTIONS_PREFIX.'_bg_color_2'); } else { $bg_color_2 = ''; } $privacy = ($uid1 > 0) ? __wps__get_meta($uid1, 'wall_share') : 'public'; $html = ""; if (is_user_logged_in() || $privacy == 'public') { $is_friend = ($uid1 > 0) ? __wps__friend_of($uid1, $current_user->ID) : false; if ( ($uid1 == $uid2) || (is_user_logged_in() && strtolower($privacy) == 'everyone') || (strtolower($privacy) == 'public') || (strtolower($privacy) == 'friends only' && $is_friend) || __wps__get_current_userlevel() == 5) { // Optional panel if ($exclude_info_box && get_option(WPS_OPTIONS_PREFIX.'_show_wall_extras') == "on" && $limit_from == 0 && version != 'stream_activity') { $html .= "<div id='__wps__profile_right_column'>"; // Extended $extended = __wps__get_meta($uid1, 'extended'); $fields = explode('[|]', $extended); $has_extended_fields = false; if ($fields) { $ext_rows = array(); foreach ($fields as $field) { $split = explode('[]', $field); if ( ($split[0] != '') && ($split[1] != '') ) { $extension = $wpdb->get_row($wpdb->prepare("SELECT extended_name,extended_order FROM ".$wpdb->base_prefix."symposium_extended WHERE eid = %d", $split[0])); $ext = array ( 'name'=>$extension->extended_name, 'value'=>wpautop(__wps__make_url($split[1])), 'order'=>$extension->extended_order ); array_push($ext_rows, $ext); $has_info = true; $has_extended_fields = true; } } $ext_rows = __wps__sub_val_sort($ext_rows,'order'); foreach ($ext_rows as $row) { $html .= "<div style='margin-bottom:0px;overflow: auto;'>"; $html .= "<div style='font-weight:bold;'>".stripslashes($row['name'])."</div>"; $html .= "<div>".wpautop(__wps__make_url(stripslashes($row['value'])))."</div>"; $html .= "</div>"; } } // Friends $has_friends = false; $html .= "<div class='profile_panel_friends_div'>"; $sql = "SELECT f.*, cast(m.meta_value as datetime) as last_activity FROM ".$wpdb->base_prefix."symposium_friends f LEFT JOIN ".$wpdb->base_prefix."usermeta m ON m.user_id = f.friend_to WHERE f.friend_from = %d AND f.friend_accepted = 'on' AND m.meta_key = 'symposium_last_activity'ORDER BY cast(m.meta_value as datetime) DESC LIMIT 0,6"; $friends = $wpdb->get_results($wpdb->prepare($sql, $uid1)); if ($friends) { $inactive = get_option(WPS_OPTIONS_PREFIX.'_online'); $offline = get_option(WPS_OPTIONS_PREFIX.'_offline'); $html .= '<div class="profile_panel_friends_div_title">'.sprintf(__('Recently Active %s', WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friends')).'</div>'; foreach ($friends as $friend) { $time_now = time(); $last_active_minutes = strtotime($friend->last_activity); $last_active_minutes = floor(($time_now-$last_active_minutes)/60); $html .= "<div class='profile_panel_friends_div_row'>"; $html .= "<div class='profile_panel_friends_div_avatar'>"; $html .= get_avatar($friend->friend_to, 42); $html .= "</div>"; $html .= "<div>"; $html .= __wps__profile_link($friend->friend_to)."<br />"; $html .= __('Last active', WPS_TEXT_DOMAIN).' '.__wps__time_ago($friend->last_activity)."."; $html .= "</div>"; $html .= "</div>"; } $has_friends = true; } $html .= "</div>"; if (!$has_extended_fields && !$has_friends) { $html .= __('Make friends and they will be listed here...', WPS_TEXT_DOMAIN); } $html .= "</div>"; } // Wall // Filter for additional buttons if ($version == "wall") { $html = apply_filters ( '__wps__profile_wall_header_filter', $html, $uid1, $uid2, $privacy, $is_friend, __wps__get_meta($uid1, 'extended') ); } /* add activity stream */ $html .= __wps__activity_stream($uid1, $version, $limit_from, $limit_count, $post); } else { if ($version == "friends_activity") { $html .= '<p>'.__("Sorry, this member has chosen not to share their activity.", WPS_TEXT_DOMAIN); } if ($version == "wall") { $html .= '<p>'.__("Sorry, this member has chosen not to share their activity.", WPS_TEXT_DOMAIN); } } return __wps__buffer($html); } else { return __wps__show_login_link(__("Please <a href='%s'>login</a> to view this member's profile.", WPS_TEXT_DOMAIN), false); } // } else { // return ''; // } }
function get_breadcrumbs($current_catid=0, $param='catid', $show_home=true, $sep='→', $include_last_link=false, $return_array='', $url='', $order=100) { global $wpdb; $url = $url != '' ? $url : get_bloginfo('url').get_option(WPS_OPTIONS_PREFIX.'_forum_url'); if ($return_array=='') { $return_array = array(); if ($show_home) { $row_array['order'] = 0; $row_array['cat_id'] = 0; $row_array['this_id'] = 0; $row_array['cat_title'] = __('Top Level', WPS_TEXT_DOMAIN); $row_array['cat_description'] = __('Top Level', WPS_TEXT_DOMAIN); array_push($return_array,$row_array); } } $sql = "select * from ".$wpdb->prefix."symposium_cats where cid = %d"; $parent_cat = $wpdb->get_row($wpdb->prepare($sql, $current_catid)); if (!$parent_cat) { return false; } else { $row_array['order'] = $order; $row_array['cat_id'] = $parent_cat->cat_parent; $row_array['this_id'] = $parent_cat->cid; $row_array['cat_title'] = $parent_cat->title; $row_array['cat_description'] = $parent_cat->cat_desc; array_push($return_array,$row_array); if ($parent_cat->cat_parent > 0) { $order--; $this->get_breadcrumbs($parent_cat->cat_parent, $param, $show_home, $sep, $include_last_link, $return_array, $url, $order); } else { $trail = __wps__sub_val_sort($return_array,'order'); $crumbs = ''; $count = 0; foreach ($trail as $crumb) { $count++; if ($count < count($trail) || $include_last_link) { $crumbs .= "<a href='".$url.__wps__string_query($url).$param."=".$crumb['this_id']."'>".$crumb['cat_title']."</a> "; if ($count < count($trail)) $crumbs .= $sep." "; } else { $crumbs .= $crumb['cat_title']; } } echo $crumbs; } } }
$friends_list = $wpdb->get_results($sql); if ($friends_list) { $friends_array = array(); foreach ($friends_list as $friend) { $add = array ( 'ID' => $friend->ID, 'display_name' => $friend->display_name, 'last_activity' => __wps__get_meta($friend->ID, 'last_activity'), 'status' => __wps__get_meta($friend->ID, 'status') ); array_push($friends_array, $add); } $friends = __wps__sub_val_sort($friends_array, 'last_activity', false); } else { $friends = false; } if ($friends) { foreach ($friends as $friend) { $time_now = time(); if ($friend['last_activity'] && $friend['status'] != 'offline') { $last_active_minutes = __wps__convert_datetime($friend['last_activity']); $last_active_minutes = floor(($time_now-$last_active_minutes)/60); } else { $last_active_minutes = 999999999;
function add_reply($tid, $reply_text, $uid=0, $replybyemail=false) { if ($tid != '') { global $wpdb, $current_user; // Defaults for current state of class $topic_approved = 'on'; $group_id = 0; $answered = ''; // User ID? if ($uid == 0) { $uid = $current_user->ID; } // Get category for this topic ID $cat_id = $wpdb->get_var($wpdb->prepare("SELECT topic_category from ".$wpdb->prefix."symposium_topics where tid = %d", $tid)); // Don't allow HTML in subject if not using WYSIWYG editor if (get_option(WPS_OPTIONS_PREFIX.'_use_wysiwyg') != 'on') { $reply_text = str_replace("<", "<", $reply_text); $reply_text = str_replace(">", ">", $reply_text); } // Check for banned words $chatroom_banned = get_option(WPS_OPTIONS_PREFIX.'_chatroom_banned'); if ($chatroom_banned != '') { $badwords = $pieces = explode(",", $chatroom_banned); for($i=0;$i < sizeof($badwords);$i++){ if (strpos(' '.$reply_text.' ', $badwords[$i])) { $reply_text=eregi_replace($badwords[$i], "***", $reply_text); } } } // First check for potential duplicate $sql = "SELECT tid FROM ".$wpdb->prefix."symposium_topics WHERE topic_parent = %d AND topic_post = %s"; $duplicate = $wpdb->get_var($wpdb->prepare($sql, $tid, $reply_text)); if (!$duplicate) { if ( // Store new reply in post $wpdb->query( $wpdb->prepare( " INSERT INTO ".$wpdb->prefix."symposium_topics ( topic_subject, topic_category, topic_post, topic_date, topic_started, topic_owner, topic_parent, topic_views, topic_approved, topic_group, topic_answer ) VALUES ( %s, %d, %s, %s, %s, %d, %d, %d, %s, %d, %s )", array( '', $cat_id, $reply_text, date("Y-m-d H:i:s"), date("Y-m-d H:i:s"), $uid, $tid, 0, $topic_approved, $group_id, $answered ) ) ) ) { // get new topic id (or response) for return $new_id = $wpdb->insert_id; // Now send out emails as appropriate // Get forum URL worked out $forum_url = __wps__get_url('forum'); if (strpos($forum_url, '?') !== FALSE) { $q = "&"; } else { $q = "?"; } // Get group URL worked out if ($group_id > 0) { $forum_url = __wps__get_url('group'); if (strpos($forum_url, '?') !== FALSE) { $q = "&gid=".$group_id."&"; } else { $q = "?gid=".$group_id."&"; } } // Email people who want to know and prepare body $owner_name = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM ".$wpdb->base_prefix."users WHERE ID = %d", $uid)); $parent = $wpdb->get_var($wpdb->prepare("SELECT topic_subject FROM ".$wpdb->prefix."symposium_topics WHERE tid = %d", $tid)); $body = "<span style='font-size:24px'>".$parent."</span><br /><br />"; $body .= "<p>".$owner_name." ".__('replied', WPS_TEXT_DOMAIN)."...</p>"; $body .= "<p>".$reply_text."</p>"; $url = $forum_url.$q."cid=".$cat_id."&show=".$tid; $body .= "<p><a href='".$url."'>".$url."</a></p>"; $body = str_replace(chr(13), "<br />", $body); $body = str_replace("\\r\\n", "<br />", $body); $body = str_replace("\\", "", $body); $email_list = '0,'; if ($topic_approved == "on") { $query = $wpdb->get_results($wpdb->prepare(" SELECT user_email, ID FROM ".$wpdb->base_prefix."users u RIGHT JOIN ".$wpdb->prefix."symposium_subs ON ".$wpdb->prefix."symposium_subs.uid = u.ID WHERE u.ID != %d AND tid = %d", $uid, $tid)); if ($query) { foreach ($query as $user) { // Filter to allow further actions to take place apply_filters ('__wps__forum_newreply_filter', $user->ID, $uid, $owner_name, $url); // Keep track of who sent to so far $email_list .= $user->ID.','; // Check for Reply-By-Email if ($replybyemail || function_exists('__wps__mailinglist')) { $subject_add = ' #TID='.$tid.' ['.__('do not edit', WPS_TEXT_DOMAIN).']'; $body = get_option(WPS_OPTIONS_PREFIX.'_mailinglist_prompt').'<br />'.get_option(WPS_OPTIONS_PREFIX.'_mailinglist_divider').'<br /><br />'.get_option(WPS_OPTIONS_PREFIX.'_mailinglist_divider_bottom').'<br /><br />'.'<br /><br />'.$body; } else { $subject_add = ''; } // Send mail if (strpos(get_option(WPS_OPTIONS_PREFIX.'_subject_forum_reply'), '[topic]') !== FALSE) { $subject = str_replace("[topic]", $parent, get_option(WPS_OPTIONS_PREFIX.'_subject_forum_reply')); } else { $subject = get_option(WPS_OPTIONS_PREFIX.'_subject_forum_reply'); } __wps__sendmail($user->user_email, $subject.$subject_add, $body); } } // Now send to everyone who wants to know about all new topics and replies $email_list .= '0'; $sql = "SELECT ID,user_email FROM ".$wpdb->base_prefix."users u WHERE ID != %d AND ID NOT IN (".$email_list.")"; $list = $wpdb->get_results($wpdb->prepare($sql, $current_user->ID)); if ($list) { $list_array = array(); foreach ($list as $item) { if (__wps__get_meta($item->ID, 'forum_all') == 'on') { $add = array ( 'ID' => $item->ID, 'user_email' => $item->user_email ); array_push($list_array, $add); } } $query = __wps__sub_val_sort($list_array, 'last_activity'); } else { $query = false; } // Get list of permitted roles for this topic category $sql = "SELECT level FROM ".$wpdb->prefix."symposium_cats WHERE cid = %d"; $level = $wpdb->get_var($wpdb->prepare($sql, $cat_id)); $cat_roles = unserialize($level); if ($query) { foreach ($query as $user) { // If a group and a member of the group, or not a group forum... if ($group_id == 0 || __wps__member_of($group_id) == "yes") { // Get role of recipient user $the_user = get_userdata( $user->ID ); $capabilities = $the_user->{$wpdb->prefix . 'capabilities'}; if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles(); $user_role = 'NONE'; if ($capabilities) { foreach ( $wp_roles->role_names as $role => $name ) { if ( array_key_exists( $role, $capabilities ) ) $user_role = $role; } } // Check in this topics category level if (strpos(strtolower($cat_roles), 'everyone,') !== FALSE || strpos(strtolower($cat_roles), $user_role.',') !== FALSE) { // Filter to allow further actions to take place apply_filters ('__wps__forum_newreply_filter', $user->ID, $uid, $owner_name, $url); // Send mail if (strpos(get_option(WPS_OPTIONS_PREFIX.'_subject_forum_reply'), '[topic]') !== FALSE) { $subject = str_replace("[topic]", $parent, get_option(WPS_OPTIONS_PREFIX.'_subject_forum_reply')); } else { $subject = get_option(WPS_OPTIONS_PREFIX.'_subject_forum_reply'); } __wps__sendmail($user->user_email, $subject, $body); } } } } } else { // Email admin if post needs approval $body = "<span style='font-size:24px; font-style:italic;'>".__("Moderation required for a reply", WPS_TEXT_DOMAIN)."</span><br /><br />".$body; __wps__sendmail(get_bloginfo('admin_email'), __('Moderation required for a reply', WPS_TEXT_DOMAIN), $body); } return $new_id; } else { //__wps__sendmail(get_bloginfo('admin_email'), __('POP3 insert failed', WPS_TEXT_DOMAIN), 'Query:'.$wpdb->last_query); return false; } } else { //__wps__sendmail(get_bloginfo('admin_email'), __('POP3 insert failed', WPS_TEXT_DOMAIN), 'Duplicate skipped: '.$wpdb->last_query); return false; } // End duplicate check } else { //__wps__sendmail(get_bloginfo('admin_email'), __('POP3 insert failed', WPS_TEXT_DOMAIN), 'No tid passed'); return false; } }
function get_friend_requests($max=10) { global $wpdb; $id = $this->id; $sql = "SELECT f.friend_from AS id, friend_timestamp FROM ".$wpdb->base_prefix."symposium_friends f WHERE friend_to = %d AND friend_accepted != 'on' LIMIT 0,%d"; $friends_list = $wpdb->get_results($wpdb->prepare($sql, $id, $max)); if ($friends_list) { $friends_array = array(); foreach ($friends_list as $friend) { $add = array ( 'id' => $friend->id, 'last_activity' => __wps__get_meta($friend->id, 'last_activity'), 'requested' => $friend->friend_timestamp ); array_push($friends_array, $add); } $friends = __wps__sub_val_sort($friends_array, 'last_activity', false); } else { $friends = false; } return $friends; }
$friend_user = new $wps_user($friend['id']); // Add row with id and friend's name $friends_array[] = array("id"=>$friend_user->id, "display_name"=>$friend_user->get_display_name()); } // Add current user so can send yourself a mail (as you're not in your own friends list) $friends_array[] = array("id"=>$current_user->ID, "display_name"=>$current_user->display_name); // Now sort the array by display name $friends_array=__wps__sub_val_sort($friends_array, 'display_name'); // And show the drop down list of friends (you could choose a different selection method if you prefer) echo '<select name="my-recipient">'; foreach ($friends_array as $i => $row) { $selected = $default_recipient == $row['id'] ? 'SELECTED' : ''; echo '<option '.$selected.' value='.$row['id'].'>'.$row['display_name'].'</option>'; } echo '</select>';
$value = __wps__get_meta($uid1, 'extended_'.$extension->extended_slug); if ($extension->extended_type == 'Checkbox' || $value) { array_push ($ext_rows, array ( 'name'=>$extension->extended_name, 'value'=>$value, 'type'=>$extension->extended_type, 'order'=>$extension->extended_order ) ); } } } // Hook to add Extended Fields within the array $ext_rows $ext_rows = apply_filters ( '__wps__add_extended_field_filter', $ext_rows ); if ($ext_rows) { $ext_rows = __wps__sub_val_sort($ext_rows,'order'); foreach ($ext_rows as $row) { if ($row['type'] == 'Checkbox' && !$row['value'] && get_option(WPS_OPTIONS_PREFIX.'_profile_show_unchecked') != 'on') { // Don't show if unchecked and chosen not to show (in Profile config) } else { $html .= "<div style='margin-bottom:0px;overflow: auto;'>"; if ($row['type'] != 'Checkbox') { $html .= "<div class='profilemenu-head' style='font-weight:bold;'>".stripslashes($row['name'])."</div>"; $value = str_replace("\n", "<br />", stripslashes(stripslashes($row['value']))); $html .= "<div style='margin-bottom:10px'>".__wps__make_url($value)."</div>"; } else { $html .= "<div class='profilemenu-content' style='margin-bottom:10px;font-weight:bold;'>"; $html .= stripslashes($row['name'])." "; if (get_option(WPS_OPTIONS_PREFIX.'_profile_show_unchecked') == 'on') { if ($row['value']) {
function __wps__plugin_profile() { echo '<div class="wrap">'; echo '<div id="icon-themes" class="icon32"><br /></div>'; echo '<h2>'.sprintf(__('%s Options', WPS_TEXT_DOMAIN), WPS_WL).'</h2><br />'; __wps__show_tabs_header('profile'); global $wpdb; global $user_ID; get_currentuserinfo(); include_once( ABSPATH . 'wp-includes/formatting.php' ); // Delete an extended field? if ( isset($_GET['del_eid']) && $_GET['del_eid'] != '') { // get slug $sql = "SELECT extended_slug from ".$wpdb->base_prefix."symposium_extended WHERE eid = %d"; $slug = $wpdb->query($wpdb->prepare($sql, $_GET['del_eid'])); // now delete extended field $wpdb->query( $wpdb->prepare( "DELETE FROM ".$wpdb->base_prefix.'symposium_extended'." WHERE eid = %d", $_GET['del_eid'] ) ); // finally delete all of these extended fields $sql = "DELETE FROM ".$wpdb->base_prefix."usermeta WHERE meta_key = 'symposium_".$slug."'"; $wpdb->query($sql); } // See if the user has posted profile settings if( isset($_POST[ 'symposium_update' ]) && $_POST[ 'symposium_update' ] == '__wps__plugin_profile' ) { update_option(WPS_OPTIONS_PREFIX.'_online', $_POST['online'] != '' ? $_POST['online'] : 5); update_option(WPS_OPTIONS_PREFIX.'_offline', $_POST['offline'] != '' ? $_POST['offline'] : 15); update_option(WPS_OPTIONS_PREFIX.'_use_poke', isset($_POST['use_poke']) ? $_POST['use_poke'] : ''); update_option(WPS_OPTIONS_PREFIX.'_poke_label', $_POST['poke_label'] != '' ? $_POST['poke_label'] : __('Hey!', "wp-symposium")); update_option(WPS_OPTIONS_PREFIX.'_status_label', $_POST['status_label'] != '' ? str_replace("'", "`", $_POST['status_label']) : __('What`s up?', "wp-symposium")); update_option(WPS_OPTIONS_PREFIX.'_enable_password', isset($_POST['enable_password']) ? $_POST['enable_password'] : ''); update_option(WPS_OPTIONS_PREFIX.'_show_wall_extras', isset($_POST['show_wall_extras']) ? $_POST['show_wall_extras'] : ''); update_option(WPS_OPTIONS_PREFIX.'_profile_google_map', $_POST['profile_google_map'] != '' ? $_POST['profile_google_map'] : 250); update_option(WPS_OPTIONS_PREFIX.'_profile_comments', isset($_POST['profile_comments']) ? $_POST['profile_comments'] : ''); update_option(WPS_OPTIONS_PREFIX.'_show_dob', isset($_POST['show_dob']) ? $_POST['show_dob'] : ''); update_option(WPS_OPTIONS_PREFIX.'_show_dob_format', ($_POST['show_dob_format'] != '') ? $_POST['show_dob_format'] : __('Born', WPS_TEXT_DOMAIN).' %monthname %day%th, %year'); update_option(WPS_OPTIONS_PREFIX.'_profile_avatars', isset($_POST['profile_avatars']) ? $_POST['profile_avatars'] : ''); update_option(WPS_OPTIONS_PREFIX.'_initial_friend', $_POST['initial_friend']); update_option(WPS_OPTIONS_PREFIX.'_redirect_wp_profile', isset($_POST['redirect_wp_profile']) ? $_POST['redirect_wp_profile'] : ''); update_option(WPS_OPTIONS_PREFIX.'_profile_show_unchecked', isset($_POST['profile_show_unchecked']) ? $_POST['profile_show_unchecked'] : ''); update_option(WPS_OPTIONS_PREFIX.'_wps_profile_default', isset($_POST['wps_profile_default']) ? $_POST['wps_profile_default'] : ''); update_option(WPS_OPTIONS_PREFIX.'_wps_default_privacy', isset($_POST['wps_default_privacy']) ? $_POST['wps_default_privacy'] : ''); update_option(WPS_OPTIONS_PREFIX.'_wps_use_gravatar', isset($_POST['wps_use_gravatar']) ? $_POST['wps_use_gravatar'] : ''); update_option(WPS_OPTIONS_PREFIX.'_hide_location', isset($_POST['symposium_hide_location']) ? $_POST['symposium_hide_location'] : ''); update_option(WPS_OPTIONS_PREFIX.'_profile_menu_type', isset($_POST[ 'wps_profile_menu_type' ]) ? $_POST[ 'wps_profile_menu_type' ] : ''); update_option(WPS_OPTIONS_PREFIX.'_use_templates', isset($_POST[ 'wps_use_templates' ]) ? $_POST[ 'wps_use_templates' ] : ''); if (isset($_POST['__wps__profile_extended_fields'])) { $range = array_keys($_POST['__wps__profile_extended_fields']); $level = ''; foreach ($range as $key) { $level .= $_POST['__wps__profile_extended_fields'][$key].','; } } else { $level = ''; } update_option(WPS_OPTIONS_PREFIX.'_profile_extended_fields', $level); // This is the hidden field, if not using default layout if (isset($_POST[ '__wps__profile_extended_fields_list' ])) { update_option(WPS_OPTIONS_PREFIX.'_profile_extended_fields', $_POST[ '__wps__profile_extended_fields_list' ] ); } // Profile menu // Vertical menu if (!get_option(WPS_OPTIONS_PREFIX.'_profile_menu_type')) { update_option(WPS_OPTIONS_PREFIX.'_menu_texthtml', isset($_POST['menu_texthtml']) ? $_POST['menu_texthtml'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_my_activity', isset($_POST['menu_my_activity']) ? $_POST['menu_my_activity'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity', isset($_POST['menu_friends_activity']) ? $_POST['menu_friends_activity'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_all_activity', isset($_POST['menu_all_activity']) ? $_POST['menu_all_activity'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_profile', isset($_POST['menu_profile']) ? $_POST['menu_profile'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_friends', isset($_POST['menu_friends']) ? $_POST['menu_friends'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_mentions', isset($_POST['menu_mentions']) ? $_POST['menu_mentions'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_groups', isset($_POST['menu_groups']) ? $_POST['menu_groups'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_events', isset($_POST['menu_events']) ? $_POST['menu_events'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_gallery', isset($_POST['menu_gallery']) ? $_POST['menu_gallery'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_following', isset($_POST['menu_following']) ? $_POST['menu_following'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_followers', isset($_POST['menu_followers']) ? $_POST['menu_followers'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_lounge', isset($_POST['menu_lounge']) ? $_POST['menu_lounge'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_avatar', isset($_POST['menu_avatar']) ? $_POST['menu_avatar'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_details', isset($_POST['menu_details']) ? $_POST['menu_details'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_settings', isset($_POST['menu_settings']) ? $_POST['menu_settings'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_other', isset($_POST['menu_my_activity_other']) ? $_POST['menu_my_activity_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_other', isset($_POST['menu_friends_activity_other']) ? $_POST['menu_friends_activity_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_other', isset($_POST['menu_all_activity_other']) ? $_POST['menu_all_activity_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_profile_other', isset($_POST['menu_profile_other']) ? $_POST['menu_profile_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_friends_other', isset($_POST['menu_friends_other']) ? $_POST['menu_friends_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_mentions_other', isset($_POST['menu_mentions_other']) ? $_POST['menu_mentions_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_groups_other', isset($_POST['menu_groups_other']) ? $_POST['menu_groups_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_events_other', isset($_POST['menu_events_other']) ? $_POST['menu_events_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_gallery_other', isset($_POST['menu_gallery_other']) ? $_POST['menu_gallery_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_following_other', isset($_POST['menu_following_other']) ? $_POST['menu_following_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_followers_other', isset($_POST['menu_followers_other']) ? $_POST['menu_followers_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_lounge_other', isset($_POST['menu_lounge_other']) ? $_POST['menu_lounge_other'] : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_profile_text', isset($_POST['menu_profile_text']) ? stripslashes($_POST['menu_profile_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_text', isset($_POST['menu_my_activity_text']) ? stripslashes($_POST['menu_my_activity_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_text', isset($_POST['menu_friends_activity_text']) ? stripslashes($_POST['menu_friends_activity_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_text', isset($_POST['menu_all_activity_text']) ? stripslashes($_POST['menu_all_activity_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_friends_text', isset($_POST['menu_friends_text']) ? stripslashes($_POST['menu_friends_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_mentions_text', isset($_POST['menu_mentions_text']) ? stripslashes($_POST['menu_mentions_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_groups_text', isset($_POST['menu_groups_text']) ? stripslashes($_POST['menu_groups_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_events_text', isset($_POST['menu_events_text']) ? stripslashes($_POST['menu_events_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_gallery_text', isset($_POST['menu_gallery_text']) ? stripslashes($_POST['menu_gallery_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_following_text', isset($_POST['menu_following_text']) ? stripslashes($_POST['menu_following_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_followers_text', isset($_POST['menu_followers_text']) ? stripslashes($_POST['menu_followers_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_lounge_text', isset($_POST['menu_lounge_text']) ? stripslashes($_POST['menu_lounge_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_avatar_text', isset($_POST['menu_avatar_text']) ? stripslashes($_POST['menu_avatar_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_details_text', isset($_POST['menu_details_text']) ? stripslashes($_POST['menu_details_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_settings_text', isset($_POST['menu_settings_text']) ? stripslashes($_POST['menu_settings_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_profile_other_text', isset($_POST['menu_profile_other_text']) ? stripslashes($_POST['menu_profile_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_other_text', isset($_POST['menu_my_activity_other_text']) ? stripslashes($_POST['menu_my_activity_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_other_text', isset($_POST['menu_friends_activity_other_text']) ? stripslashes($_POST['menu_friends_activity_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_other_text', isset($_POST['menu_all_activity_other_text']) ? stripslashes($_POST['menu_all_activity_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_friends_other_text', isset($_POST['menu_friends_other_text']) ? stripslashes($_POST['menu_friends_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_mentions_other_text', isset($_POST['menu_mentions_other_text']) ? stripslashes($_POST['menu_mentions_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_groups_other_text', isset($_POST['menu_groups_other_text']) ? stripslashes($_POST['menu_groups_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_events_other_text', isset($_POST['menu_events_other_text']) ? stripslashes($_POST['menu_events_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_gallery_other_text', isset($_POST['menu_gallery_other_text']) ? stripslashes($_POST['menu_gallery_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_following_other_text', isset($_POST['menu_following_other_text']) ? stripslashes($_POST['menu_following_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_followers_other_text', isset($_POST['menu_followers_other_text']) ? stripslashes($_POST['menu_followers_other_text']) : ''); update_option(WPS_OPTIONS_PREFIX.'_menu_lounge_other_text', isset($_POST['menu_lounge_other_text']) ? stripslashes($_POST['menu_lounge_other_text']) : ''); } // Horizontal menu if (get_option(WPS_OPTIONS_PREFIX.'_profile_menu_type') || get_option(WPS_OPTIONS_PREFIX.'_use_templates') != "on") { $default_menu_structure = '[Profile] View Profile=viewprofile Profile Details=details Community Settings=settings Upload Avatar=avatar [Activity] My Activity=activitymy Friends Activity=activityfriends All Activity=activityall [Social%f] My Friends=myfriends My Groups=mygroups The Lounge=lounge My @mentions=mentions Who I am Following=following My Followers=followers [More] My Events=events My Gallery=gallery'; $default_menu_structure_other = '[Profile] View Profile=viewprofile Profile Details=details Community Settings=settings Upload Avatar=avatar [Activity] Activity=activitymy Friends Activity=activityfriends All Activity=activityall [Social] Friends=myfriends Groups=mygroups The Lounge=lounge @mentions=mentions Following=following Followers=followers [More] Events=events Gallery=gallery'; update_option(WPS_OPTIONS_PREFIX.'_profile_menu_structure', (isset($_POST['profile_menu_structure']) && $_POST['profile_menu_structure']) ? $_POST['profile_menu_structure'] : $default_menu_structure); update_option(WPS_OPTIONS_PREFIX.'_profile_menu_structure_other', (isset($_POST['profile_menu_structure_other']) && $_POST['profile_menu_structure_other']) ? $_POST['profile_menu_structure_other'] : $default_menu_structure_other); } // Update extended fields if (isset($_POST['eid']) && $_POST['eid'] != '') { $range = array_keys($_POST['eid']); foreach ($range as $key) { $eid = $_POST['eid'][$key]; $order = $_POST['order'][$key]; $type = $_POST['type'][$key]; $default = $_POST['default'][$key]; $readonly = $_POST['readonly'][$key]; $search = $_POST['search'][$key]; $name = $_POST['name'][$key]; $slug = strtolower(preg_replace("/[^A-Za-z0-9_]/", '',$_POST['slug'][$key])); if (in_array($slug, array( "city", "country" ))) $slug .= '_2'; $wp_usermeta = $_POST['wp_usermeta'][$key]; $old_wp_usermeta = $_POST['old_wp_usermeta'][$key]; if ( $wp_usermeta != $old_wp_usermeta ) { // Hook for connecting/disconnecting EF to/from WP metadata, do something with user data based on admin's choice do_action('symposium_update_extended_metadata_hook', $slug, $wp_usermeta, $old_wp_usermeta); } $wpdb->query( $wpdb->prepare( " UPDATE ".$wpdb->base_prefix.'symposium_extended'." SET extended_name = %s, extended_order = %s, extended_slug = %s, extended_type = %s, readonly = %s, search = %s, extended_default = %s, wp_usermeta = %s WHERE eid = %d", $name, $order, $slug, $type, $readonly, $search, $default, $wp_usermeta, $eid ) ); } } // Add new extended field if applicable if ($_POST['new_name'] != '' && $_POST['new_name'] != __('New label', WPS_TEXT_DOMAIN) ) { if ( ( $_POST['new_slug'] == '' ) || ( $_POST['new_slug'] == __('New slug', WPS_TEXT_DOMAIN) ) ) { $slug = $_POST['new_name']; } else { $slug = $_POST['new_slug']; } $slug = sanitize_title_with_dashes( $slug ); $slug = substr( $slug, 0, 64 ); if (in_array($slug, array( "city", "country" ))) $slug .= '_2'; $wpdb->query( $wpdb->prepare( " INSERT INTO ".$wpdb->base_prefix.'symposium_extended'." ( extended_name, extended_order, extended_slug, readonly, search, extended_type, extended_default, wp_usermeta ) VALUES ( %s, %d, %s, %s, %s, %s, %s, %s )", array( $_POST['new_name'], $_POST['new_order'], $slug, $_POST['new_readonly'], '', $_POST['new_type'], $_POST['new_default'], $_POST['new_wp_usermeta'] ) ) ); } // Put an settings updated message on the screen echo "<div class='updated slideaway'><p>".__('Saved', WPS_TEXT_DOMAIN).".</p></div>"; } ?> <form method="post" action=""> <input type="hidden" name="symposium_update" value="__wps__plugin_profile"> <table class="form-table __wps__admin_table"> <tr><td colspan="2"><h2><?php _e('Options', WPS_TEXT_DOMAIN) ?></h2></td></tr> <tr valign="top"> <td scope="row"><label for="wps_use_templates"><?php echo __('Custom Profile Page templates', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="wps_use_templates" id="wps_use_templates" <?php if (get_option(WPS_OPTIONS_PREFIX.'_use_templates') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo sprintf(__('Activate <a href="%s">templates</a> for the profile page (default layout used if not)', WPS_TEXT_DOMAIN), 'admin.php?page=symposium_templates'); ?></span></td> </tr> <?php if (get_option(WPS_OPTIONS_PREFIX.'_use_templates') == "on") { ?> <tr valign="top"> <td scope="row"><label for="wps_profile_menu_type"><?php echo __('Horizontal menu style', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="wps_profile_menu_type" id="wps_profile_menu_type" <?php if (get_option(WPS_OPTIONS_PREFIX.'_profile_menu_type') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('Check to select horizontal menu version with drop-down items, for profile and group pages.', WPS_TEXT_DOMAIN); ?></span><br /><br /> <span class="description"><strong><?php echo __('Important! If activated, make sure that you also do the following:', WPS_TEXT_DOMAIN); ?></strong></span><br /> <ol> <span class="description"><li><?php echo __('Reset the <a href="admin.php?page=symposium_templates">Profile Page Body</a> template.', WPS_TEXT_DOMAIN); ?></span><br /> <span class="description"><li><?php echo __('Set up your menu (below).', WPS_TEXT_DOMAIN); ?></li></span> <?php if (function_exists('__wps__group')) { ?> <span class="description"><li><?php echo __('Reset the <a href="admin.php?page=symposium_templates">Group Page</a> template.', WPS_TEXT_DOMAIN); ?></span><br /> <span class="description"><li><?php echo sprintf(__('Set up your <a href="%s">group menu</a>.', WPS_TEXT_DOMAIN), 'admin.php?page=wp-symposium/groups_admin.php'); ?></li></span> <?php } ?> </ol> </td> </tr> <?php ?> <?php } else { ?> <input type="hidden" name="wps_profile_menu_type" id="wps_profile_menu_type" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_profile_menu_type') == 'on') { echo 'on'; } ?>" /> <?php } ?> <tr valign="top"> <td scope="row"><label for="redirect_wp_profile"><?php echo __('Redirect profile page', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="redirect_wp_profile" id="redirect_wp_profile" <?php if (get_option(WPS_OPTIONS_PREFIX.'_redirect_wp_profile') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo sprintf(__('Redirect WordPress generated links for WordPress profile page to %s profile page', WPS_TEXT_DOMAIN), WPS_WL_SHORT); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="wps_default_profile"><?php echo __('Default view', WPS_TEXT_DOMAIN); ?></label></td> <td> <select name="wps_profile_default"> <option value='extended'<?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_profile_default') == 'extended') { echo ' SELECTED'; } ?>><?php echo __('Profile', WPS_TEXT_DOMAIN); ?></option> <option value='wall'<?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_profile_default') == 'wall') { echo ' SELECTED'; } ?>><?php echo __('My activity', WPS_TEXT_DOMAIN); ?></option> <option value='activity'<?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_profile_default') == 'activity') { echo ' SELECTED'; } ?>><?php echo __('Friends activity (includes my activity)', WPS_TEXT_DOMAIN); ?></option> <option value='all'<?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_profile_default') == 'all') { echo ' SELECTED'; } ?>><?php echo __('All activity', WPS_TEXT_DOMAIN); ?></option> </select> <span class="description"><?php echo __("Default view for the member's own profile page", WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="wps_default_privacy"><?php echo __('Default privacy level', WPS_TEXT_DOMAIN); ?></label></td> <td> <select name="wps_default_privacy"> <option value='Nobody'<?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_default_privacy') == 'Nobody') { echo ' SELECTED'; } ?>><?php echo __('Nobody', WPS_TEXT_DOMAIN); ?></option> <option value='Friends only'<?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_default_privacy') == 'Friends only') { echo ' SELECTED'; } ?>><?php echo __('Friends only', WPS_TEXT_DOMAIN); ?></option> <option value='Everyone'<?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_default_privacy') == 'Everyone') { echo ' SELECTED'; } ?>><?php echo stripslashes(get_option(WPS_OPTIONS_PREFIX.'_alt_everyone')); ?></option> <option value='public'<?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_default_privacy') == 'public') { echo ' SELECTED'; } ?>><?php echo __('Public', WPS_TEXT_DOMAIN); ?></option> </select> <span class="description"><?php echo __("Default privacy setting for new members", WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="initial_friend"><?php echo __('Default Friend', WPS_TEXT_DOMAIN); ?></label></td> <td><input name="initial_friend" type="text" id="initial_friend" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_initial_friend'); ?>" /> <span class="description"><?php echo __('Comma separated list of user ID\'s that automatically become friends of new users (leave blank for no-one)', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="profile_avatars"><?php echo __('Profile Photos', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="profile_avatars" id="profile_avatars" <?php if (get_option(WPS_OPTIONS_PREFIX.'_profile_avatars') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('Allow members to upload their own profile photos, over-riding the internal WordPress avatars', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="wps_use_gravatar"><?php echo __('Use Gravatar', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="wps_use_gravatar" id="wps_use_gravatar" <?php if (get_option(WPS_OPTIONS_PREFIX.'_wps_use_gravatar') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('If allowing member to upload profile photos, should <a href="http://www.gravatar.com" target="_blank">gravatar</a> be used if they have not yet done so?', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="use_poke"><?php echo __('Poke/Nudge/Wink/etc', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="use_poke" id="use_poke" <?php if (get_option(WPS_OPTIONS_PREFIX.'_use_poke') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('Enable this feature', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="poke_label"><?php echo __('Poke label', WPS_TEXT_DOMAIN); ?></label></td> <td><input name="poke_label" type="text" id="poke_label" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_poke_label'); ?>" /> <span class="description"><?php echo __('The "poke" button label for your site, beware of trademarked words (includes Poke and Nudge for example)', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="status_label"><?php echo __('Status label', WPS_TEXT_DOMAIN); ?></label></td> <td><input name="status_label" type="text" id="status_label" value="<?php echo stripslashes(get_option(WPS_OPTIONS_PREFIX.'_status_label')); ?>" /> <span class="description"><?php echo __('The default prompt for new activity posts on the profile page', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="show_dob"><?php echo __('Use Date of Birth', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="show_dob" id="show_dob" <?php if (get_option(WPS_OPTIONS_PREFIX.'_show_dob') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('Use date of birth on profile', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="show_dob_format"><?php echo __('Date of birth format', WPS_TEXT_DOMAIN); ?></label></td> <td><input name="show_dob_format" type="text" id="show_dob_format" style="width:250px;" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_show_dob_format'); ?>" /> <span class="description"><?php echo sprintf(__('Valid parameters: %%0day %%day %%th %%0month %%month %%monthname %%year (see <a href="%s">admin guide</a>)', WPS_TEXT_DOMAIN), 'https://dl.dropbox.com/u/49355018/wps.pdf'); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="show_wall_extras"><?php echo __('Recently Active Friends Box', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="show_wall_extras" id="show_wall_extras" <?php if (get_option(WPS_OPTIONS_PREFIX.'_show_wall_extras') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('Show Recently Active Friends box on side of wall (may take up space, depending on page template)', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="profile_google_map"><?php echo __('Google Map', WPS_TEXT_DOMAIN); ?></label></td> <td><input name="profile_google_map" type="text" id="profile_google_map" style="width:50px" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_profile_google_map'); ?>" /> <span class="description"><?php echo __('Size of location map, in pixels. eg: 250. Set to 0 to hide.', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="profile_comments"><?php echo __('Show comment fields', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="profile_comments" id="profile_comments" <?php if (get_option(WPS_OPTIONS_PREFIX.'_profile_comments') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('Always show post comment fields (or hover to show)', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="symposium_hide_location"><?php echo __('Remove location fields', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="symposium_hide_location" id="symposium_hide_location" <?php if (get_option(WPS_OPTIONS_PREFIX.'_hide_location') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('Hide and disable location profile fields, and exclude distance from member directory', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="enable_password"><?php echo __('Enable Password Change', WPS_TEXT_DOMAIN); ?></label></td> <td> <input type="checkbox" name="enable_password" id="enable_password" <?php if (get_option(WPS_OPTIONS_PREFIX.'_enable_password') == "on") { echo "CHECKED"; } ?>/> <span class="description"><?php echo __('Allow members to change their password', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="online"><?php echo __('Inactivity period', WPS_TEXT_DOMAIN); ?></label></td> <td><input name="online" type="text" id="online" style="width:50px" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_online'); ?>" /> <span class="description"><?php echo __('How many minutes before a member is assumed off-line', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr valign="top"> <td scope="row"><label for="offline"> </label></td> <td><input name="offline" type="text" id="offline" style="width:50px" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_offline'); ?>" /> <span class="description"><?php echo __('How many minutes before a member is assumed logged out', WPS_TEXT_DOMAIN); ?></span></td> </tr> <tr><td colspan="2"><h2><?php _e('Profile Menu Items', WPS_TEXT_DOMAIN) ?></h2></td></tr> <?php if (get_option(WPS_OPTIONS_PREFIX.'_profile_menu_type') || get_option(WPS_OPTIONS_PREFIX.'_use_templates') != "on") { ?> <tr valign="top"> <td scope="row"><label for="profile_menu_structure"><?php echo __('Your page', WPS_TEXT_DOMAIN); ?></label></td> <td> <textarea rows="12" cols="40" name="profile_menu_structure" id="profile_menu_structure"><?php echo get_option(WPS_OPTIONS_PREFIX.'_profile_menu_structure') ?></textarea><br /> <span class="description"> <?php echo sprintf(__('Only applicable to the horizontal version of the profile page menu', WPS_TEXT_DOMAIN), WPS_WL); ?><br /> <?php echo sprintf(__('%%f is replaced by any pending friendship requests in top level items', WPS_TEXT_DOMAIN), WPS_WL); ?> </span><br /> <a id="__wps__reset_profile_menu" href="javascript:void(0)"><?php echo __('Reset the above...', WPS_TEXT_DOMAIN); ?></a> </td> </tr> <tr valign="top"> <td scope="row"><label for="profile_menu_structure_other"><?php echo __('Other members', WPS_TEXT_DOMAIN); ?></label></td> <td> <textarea rows="12" cols="40" name="profile_menu_structure_other" id="profile_menu_structure_other"><?php echo get_option(WPS_OPTIONS_PREFIX.'_profile_menu_structure_other') ?></textarea><br /> <span class="description"><?php echo sprintf(__('Only applicable to the horizontal version of the profile page menu', WPS_TEXT_DOMAIN), WPS_WL); ?></span><br /> <a id="__wps__reset_profile_menu_other" href="javascript:void(0)"><?php echo __('Reset the above...', WPS_TEXT_DOMAIN); ?></a> </td> </tr> <?php } else { ?> <input type="hidden" name="profile_menu_structure" id="profile_menu_structure" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_profile_menu_structure') ?>" /> <input type="hidden" name="profile_menu_structure_other" id="profile_menu_structure_other" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_profile_menu_structure_other') ?>" /> <?php } ?> <?php if (!get_option(WPS_OPTIONS_PREFIX.'_profile_menu_type') && get_option(WPS_OPTIONS_PREFIX.'_use_templates') == "on") { ?> <tr valign="top"> <td colspan="2" style="padding:0"> <table> <tr style='font-weight:bold'> <td style="width:125px"><?php _e('Menu Item', WPS_TEXT_DOMAIN); ?></td> <td><?php _e('Own Page', WPS_TEXT_DOMAIN); ?></td> <td><?php _e('Own Page Text', WPS_TEXT_DOMAIN); ?></td> <td><?php _e('Other Members', WPS_TEXT_DOMAIN); ?></td> <td><?php _e('Other Members Text', WPS_TEXT_DOMAIN); ?></td> </tr> <tr> <td><span class="description"><?php echo __('Profile', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_profile" id="menu_profile" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_profile') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_profile_text" type="text" id="menu_profile_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_profile_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_profile_other" id="menu_profile_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_profile_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_profile_other_text" type="text" id="menu_profile_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_profile_other_text'); ?>" /></td> </tr> <tr> <td><span class="description"><?php echo __('My Activity', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_my_activity" id="menu_my_activity" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_my_activity') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_my_activity_text" type="text" id="menu_my_activity_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_my_activity_other" id="menu_my_activity_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_my_activity_other_text" type="text" id="menu_my_activity_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_other_text'); ?>" /></td> </tr> <tr> <td><span class="description"><?php echo __('Friends Activity', WPS_TEXT_DOMAIN); ?></span></span></td> <td align='center'><input type="checkbox" name="menu_friends_activity" id="menu_friends_activity" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_friends_activity_text" type="text" id="menu_friends_activity_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_friends_activity_other" id="menu_friends_activity_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_friends_activity_other_text" type="text" id="menu_friends_activity_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_other_text'); ?>" /></td> </tr> <tr> <td><span class="description"><?php echo __('All Activity', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_all_activity" id="menu_all_activity" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_all_activity') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_all_activity_text" type="text" id="menu_all_activity_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_all_activity_other" id="menu_all_activity_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_all_activity_other_text" type="text" id="menu_all_activity_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_other_text'); ?>" /></td> </tr> <tr> <td><span class="description"><?php echo __('Friends', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_friends" id="menu_friends" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_friends') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_friends_text" type="text" id="menu_friends_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_friends_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_friends_other" id="menu_friends_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_friends_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_friends_other_text" type="text" id="menu_friends_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_friends_other_text'); ?>" /></td> </tr> <?php if ( function_exists('__wps__profile_plus') ) { ?> <tr> <td><span class="description"><?php echo __('Forum @mentions', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_mentions" id="menu_mentions" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_mentions') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_mentions_text" type="text" id="menu_mentions_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_mentions_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_mentions_other" id="menu_mentions_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_mentions_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_mentions_other_text" type="text" id="menu_mentions_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_mentions_other_text'); ?>" /></td> </tr> <?php } ?> <?php if ( function_exists('__wps__group') ) { ?> <tr> <td><span class="description"><?php echo __('Groups', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_groups" id="menu_groups" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_groups') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_groups_text" type="text" id="menu_groups_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_groups_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_groups_other" id="menu_groups_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_groups_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_groups_other_text" type="text" id="menu_groups_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_groups_other_text'); ?>" /></td> </tr> <?php } ?> <?php if ( function_exists('__wps__events_main') ) { ?> <tr> <td><span class="description"><?php echo __('Events', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_events" id="menu_events" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_events') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_events_text" type="text" id="menu_events_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_events_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_events_other" id="menu_events_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_events_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_events_other_text" type="text" id="menu_events_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_events_other_text'); ?>" /></td> </tr> <?php } ?> <?php if ( function_exists('__wps__gallery') ) { ?> <tr> <td><span class="description"><?php echo __('Gallery', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_gallery" id="menu_gallery" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_gallery') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_gallery_text" type="text" id="menu_gallery_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_gallery_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_gallery_other" id="menu_gallery_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_gallery_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_gallery_other_text" type="text" id="menu_gallery_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_gallery_other_text'); ?>" /></td> </tr> <?php } ?> <?php if ( function_exists('__wps__profile_plus') ) { ?> <tr> <td><span class="description"><?php echo __('Following', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_following" id="menu_following" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_following') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_following_text" type="text" id="menu_following_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_following_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_following_other" id="menu_following_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_following_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_following_other_text" type="text" id="menu_following_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_following_other_text'); ?>" /></td> </tr> <tr> <td><span class="description"><?php echo __('Followers', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_followers" id="menu_followers" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_followers') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_followers_text" type="text" id="menu_followers_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_followers_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_followers_other" id="menu_followers_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_followers_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_followers_other_text" type="text" id="menu_followers_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_followers_other_text'); ?>" /></td> </tr> <?php } ?> <?php if ( function_exists('__wps__lounge_main') ) { ?> <tr> <td><span class="description"><?php echo __('The Lounge', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_lounge" id="menu_lounge" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_lounge') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_lounge_text" type="text" id="menu_lounge_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_lounge_text'); ?>" /></td> <td align='center'><input type="checkbox" name="menu_lounge_other" id="menu_lounge_other" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_lounge_other') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_lounge_other_text" type="text" id="menu_lounge_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_lounge_other_text'); ?>" /></td> </tr> <?php } ?> <tr> <td><span class="description"><?php echo __('Profile Photo', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_avatar" id="menu_avatar" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_avatar') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_avatar_text" type="text" id="menu_avatar_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_avatar_text'); ?>" /></td> <td> </td> <td> </td> </tr> <tr> <td><span class="description"><?php echo __('Profile Details', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_details" id="menu_details" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_details') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_details_text" type="text" id="menu_details_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_details_text'); ?>" /></td> <td> </td> <td> </td> </tr> <tr> <td><span class="description"><?php echo __('Community Settings', WPS_TEXT_DOMAIN); ?></span></td> <td align='center'><input type="checkbox" name="menu_settings" id="menu_settings" <?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_settings') == "on") { echo "CHECKED"; } ?>/></td> <td><input name="menu_settings_text" type="text" id="menu_settings_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_settings_text'); ?>" /></td> <td> </td> <td> </td> </tr> </table> </td> </tr> <tr valign="top"> <td scope="row"><label for="menu_texthtml"><?php echo __('Profile Menu Text/HTML', WPS_TEXT_DOMAIN); ?></label></td> <td> <textarea name="menu_texthtml" id="menu_texthtml" rows="4" cols="30"><?php echo stripslashes(get_option(WPS_OPTIONS_PREFIX.'_menu_texthtml')); ?></textarea><br /> <span class="description"><?php echo __('Text/HTML that appears at the end of the profile menu', WPS_TEXT_DOMAIN); ?></span></td> </tr> <?php } else {?> <input type="hidden" name="menu_profile" id="menu_profile" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_profile') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_profile_text" id="menu_profile_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_profile_text'); ?>" /> <input type="hidden" name="menu_profile_other" id="menu_profile_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_profile_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_profile_other_text" id="menu_profile_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_profile_other_text'); ?>" /> <input type="hidden" name="menu_my_activity" id="menu_my_activity" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_my_activity') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_my_activity_text" id="menu_my_activity_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_text'); ?>" /> <input type="hidden" name="menu_my_activity_other" id="menu_my_activity_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_my_activity_other_text" id="menu_my_activity_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_my_activity_other_text'); ?>" /> <input type="hidden" name="menu_friends_activity" id="menu_friends_activity" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_friends_activity_text" id="menu_friends_activity_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_text'); ?>" /> <input type="hidden" name="menu_friends_activity_other" id="menu_friends_activity_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_friends_activity_other_text" id="menu_friends_activity_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_friends_activity_other_text'); ?>" /> <input type="hidden" name="menu_all_activity" id="menu_all_activity" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_all_activity') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_all_activity_text" id="menu_all_activity_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_text'); ?>" /> <input type="hidden" name="menu_all_activity_other" id="menu_all_activity_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_all_activity_other_text" id="menu_all_activity_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_all_activity_other_text'); ?>" /> <input type="hidden" name="menu_friends" id="menu_friends" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_friends') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_friends_text" id="menu_friends_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_friends_text'); ?>" /> <input type="hidden" name="menu_friends_other" id="menu_friends_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_friends_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_friends_other_text" id="menu_friends_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_friends_other_text'); ?>" /> <input type="hidden" name="menu_mentions" id="menu_mentions" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_mentions') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_mentions_text" id="menu_mentions_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_mentions_text'); ?>" /> <input type="hidden" name="menu_mentions_other" id="menu_mentions_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_mentions_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_mentions_other_text" id="menu_mentions_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_mentions_other_text'); ?>" /> <input type="hidden" name="menu_groups" id="menu_groups" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_groups') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_groups_text" id="menu_groups_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_groups_text'); ?>" /> <input type="hidden" name="menu_groups_other" id="menu_groups_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_groups_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_groups_other_text" id="menu_groups_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_groups_other_text'); ?>" /> <input type="hidden" name="menu_events" id="menu_events" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_events') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_events_text" id="menu_events_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_events_text'); ?>" /> <input type="hidden" name="menu_events_other" id="menu_events_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_events_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_events_other_text" id="menu_events_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_events_other_text'); ?>" /> <input type="hidden" name="menu_gallery" id="menu_gallery" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_gallery') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_gallery_text" id="menu_gallery_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_gallery_text'); ?>" /> <input type="hidden" name="menu_gallery_other" id="menu_gallery_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_gallery_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_gallery_other_text" id="menu_gallery_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_gallery_other_text'); ?>" /> <input type="hidden" name="menu_following" id="menu_following" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_following') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_following_text" id="menu_following_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_following_text'); ?>" /> <input type="hidden" name="menu_following_other" id="menu_following_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_following_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_following_other_text" id="menu_following_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_following_other_text'); ?>" /> <input type="hidden" name="menu_followers" id="menu_followers" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_followers') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_followers_text" id="menu_followers_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_followers_text'); ?>" /> <input type="hidden" name="menu_followers_other" id="menu_followers_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_followers_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_followers_other_text" id="menu_followers_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_followers_other_text'); ?>" /> <input type="hidden" name="menu_lounge" id="menu_lounge" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_lounge') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_lounge_text" id="menu_lounge_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_lounge_text'); ?>" /> <input type="hidden" name="menu_lounge_other" id="menu_lounge_other" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_lounge_other') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_lounge_other_text" id="menu_lounge_other_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_lounge_other_text'); ?>" /> <input type="hidden" name="menu_avatar" id="menu_avatar" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_avatar') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_avatar_text" id="menu_avatar_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_avatar_text'); ?>" /> <input type="hidden" name="menu_details" id="menu_details" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_details') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_details_text" id="menu_details_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_details_text'); ?>" /> <input type="hidden" name="menu_settings" id="menu_settings" value="<?php if (get_option(WPS_OPTIONS_PREFIX.'_menu_settings') == "on") { echo "on"; } ?>" /> <input type="hidden" name="menu_settings_text" id="menu_settings_text" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_settings_text'); ?>" /> <input type="hidden" name="menu_texthtml" id="menu_texthtml" value="<?php echo get_option(WPS_OPTIONS_PREFIX.'_menu_texthtml'); ?>" /> <?php } ?> <?php // Hook to add items to the Profile settings page echo apply_filters ( '__wps__profile_settings_before_ef_hook', "" ); ?> <tr><td colspan="2"><h2><?php _e('Extended Fields', WPS_TEXT_DOMAIN) ?></h2></td></tr> <?php if (get_option(WPS_OPTIONS_PREFIX.'_use_templates') != "on") { ?> <?php // Optionally include extended fields $sql = "SELECT * FROM ".$wpdb->base_prefix."symposium_extended"; $extensions = $wpdb->get_results($sql); $ext_rows = array(); if ($extensions) { foreach ($extensions as $extension) { array_push ($ext_rows, array ( 'eid'=>$extension->eid, 'name'=>$extension->extended_name, 'type'=>$extension->extended_type, 'order'=>$extension->extended_order ) ); } } if ($ext_rows) { ?> <tr valign="top"> <td scope="row"><label for="redirect_wp_profile"><?php echo __('Extended Fields to show<br />on profile page header', WPS_TEXT_DOMAIN); ?></label></td> <td> <?php $include = get_option(WPS_OPTIONS_PREFIX.'_profile_extended_fields'); $ext_rows = __wps__sub_val_sort($ext_rows,'order'); foreach ($ext_rows as $row) { echo '<input type="checkbox" '; if (strpos($include, $row['eid'].',') !== FALSE) echo 'CHECKED '; echo 'name="__wps__profile_extended_fields[]" value="'.$row['eid'].'" />'; echo ' <span class="description">'.stripslashes($row['name']).'</span><br />'; } echo '</td></tr>'; } ?> <?php } else { echo '<input type="hidden" name="__wps__profile_extended_fields_list" value="'.get_option(WPS_OPTIONS_PREFIX.'_profile_extended_fields').'" />'; } ?> <tr valign="top"> <td scope="row"><?php echo __('Current extended fields', WPS_TEXT_DOMAIN); ?></td><td> <?php echo '<input type="checkbox" name="profile_show_unchecked" id="profile_show_unchecked"'; if (get_option(WPS_OPTIONS_PREFIX.'_profile_show_unchecked') == "on") { echo "CHECKED"; } echo '/> <span class="description">'. __('Display checkboxes fields that are not selected (on member profile page)', WPS_TEXT_DOMAIN).'</span>'; // Extended Fields table $extensions = $wpdb->get_results("SELECT * FROM ".$wpdb->base_prefix."symposium_extended ORDER BY extended_order, extended_name"); $sql = " WHERE meta_key NOT LIKE 'symposium_%'"; $sql .= " AND meta_key NOT LIKE '%wp_%'"; $sql .= " AND meta_key NOT LIKE '%level%'"; $sql .= " AND meta_key NOT LIKE '%role%'"; $sql .= " AND meta_key NOT LIKE '%capabilit%'"; $sql = apply_filters( 'symposium_query_wp_metadata_hook', $sql ); $rows = $wpdb->get_results("SELECT DISTINCT meta_key FROM ".$wpdb->base_prefix."usermeta".$sql); echo '<style>.widefat td { border:0 } </style>'; echo '<table class="widefat">'; echo '<thead>'; echo '<tr>'; echo '<th style="width:40px">'.__('Order', WPS_TEXT_DOMAIN).'</th>'; echo '<th style="width:40px">'.__('Slug', WPS_TEXT_DOMAIN).'</th>'; echo '<th>'.__('Label', WPS_TEXT_DOMAIN).'</th>'; echo '<th>'.__('Default Value', WPS_TEXT_DOMAIN).'</th>'; echo '<th>'.__('Read Only?', WPS_TEXT_DOMAIN).'</th>'; echo '<th>'.__('Advanced Search?', WPS_TEXT_DOMAIN).'</th>'; echo '<th style="width:80px">'.__('Type', WPS_TEXT_DOMAIN).'</th>'; echo '<th style="width:30px"> </th>'; echo '</tr>'; echo '</thead>'; echo '<tbody>'; $cnt = 0; if ($extensions) { foreach ($extensions as $extension) { $slug = (!$extension->extended_slug) ? 'slug_'.$extension->eid : $extension->extended_slug ; $cnt++; if ( $cnt % 2 != 0 ) { echo '<tr>'; } else { echo '<tr style="background-color:#eee">'; } echo '<td>'; echo '<input type="hidden" name="eid[]" value="'.$extension->eid.'" />'; echo '<input type="text" name="order[]" style="width:40px" value="'.$extension->extended_order.'" />'; echo '</td>'; echo '<td>'; echo '<input type="hidden" name="slug[]" value="'.$slug.'" />'.$slug; echo '</td>'; echo '<td>'; echo '<input type="text" name="name[]" value="'.stripslashes($extension->extended_name).'" />'; echo '</td>'; echo '<td>'; echo '<input type="text" name="default[]" value="'.stripslashes($extension->extended_default).'" />'; echo '</td>'; echo '<td>'; echo '<select name="readonly[]">'; echo '<option value=""'; if ($extension->readonly != 'on') echo ' SELECTED'; echo '>'.__('No', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="on"'; if ($extension->readonly == 'on') echo ' SELECTED'; echo '>'.__('Yes', WPS_TEXT_DOMAIN).'</option>'; echo '</select>'; echo '</td>'; echo '<td>'; if ($extension->extended_type == 'Checkbox' || $extension->extended_type == 'List') { echo '<select name="search[]">'; echo '<option value=""'; if ($extension->search != 'on') echo ' SELECTED'; echo '>'.__('No', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="on"'; if ($extension->search == 'on') echo ' SELECTED'; echo '>'.__('Yes', WPS_TEXT_DOMAIN).'</option>'; echo '</select>'; } else { echo '<select name="search[]">'; echo '<option value=""'; if ($extension->search != 'on') echo ' SELECTED'; echo '>'.__('No (wrong type)', WPS_TEXT_DOMAIN).'</option>'; echo '</select>'; } echo '</td>'; echo '<td>'; echo '<select name="type[]">'; echo '<option value="Text"'; if ($extension->extended_type == 'Text') { echo ' SELECTED'; } echo '>'.__('Text', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="Checkbox"'; if ($extension->extended_type == 'Checkbox') { echo ' SELECTED'; } echo '>'.__('Checkbox', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="List"'; if ($extension->extended_type == 'List') { echo ' SELECTED'; } echo '>'.__('List', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="Textarea"'; if ($extension->extended_type == 'Textarea') { echo ' SELECTED'; } echo '>'.__('Textarea', WPS_TEXT_DOMAIN).'</option>'; echo '</select>'; echo '</td>'; echo '<td>'; echo "<a href='admin.php?page=symposium_profile&view=profile&del_eid=".$extension->eid."' class='delete'>".__('Delete', WPS_TEXT_DOMAIN)."</a>"; echo '</td>'; echo '</tr>'; if ( $cnt % 2 != 0 ) { echo '<tr>'; } else { echo '<tr style="background-color:#eee">'; } echo '<td colspan="2"></td><td colspan="6">'; echo __('Linked WP Metadata', WPS_TEXT_DOMAIN).':<br />'; echo '<input type="hidden" name="old_wp_usermeta[]" value="'.$extension->wp_usermeta.'" />'; echo '<select name="wp_usermeta[]"><option value="" SELECTED></option>'; if ($rows) { foreach ($rows as $row) { echo '<option value="'.$row->meta_key .'"'; if ( $row->meta_key == $extension->wp_usermeta ) { echo ' SELECTED'; } echo '>'.$row->meta_key.'</option>'; } } echo '</select>'; echo '</td>'; echo '</tr>'; } } echo '</table>'; echo '<tr valign="top">'; echo '<td scope="row">'.__('Add extended field', WPS_TEXT_DOMAIN).'</td><td>'; echo '<table class="widefat">'; echo '<thead><tr>'; echo '<th style="width:40px">'.__('Order', WPS_TEXT_DOMAIN).'</th>'; echo '<th style="width:40px">'.__('Slug', WPS_TEXT_DOMAIN).'</th>'; echo '<th>'.__('Label', WPS_TEXT_DOMAIN).'</th>'; echo '<th>'.__('Default Value', WPS_TEXT_DOMAIN).'</th>'; echo '<th> </th>'; echo '<th> </th>'; echo '<th style="width:80px">'.__('Type', WPS_TEXT_DOMAIN).'</th>'; echo '<th style="width:30px"> </th>'; echo '</tr></thead>'; echo '<tr>'; echo '<td>'; echo '<input type="text" name="new_order" style="width:40px" onclick="javascript:this.value = \'\'" value="0" />'; echo '</td>'; echo '<td>'; echo '<input type="text" name="new_slug" style="width:75px" onclick="javascript:this.value = \'\'" value="'.__('New slug', WPS_TEXT_DOMAIN).'" />'; echo '</td>'; echo '<td>'; echo '<input type="text" name="new_name" onclick="javascript:this.value = \'\'" value="'.__('New label', WPS_TEXT_DOMAIN).'" />'; echo '</td>'; echo '<td>'; echo '<input type="text" name="new_default" onclick="javascript:this.value = \'\'" value="" />'; echo '</td>'; echo '<td>'; echo '<select name="new_readonly">'; echo '<option value="" SELECTED>'.__('No', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="on">'.__('Yes', WPS_TEXT_DOMAIN).'</option>'; echo '</select>'; echo '</td>'; echo '<td></td>'; echo '<td>'; echo '<select name="new_type">'; echo '<option value="Text" SELECTED>'.__('Text', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="Checkbox">'.__('Checkbox', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="List">'.__('List', WPS_TEXT_DOMAIN).'</option>'; echo '<option value="Textarea">'.__('Textarea', WPS_TEXT_DOMAIN).'</option>'; echo '</select>'; echo '</td>'; echo '<td> </td>'; echo '</tr>'; echo '<tr>'; echo '<td colspan="2"></td><td colspan="5">'; echo __('Linked WP Metadata', WPS_TEXT_DOMAIN).':<br />'; echo '<select name="new_wp_usermeta"><option value="" SELECTED></option>'; if ($rows) { foreach ($rows as $row) { echo '<option value="'.$row->meta_key .'">'.$row->meta_key.'</option>'; } } echo '</select>'; echo '</td>'; echo '</tr>'; echo '<tr><td colspan="7"><span class="description">'; echo __('For lists, enter all the values separated by commas - the first value is the default choice.', WPS_TEXT_DOMAIN); echo '<br />'.__('For checkboxes, enter a value of \'on\' to default to checked.', WPS_TEXT_DOMAIN); echo '<br />'.__('Slugs should be a single descriptive word.', WPS_TEXT_DOMAIN); echo '<br />'.__('Members extended field values are not shown when they are left empty, except checkboxes where you can choose what happens above.', WPS_TEXT_DOMAIN); echo '<br /><br /><strong>'.__('Extended Fields and WordPress Profile Metadata', WPS_TEXT_DOMAIN).'</strong>'; echo '<br />'.__('Extended fields can be linked to WordPress profile metadata - make sure you choose the correct type to match the WordPress profile metadata.', WPS_TEXT_DOMAIN); echo '<br />'.__('Only link to WordPress profile metadata that you want your user\'s to access, and use the read-only setting to stop them making changes.', WPS_TEXT_DOMAIN); // Display user info as an example $rows = $wpdb->get_results("SELECT meta_key, meta_value FROM ".$wpdb->base_prefix."usermeta".$sql." AND user_id = '".$user_ID."'"); echo '<br /><br />'; echo '<input id="symposium_meta_show_button" style="margin-bottom:10px;" onclick="document.getElementById(\'symposium_meta_show\').style.display=\'block\';document.getElementById(\'symposium_meta_show_button\').style.display=\'none\';document.getElementById(\'symposium_meta_show_button_hide\').style.display=\'block\';" value="'.__('Show WP metadata for current user', WPS_TEXT_DOMAIN).'" type="button">'; echo '<input id="symposium_meta_show_button_hide" style="margin-bottom:10px;display:none;" onclick="document.getElementById(\'symposium_meta_show\').style.display=\'none\';document.getElementById(\'symposium_meta_show_button\').style.display=\'block\';document.getElementById(\'symposium_meta_show_button_hide\').style.display=\'none\';" value="'.__('Hide WP metadata', WPS_TEXT_DOMAIN).'" type="button">'; echo '<div id="symposium_meta_show" style="display:none;">'; echo '<table class="widefat" style="width:400px"><thead><tr>'; echo '<th>'.__('WP Metadata', WPS_TEXT_DOMAIN).'</th>'; echo '<th>'.__('Value', WPS_TEXT_DOMAIN).'</th>'; echo '</tr></thead><tbody>'; foreach ($rows as $row) { echo '<tr><td>'.$row->meta_key.'</td><td>'; $meta_value = maybe_unserialize($row->meta_value); if (is_array($meta_value)) { echo '<input class="regular-text all-options disabled" type="text" value="'.__('SERIALIZED DATA', WPS_TEXT_DOMAIN).'" disabled="disabled" />'; } else { // let's cut very long strings in parts so that browsers display them correctly $v = str_replace(",", ", ", $row->meta_value); $v = str_replace(";", "; ", $v); echo $v; } echo '</td></tr>'; } echo '</tbody></table>'; echo '</div>'; echo '</td></tr></tbody></table>'; // class="widefat" // Hook to add items to the Profile settings page echo apply_filters ( '__wps__profile_settings_hook', "" ); ?> <tr><td colspan="2"><h2>Shortcodes</h2></td></tr> <table style="margin-left:10px; margin-top:10px;"> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-stream]</td> <td><?php echo __('Show all activity, with activity box.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td width="165px">[<?php echo WPS_SHORTCODE_PREFIX; ?>-profile]</td> <td><?php echo __('Profile page, defaulting to activity.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-extended]</td> <td><?php echo __('Profile page, defaulting to extended information.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-activity]</td> <td><?php echo __('Profile page, defaulting to friends activity.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-settings]</td> <td><?php echo __('Profile page, defaulting to settings.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-gallery]</td> <td><?php echo __('Profile page, defaulting to gallery.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-personal]</td> <td><?php echo __('Profile page, defaulting to personal information.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-friends]</td> <td><?php echo __('Profile page, defaulting to friends.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-avatar]</td> <td><?php echo __('Profile page, defaulting to avatar upload.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-following]</td> <td><?php echo __('Profile page, defaulting to members following.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-menu]</td> <td><?php echo __('Display the profile menu.', WPS_TEXT_DOMAIN); ?></td></tr> <tr><td>[<?php echo WPS_SHORTCODE_PREFIX; ?>-member-header]</td> <td><?php echo __('Display just the member profile page header.', WPS_TEXT_DOMAIN); ?></td></tr> <?php if (function_exists('__wps__profile_plus')) { ?> <tr><td width="165px">[<?php echo WPS_SHORTCODE_PREFIX; ?>-following]</td> <td><?php echo __('Display the profile page, defaulting to show who the member is following.', WPS_TEXT_DOMAIN); ?></td></tr> <?php } ?> </table> <?php echo '</table>'; // class="form-table" ?> </td></tr> </table> <?php echo '<p class="submit" style="margin-left:6px">'; echo '<input type="submit" name="Submit" class="button-primary" value="'.__('Save Changes', WPS_TEXT_DOMAIN).'" />'; echo '</p>'; echo '</form>'; __wps__show_tabs_header_end(); echo '</div>'; }
foreach ($comment_list as $comment) { $add = array ( 'lid' => $comment->lid, 'comment' => $comment->comment, 'author' => $comment->author, 'added' => $comment->added, 'display_name' => $comment->display_name, 'ID' => $comment->ID, 'last_activity' => __wps__get_meta($comment->ID, 'last_activity'), 'status' => __wps__get_meta($comment->ID, 'status') ); array_push($comment_array, $add); } $comments = __wps__sub_val_sort($comment_array, 'lid', false); // Prepare to return comments in JSON format $return_arr = array(); // Loop through comments, adding to array if any exist if ($comments) { foreach ($comments as $comment) { // Work out if they are active or not $time_now = time(); if ($comment['last_activity'] && $comment['status'] != 'offline') { $last_active_minutes = __wps__convert_datetime($comment['last_activity']); $last_active_minutes = floor(($time_now-$last_active_minutes)/60); } else { $last_active_minutes = 999999999;
function __wps__profile_header($uid1, $uid2, $url, $display_name) { global $wpdb, $current_user; $plugin = WPS_PLUGIN_URL; $template = get_option(WPS_OPTIONS_PREFIX.'_template_profile_header'); $html = str_replace("[]", "", stripslashes($template)); $privacy = __wps__get_meta($uid1, 'share'); $html = str_replace("[display_name]", $display_name, $html); // Extended fields if (strpos($html, '[ext_') !== FALSE) { // Prepare array for use $sql = "SELECT * FROM ".$wpdb->base_prefix."symposium_extended"; $extensions = $wpdb->get_results($sql); $ext_rows = array(); if ($extensions) { foreach ($extensions as $extension) { $value = __wps__get_meta($uid1, 'extended_'.$extension->extended_slug); if ($extension->extended_type == 'Checkbox' || $value) { array_push ($ext_rows, array ( 'slug'=>$extension->extended_slug, 'name'=>$extension->extended_name, 'value'=>$value, 'type'=>$extension->extended_type, 'order'=>$extension->extended_order ) ); } } } $c = 0; while ($c < 100 && strpos($html, '[ext_') !== FALSE) { $ext = ''; $c++; $s1 = strpos($html, '[ext_'); $s2 = strpos($html, ']', $s1+1); $start = substr($html, 0, $s1); $code = substr($html, $s1+5, $s2-$s1-5); $end = substr($html, $s2+1, strlen($html)-$s1); if ( ($uid1 == $uid2) || (is_user_logged_in() && strtolower($privacy) == 'everyone') || (strtolower($privacy) == 'public') || (strtolower($privacy) == 'friends only' && __wps__friend_of($uid1, $current_user->ID)) ) { if ($ext_rows) { $ext_rows = __wps__sub_val_sort($ext_rows,'order'); foreach ($ext_rows as $row) { if (strtolower($row['slug']) == strtolower($code)) { if ($row['type'] == 'Checkbox' && !$row['value'] && get_option(WPS_OPTIONS_PREFIX.'_profile_show_unchecked') != 'on') { // Don't show if unchecked and chosen not to show (in Profile config) } else { if ($row['type'] == 'Text' && $row['value']) { $ext .= '<div class="__wps__profile_page_header_ext_label">'.stripslashes($row['name']).'</div>'; $ext .= '<div class="__wps__profile_page_header_ext_value">'.stripslashes(__wps__make_url($row['value'])).'</div>'; } if ($row['type'] == 'Textarea' && $row['value']) { $ext .= '<div class="__wps__profile_page_header_ext_label">'.stripslashes($row['name']).'</div>'; $ext .= '<div class="__wps__profile_page_header_ext_value">'.str_replace(chr(10),'<br />',stripslashes(__wps__make_url($row['value']))).'</div>'; } if ($row['type'] == 'List' && $row['value']) { $ext .= '<div class="__wps__profile_page_header_ext_label">'.stripslashes($row['name']).'</div>'; $ext .= '<div class="__wps__profile_page_header_ext_value">'.str_replace(chr(10),'<br />',stripslashes(__wps__make_url($row['value']))).'</div>'; } if ($row['type'] == 'Checkbox') { if (get_option(WPS_OPTIONS_PREFIX.'_profile_show_unchecked') == 'on' || $row['value']) { $ext .= '<div class="__wps__profile_page_header_ext_label">'.stripslashes($row['name'])." "; if ($row['value']) { $ext .= "<img src='".get_option(WPS_OPTIONS_PREFIX.'_images')."/tick.png' />"; } else { $ext .= "<img src='".get_option(WPS_OPTIONS_PREFIX.'_images')."/cross.png' />"; } $ext .= '</div>'; } } } } } } if ($c == 1) { $html = $start.'<div id="__wps__profile_page_header_ext_fields">'.$ext; } else { $html = $start.$ext; } if (strpos($end, '[ext_') === FALSE) $html .= '</div>'; $html .= $end; } else { $html = $start.$end; } } } // Profile label if ($label = __wps__get_meta($uid1, 'profile_label')) { $html = str_replace("[profile_label]", $label, $html); } else { $html = str_replace("<div id='profile_label'>[profile_label]</div>", '', $html); } // Follow/Unfollow if (function_exists('__wps__profile_plus') && is_user_logged_in() && $uid1 != $uid2) { if (__wps__is_following($uid2, $uid1)) { $html = str_replace("[follow]", '<input type="submit" ref="unfollow" value="'.__('Unfollow', WPS_TEXT_DOMAIN).'" class="__wps__button follow-button">', $html); } else { $html = str_replace("[follow]", '<input type="submit" ref="follow" value="'.__('Follow', WPS_TEXT_DOMAIN).'" class="__wps__button follow-button">', $html); } } else { $html = str_replace("[follow]", '', $html); } // Poke if (get_option(WPS_OPTIONS_PREFIX.'_use_poke') == 'on' && is_user_logged_in() && $uid1 != $uid2) { $html = str_replace("[poke]", '<input type="submit" value="'.get_option(WPS_OPTIONS_PREFIX.'_poke_label').'" class="__wps__button poke-button">', $html); } else { $html = str_replace("[poke]", '', $html); } $location = ""; $born = ""; if ( ($uid1 == $uid2) || (is_user_logged_in() && strtolower($privacy) == 'everyone') || (strtolower($privacy) == 'public') || (strtolower($privacy) == 'friends only' && __wps__friend_of($uid1, $current_user->ID)) ) { $city = __wps__get_meta($uid1, 'extended_city'); $country = __wps__get_meta($uid1, 'extended_country'); if ($city != '') { $location .= $city; } if ($city != '' && $country != '') { $location .= ", "; } if ($country != '') { $location .= $country; } $day = (int)__wps__get_meta($uid1, 'dob_day'); $month = __wps__get_meta($uid1, 'dob_month'); $year = (int)__wps__get_meta($uid1, 'dob_year'); if ($year > 0 || $month > 0 || $day > 0) { $monthname = __wps__get_monthname($month); if ($day == 0) $day = ''; if ($year == 0) $year = ''; $born = get_option(WPS_OPTIONS_PREFIX.'_show_dob_format'); $born = ( $born != '') ? $born : __('Born', WPS_TEXT_DOMAIN).' %monthname %day%th, %year'; $day0 = str_pad($day, 2, '0', STR_PAD_LEFT); $month = ($month > 0) ? str_pad($month, 2, '0', STR_PAD_LEFT) : ''; $month0 = ($month > 0) ? str_pad($month, 2, '0', STR_PAD_LEFT) : ''; $year = ($year > 0) ? $year : ''; $born = str_replace('%0day', $day0, $born); $born = str_replace('%day', $day, $born); $born = str_replace('%monthname', $monthname, $born); $born = str_replace('%0month', $month0, $born); $born = str_replace('%month', $month, $born); $born = str_replace('%year', $year, $born); $th = 'th'; if ($day == 1 || $day == 21 || $day == 31) $th = 'st'; if ($day == 2 || $day == 22) $th = 'nd'; if ($day == 3 || $day == 23) $th = 'rd'; if (strpos($born, '%th')) { if ($day) { $born = str_replace('%th', $th, $born); } else { $born = str_replace('%th', '', $born); } } $born = str_replace(' ,', ',', $born); if ($year == '') $born = str_replace(', ', '', $born); $born = apply_filters ( '__wps__profile_born', $born, $day, $month, $year ); } } else { if (strtolower($privacy) == 'friends only') { $html = str_replace("[born]", sprintf(__("Personal information only for %s.", WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friends')), $html); } if (strtolower($privacy) == 'nobody') { $html = str_replace("[born]", __("Personal information is private.", WPS_TEXT_DOMAIN), $html); } } $html = str_replace("[location]", $location, $html); if (get_option(WPS_OPTIONS_PREFIX.'_show_dob') == 'on') { $html = str_replace("[born]", $born, $html); } else { $html = str_replace("[born]", "", $html); } if ( is_user_logged_in() ) { $actions = ''; if ($uid1 == $uid2) { // Facebook Connect if (function_exists('__wps__facebook')) $actions .= __wps__get_facebook(); } else { // Buttons if (__wps__friend_of($uid1, $current_user->ID)) { // A friend // Send mail if (function_exists('__wps__mail')) $actions .= '<input type="submit" class="__wps__button" id="profile_send_mail_button" value="'.__('Send a Mail...', WPS_TEXT_DOMAIN).'" />'; } else { if (__wps__pending_friendship($uid1)) { // Pending $actions .= '<input type="submit" title="'.$uid1.'" id="cancelfriendrequest" class="__wps__button" value="'.sprintf(__('Cancel %s Request', WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend')).'" /> '; $actions .= '<div id="cancelfriendrequest_done" class="hidden addasfriend_input">'.sprintf(__('%s Request Cancelled', WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend')).'</div>'; } else { // Not a friend $actions .= '<div id="addasfriend_done1_'.$uid1.'" class="addasfriend_input" >'; $actions .= '<div id="add_as_friend_message">'; $actions .= '<input type="text" title="'.$uid1.'"id="addfriend" class="input-field" onclick="this.value=\'\'" value="'.sprintf(__('Add as a %s', WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend')).'...."'; if (!get_option(WPS_OPTIONS_PREFIX.'_show_buttons')) { $actions .= ' style="width:210px"'; } $actions .= '>'; if (get_option(WPS_OPTIONS_PREFIX.'_show_buttons')) { $actions .= '<input type="submit" title="'.$uid1.'" id="addasfriend" class="__wps__button" value="'.__('Add', WPS_TEXT_DOMAIN).'" /> '; } $actions .= '</div></div>'; $actions .= '<div id="addasfriend_done2_'.$uid1.'" class="hidden addasfriend_input">'.sprintf(__('%s Request Sent', WPS_TEXT_DOMAIN), get_option(WPS_OPTIONS_PREFIX.'_alt_friend')).'</div>'; } } } $html = str_replace("[actions]", $actions, $html); } else { $html = str_replace("[actions]", "", $html); } // Photo if (strpos($html, '[avatar') !== FALSE) { if (strpos($html, '[avatar]')) { $html = str_replace("[avatar]", get_avatar($uid1, 200), $html); } else { $x = strpos($html, '[avatar'); $y = strpos($html, ']', $x); $diff = $y-$x-8; $avatar = substr($html, 0, $x); $avatar2 = substr($html, $x+8, $diff); $avatar3 = substr($html, $x+$diff+9, strlen($html)-$x-($diff+9)); $html = $avatar . get_avatar($uid1, $avatar2) . $avatar3; } } // Filter for profile header $html = apply_filters ( '__wps__profile_header_filter', $html, $uid1 ); return $html; }
$members_array = array(); foreach ($get_members as $member) { $add = array ( 'ID' => $member->ID, 'admin' => $member->admin, 'valid' => $member->valid, 'last_activity' => __wps__get_meta($member->ID, 'last_activity'), 'city' => __wps__get_meta($member->ID, 'city'), 'country' => __wps__get_meta($member->ID, 'country'), 'share' => __wps__get_meta($member->ID, 'share') ); array_push($members_array, $add); } $members = __wps__sub_val_sort($members_array, 'last_activity', false); $inactive = get_option(WPS_OPTIONS_PREFIX.'_online'); $offline = get_option(WPS_OPTIONS_PREFIX.'_offline'); $profile = __wps__get_url('profile'); $shown_pending_title = false; $shown_members_title = true; foreach ($members as $member) { if ($member['valid'] != "on" && $shown_pending_title == false) { $html .= "<br /><p><strong>".__("Awaiting approval", WPS_TEXT_DOMAIN)."</strong></p>"; $shown_pending_title = true; $shown_members_title = false; }