Advertisement:

Author Topic: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.  (Read 49867 times)

Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
How to COMPLETELY integrate Skype and Ventrillo into SMF.

After may hours of work (and that's saying something as I have near zero knowledge of PHP) I have figured out how to not only show the Skype and Ventrilo icons in a user profile and posts, but I also have suceeded in showing them in the Memberlist.

This has only been tested and verified on RC2 and the Skype version was 2.0.79 or higher.

(these should be in your themes directory either the specific theme or the default theme)
In display.template.php:

Find:
Code: [Select]
', $message['member']['yim']['link'], '<br />';
and replace:
Code: [Select]
', $message['member']['yim']['link'], '<br />
', $message['member']['Skype']['link'], '
', $message['member']['Ventrilo']['link'], '<br />';
In index.template.php:

Find:

Code: [Select]
// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
Replace:
Code: [Select]
// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js">
</script>
In memberlist.template.php:

Find:

Code: [Select]
<td class="windowbg2">', $member['msn']['link'], '</td>
Replace:

Code: [Select]
<td class="windowbg2">', $member['msn']['link'], '</td>
<td class="windowbg2">', $member['Skype']['link'], '</td>
<td class="windowbg2">', $member['Ventrilo']['link'], '</td>
In profile.template.php:

Find:

Code: [Select]
<td>', $context['member']['yim']['link_text'], '</td>
</tr><tr>
Add after:

Code: [Select]
<td><b>Skype: </b></td>
<td>', $context['member']['Skype']['link_text'], '</td>
</tr><tr>
<td><b>Ventrilo: </b></td>
<td>', $context['member']['Ventrilo']['link_text'], '</td>
</tr><tr>
Find:

Code: [Select]
<td align="center">', $txt['MSN'], '</td>
Add after:

Code: [Select]
<td align="center">Skype</td>
<td align="center">Ventrilo</td>
Find:

Code: [Select]
<td align="center">', $buddy['msn']['link'], '</td>
Add after:

Code: [Select]
<td align="center">', $buddy['Skype']['link'], '</td>
<td align="center">', $buddy['Ventrilo']['link'], '</td>
Find:

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

Code: [Select]
<td width="40%"><b>Skype Name: </b><div class="smalltext">Your Skype internet call name.</div></td>
<td><input type="text" name="Skype" size="24" value="', $context['member']['skype']['name'], '" /></td>
</tr><tr>
<td width="40%"><b>Ventrilo IP: </b><div class="smalltext">Your Ventrilo IP.</div></td>
<td><input type="text" name="Ventrilo" maxlength="65" size="24" value="', $context['member']['Ventrilo']['name'], '" /></td>
</tr><tr>
In the Sources directory:

In load.php:

Find:
Code: [Select]
mem.birthdate, mem.memberIP, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin,
Replace:
Code: [Select]
mem.birthdate, mem.memberIP, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.Skype, mem.Ventrilo, mem.posts, mem.lastLogin,
Find:
Code: [Select]
mem.birthdate, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin, mem.karmaGood,
Replace
Code: [Select]
mem.birthdate, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.Skype, mem.Ventrilo, mem.posts, mem.lastLogin, mem.karmaGood,
Find:
Code: [Select]
'link' => '<a href="http://members.msn.com/' . $profile['MSN'] . '" target="_blank"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $profile['MSN'] . '" border="0" /></a>',
Add after:
Code: [Select]
'Skype' => $profile['Skype'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => &$profile['Skype'],
'href' => 'callto://' . $profile['Skype'],
'link' => '<a href="callto://' . $profile['Skype'] . '"><img src="http://mystatus.skype.com/smallicon/' . $profile['Skype'] . '" alt="' . $profile['Skype'] . '" border="0" /></a>',
'link_text' => '<a href="callto://' . $profile['Skype'] . '">' . $profile['Skype'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),
'Ventrilo' => $profile['Ventrilo'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => &$profile['Ventrilo'],
'href' => 'ventrilo://' . $profile['Ventrilo'],
'link' => '<a href="ventrilo://' . $profile['Ventrilo'] . '"><img border="0" src="' . $settings['images_url'] . '/Ventrilo.gif"></a>',
'link_text' => '<a href="ventrilo://' . $profile['Ventrilo'] . '">' . $profile['Ventrilo'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),
In memberlist.php:

Find:
Code: [Select]
'MSN' => array(
'label' => $txt['MSN'],
'width' => '25'
),
Add after:
Code: [Select]
'Skype' => array(
'label' => Skype,
'width' => '25'
),
'Ventrilo' => array(
'label' => Ventrilo,
'width' => '25'
),
Find:
Code: [Select]
'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:
Code: [Select]
'Skype' => array(
'down' => 'LENGTH(mem.Skype) > 0 DESC, ISNULL(mem.Skype) ASC, mem.Skype ASC',
'up' => 'LENGTH(mem.Skype) > 0 ASC, ISNULL(mem.Skype) DESC, mem.Skype DESC'
),

'Ventrilo' => array(
'down' => 'LENGTH(mem.Ventrilo) > 0 DESC, ISNULL(mem.Ventrilo) ASC, mem.Ventrilo ASC',
'up' => 'LENGTH(mem.Ventrilo) > 0 ASC, ISNULL(mem.Ventrilo) DESC, mem.Ventrilo DESC'
),

Find:
[code]
$fields += array(3 => 'MSN', 'AIM', 'ICQ', 'YIM');
Replace:
Code: [Select]
$fields += array(3 => 'MSN', 'AIM', 'ICQ', 'YIM', 'Skype', 'Ventrilo');
In profile.php:

Find:
Code: [Select]
'msn' => array('name' => empty($user_profile[$memID]['MSN']) ? '' : $user_profile[$memID]['MSN']),
Add after:
Code: [Select]
'skype' => array('name' => empty($user_profile[$memID]['Skype']) ? '' : $user_profile[$memID]['Skype']),
'Ventrilo' => array('name' => empty($user_profile[$memID]['Ventrilo']) ? '' : $user_profile[$memID]['Ventrilo']),
Find:
Code: [Select]
$profile_strings = array(
'websiteUrl', 'websiteTitle',
'AIM', 'YIM',
Replace:
Code: [Select]
$profile_strings = array(
'websiteUrl', 'websiteTitle',
'AIM', 'YIM', 'Skype', 'Ventrilo',
Find:
Code: [Select]
// Fix the spaces in messenger screennames...
$fix_spaces = array('MSN', 'AIM', 'YIM');
Replace:
Code: [Select]
// Fix the spaces in messenger screennames...
$fix_spaces = array('MSN', 'AIM', 'YIM', 'Skype', 'Ventrilo');
Find:
Code: [Select]
'msn' => array(
'name' => empty($_POST['msn']) ? '' : stripslashes($_POST['MSN'])
),
Add after:
Code: [Select]
'skype' => array(
'name' => empty($_POST['Skype']) ? '' : stripslashes($_POST['Skype'])
),
'Ventrilo' => array(
'name' => empty($_POST['Ventrilo']) ? '' : stripslashes($_POST['Ventrilo'])
),
Now for the faint hearted :)

You have to add two fields to your database using phpmyadmin or phpflashmyadmin.

in the table smf_members add two fields:

Skype as type tinytext
Ventrilo as type varchar with a size of 65.

Note the case has to be exact or it will not work.

the only error i have seen is that with the Skype field in the profile.  If you enter the skype name in the field and submit, the field clears, but the info is saved in the database and the icons show up everywhere they need to be...just that the profile field stays empty (anyone have any ideas that would fix this please tell me).

A special thanks to Oldiesman in helping me figure this out.  I also got some of the code for Skype from this post: http://www.simplemachines.org/community/index.php?topic=38550.0;topicseen

Skype provides it's own image now...for ventrilo:



[/code]
« Last Edit: March 05, 2006, 03:33:20 PM by technodragon73 »
Don't tell me to get into shape...I have a shape...It is round!


Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #1 on: February 24, 2006, 11:07:21 PM »
I would appreciate it if some one could help me out with two things on this...

1.  How can I make this into a mod? Believe i have that done...

2. What is the way to create the DB query to add the fields in the database so it does not have to be done manually (especially if this gets turned inot a mod). <---anyone please help me on this?
« Last Edit: February 25, 2006, 09:37:57 PM by technodragon73 »
Don't tell me to get into shape...I have a shape...It is round!


Offline redlabour

  • Semi-Newbie
  • *
  • Posts: 87
  • Gender: Male
    • Politikstube.de - die christliche Politikcommunity
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #2 on: February 27, 2006, 06:14:17 PM »
Hmmm....can somebody code this as a PlugIn ?
http://www.politikstube.de - die christliche Politikcommunity

Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #3 on: February 27, 2006, 06:16:32 PM »
I have been desperately trying to get help to do just that, but noone has yet offered.  I know it is a bit daunting when you look at it, trust me I know...I had to do it twice.  Once to install it, then again to do this tutorial.
Don't tell me to get into shape...I have a shape...It is round!


Offline redlabour

  • Semi-Newbie
  • *
  • Posts: 87
  • Gender: Male
    • Politikstube.de - die christliche Politikcommunity
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #4 on: February 27, 2006, 06:21:09 PM »
Hi,

i think in the Year 2006 it is absolutely unnecessary to lost Time on manually edit so much Code for a small Feature like Skype. Every great Boardsoftware has a Hook and Plugin System today to hold the original Code and Templates clean & secure.

I think a lot of People will thank you for your work but i am a little bit shocked.  ;)

I hope you do not misunderstand me - i mean this friendly but a little bit amused. ;)

Sorry for my poor english.
http://www.politikstube.de - die christliche Politikcommunity

Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #5 on: February 28, 2006, 12:32:35 AM »
No, I understand, there is a much easier way to put the skype icon in...just do a search for skype and you'll find it...it is just that mine is long because I wanted it to actually be "in" the forum, just like MSN and ICQ...the other method you'll find does not.

If only I could find someone who'll help me build a mod package we'd be good to go...
Don't tell me to get into shape...I have a shape...It is round!


Offline redlabour

  • Semi-Newbie
  • *
  • Posts: 87
  • Gender: Male
    • Politikstube.de - die christliche Politikcommunity
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #6 on: February 28, 2006, 02:05:32 AM »
Ahhhh ... ok - thx ! ;)
http://www.politikstube.de - die christliche Politikcommunity

Online Gary

  • Lead Customizer
  • SMF Super Hero
  • *
  • Posts: 17,317
  • Gender: Male
  • So this is the luck of the draw...
    • Gazmanafc on Facebook
    • garygadsdon on LinkedIn
    • @Gazmanafc on Twitter
    • The Bongo Comics Fan Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #7 on: February 28, 2006, 07:05:59 AM »
Hmm...

* AwwLilMaggie  makes a mental note to put this into my forum

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,098
  • Gender: Male
    • Kindred-999 on GitHub
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #8 on: February 28, 2006, 07:49:16 AM »
suggestion:

Download and take a look at some other mod that modifies the database (like Globalopper's Member Map mod, or my Jack's Phat Calendar Pack, or any of a dozen others...)   and see how they do it in the install XML and the code to run the add-table...
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #9 on: February 28, 2006, 08:22:28 AM »
I have done that...and I think I have the mod part finished...it is the DB query that I cannot figure out...

http://www.technodragon.net/files/skypeventrilo.zip

If someone could take a look and make sure...just need help with the db query I think now.
Don't tell me to get into shape...I have a shape...It is round!


Offline nokonium

  • Full Member
  • ***
  • Posts: 680
  • Gender: Male
  • TinyPortal Support Team
    • Our-Local
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #10 on: February 28, 2006, 05:55:11 PM »
I have it installed now I need to go and play

Thanks

Though when I checked the syntax I found a couple of errors

Quote
Find:
Code:
// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.

Replace:

Code:
// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js">
</script>

Needs to end
Quote
</script> ';

Quote
'link' => '<a href="http://members.msn.com/' . $profile['MSN'] . '" target="_blank"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $profile['MSN'] . '" border="0" /></a>',

should include the following line:
Quote
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),

