Request: Apple iChat support.

Started by Banitsa, January 25, 2007, 04:42:58 AM

Previous topic - Next topic

Banitsa

I have made searches of the forum and the download area but I can not find what I want.

I would like to be able to insert iChat addresses into a profile, just like AIM, MSM etc. I have tried putting an iChat address into the AIM field (as iChat appears to be associated with AIM somehow), but my iChat address is to long for AIM.

I am sure I am not the only Apple/iChat user so, does anyone have a mod, or know who may be (interested in) developing one?

I would have a go myself but Im not a programmer and I wouldnt have a clue where to start :( but am more than willing to help with testing such a mod.

Thanks

Victor


drhamad

#1
What does an iChat address look like?  I didn't realize they were any longer or different than AIM addresses?
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Banitsa

Mine is [email protected] and the last 2 chars dont fit in the AIM field. I dont know what would be required as coding change to invoke iChat or if it would work automagically via AIM.

drhamad

Barring unforseen problems, I'll try to get you one today.

Couple questions:
1. Do you have graphics for the icons for iChat?
2. Do you have any examples of an iChat link anywhere on any site? (I need to know what the protocol is, like AIM's "aim:goim?screenname="  )  I can do it without this, just won't autoopen iChat
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

drhamad

#4
OK, here you go.  Do you need it in package format?  Going to have to wait for that, if so, but let me know.

Please keep in mind that while I have tested (a little bit) the functionality, I have NOT tested the "find" commands that I'm telling you to do below - in other words, be careful where you put things because I haven't checked to make sure 100% of the finds will get you ONLY what you should be doing.  In other words, just keep backups.  Nothing here will screw anything up (theoretically), even if it is done wrong, but never hurts to be sure.

Also, if you find a better graphic than the one I used, please let me know.  You need roughly a 16x16 graphic (this one is a 50x48 that I told the software to bring down to 16).


Alter your database, using this sql (using phpMyAdmin or whatever):
ALTER TABLE `smf_members` ADD `iChat` VARCHAR( 32 ) NOT NULL AFTER `MSN` ;

Upload ichat.jpg to $theme_dir/images/

Open: Sources/Profile.php

Find:
'msn' => array('name' => empty($user_profile[$memID]['MSN']) ? '' : $user_profile[$memID]['MSN']),

Add Below:

'iChat' => array('name' => empty($user_profile[$memID]['iChat']) ? '' : $user_profile[$memID]['iChat']),

Find:

$fix_spaces = array('MSN', 'AIM', 'YIM');

Replace With:

$fix_spaces = array('MSN', 'AIM', 'YIM', 'iChat');

Find:

if (isset($_POST['MSN']) && ($_POST['MSN'] == '' || preg_match('~^[0-9A-Za-z=_+\\-/][0-9A-Za-z=_\\'+\\-/\\.]*@[\\w\\-]+(\\.[\\w\\-]+)*(\\.[\\w]{2,6})$~', $_POST['MSN']) != 0))
$profile_strings[] = 'MSN';


Add Below:

// Make sure the iChat one is an email address, not something like 'none' :P.
if (isset($_POST['iChat']) && ($_POST['iChat'] == '' || preg_match('~^[0-9A-Za-z=_+\\-/][0-9A-Za-z=_\\'+\\-/\\.]*@[\\w\\-]+(\\.[\\w\\-]+)*(\\.[\\w]{2,6})$~', $_POST['iChat']) != 0))
$profile_strings[] = 'iChat';

Find:

'msn' => array(
'name' => empty($_POST['msn']) ? '' : stripslashes($_POST['MSN'])
),


Add Below:

'iChat' => array(
'name' => empty($_POST['iChat']) ? '' : stripslashes($_POST['iChat'])
),


Open: $theme_dir/Profile.template.php

Find:
<td><b>', $txt[604], ': </b></td>
<td>', $context['member']['yim']['link_text'], '</td>
</tr><tr>


Add Below:

<td><b>', $txt['iChat'], ': </b></td>
<td>', $context['member']['iChat']['link_text'], '</td>
</tr><tr>


Find:

<td align="center">', $txt['MSN'], '</td>

Add Below:

<td align="center">', $txt['iChat'], '</td>

Find:

<td align="center">', $buddy['msn']['link'], '</td>

Add Below:

<td align="center">', $buddy['iChat']['link'], '</td>

Find:

<td><input type="text" name="YIM" maxlength="32" size="24" value="', $context['member']['yim']['name'], '" /></td>
</tr><tr>


Add Below:

<td width="40%"><b>', $txt['iChat'], ': </b><div class="smalltext">', $txt['iChatUnder'], '</div></td>
<td><input type="text" name="iChat" maxlength="32" size="24" value="', $context['member']['iChat']['name'], '" /></td>
</tr><tr>


Open: $theme_dir/language/index.english.php

Find:

$txt['MSN'] = 'MSN';

Add Below:

$txt['iChat'] = 'iChat';

Open: Sources/Load.php

Find:

mem.birthdate, mem.memberIP, mem.memberIP2, mem.ICQ, mem.AIM, mem.YIM, mem.MSN,

Insert In-line (directly after mem.MSN, ):

mem.iChat,

Find:

mem.birthdate, mem.ICQ, mem.AIM, mem.YIM, mem.MSN,

Insert In-line (directly after mem.MSN, ):

mem.iChat,

Find:

'msn' => $profile['MSN'] !='' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => &$profile['MSN'],
'href' => 'http://members.msn.com/' . $profile['MSN'],
'link' => '<a href="http://members.msn.com/' . $profile['MSN'] . '" target="_blank"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $profile['MSN'] . '" border="0" /></a>',
'link_text' => '<a href="http://members.msn.com/' . $profile['MSN'] . '" target="_blank">' . $profile['MSN'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),


Add After:

'iChat' => $profile['iChat'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => &$profile['iChat'],
'href' => 'aim:goim?screenname=' . urlencode(strtr($profile['iChat'], array(' ' => '%20'))) . '&amp;message=' . $txt['iChat_default_message'],
'link' => '<a href="aim:goim?screenname=' . urlencode(strtr($profile['iChat'], array(' ' => '%20'))) . '&amp;message=' . $txt['iChat_default_message'] . '"><img src="' . $settings['images_url'] . '/ichat.gif" alt="' . $profile['iChat'] . '" border="0" width="16" /></a>',
'link_text' => '<a href="aim:goim?screenname=' . urlencode(strtr($profile['iChat'], array(' ' => '%20'))) . '&amp;message=' . $txt['iChat_default_message'] . '">' . $profile['iChat'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),



Open: $theme_dir/languages/profile.english.php

Find:

$txt[602] = 'This is your Yahoo! Instant Messenger nickname.';

Add Below:

$txt['iChatUnder'] = 'This is your Apple iChat nickname (e-mail).';

Open: $theme_dir/Display.template.php

Find:

', $message['member']['yim']['link'], '<br />';

Replace With:

', $message['member']['yim']['link'], '
', $message['member']['iChat']['link'], '<br />';



      OPEN: Sources/Memberlist.php

      FIND:
      
      'MSN' => array(
         'label' => $txt['MSN'],
         'width' => '25'
      ),
      
      ADD AFTER:
         
      'iChat' => array(
         'label' => $txt['iChat'],
         'width' => '25'
      ),
   
   
      FIND:
      
      'MSN' => array(
         'down' => 'LENGTH(mem.MSN) > 0 DESC, ISNULL(mem.MSN) ASC, mem.MSN ASC',
         'up' => 'LENGTH(mem.MSN) > 0 ASC, ISNULL(mem.MSN) DESC, mem.MSN DESC'
      ),
      
      ADD AFTER:
      
      'iChat' => array(
         'down' => 'LENGTH(mem.iChat) > 0 DESC, ISNULL(mem.iChat) ASC, mem.iChat ASC',
         'up' => 'LENGTH(mem.iChat) > 0 ASC, ISNULL(mem.iChat) DESC, mem.iChat DESC'
      ),
      
      FIND:
      
         $fields += array(3 => 'MSN', 'AIM', 'ICQ', 'YIM');
         
      REPLACE WITH:
      
         $fields += array(3 => 'MSN', 'AIM', 'ICQ', 'YIM', 'iChat');
         
      
      
      OPEN: $theme_dir/Memberlist.template.php
      
      
      FIND:
      
         <td class="windowbg2">', $member['msn']['link'], '</td>
               
      ADD AFTER:
      
         <td class="windowbg2">', $member['iChat']['link'], '</td>
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Banitsa

Many Many thanks!

Sorry I didnt get back to you quicker. I work shifts and I was sleeping until a couple of hours ago.

If at some stage a package could be made I think there will be other people interested in installing it.

I will print out and try the mods given, and let you know how I get on. But first I will create a second forum to try it on :)

Thanks again

Victor

drhamad

No problem.  The only thing I'm not 100% sure of, as far as functionality goes, (because I developed that on my pc at work, not my Mac's at home) is whether clicking the little iChat icon I put into posts will actually bring up an IM window with the username already in it/etc.  Every link I found on the web seemed to just use the AIM protocol for iChat, so that's what I used.

I'll try to do a package sometime soon, not sure exactly when though.
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Banitsa

I have extracted the iChat icon file from the iChat package, but I dont appear to have the permission to attach a file. As you have a mac at home I assume you can also extract the icon?

I had one problem with the instructions, the part in $theme_dir/Profile.template.php to

FIND <td width="40%"><b>', $txt['iChat'], ': </b><div class="smalltext">', $txt['iChatUnder'], '</div></td>
<td><input type="text" name="YIM" maxlength="32" size="24" value="', $context['member']['yim']['name'], '" /></td>
</tr><tr>
appears to be incorrect sa the code doesnt exist. So I have inserted it in the are where it refered to msm,yim etc. I assume this is correct?

As an aside, if I want to change a theme in future I assume as well, I would have to edit the new theme. Is this correct? (I have a couple of mods installed that only appear to work with the default theme.

drhamad

Quote from: Banitsa on January 26, 2007, 10:34:59 AM
I have extracted the iChat icon file from the iChat package, but I dont appear to have the permission to attach a file. As you have a mac at home I assume you can also extract the icon?

I had one problem with the instructions, the part in $theme_dir/Profile.template.php to

FIND <td width="40%"><b>', $txt['iChat'], ': </b><div class="smalltext">', $txt['iChatUnder'], '</div></td>
<td><input type="text" name="YIM" maxlength="32" size="24" value="', $context['member']['yim']['name'], '" /></td>
</tr><tr>
appears to be incorrect sa the code doesnt exist. So I have inserted it in the are where it refered to msm,yim etc. I assume this is correct?

Oops, just reversed some code there.  Look at my post again now, I've fixed it.  Basically the first line of that, that has the iChat in it, was supposed to be the first line of the Add.  You need both lines of that Add, the one that was listed as Add, plus the first line of that search (Look in my post, I've fixed it now).

Quote
As an aside, if I want to change a theme in future I assume as well, I would have to edit the new theme. Is this correct? (I have a couple of mods installed that only appear to work with the default theme.

You will need to change anything in the $theme_dir again - so the language files and the .template.php files.  You will not need to change anything in the Sources dir.
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Banitsa

Thanks Im slowly getting there!

The test forum is at www.ogee.org/forum [nofollow]


drhamad

Looks like everything is working, just missing the graphic.
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Banitsa

Yes the graphic needed to be a gif. fixed.

There is still a bug in that it looks like the ichat address is not stored. I have checked the SQL has been updated, but when you enter an address, it doesnt show in the profile. Any suggestions?

drhamad

actually, the way I coded it it should be a jpg.  But whatever works :)

Let me check the prob, 1 sec
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

drhamad

OK, it's definitely stored, because it works in the posts (you can check the db table yourself, in phpMyAdmin or whatever, to see that it is stored - I obviously can't).

So the problem must be in Profile.template.php or Profile.php...

Edit:

or possibly Load.php - make sure you did that mem.iChat step both times.

Make sure you did all the Profile.php and Profile.template.php code correctly.

OK I really need to make this into a pkg ;)
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Banitsa

Yes I can see your and my ichat address in the table.

Banitsa

Got it! it was one of the mem.iChat in load.php.

Your a star!

Thanks alot again.

As soon as the package is available I will include it on all my forums. :)

drhamad

I doubt I'll be able to do it this weekend, but perhaps next week.
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Banitsa

Maybe the Member list could also have the iChat icon.

drhamad

Quote from: Banitsa on January 26, 2007, 12:11:27 PM
Maybe the Member list could also have the iChat icon.

Oops, yep, forgot that there was an icon there.  I'll get that in too.  I'm going to do a little work on the package right now, but I probably won't get it done today.
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

drhamad

Quote from: drhamad on January 26, 2007, 04:26:22 PM
Quote from: Banitsa on January 26, 2007, 12:11:27 PM
Maybe the Member list could also have the iChat icon.

Oops, yep, forgot that there was an icon there.  I'll get that in too.  I'm going to do a little work on the package right now, but I probably won't get it done today.

OK, fixed, check the original post
FMVperformance:  3.51m posts, 63k members, 11 boards, 1 database

Mazda3Forums - SmallVolvos - MazdaSpeeders Mazda Club - FordFusionClubMazda CX-7 Club - MyMazda6
Now introducing: MKSdrivers.com - FocusDrivers - TaurusDrivers

Advertisement: