Welcome, Guest. Please Login or Register.
November 02, 2024, 03:31:38 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Completed mods  |  [CODE 1.5.1] MSN Hack « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: [CODE 1.5.1] MSN Hack  (Read 2865 times)
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
[CODE 1.5.1] MSN Hack
« on: April 04, 2003, 07:32:10 PM »
Reply with quote

Note: This is a conversion of the MSN Hack for phpBB. All I did was changed the code so it works with YaBB. This is actually pretty simple. Original hack: http://www.phpbb.com/phpBB/viewtopic.php?t=22732. All credit goes to the original author.

I know that there was some sort of an error in 1.4.1 that made the MSN Messenger thing pretty much useless, and the "fix" in 1.5.1 is annoying because most people don't bother filling out their msn profiles. So, knowing that there was a working hack available for the ever-popular phpBB, I went and downloaded it and converted it for YaBB. Then, I used my board as a test board. Now it works great ;D

Here's what you do:

In Profile.php
search for:
Quote     $msn = "<a href=\"http://members.msn.com/$memsettings[25]\" target=\"blank\">$memsettings[25]</a>";

replace with:
Quote      $msn = "<a href=\"javascript:DoInstantMessage('$memsettings[25]','$user');\">$memsettings[25]</a>";

Next,
in Load.php
search for:

Quote   $userprofile[$user]['MSN'] = (($userprofile[$user]['MSN'] != '') ? "<a href=\"http://members.msn.com/" . htmlspecialchars($userprofile[$user]['MSN']) . "\" target=\"blank\"><img src=\"$imagesdir/msntalk.gif\" border=\"0\" alt=\"\" /></a>" : "");

replace with:
Quote   $userprofile[$user]['MSN'] = (($userprofile[$user]['MSN'] != '') ? "<a href=\"javascript:DoInstantMessage('" . htmlspecialchars($userprofile[$user]['MSN']) . "','" . htmlspecialchars($userprofile[$user]['realName']) . "');\"><img src=\"$imagesdir/msntalk.gif\" border=\"0\" alt=\"\" /></a>" : "");

In Memberlist.php
search for:

Quote         $row['MSN'] = "<a href=\"http://members.msn.com/$row[MSN]\" target=\"_blank\"><img src=\"$imagesdir/msntalk.gif\" alt=\"$row[MSN]\" border=\"0\" /></a>";

replace with:
Quote$row['MSN'] = "<a href=\"javascript:DoInstantMessage('$row[MSN]','$user');\"><img src=\"$imagesdir/msntalk.gif\" alt=\"$row[MSN]\" border=\"0\" /></a>";

In your template, insert the following somewhere between the <head> and </head> tags:

Quote<OBJECT height='1' id='MsgrObj' width='1'></OBJECT>
<script>
function DoInstantMessage(person,screen)
{
//Check if person has messenger installed
try{MsgrObj.classid="clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28";}
  catch(e)
  {
  if
  ((e.number && -2147467259) == -2147467259)
     alert("You cannot send a message to yourself.");
  else
     alert("Unknown Error");
}

//Check if you are logged in
if(MsgrObj.MyStatus == 1)
{
alert("You are not logged into Messenger.\nYou must login to Messenger before continuing.");
return;
}

//Check if person is already in contact list
try{var contact = MsgrObj.GetContact(person,"");}
catch(e)
{
if((e.number && 2164261642) == 2164261642) //MSGR_E_USER_NOT_FOUND
{
if(confirm("Add "+screen+" to your contact list?")==true)MsgrObj.AddContact(0,person);
}
}
//Ask to send an instant message
  if(confirm("Send "+screen+" an instant message?")==true){try{MsgrObj.InstantMessage(person);}
  catch(e){if((e.number && -2147467259) == -2147467259)alert("You cannot send a message to yourself.");else alert("Unknown Error");}}
}
</script>

(Note: The above can also be accomplished by inserting only the <OBJECT>...</OBJECT> tag in the template and then storing the javascript code in another .js file and then putting <script language="javascript" type="text/javascript" src="location of DoInstantMessage.js"></script> in your template).

This will accomplish what the code in 1.4.1 was supposed to accomplish, without the javascript errors.

EDIT: Whoops! Left out a \ before a quote... The code is correct now and should work just fine...
« Last Edit: April 19, 2003, 02:00:45 AM by oldiesmann » Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
babylonking
Full Member
***
Posts: 174


Proudly Canadian

WWW
Re:[code 1.5.1RC1 B45] Msn Hack
« Reply #1 on: April 04, 2003, 08:51:28 PM »
Reply with quote

am getting this error  ???


Parse error: parse error in c:\apache\htdocs\forum\Sources\Load.php on line 295

Warning: Cannot send session cache limiter - headers already sent (output started at c:\apache\htdocs\forum\Sources\Load.php:295) in c:\apache\htdocs\forum\index.php on line 80

Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdocs\forum\Sources\Load.php:295) in c:\apache\htdocs\forum\Sources\Subs.php on line 162

Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdocs\forum\Sources\Load.php:295) in c:\apache\htdocs\forum\Sources\Subs.php on line 163

Logged

Proudly Canadian          
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[code 1.5.1RC1 B45] Msn Hack
« Reply #2 on: April 04, 2003, 09:11:39 PM »
Reply with quote

Thanks for saying something... I posted it out here wrong. There should be a ' after DoInstantMessage( but I left it out. OOOPS! ;D
« Last Edit: April 04, 2003, 10:24:50 PM by oldiesmann » Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[code 1.5.1RC1 B45] Msn Hack
« Reply #3 on: April 05, 2003, 12:29:47 AM »
Reply with quote

The problem was that it caused problems for people who DIDN'T have MSN.... I remember them in fact.