before you <add after>




Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #11 on: February 28, 2006, 06:11:59 PM »
technodragon73 take a look at Package SDK, anyone?.  There is a file called addsettings.php it tells you how to add the queries.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #12 on: February 28, 2006, 10:38:07 PM »
Thank you so very much...that info was exactly what I needed (wish someone had pointed that out weeks ago).

I believe I have  a successful mod package now...since I do not know how to make it available as a mod here, here is the link to download it:

http://www.technodragon.net/files/skypeventrilo.zip

This is ONLY for RC2...modify earlier versions at your own risk.
Don't tell me to get into shape...I have a shape...It is round!


Online Gary

  • Lead Customizer
  • SMF Super Hero
  • *
  • Posts: 17,317
  • Gender: Male
  • So this is the luck of the draw...
    • Gazmanafc on Facebook
    • garygadsdon on LinkedIn
    • @Gazmanafc on Twitter
    • The Bongo Comics Fan Forum

Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #14 on: March 01, 2006, 08:47:53 AM »
I have it installed now I need to go and play

Thanks

Though when I checked the syntax I found a couple of errors

Quote
Find:
Code:
// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.

Replace:

Code:
// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js">
</script>

Needs to end
Quote
</script> ';



Quote
'link' => '<a href="http://members.msn.com/' . $profile['MSN'] . '" target="_blank"><img src="' . $settings['images_url'] . '/msntalk.gif" alt="' . $profile['MSN'] . '" border="0" /></a>',

