News:

Wondering if this will always be free?  See why free is better.

Main Menu

Remove MSN, ICQ, AIM and YIM

Started by shadav, September 21, 2019, 04:12:46 PM

Previous topic - Next topic

shadav

ok so bare with me :D
I took on the task of removing the outdated messengers, using the MSN Remover mod as an example, on my forum and decided to share here what I did
..... ok so ICQ might still be in use, but meh, too bad, it's gone now  :laugh:

yours might be a bit different as I'm using 2.0.15 and heavily modified, but this should point you into the right directions to remove everything

:P please don't blame me if something happens.... I have run through and made sure that things were working and no errors..... but please make a backup first, just in case

in Sources > Load.php
find and remove each of the codes below
mem.icq, mem.aim, mem.yim, mem.msn,
mem.icq, mem.aim, mem.yim, mem.msn, yes there are two of them
'icq' => $profile['icq'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => $profile['icq'],
'href' => 'https://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'],
'link' => '<a class="icq new_win" href="https://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'] . '" target="_blank" title="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '"><img src="https://status.icq.com/online.gif?img=5&amp;icq=' . $profile['icq'] . '" alt="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '" width="18" height="18" /></a>',
'link_text' => '<a class="icq extern" href="https://www.icq.com/whitepages/about_me.php?uin=' . $profile['icq'] . '" title="' . $txt['icq_title'] . ' - ' . $profile['icq'] . '">' . $profile['icq'] . '</a>',
) : array('name' => '', 'add' => '', 'href' => '', 'link' => '', 'link_text' => ''),
'aim' => $profile['aim'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => $profile['aim'],
'href' => 'aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'],
'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' => ''),
'yim' => $profile['yim'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => $profile['yim'],
'href' => 'https://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']),
'link' => '<a class="yim" href="https://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']) . '" title="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '"><img src="https://opi.yahoo.com/online?u=' . urlencode($profile['yim']) . '&amp;m=g&amp;t=0" alt="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '" /></a>',
'link_text' => '<a class="yim" href="https://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($profile['yim']) . '" title="' . $txt['yim_title'] . ' - ' . $profile['yim'] . '">' . $profile['yim'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),
'msn' => $profile['msn'] !='' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => $profile['msn'],
'href' => 'https://members.msn.com/' . $profile['msn'],
'link' => '<a class="msn new_win" href="https://members.msn.com/' . $profile['msn'] . '" title="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '" /></a>',
'link_text' => '<a class="msn new_win" href="https://members.msn.com/' . $profile['msn'] . '" title="' . $txt['msn_title'] . ' - ' . $profile['msn'] . '">' . $profile['msn'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),

'icq', 'msn', 'aim', 'yim', *I've added other messengers* yours  might look like 'icq', 'msn', 'aim', 'yim'
SAVE

in Sources > ManageMembers.php
find and remove each of the codes below
'messenger' => array(
'db_fields' => array('icq', 'aim', 'yim', 'msn'),
'type' => 'string'
)

SAVE

Sources > ManageSettings.php
find and remove each of the codes below
'icq', 'msn', 'aim', 'yim',
'icq', 'msn', 'aim', 'yim', yes there are two of them
SAVE

Sources > Memberslist.php
find and remove each of the codes below
'icq' => array(
'label' => $txt['icq'],
'width' => '30'
),
'aim' => array(
'label' => $txt['aim'],
'width' => '30'
),
'yim' => array(
'label' => $txt['yim'],
'width' => '30'
),
'msn' => array(
'label' => $txt['msn'],
'width' => '30'
),

'icq' => array(
'down' => 'LENGTH(mem.icq) > 0 ASC, mem.icq = 0 DESC, mem.icq DESC',
'up' => 'LENGTH(mem.icq) > 0 DESC, mem.icq = 0 ASC, mem.icq ASC'
),
'aim' => array(
'down' => 'LENGTH(mem.aim) > 0 ASC, IFNULL(mem.aim, 1=1) DESC, mem.aim DESC',
'up' => 'LENGTH(mem.aim) > 0 DESC, IFNULL(mem.aim, 1=1) ASC, mem.aim ASC'
),
'yim' => array(
'down' => 'LENGTH(mem.yim) > 0 ASC, IFNULL(mem.yim, 1=1) DESC, mem.yim DESC',
'up' => 'LENGTH(mem.yim) > 0 DESC, IFNULL(mem.yim, 1=1) ASC, mem.yim ASC'
),
'msn' => array(
'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'
),

// Search for messengers...
if (in_array('messenger', $_POST['fields']) && (!$user_info['is_guest'] || empty($modSettings['guest_hideContacts'])))
{
$fields += array(3 => 'msn', 'aim', 'icq', 'yim');
$search_fields[] = 'messenger';
}

SAVE

Sources > News.php
find and remove each of the codes below
if (!empty($profile['icq']['name']) && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
$data['icq'] = $profile['icq']['name'];
if ($profile['aim']['name'] != '' && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
$data['aim'] = $profile['aim']['name'];
if ($profile['msn']['name'] != '' && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
$data['msn'] = $profile['msn']['name'];
if ($profile['yim']['name'] != '' && !(!empty($modSettings['guest_hideContacts']) && $user_info['is_guest']))
$data['yim'] = $profile['yim']['name'];

SAVE

Sources > Profile-Modify.php
find and remove each of the codes below
'msn' => array(
'type' => 'text',
'label' => $txt['msn'],
'subtext' => $txt['msn_email_address'],
'size' => 24,
'permission' => 'profile_extra',
'input_validate' => create_function('&$value', '
global $cur_profile;
// Make sure the msn one is an email address, not something like \'none\' :P.
if ($value != \'\' && preg_match(\'~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\\\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~\', $value) == 0)
{
$value = $cur_profile[\'msn\'];
return false;
}
return true;
'),
),

'icq', 'aim', 'msn', 'yim', 'hr',
'yim' => array(
'type' => 'text',
'label' => $txt['yim'],
'subtext' => $txt['your_yim'],
'size' => 24,
'input_attr' => array('maxlength="32"'),
'permission' => 'profile_extra',
),

'icq' => array(
'type' => 'text',
'label' => $txt['icq'],
'subtext' => $txt['your_icq'],
'size' => 24,
'permission' => 'profile_extra',
// Need to make sure ICQ doesn't equal 0.
'input_validate' => create_function('&$value', '
if (empty($value))
$value = \'\';
else
$value = (int) $value;
return true;
'),
),

'aim' => array(
'type' => 'text',
'label' => $txt['aim'],
'subtext' => $txt['your_aim'],
'size' => 24,
'value' => strtr(empty($cur_profile['aim']) ? '' : $cur_profile['aim'], '+', ' '),
'permission' => 'profile_extra',
'input_validate' => create_function('&$value', '
$value = strtr($value, \' \', \'+\');
return true;
'),
),

SAVE

Sources > Register.php
find and remove each of the codes below
if (isset($_POST['msn']) && preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['msn']) != 0)
$profile_strings[] = 'msn';

'icq', 'msn', 'aim', 'yim',
'icq', 'msn', 'aim', 'yim', yes there's two of them
'icq',
'aim', 'yim',
SAVE

Sources > Subs-Members.php
find and remove each of the codes below
'icq' => '',
'aim' => '',
'yim' => '',
'msn' => '',

mem.icq, mem.aim, mem.yim, mem.msn,
// ICQ cannot be zero.
if (isset($regOptions['extra_register_vars']['icq']) && empty($regOptions['extra_register_vars']['icq']))
$regOptions['extra_register_vars']['icq'] = '';

SAVE

Themes > YOUR THEME > Display.template.php
find and remove each of the codes below
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
echo '
<li class="im_icons">
<ul>
', !empty($message['member']['icq']['link']) ? '<li>' . $message['member']['icq']['link'] . '</li>' : '', '
', !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>' : '', '
</ul>
</li>';

SAVE

Themes > YOUR THEME > Memberlist.template.php
find and remove each of the codes below
// ICQ?
if (!isset($context['disabled_fields']['icq']))
echo '
<td class="windowbg2">', $member['icq']['link'], '</td>';

// AIM?
if (!isset($context['disabled_fields']['aim']))
echo '
<td class="windowbg2">', $member['aim']['link'], '</td>';

// YIM?
if (!isset($context['disabled_fields']['yim']))
echo '
<td class="windowbg2">', $member['yim']['link'], '</td>';

// MSN?
if (!isset($context['disabled_fields']['msn']))
echo '
<td class="windowbg2">', $member['msn']['link'], '</td>';

// ICQ?
if (!isset($context['disabled_fields']['icq']))
echo '
', $member['icq']['link'], '';
// AIM?
if (!isset($context['disabled_fields']['aim']))
echo '
', $member['aim']['link'], '';
// YIM?
if (!isset($context['disabled_fields']['yim']))
echo '
', $member['yim']['link'], '';

SAVE

Themes > YOUR THEME > PersonalMessage.template.php
find and remove each of the codes below
// This shows the popular messaging icons.
if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
echo '
<li class="im_icons">
<ul>', !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '
<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>' : '', '
</ul>
</li>';

SAVE

Themes > YOUR THEME > Profile.template.php
find and remove each of the codes below
', !isset($context['disabled_fields']['icq']) && !empty($context['member']['icq']['link']) ? '<li>' . $context['member']['icq']['link'] . '</li>' : '', '
', !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>' : '', '

<th scope="col">', $txt['icq'], '</th>
<th scope="col">', $txt['aim'], '</th>
<th scope="col">', $txt['yim'], '</th>
<th scope="col">', $txt['msn'], '</th>

<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['msn']['link'], '</td>
I think this was one of the buddy mods that added this so, well you may not have this
<th scope="col">', $txt['icq'], '</th>
<th scope="col">', $txt['aim'], '</th>
<th scope="col">', $txt['yim'], '</th>
<th scope="col">', $txt['msn'], '</th>
yes there's two of them
<td align="center">', $member['icq']['link'], '</td>
<td align="center">', $member['aim']['link'], '</td>
<td align="center">', $member['yim']['link'], '</td>
<td align="center">', $member['msn']['link'], '</td>

       ', $buddy['icq']['link'], '
       ', $buddy['aim']['link'], '
       ', $buddy['yim']['link'], '
I think this was one of the buddy mods that added this so, well you may not have this
SAVE

Themes > YOUR THEME > Who.template.php
find and remove each of the codes below
', 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'], '
like icq, msn, y!, and aim  :laugh: just because  :laugh:
        ', isset($context['disabled_fields']['icq']) ? '' : $member['icq']['link'] , '
       
        ', isset($context['disabled_fields']['aim']) ? '' : $member['aim']['link'], '
       
        ', isset($context['disabled_fields']['yim']) ? '' : $member['yim']['link'], '

SAVE

The Below is the language files, if you use utf8, make sure to also edit those files..... if you use another language, make sure to edit those files as well

Themes > YOUR THEME > languages >  index.english.php
find and remove each of the codes below
$txt['aim'] = 'AIM';
// In this string, please use +'s for spaces.
$txt['aim_default_message'] = 'Hi.+Are+you+there?';
$txt['aim_title'] = 'AOL Instant Messenger';
$txt['icq'] = 'ICQ';
$txt['icq_title'] = 'ICQ Messenger';
$txt['msn'] = 'MSN';
$txt['msn_title'] = 'MSN Messenger';
$txt['yim'] = 'YIM';
$txt['yim_title'] = 'Yahoo Instant Messenger';

SAVE

Themes > YOUR THEME > languages > Profile.english.php
find and remove each of the codes below
$txt['msn_email_address'] = 'Your MSN messenger email address';

$txt['your_icq'] = 'This is your ICQ number.';
$txt['your_aim'] = 'This is your AOL Instant Messenger nickname.';
$txt['your_yim'] = 'This is your Yahoo! Instant Messenger nickname.';

SAVE

ok a few more things.... removing the icons  ;)
Themes > YOUR THEME > images
find and remove
msntalk.gif
aim.gif
doesn't seem that icq or yim had icons  :laugh:

CONGRATS, YOU'VE NOW GOTTEN RID OF MSN, ICQ, AIM AND YIM!!!!
well I think so anyways....

now if you want to..... go into your database, i'm sure there's some stuff in there that can be removed, but I'm not going to do that (at least not right now....this was enough of an achievement for me today)


found a few more that are mod related
for the adk blog mod
in sources > Subs-adkblog.php
find and remove
'icq' => $memberContext[$id_member]['icq']['link'].'&nbsp;',
'aim' => $memberContext[$id_member]['aim']['link'].'&nbsp;',
'msn' => $memberContext[$id_member]['msn']['link'].'&nbsp;',
'yim' => $memberContext[$id_member]['yim']['link'].'&nbsp;',

SAVE

if i find anymore mods that still reference msn, icq, aim or yim i will add them here

Code edited to remove correct mistake, as requested.

Antechinus

Comprehensive. And definitely the way to go for minimal code processing once completed. :)

Of course, if you're lazy you can do it all with a bit of CSS. ;)

shadav

thank you  :-[

at first i just was commenting them out in my template files but then I was like, really there's no need for them since they aren't even around anymore.... so figured just get rid of them all together..... seemed silly to keep commenting them out, it's not like i'm going to change my mind and want to use them  :laugh:

but as I started doing it, realized there was a lot of places they were called at....so thought why not, try to jot it down, I'm sure someone else would like to just remove them :)

if i knew how, i'd package it up but meh, oh well :D plus with different templates and modifications, a packaged file probably wouldn't work that well

Arantor

If you go to Core Features, turn on Advanced Profile Fields, you get a UI where you can turn them all off.

Also note in 2.1 these have all been moved to the Custom Profile Fields feature so you can truly delete them in 2.1 without changing files.

shawnb61

Further, a word of caution: do not remove the DB fields.  This will cause the 2.1 migration to custom fields to fail.  Just hide them.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Antechinus

Quote from: Arantor on September 22, 2019, 06:42:21 PMIf you go to Core Features, turn on Advanced Profile Fields, you get a UI where you can turn them all off.

Didn't know that. Handy. I'll take a look.

ETA: Aha. Noice. :) Why didn't someone mention this before? :P

shadav

Quote from: Arantor on September 22, 2019, 06:42:21 PM
If you go to Core Features, turn on Advanced Profile Fields, you get a UI where you can turn them all off.

Also note in 2.1 these have all been moved to the Custom Profile Fields feature so you can truly delete them in 2.1 without changing files.
yeah I turned them off, but still their codes were in template files and source files..... figured meh, get rid of it, never going to use it.....

I figured for 2.1 they'd be gone  ;D (at least I'd hope so  :laugh: )

Quote from: shawnb61 on September 22, 2019, 06:45:29 PM
Further, a word of caution: do not remove the DB fields.  This will cause the 2.1 migration to custom fields to fail.  Just hide them.

that's good to know.... I was going to look in the db but decided not to, it can sit in there unused, i don't play with my db as much as i do source and template files ;)

Antechinus

Incidentally, is there any reason why the ICQ and AIM columns are still used on the memberlist of this site?

(And someone really should throw text-align: center; on the website column. :P )

shawnb61

#8
Quote from: shadav on September 22, 2019, 06:52:55 PM
I was going to look in the db but decided not to, it can sit in there unused, i don't play with my db as much as i do source and template files ;)

Yes, the general rule do not remove fields from the DB, as that will almost certainly impact upgrades & future patches, etc.  People do it, & wonder why upgrades are hard.   ::)
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Antechinus

The other point is that it's usually ok to remove db fields that were created by mods that have been uninstalled.
Providing, of course, that you are dead sure you have the right db fields.
It's removal of default fields which will screw things up.

Arantor

Quote from: shadav on September 22, 2019, 06:52:55 PM
Quote from: Arantor on September 22, 2019, 06:42:21 PM
If you go to Core Features, turn on Advanced Profile Fields, you get a UI where you can turn them all off.

Also note in 2.1 these have all been moved to the Custom Profile Fields feature so you can truly delete them in 2.1 without changing files.
yeah I turned them off, but still their codes were in template files and source files..... figured meh, get rid of it, never going to use it.....

I figured for 2.1 they'd be gone  ;D (at least I'd hope so  :laugh: )

Quote from: shawnb61 on September 22, 2019, 06:45:29 PM
Further, a word of caution: do not remove the DB fields.  This will cause the 2.1 migration to custom fields to fail.  Just hide them.

that's good to know.... I was going to look in the db but decided not to, it can sit in there unused, i don't play with my db as much as i do source and template files ;)