I had to start MSN up to get anything working to any less than annoying degree....

-[Unknown]
Logged
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[code 1.5.1] Msn Hack
« Reply #4 on: April 07, 2003, 02:45:59 PM »
Reply with quote

Ok. Well, I'm glad this one works... :)
Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
Thomas
Full Member
***
Posts: 203


WWW
Re:[code 1.5.1] Msn Hack
« Reply #5 on: April 18, 2003, 06:29:00 PM »
Reply with quote

I tried out this one, but I get the errors:

Parse error: parse error, unexpected '<' in /home/dykkesid/www/forum/Sources/Load.php on line 307

Warning: Cannot send session cache limiter - headers already sent (output started at /home/dykkesid/www/forum/Sources/Load.php:307) in /home/dykkesid/www/forum/index.php on line 78

Warning: Cannot add header information - headers already sent by (output started at /home/dykkesid/www/forum/Sources/Load.php:307) in /home/dykkesid/www/forum/Sources/Subs.php on line 152

Warning: Cannot add header information - headers already sent by (output started at /home/dykkesid/www/forum/Sources/Load.php:307) in /home/dykkesid/www/forum/Sources/Subs.php on line 153

Warning: Cannot add header information - headers already sent by (output started at /home/dykkesid/www/forum/Sources/Load.php:307) in /home/dykkesid/www/forum/Sources/Subs.php on line 156

Warning: Cannot add header information - headers already sent by (output started at /home/dykkesid/www/forum/Sources/Load.php:307) in /home/dykkesid/www/forum/Sources/Subs.php on line 157

Ideas?

/MR.T
Logged
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[code 1.5.1] Msn Hack
« Reply #6 on: April 18, 2003, 07:21:38 PM »
Reply with quote

Make sure everything is exactly as I have posted it... Post line 307 out here and I'll probably be able to tell you what's going on...
Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
Thomas
Full Member
***
Posts: 203


WWW
Re:[code 1.5.1] Msn Hack
« Reply #7 on: April 18, 2003, 08:12:50 PM »
Reply with quote

This is line 307:

$userprofile[$user]['MSN'] = (($userprofile[$user]['MSN'] != '') ? "<a href=\"javascript:DoInstantMessage('" . htmlspecialchars($userprofile[$user]['MSN']) . "','" . htmlspecialchars($userprofile[$user]['realName']) . "');"><img src=\"$imagesdir/msntalk.gif\" border=\"0\" alt=\"\" /></a>" : "");

/MR.T
Logged
Thomas
Full Member
***
Posts: 203


WWW
Re:[code 1.5.1] Msn Hack
« Reply #8 on: April 18, 2003, 08:16:42 PM »
Reply with quote

If I drop to change load.php it works. What does actualle the cahnges in load.php do?

/MR.T
Logged
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[code 1.5.1] Msn Hack
« Reply #9 on: April 18, 2003, 08:53:17 PM »
Reply with quote

That changes what happens when you click on the MSN Icon in the posts. If you don't make that change, you will still go to the user's MSN profile instead of getting a box asking you if you want to send them a message and/or add them to your contacts list.
Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:[code 1.5.1] Msn Hack
« Reply #10 on: April 18, 2003, 09:30:57 PM »
Reply with quote

is it still slow when one doesn't have msn installed when visiting a forum with this mod installed?
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[code 1.5.1] Msn Hack
« Reply #11 on: April 19, 2003, 01:19:56 AM »
Reply with quote

Installing this mod won't make your forum any slow than it already is...
Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:[code 1.5.1] Msn Hack
« Reply #12 on: April 19, 2003, 01:26:04 AM »
Reply with quote

i asked because there was a problem in the older yse version when a user doesnt have msn installed, the forum becomes slower
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[code 1.5.1] Msn Hack
« Reply #13 on: April 19, 2003, 01:53:29 AM »
Reply with quote

Quote from: MR.T on April 18, 2003, 08:12:50 PM
This is line 307:

$userprofile[$user]['MSN'] = (($userprofile[$user]['MSN'] != '') ? "<a href=\"javascript:DoInstantMessage('" . htmlspecialchars($userprofile[$user]['MSN']) . "','" . htmlspecialchars($userprofile[$user]['realName']) . "');"><img src=\"$imagesdir/msntalk.gif\" border=\"0\" alt=\"\" /></a>" : "");

/MR.T
Hmmm... Your code looks exactly like what I've got posted... Let me go grab my copy of Load.php and make sure I posted that correctly...
Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
oldiesmann
YaBB God
*****
Posts: 577


Jesus died for your sins... Have you thanked him?

oldiesmann@oldiesmann.us WWW
Re:[code 1.5.1] Msn Hack
« Reply #14 on: April 19, 2003, 01:59:18 AM »
Reply with quote

Quote from: oldiesmann on April 19, 2003, 01:53:29 AM
Quote from: MR.T on April 18, 2003, 08:12:50 PM
This is line 307:

$userprofile[$user]['MSN'] = (($userprofile[$user]['MSN'] != '') ? "<a href=\"javascript:DoInstantMessage('" . htmlspecialchars($userprofile[$user]['MSN']) . "','" . htmlspecialchars($userprofile[$user]['realName']) . "');"><img src=\"$imagesdir/msntalk.gif\" border=\"0\" alt=\"\" /></a>" : "");

/MR.T

Ok. I see what's wrong... There should be a \before that quote right before the >... That's what's causing the error.
Logged

"I've sinned greatly, but Christ's for real, baby
It's a wonder He saved me and just didn't hate me
So won't you tell Him "Save me"
Please stand up, please stand up, please stand up..." - J. Jackson (More Info)
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [CODE 1.5.1] MSN Hack « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.076 seconds with 20 queries.