should include the following line:
Quote
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),

before you <add after>


First part:
No, in the default theme there are two other lines below the echo statement (at least on mine there is) and the last line is escaped with ';
Second part:
I did not catch that...thank you...I fixed it and reuploaded the zip to my server.

I thank you for showing me the upload for packages...now if anyone could let me know if the mod works...it is my first after all...
« Last Edit: March 01, 2006, 08:56:45 AM by technodragon73 »
Don't tell me to get into shape...I have a shape...It is round!


Offline Georges

  • Newbie
  • *
  • Posts: 3
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #15 on: March 04, 2006, 07:20:33 PM »
Hi Technodragon73,

Thank you for this tutorial.
I used the manual way as I was interested in seeing which part of the screen display was linked to a specific php script.
All is going fine except the Skype name disappearing from the profile as you mentioned it.
Did you find the trick to correct this behavior?

Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #16 on: March 04, 2006, 09:42:24 PM »
Not at the moment, but it seems to be an issue that is on each machine locally...as now my profile at my forum shows the skype and ventrilo name peoperly like it should...
Don't tell me to get into shape...I have a shape...It is round!


Offline Georges

  • Newbie
  • *
  • Posts: 3
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #17 on: March 05, 2006, 10:49:08 AM »
I install only the Skype icon and yes it shows properly.

1- Skype
BTW you need Skype 2.0 version and set properly the Tools-Privacy-Allow my status to be show on the web in order the icon can display your real status.
If you need a more explicit Skype icon in load.php
Find:
Code: [Select]
<img src="http://mystatus.skype.com/smallicon/'Change:
Code: [Select]
<img src="http://mystatus.skype.com/smallclassic/'
I note too that reloading the MEMBERS do not refresh the page and the Skype icon does not change despite the Skype status of the member has effectively changed.

2- Profile
The problem with the Skype Name not showing in the profile is when the member will update his profile. If nothing is entered again into the Skype Name box then it will be blank in the Data Base.

May be something related to the $context['member']['Skype']['name'] variable not declared correctly?
I am in the process of modifying the Profile in order to get more personal information from the members as company, phone, fax, address etc... (it is a private forum) and the Skype Name issue should be solved before to go ahead with this small project.
I am newbie to PHP and SMF so I have to rely on help from the experts!

« Last Edit: March 05, 2006, 03:40:44 PM by ghannelais »

Offline Georges

  • Newbie
  • *
  • Posts: 3
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #18 on: March 05, 2006, 11:27:07 AM »
Hi Technodragon73,

It seems I have found the profile update problem:

In Profile.php
You write:
Code: [Select]
'Skype' => array('name' => empty($user_profile[$memID]['Skype'])
Code: [Select]
'Skype' => array(
'name' => empty($_POST['Skype']) ? '' : stripslashes($_POST['Skype'])

You should write:
Code: [Select]
'skype' => array('name' => empty($user_profile[$memID]['Skype'])
Code: [Select]
'skype' => array(
'name' => empty($_POST['Skype']) ? '' : stripslashes($_POST['Skype'])

Skype is the DB field but skype is the variable.
« Last Edit: March 05, 2006, 03:38:36 PM by ghannelais »

Offline TechnoDragon

  • Jr. Member
  • **
  • Posts: 374
  • Gender: Male
  • With great power comes great resposibility...
    • Dragon Talk Forum
Re: Tutorial: How to COMPLETELY integrate Skype and Ventrillo into SMF.
« Reply #19 on: March 05, 2006, 03:31:14 PM »
Thank you for that bit of info...I am still very new to all of this php stuff and I am finding case can really affect teh context of things...I will update this tutorial as soon as I can.
Don't tell me to get into shape...I have a shape...It is round!