Let's hope no SMF patch touches that code because that would break the patch if it did. I'm always a fan of not touching code if I don't have to.

shadav

Quote from: shadav on September 21, 2019, 04:12:46 PM
Themes > YOUR THEME > languages > Profile.english.php
find and remove each of the codes below
$txt['msn_email_address'] = 'Your MSN messenger email address';
$txt['current_password'] = 'Current Password';

$txt['your_icq'] = 'This is your ICQ number.';
$txt['your_aim'] = 'This is your AOL Instant Messenger nickname.';
$txt['your_yim'] = 'This is your Yahoo! Instant Messenger nickname.';

SAVE

I can't edit the post, I reported it so hopefully a moderator will change it ;)
I made a mistake
don't remove $txt['current_password'] = 'Current Password'; sorry :) that is needed in the language files,  got a bit carried away there ;)
so ignore that bit above and do this instead
Themes > YOUR THEME > languages > Profile.english.php
find and remove each of the codes below
$txt['msn_email_address'] = 'Your MSN messenger email address';
$txt['your_icq'] = 'This is your ICQ number.';
$txt['your_aim'] = 'This is your AOL Instant Messenger nickname.';
$txt['your_yim'] = 'This is your Yahoo! Instant Messenger nickname.';

SAVE

if you already removed it just look for
// Don't use entities in the below string, except the main ones. (lt, gt, quot.)
and add before
$txt['current_password'] = 'Current Password';

:-[ sorry  :-[

Antechinus

Meh. It would only have caused an undefined index error and a bit of blank space on the account settings page. Good to correct it, but hardly a critical error.

Advertisement: