else { if ($user->data['user_level'] > 0) { $pm_send = true; } else { $u_pm_in = user_check_pm_in_allowed($to_userdata['user_id']); if ($u_pm_in == true) { $pm_send = true; } else { $u_pm_friend = user_check_friend_foe($to_userdata['user_id'], true); if ($u_pm_friend == true) { $pm_send = true; } else { $msg = $lang['Allow_PM_IN_SEND_ERROR'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid(CMS_PAGE_PRIVMSG . '?folder=inbox') . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid(CMS_PAGE_FORUM) . '">', '</a>'); message_die(GENERAL_MESSAGE, $msg); } } } $sql_info = "UPDATE " . PRIVMSGS_TABLE . " SET privmsgs_type = " . PRIVMSGS_NEW_MAIL . ", privmsgs_subject = '" . $db->sql_escape($privmsg_subject) . "', privmsgs_text = '" . $db->sql_escape($privmsg_message) . "', privmsgs_from_userid = " . $user->data['user_id'] . ", privmsgs_to_userid = " . $to_userdata['user_id'] . ", privmsgs_date = $msg_time, privmsgs_ip = '$user_ip', privmsgs_enable_html = $html_on, privmsgs_enable_bbcode = $bbcode_on, privmsgs_enable_smilies = $smilies_on, privmsgs_enable_autolinks_acronyms = $acro_auto_on, privmsgs_attach_sig = $attach_sig WHERE privmsgs_id = $privmsg_id"; }
$feedback_received = ''; if (!empty($config['plugins']['feedback']['enabled']) && !empty($config['plugins']['feedback']['dir'])) { include IP_ROOT_PATH . PLUGINS_PATH . $config['plugins']['feedback']['dir'] . 'common.' . PHP_EXT; $feedback_details = get_user_feedback_received($profiledata['user_id']); if ($feedback_details['feedback_count'] > 0) { $feedback_average = $feedback_details['feedback_count'] > 0 ? round($feedback_details['feedback_sum'] / $feedback_details['feedback_count'], 1) : 0; $feedback_average_img = IP_ROOT_PATH . 'images/feedback/' . build_feedback_rating_image($feedback_average); $feedback_received = $feedback_details['feedback_count'] > 0 ? '[ <a href="' . append_sid(PLUGINS_FEEDBACK_FILE . '?' . POST_USERS_URL . '=' . $profiledata['user_id']) . '">' . $feedback_details['feedback_count'] . '</a> ] <img src="' . $feedback_average_img . '" style="vertical-align: middle;" alt="' . $feedback_average . '" title="' . $feedback_average . '" />' : ''; } } // Mighty Gorgon - Feedback - END $user_sn_im_array = get_user_sn_im_array(); foreach ($user_sn_im_array as $k => $v) { $template->assign_var('ICON_' . strtoupper($k), $all_ims[$k]['icon']); } $is_friend = user_check_friend_foe($profiledata['user_id'], true); $template->assign_vars(array('FEEDBACK' => $feedback_received, 'USERNAME' => $profiledata['username'], 'JOINED' => create_date($lang['JOINED_DATE_FORMAT'], $profiledata['user_regdate'], $config['board_timezone']), 'SHOW_FRIEND_LINK' => $profiledata['user_id'] != $user->data['user_id'] ? true : false, 'IS_FRIEND' => !empty($is_friend) ? true : false, 'U_FRIEND_ADD_REMOVE' => append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&' . POST_USERS_URL . '=' . $profiledata['user_id'] . '&zmode=friend&zaction=' . (!empty($is_friend) ? 'remove' : 'add')), 'L_LOGON' => $lang['Last_logon'], 'LAST_LOGON' => $user->data['user_level'] == ADMIN || !$config['hidde_last_logon'] && $profiledata['user_allow_viewonline'] ? $profiledata['user_lastvisit'] ? create_date($config['default_dateformat'], $profiledata['user_lastvisit'], $config['board_timezone']) : $lang['Never_last_logon'] : $lang['Hidde_last_logon'], 'L_TOTAL_ONLINE_TIME' => $lang['Total_online_time'], 'TOTAL_ONLINE_TIME' => make_hours($profiledata['user_totaltime']), 'L_LAST_ONLINE_TIME' => $lang['Last_online_time'], 'LAST_ONLINE_TIME' => make_hours($profiledata['user_session_time'] - $profiledata['user_lastvisit']), 'L_NUMBER_OF_VISIT' => $lang['Number_of_visit'], 'NUMBER_OF_VISIT' => $profiledata['user_totallogon'] > 0 ? $profiledata['user_totallogon'] : $lang['None'], 'L_NUMBER_OF_PAGES' => $lang['Number_of_pages'], 'NUMBER_OF_PAGES' => $profiledata['user_totalpages'] ? $profiledata['user_totalpages'] : $lang['None'], 'USER_RANK_01' => $user_ranks['rank_01_html'], 'USER_RANK_01_IMG' => $user_ranks['rank_01_img_html'], 'USER_RANK_02' => $user_ranks['rank_02_html'], 'USER_RANK_02_IMG' => $user_ranks['rank_02_img_html'], 'USER_RANK_03' => $user_ranks['rank_03_html'], 'USER_RANK_03_IMG' => $user_ranks['rank_03_img_html'], 'USER_RANK_04' => $user_ranks['rank_04_html'], 'USER_RANK_04_IMG' => $user_ranks['rank_04_img_html'], 'USER_RANK_05' => $user_ranks['rank_05_html'], 'USER_RANK_05_IMG' => $user_ranks['rank_05_img_html'], 'POSTS_PER_DAY' => $posts_per_day, 'POSTS' => $profiledata['user_posts'], 'S_POSTS_SECTION' => $profiledata['user_posts'] > 0 ? true : false, 'PERCENTAGE' => $percentage . '%', 'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day), 'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage), 'THANKS_RECEIVED' => $total_thanks_received > 0 ? '<a href="' . append_sid(CMS_PAGE_SEARCH . '?search_thanks=' . $profiledata['user_id']) . '">' . $total_thanks_received . '</a>' : $total_thanks_received, 'INVISION_AVATAR_IMG' => $avatar_img, 'INVISION_MOST_ACTIVE_FORUM_URL' => $user_most_active_forum_url, 'INVISION_MOST_ACTIVE_FORUM_ID' => $user_most_active_forum_id, 'INVISION_MOST_ACTIVE_FORUM_NAME' => $user_most_active_forum_name, 'INVISION_POST_DAY_STATS' => sprintf($lang['Invision_User_post_day_stats'], $posts_per_day), 'INVISION_POST_PERCENT_STATS' => sprintf($lang['Invision_User_post_pct_stats'], $percentage), 'INVISION_USER_SIG' => $user_sig, 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, 'PM_IMG' => $pm_img, 'PM' => $pm, 'U_PM' => $pm_url, 'EMAIL_IMG' => !$user->data['session_logged_in'] ? '' : $email_img, 'EMAIL' => $email, 'U_EMAIL' => $email_url, 'WWW_IMG' => $www_img, 'WWW' => $www, 'U_WWW' => $www_url, 'AIM_IMG' => $aim_img, 'AIM' => $aim, 'U_AIM' => $aim_url, 'ICQ_STATUS_IMG' => $icq_status_img, 'ICQ_IMG' => $icq_img, 'ICQ' => $icq, 'U_ICQ' => $icq_url, 'MSN_IMG' => $msn_img, 'MSN' => $msn, 'U_MSN' => $msn_url, 'SKYPE_IMG' => $skype_img, 'SKYPE' => $skype, 'U_SKYPE' => $skype_url, 'YIM_IMG' => $yahoo_img, 'YIM' => $yahoo, 'U_YIM' => $yahoo_url, 'LOCATION' => $location, 'USER_FIRST_NAME' => $profiledata['user_first_name'] ? $profiledata['user_first_name'] : ' ', 'USER_LAST_NAME' => $profiledata['user_last_name'] ? $profiledata['user_last_name'] : ' ', 'OCCUPATION' => $profiledata['user_occ'] ? $profiledata['user_occ'] : ' ', 'INTERESTS' => $profiledata['user_interests'] ? $profiledata['user_interests'] : ' ', 'PHONE' => $profiledata['user_phone'] ? $profiledata['user_phone'] : ' ', 'SELFDES' => $selfdes, 'U_PROFILE_VISITS' => append_sid('profile_view_user.' . PHP_EXT . '?' . POST_USERS_URL . '=' . $profiledata['user_id'] . '&' . POST_POST_URL . '=0'), 'U_VISITS' => '<a href="' . append_sid('profile_view_user.' . PHP_EXT . '?' . POST_USERS_URL . '=' . $profiledata['user_id'] . '&' . POST_POST_URL . '=0') . '"><img src="' . $images['icon_view'] . '" alt="' . $lang['Views'] . '" /></a>', 'GENDER' => $gender, 'BIRTHDAY' => $user_birthday, 'AVATAR_IMG' => $avatar_img, 'L_VIEWING_PROFILE' => htmlspecialchars(sprintf($lang['Viewing_user_profile'], $profiledata['username'])), 'L_ABOUT_USER' => htmlspecialchars(sprintf($lang['About_user'], $profiledata['username'])), 'L_AVATAR' => $lang['Avatar'], 'L_POSTER_RANK' => $lang['Poster_rank'], 'L_JOINED' => $lang['Joined'], 'L_TOTAL_POSTS' => $lang['Total_posts'], 'L_SEARCH_USER_POSTS' => htmlspecialchars(sprintf($lang['Search_user_posts'], $profiledata['username'])), 'L_SEARCH_USER_TOPICS' => htmlspecialchars(sprintf($lang['Search_user_topics_started'], $profiledata['username'])), 'L_NO_POSTS' => $lang['No_Posts'], 'L_CONTACT' => $lang['Contact'], 'L_EMAIL_ADDRESS' => $lang['Email_address'], 'L_EMAIL' => $lang['Email'], 'L_PM' => $lang['Private_Message'], 'L_ICQ_NUMBER' => $lang['ICQ'], 'L_YAHOO' => $lang['YIM'], 'L_SKYPE' => $lang['SKYPE'], 'L_AIM' => $lang['AIM'], 'L_MESSENGER' => $lang['MSNM'], 'L_WEBSITE' => $lang['Website'], 'L_LOCATION' => $lang['Location'], 'L_OCCUPATION' => $lang['Occupation'], 'L_INTERESTS' => $lang['Interests'], 'U_USERGROUPS' => append_sid(CMS_PAGE_GROUP_CP), 'L_PHONE' => $lang['UserPhone'], 'L_EXTRA_PROFILE_INFO' => $lang['Extra_profile_info'], 'L_EXTRA_WINDOW' => $lang['Extra_window'] . ' :: ' . $profiledata['username'], 'U_EXTRA_WINDOW' => append_sid(CMS_PAGE_PROFILE . '?mode=viewprofile&' . POST_USERS_URL . '=' . $profiledata['user_id'] . '&extra_mode=window'), 'USER_OS_IMG' => $user_os['img'], 'USER_BROWSER_IMG' => $user_browser['img'], 'ONLINE_STATUS_IMG' => $online_status_img, 'L_ONLINE_STATUS' => $lang['Online_status'], 'L_INVISION_A_STATS' => $lang['Invision_Active_Stats'], 'L_INVISION_COMMUNICATE' => $lang['Invision_Communicate'], 'L_INVISION_INFO' => $lang['Invision_Info'], 'L_INVISION_MEMBER_TITLE' => $lang['Invision_Member_Title'], 'L_INVISION_MEMBER_GROUP' => $lang['Invision_Member_Group'], 'L_INVISION_MOST_ACTIVE' => $lang['Invision_Most_Active'], 'L_INVISION_MOST_ACTIVE_POSTS' => sprintf($lang['Invision_Most_Active_Posts'], $user_most_active_posts), 'L_INVISION_P_DETAILS' => $lang['Invision_Details'], 'L_INVISION_POSTS' => $lang['Invision_Total_Posts'], 'L_INVISION_PPD_STATS' => $lang['Invision_PPD_Stats'], 'L_INVISION_SIGNATURE' => $lang['Invision_Signature'], 'L_INVISION_WEBSITE' => $lang['Invision_Website'], 'L_INVISION_VIEWING_PROFILE' => htmlspecialchars(sprintf($lang['Invision_View_Profile'], $profiledata['username'])), 'L_GENDER' => $lang['Gender'], 'L_BIRTHDAY' => $lang['Birthday'], 'U_SEARCH_USER' => append_sid(CMS_PAGE_SEARCH . '?search_author=' . $u_search_author), 'U_SEARCH_USER_TOPICS' => append_sid(CMS_PAGE_SEARCH . '?search_author=' . $u_search_author . '&search_topic_starter=1&show_results=topics'), 'L_MODERATOR_IP_INFORMATION' => $lang['Moderator_ip_information'], 'L_REGISTERED_IP_ADDRESS' => $lang['Registered_ip_address'], 'L_REGISTERED_HOSTNAME' => $lang['Registered_hostname'], 'L_OTHER_REGISTERED_IPS' => sprintf($lang['Other_registered_ips'], $decoded_ip), 'L_OTHER_IPS' => $lang['Other_posted_ips'], 'USER_EMAIL_ADDRESS' => $profiledata['user_email'], 'U_USER_IP_ADDRESS' => $decoded_ip != $lang['Not_recorded'] ? '<a href="http://whois.sc/' . htmlspecialchars(urlencode($decoded_ip)) . '" target="_blank">' . $decoded_ip . '</a>' : $lang['Not_recorded'], 'USER_IP_ADDRESS' => $decoded_ip, 'USER_REGISTERED_HOSTNAME' => $hostname, 'U_USER_RECENT_TOPICS' => append_sid('recent.' . PHP_EXT . '?mode=utopics&' . POST_USERS_URL . '=' . $profiledata['user_id']), 'U_USER_RECENT_POSTS' => append_sid('recent.' . PHP_EXT . '?mode=uposts&' . POST_USERS_URL . '=' . $profiledata['user_id']), 'U_USER_RECENT_TOPICS_VIEW' => append_sid('recent.' . PHP_EXT . '?mode=utview&' . POST_USERS_URL . '=' . $profiledata['user_id']), 'S_PROFILE_ACTION' => append_sid(CMS_PAGE_PROFILE))); // Profiled user must be online, so must the current user, and the profiled user must not the currently logged in user if ($user_online_status != 'offline' && $user->data['session_logged_in'] && $user->data['user_id'] != $profiledata['user_id']) { $display_chat_link = true; if (!empty($config['ajax_chat_check_online'])) { if (!function_exists('user_in_chat_session')) { include IP_ROOT_PATH . 'includes/functions_ajax_chat.' . PHP_EXT; } // Check if the user is in the chat room $is_user_in_chat = user_in_chat_session($profiledata['user_id']); $display_chat_link = !empty($is_user_in_chat) ? true : false; } if ($display_chat_link) { $ajax_chat_page = !empty($config['ajax_chat_link_type']) ? CMS_PAGE_AJAX_CHAT : CMS_PAGE_AJAX_SHOUTBOX; $ajax_chat_room = 'chat_room=' . (min($user->data['user_id'], $profiledata['user_id']) . '|' . max($user->data['user_id'], $profiledata['user_id']));
function user_friend_foe_add($target_ids, $friend = true) { global $db, $cache, $config, $user; if (empty($target_ids)) { return false; } if (!is_array($target_ids)) { $target_ids = array($target_ids); } $sql_values = !empty($friend) ? "'1', '0'" : "'0', '1'"; foreach ($target_ids as $target_id) { $is_friend_foe = user_check_friend_foe($target_id, $friend); if (empty($is_friend_foe)) { user_friend_foe_remove(array($target_id), !$friend); $sql = "INSERT INTO " . ZEBRA_TABLE . " (`user_id` , `zebra_id` , `friend` , `foe`)\n\t\t\t\t\t\t\tVALUES ('" . $user->data['user_id'] . "', '" . $target_id . "', " . $sql_values . ")"; $result = $db->sql_query($sql); } } return true; }