Skype and Gtalk icon support

Added skype and gtalk icons into the profile field. Used manual
instructions from:
http://custom.simplemachines.org/mods/index.php?mod=3338
This commit is contained in:
Jesse Watson 2015-10-27 11:39:38 -06:00
parent 194d0277b8
commit c9d035fa7c
17 changed files with 93 additions and 12 deletions

View File

@ -949,7 +949,7 @@ function loadMemberData($users, $is_name = false, $set = 'normal')
IFNULL(lo.log_time, 0) AS is_online, IFNULL(a.id_attach, 0) AS id_attach, a.filename, a.attachment_type,
mem.signature, mem.personal_text, mem.location, mem.gender, mem.avatar, mem.id_member, mem.member_name,
mem.real_name, mem.email_address, mem.hide_email, mem.date_registered, mem.website_title, mem.website_url,
mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login,
mem.birthdate, mem.member_ip, mem.member_ip2, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.skype, mem.gtalk,
mem.karma_good, mem.id_post_group, mem.karma_bad, mem.lngfile, mem.id_group, mem.time_offset, mem.show_online,
mem.buddy_list, mg.online_color AS member_group_color, IFNULL(mg.group_name, {string:blank_string}) AS member_group,
pg.online_color AS post_group_color, IFNULL(pg.group_name, {string:blank_string}) AS post_group, mem.is_activated, mem.warning,
@ -967,7 +967,7 @@ function loadMemberData($users, $is_name = false, $set = 'normal')
IFNULL(lo.log_time, 0) AS is_online, IFNULL(a.id_attach, 0) AS id_attach, a.filename, a.attachment_type,
mem.signature, mem.personal_text, mem.location, mem.gender, mem.avatar, mem.id_member, mem.member_name,
mem.real_name, mem.email_address, mem.hide_email, mem.date_registered, mem.website_title, mem.website_url,
mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good,
mem.openid_uri, mem.birthdate, mem.icq, mem.aim, mem.yim, mem.msn, mem.posts, mem.last_login, mem.karma_good, mem.skype, mem.gtalk,
mem.karma_bad, mem.member_ip, mem.member_ip2, mem.lngfile, mem.id_group, mem.id_theme, mem.buddy_list,
mem.pm_ignore_list, mem.pm_email_notify, mem.pm_receive_from, mem.time_offset' . (!empty($modSettings['titlesEnable']) ? ', mem.usertitle' : '') . ',
mem.time_format, mem.secret_question, mem.is_activated, mem.additional_groups, mem.smiley_set, mem.show_online,
@ -1211,6 +1211,18 @@ function loadMemberContext($user, $display_custom_fields = false)
'link' => '<a class="aim" href="aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'] . '" title="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '"><img src="' . $settings['images_url'] . '/aim.gif" alt="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '" /></a>',
'link_text' => '<a class="aim" href="aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'] . '" title="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '">' . $profile['aim'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),
'skype' => $profile['skype'] !='' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => &$profile['skype'],
'href' => 'skype:'.$profile['skype'].'?userinfo',
'link' => '<a href="skype:' . $profile['skype'] . '?userinfo" target="_blank" title="' . $txt['skype'] . ' - ' . $profile['skype'] . '"><img src="' . (empty($settings['skype_image']) ? 'http://mystatus.skype.com/smallicon/' . $profile['skype'] : $settings['images_url'] . '/skype.gif') . '" title="' . $txt['skype'] . ' - ' . $profile['skype'] . '" border="0" /></a>',
'link_text' => '<a href="skype:' . $profile['skype'] . '?userinfo" target="_blank" title="' . $txt['skype'] . ' - ' . $profile['skype'] . '">' . $profile['skype'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),
'gtalk' => $profile['gtalk'] !='' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => $profile['gtalk'],
'href' => 'mailto:'.$profile['gtalk'],
'link' => '<a href="mailto:' . $profile['gtalk'] . '" target="_blank" title="' . $txt['gtalk'] . ' - ' . $profile['gtalk'] . '"><img src="' . $settings['images_url'] . '/gtalk.gif" alt="' . $txt['gtalk'] . '" border="0" /></a>',
'link_text' => '<a href="mailto:' . $profile['gtalk'] . '" target="_blank" title="' . $txt['gtalk'] . ' - ' . $profile['gtalk'] . '">' . $profile['gtalk'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),
'yim' => $profile['yim'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => $profile['yim'],
'href' => 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']),
@ -1271,7 +1283,7 @@ function loadMemberContext($user, $display_custom_fields = false)
// First do a quick run through to make sure there is something to be shown.
$memberContext[$user]['has_messenger'] = false;
foreach (array('icq', 'msn', 'aim', 'yim') as $messenger)
foreach (array('icq', 'msn', 'aim', 'yim', 'skype', 'gtalk') as $messenger)
{
if (!isset($context['disabled_fields'][$messenger]) && !empty($memberContext[$user][$messenger]['link']))
{

View File

@ -298,7 +298,7 @@ function ViewMemberlist()
'type' => 'string'
),
'messenger' => array(
'db_fields' => array('icq', 'aim', 'yim', 'msn'),
'db_fields' => array('icq', 'aim', 'yim', 'msn', 'skype', 'gtalk'),
'type' => 'string'
)
);

View File

@ -1271,7 +1271,7 @@ function ShowCustomProfiles()
$context['sub_template'] = 'show_custom_profile';
// What about standard fields they can tweak?
$standard_fields = array('icq', 'msn', 'aim', 'yim', 'location', 'gender', 'website', 'posts', 'warning_status');
$standard_fields = array('icq', 'msn', 'aim', 'yim', 'skype', 'gtalk', 'location', 'gender', 'website', 'posts', 'warning_status');
// What fields can't you put on the registration page?
$context['fields_no_registration'] = array('posts', 'warning_status');
@ -1496,7 +1496,7 @@ function list_getProfileFields($start, $items_per_page, $sort, $standardFields)
if ($standardFields)
{
$standard_fields = array('icq', 'msn', 'aim', 'yim', 'location', 'gender', 'website', 'posts', 'warning_status');
$standard_fields = array('icq', 'msn', 'aim', 'yim', 'skype', 'gtalk', 'location', 'gender', 'website', 'posts', 'warning_status');
$fields_no_registration = array('posts', 'warning_status');
$disabled_fields = isset($modSettings['disabled_profile_fields']) ? explode(',', $modSettings['disabled_profile_fields']) : array();
$registration_fields = isset($modSettings['registration_fields']) ? explode(',', $modSettings['registration_fields']) : array();

View File

@ -109,6 +109,14 @@ function Memberlist()
'label' => $txt['msn'],
'width' => '30'
),
'skype' => array(
'label' => $txt['skype'],
'width' => '30'
),
'gtalk' => array(
'label' => $txt['gtalk1'],
'width' => '30'
),
'id_group' => array(
'label' => $txt['position']
),
@ -321,6 +329,14 @@ function MLAll()
'down' => 'LENGTH(mem.msn) > 0 ASC, IFNULL(mem.msn, 1=1) DESC, mem.msn DESC',
'up' => 'LENGTH(mem.msn) > 0 DESC, IFNULL(mem.msn, 1=1) ASC, mem.msn ASC'
),
'skype' => array(
'down' => 'LENGTH(mem.skype) > 0 ASC, IFNULL(mem.skype, 1=1) DESC, mem.skype DESC',
'up' => 'LENGTH(mem.skype) > 0 DESC, IFNULL(mem.skype, 1=1) ASC, mem.skype ASC'
),
'gtalk' => array(
'down' => 'LENGTH(mem.gtalk) > 0 ASC, IFNULL(mem.gtalk, 1=1) DESC, mem.gtalk DESC',
'up' => 'LENGTH(mem.gtalk) > 0 DESC, IFNULL(mem.gtalk, 1=1) ASC, mem.gtalk ASC'
),
'registered' => array(
'down' => 'mem.date_registered DESC',
'up' => 'mem.date_registered ASC'
@ -460,7 +476,7 @@ function MLSearch()
$fields = array();
// Search for messengers...
if (in_array('messenger', $_POST['fields']) && (!$user_info['is_guest'] || empty($modSettings['guest_hideContacts'])))
$fields += array(3 => 'msn', 'aim', 'icq', 'yim');
$fields += array(3 => 'msn', 'aim', 'icq', 'yim', 'skype', 'gtalk';
// Search for websites.
if (in_array('website', $_POST['fields']))
$fields += array(7 => 'website_title', 'website_url');

View File

@ -936,6 +936,10 @@ function getXmlProfile($xml_format)
$data['msn'] = $profile['msn']['name'];
if ($profile['yim']['name'] != '' && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
$data['yim'] = $profile['yim']['name'];
if ($profile['skype']['name'] != '' && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
$data['skype'] = $profile['skype']['name'];
if ($profile['gtalk']['name'] != '' && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
$data['gtalk'] = $profile['gtalk']['name'];
if ($profile['website']['title'] != '')
$data['website'] = array(

View File

@ -763,6 +763,22 @@ function loadProfileFields($force_reload = false)
'input_attr' => array('maxlength="32"'),
'permission' => 'profile_extra',
),
'skype' => array(
'type' => 'text',
'label' => $txt['skype'],
'subtext' => $txt['your_skype'],
'size' => 24,
'input_attr' => array('maxlength="32"'),
'permission' => 'profile_extra',
),
'gtalk' => array(
'type' => 'text',
'label' => $txt['gtalk'],
'subtext' => $txt['your_gtalk'],
'size' => 24,
'input_attr' => array('maxlength="32"'),
'permission' => 'profile_extra',
),
);
$disabled_fields = !empty($modSettings['disabled_profile_fields']) ? explode(',', $modSettings['disabled_profile_fields']) : array();
@ -1701,7 +1717,7 @@ function forumProfile($memID)
array(
'avatar_choice', 'hr', 'personal_text', 'hr',
'bday1', 'location', 'gender', 'hr',
'icq', 'aim', 'msn', 'yim', 'hr',
'icq', 'aim', 'msn', 'yim', 'skype', 'gtalk', 'hr',
'usertitle', 'signature', 'hr',
'karma_good', 'hr',
'website_title', 'website_url',

View File

@ -274,7 +274,7 @@ function Register2($verifiedOpenID = false)
// Collect all extra registration fields someone might have filled in.
$possible_strings = array(
'website_url', 'website_title',
'aim', 'yim',
'aim', 'yim', 'skype', 'gtalk',
'location', 'birthdate',
'time_format',
'buddy_list',

View File

@ -664,6 +664,8 @@ function registerMember(&$regOptions, $return_errors = false)
'aim' => '',
'yim' => '',
'msn' => '',
'skype' => '',
'gtalk' => '',
'time_format' => '',
'signature' => '',
'avatar' => '',
@ -1207,7 +1209,7 @@ function list_getMembers($start, $items_per_page, $sort, $where, $where_params =
$request = $smcFunc['db_query']('', '
SELECT
mem.id_member, mem.member_name, mem.real_name, mem.email_address, mem.icq, mem.aim, mem.yim, mem.msn, mem.member_ip, mem.member_ip2, mem.last_login,
mem.id_member, mem.member_name, mem.real_name, mem.email_address, mem.icq, mem.aim, mem.yim, mem.msn, mem.skype, mem.gtalk, mem.member_ip, mem.member_ip2, mem.last_login,
mem.posts, mem.is_activated, mem.date_registered, mem.id_group, mem.additional_groups, mg.group_name
FROM {db_prefix}members AS mem
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)

View File

@ -355,6 +355,8 @@ function template_main()
', !empty($message['member']['msn']['link']) ? '<li>' . $message['member']['msn']['link'] . '</li>' : '', '
', !empty($message['member']['aim']['link']) ? '<li>' . $message['member']['aim']['link'] . '</li>' : '', '
', !empty($message['member']['yim']['link']) ? '<li>' . $message['member']['yim']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['skype']) && !empty($message['member']['skype']['link']) ? '<li>' . $message['member']['skype']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['gtalk']) && !empty($message['member']['gtalk']['link']) ? '<li>' . $message['member']['gtalk']['link'] . '</li>' : '', '
</ul>
</li>';

View File

@ -103,6 +103,16 @@ function template_main()
if (!isset($context['disabled_fields']['msn']))
echo '
<td class="windowbg2">', $member['msn']['link'], '</td>';
// Skype?
if (!isset($context['disabled_fields']['skype']))
echo '
<td class="windowbg2">', $member['skype']['link'], '</td>';
// GoogleTalk?
if (!isset($context['disabled_fields']['gtalk']))
echo '
<td class="windowbg2">', $member['gtalk']['link'], '</td>';
// Group and date.
echo '

View File

@ -286,7 +286,9 @@ function template_folder()
<li>' . $message['member']['icq']['link'] . '</li>' : '', !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '
<li>' . $message['member']['msn']['link'] . '</li>' : '', !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '
<li>' . $message['member']['aim']['link'] . '</li>' : '', !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '
<li>' . $message['member']['yim']['link'] . '</li>' : '', '
<li>' . $message['member']['yim']['link'] . '</li>' : '', ' <li>' . $message['member']['yim']['link'] . '</li>' : '', !isset($context['disabled_fields']['skype']) && !empty($message['member']['skype']['link']) ? '
<li>' . $message['member']['skype']['link'] . '</li>' : '', !isset($context['disabled_fields']['gtalk']) && !empty($message['member']['gtalk']['link']) ? '
<li>' . $message['member']['gtalk']['link'] . '</li>' : '', '
</ul>
</li>';

View File

@ -88,6 +88,8 @@ function template_summary()
', !isset($context['disabled_fields']['msn']) && !empty($context['member']['msn']['link']) ? '<li>' . $context['member']['msn']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['aim']) && !empty($context['member']['aim']['link']) ? '<li>' . $context['member']['aim']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['yim']) && !empty($context['member']['yim']['link']) ? '<li>' . $context['member']['yim']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['skype']) && !empty($context['member']['skype']['link']) ? '<li>' . $context['member']['skype']['link'] . '</li>' : '', '
', !isset($context['disabled_fields']['gtalk']) && !empty($context['member']['gtalk']['link']) ? '<li>' . $context['member']['gtalk']['link'] . '</li>' : '', '
</ul>
<span id="userstatus">', $context['can_send_pm'] ? '<a href="' . $context['member']['online']['href'] . '" title="' . $context['member']['online']['label'] . '" rel="nofollow">' : '', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $context['can_send_pm'] ? '</a>' : '', $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '';
@ -500,6 +502,8 @@ function template_editBuddies()
<th scope="col">', $txt['icq'], '</th>
<th scope="col">', $txt['aim'], '</th>
<th scope="col">', $txt['yim'], '</th>
<th scope="col">', $txt['skype'], '</th>
<th scope="col">', $txt['gtalk1'], '</th>
<th scope="col">', $txt['msn'], '</th>
<th class="last_th" scope="col"></th>
</tr>';
@ -523,6 +527,8 @@ function template_editBuddies()
<td align="center">', $buddy['icq']['link'], '</td>
<td align="center">', $buddy['aim']['link'], '</td>
<td align="center">', $buddy['yim']['link'], '</td>
<td align="center">', $buddy['skype']['link'], '</td>
<td align="center">', $buddy['gtalk']['link'], '</td>
<td align="center">', $buddy['msn']['link'], '</td>
<td align="center"><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></td>
</tr>';

View File

@ -246,6 +246,10 @@ function template_settings()
'id' => 'show_profile_buttons',
'label' => $txt['show_view_profile_button'],
),
array(
'id' => 'skype_image',
'label' => $txt['skype_static_image'],
),
array(
'id' => 'show_user_images',
'label' => $txt['user_avatars'],

View File

@ -65,7 +65,7 @@ function template_main()
echo '
<span class="contact_info floatright">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="bottom" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
', isset($context['disabled_fields']['icq']) ? '' : $member['icq']['link'] , ' ', isset($context['disabled_fields']['msn']) ? '' : $member['msn']['link'], ' ', isset($context['disabled_fields']['yim']) ? '' : $member['yim']['link'], ' ', isset($context['disabled_fields']['aim']) ? '' : $member['aim']['link'], '
', isset($context['disabled_fields']['icq']) ? '' : $member['icq']['link'] , ' ', isset($context['disabled_fields']['msn']) ? '' : $member['msn']['link'], ' ', isset($context['disabled_fields']['skype']) ? '' : $member['skype']['link'], ' ', isset($context['disabled_fields']['gtalk']) ? '' : $member['gtalk']['link'], ' ', isset($context['disabled_fields']['aim']) ? '' : $member['aim']['link'], '
</span>';
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -32,4 +32,11 @@ $txt['spoiler_tag_onbuttonclickshow'] = 'Show on Button Click';
$txt['spoiler_tag_label'] = 'Spoiler Mode';
$txt['spoiler_tag_desc'] = 'Choose how spoilers will display on the theme.';
$txt['spoiler_tag_default'] = '(use global default spoiler mode)';
$txt['gtalk'] = 'Google Talk';
$txt['your_gtalk'] = 'This is your GTalk address.';
$txt['gtalk1'] = 'G-Talk';
$txt['skype'] = 'Skype';
$txt['your_skype'] = 'This is your Skype username.';
$txt['skype_static_image'] = 'Show static skype icon.<br>(unchecked will show member skype activity details)';
?>