PDA

View Full Version : vBGT [Google Talk Supprt]


Spike223
08-25-2005, 10:00 PM
vBGT [Google Talk Support]
By Spike223

Description::

This hack will add an icon which acts identically to the other four instant messager icons, it wil pop up a box and display the user's Google Talk Username. It will add this icon in three places, your member's list, postbit (both styles), and profile.


Version Info::

v 1.0:
- First Release
v 1.1:
- Added Image Alt Tags As Requested
v 1.2:
- Fixed Image Alt tage to match other 4 Im Clients'.
- Added bug so if GT is the only IM client the user has, it shows in their profile.
- vBulletin now pre-caches the template for faster load times.
v 1.3:
- the Google Talk Textbox shows by the other four when editing profiles.



Installation Instructions::

Firstly, you need to create a custom Profile Field. Make it a single-line textbox, and REMEMBER it's name. It should be something like "field__" where the __'s are a number.

Then, follow these directions. Sorry they're so crude, but I decided to document it 1/3 of the way in, and Notepad was the handiest way.

REMEMBER to replace, ANYWHERE you see "fieldXX" in this document, with your own field name from above, otherwise this hack will not function!

Here are the PHP and Template Modifications:

++ In sendmessage.php::

Replace: 'aim' => 'AIM',

With: 'aim' => 'AIM',
'gt' => 'Google Talk',


Replace: case 'icq':
$userinfo['icq'] = trim(htmlspecialchars_uni($userinfo['icq']));
break;

With: case 'icq':
$userinfo['icq'] = trim(htmlspecialchars_uni($userinfo['icq']));
break;
case 'gt':
$type = 'gt';
break;

Replace: // pre-cache templates used by specific actions
$actiontemplates = array(
'im' => array(
'im_send_aim',
'im_send_icq',
'im_send_yahoo',
'im_send_msn',
'im_message'

With:

// pre-cache templates used by specific actions
$actiontemplates = array(
'im' => array(
'im_send_aim',
'im_send_icq',
'im_send_yahoo',
'im_send_msn',
'im_message',
'im_send_gt'





Replace: if (empty($userinfo["$type"]))
{
// user does not have this messaging meduim defined
eval(print_standard_error('error_immethodnotdefine d'));
}

With: if (empty($userinfo["$type"]) and empty($userinfo['fieldXX']))
{
// user does not have this messaging meduim defined
eval(print_standard_error('error_immethodnotdefine d'));
}


++ In includes/functions_user.php::

Replace: $optionalfield = '';

if ($profilefield['required'] == 1 AND $profilefield['form'] == 0) // Ignore the required setting for fields on the options page


With: $optionalfield = '';
if($profilefieldname !== "fieldXX") {
if ($profilefield['required'] == 1 AND $profilefield['form'] == 0) // Ignore the required setting for fields on the options page



Replace: }
}
}

}


With: }
}
}
}
}




++ In Template modifyprofile::

Replace: <td>$vbphrase[msn_messenger_handle]:<br /><input type="text" class="bginput" name="msn" value="$bbuserinfo[msn]" size="25" maxlength="50" /></td>
<td>$vbphrase[yahoo_messenger_handle]:<br /><input type="text" class="bginput" name="yahoo" value="$bbuserinfo[yahoo]" size="25" maxlength="30" /></td>
</tr>

With: <td>$vbphrase[msn_messenger_handle]:<br /><input type="text" class="bginput" name="msn" value="$bbuserinfo[msn]" size="25" maxlength="50" /></td>
<td>$vbphrase[yahoo_messenger_handle]:<br /><input type="text" class="bginput" name="yahoo" value="$bbuserinfo[yahoo]" size="25" maxlength="30" /></td>
</tr><tr>
<td>Google Talk:<br /><input type="text" class="bginput" name="fieldXX" id="ctb_fieldXX" value="$bbuserinfo[fieldXX]" size="25" maxlength="125" /></td>
</tr>

++ In Template MEMBERINFO::

Replace:

<if condition="$userinfo['showyahoo']">
<tr>
<td>$userinfo[yahooicon]</td>
<td><a href="#" onclick="return imwindow('yahoo', '$userinfo', 400, 200)">$userinfo[yahoo]</a></td>
</tr>
</if>

With:

<if condition="$userinfo['showyahoo']">
<tr>
<td>$userinfo[yahooicon]</td>
<td><a href="#" onclick="return imwindow('yahoo', '$userinfo[userid]', 450, 200)">$userinfo[yahoo]</a></td>
</tr>
</if>
<if condition="$userinfo[fieldXX]">
<tr>
<td><a href="#" onclick="return imwindow('gt', '$userinfo[userid]', 450, 200)"><img src="images/misc/im_gt.gif" border="0" alt="Send a message via Google Talk to $userinfo[username]"></a></td>
<td><a href="#" onclick="return imwindow('gt', '$userinfo[userid]', 450, 200)">$userinfo[fieldXX]</a></td>
</tr>
</if>

Replace: <if condition="$show['hasimicons']>

With: <if condition="$show['hasimicons'] or $userinfo[fieldXX]">

++ In template [U]memberlist_resultsbit:

Replace:

<if condition="$show['imicons'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[icqicon] $userinfo[aimicon] $userinfo[msnicon] $userinfo[yahooicon]</td></if>

With:

<if condition="$show['imicons'] AND exec_switch_bg()"><td class="$bgclass">$userinfo[icqicon] $userinfo[aimicon] $userinfo[msnicon] $userinfo[yahooicon] <if condition="$userinfo[fieldXX]"><a href="#" onclick="return imwindow('gt', '$userinfo', 400, 200)"><img src="images/misc/im_gt.gif" border="0" alt="Send a message via Google Talk to $userinfo[username]"></a></if></td></if>

++ In [U]postbit and postbit_legacy Templates::

Find:

<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div>

Replace:

<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] <if condition="$post[fieldXX]"><a href="#" onclick="return imwindow('gt', '$userinfo[userid]', 400, 200)"><img src="images/misc/im_gt.gif" border="0" alt="Send a message via Google Talk to $post[username]"></a></if></div>


Create Template Called "im_send_gt", put this in it, but replace with HTML where it says __CONTENT HERE__.

The user's GT s/n for use in this template is "$userinfo[fieldXX]", no quotes.

<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
<tr>
<td class="tcat">
<span class="smallfont" style="float:right"><a href="#" onclick="self.close()">Close this window</a></span>
Google Talk
</td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">

*** __CONTENT HERE__ ***

</div>
</td>
</tr>
</table>

</body>
</html>

Add whatever you like in it, but whatever you add will be displayed in the popup window for contacting that user. HTML is allowed in the template as usual.


Files To Upload::

Here's a GT logo:
http://guipowered.com/images/misc/im_gt.gif

Upload it to FORUM ROOT/images/misc/.


If you liked this hack, please click INSTALL!

GetGamer.com
08-26-2005, 03:21 AM
*installed* at www.bigblueball.com/forums (Thanks, Spike!)

I did add alt text to the img tag, to provide a tooltip when people hover over the image (like they get for the other IM icons).

JsnakeJ
08-28-2005, 03:10 AM
I use the google icon for mine. :)

MThornback
08-28-2005, 01:57 PM
I use the google icon for mine. :)

Mine didn't work till I added the template to the pre-cache'd templates on line 36 (in my file) but works famously now :)

*install*

MET920
08-28-2005, 06:52 PM
I was just talking to my friend about a mod like this.. And then I found this! :P
Great job!
* MET920 installs
*installed* at www.bigblueball.com/forums (Thanks, Spike!)

I did add alt text to the img tag, to provide a tooltip when people hover over the image (like they get for the other IM icons).
That sounds great.. Mind posting what edits to make to do this?

jroy
08-28-2005, 09:51 PM
never mind, i got it

Spike223
08-29-2005, 02:39 AM
That sounds great.. Mind posting what edits to make to do this?Updated hack to 1.1 as requested.

wwesn1
08-29-2005, 03:54 AM
now how about displaying it in the who's online page

MET920
08-29-2005, 11:10 AM
Updated hack to 1.1 as requested.
thanks.. And I suggest making a zip file with the install instructions and the image.. If you want I've already madeose for myself because I like to have the installation files of all the mods I have installed.. Just tel me and I'll send it to you or something..

Rhoads
08-29-2005, 12:13 PM
Thnx Spike, it's a nice hack ;)

For the uncached templates you can replace in the sendmessage.php

Replace:
// pre-cache templates used by specific actions
$actiontemplates = array(
'im' => array(
'im_send_aim',
'im_send_icq',
'im_send_yahoo',
'im_send_msn',
'im_message',


With:
// pre-cache templates used by specific actions
$actiontemplates = array(
'im' => array(
'im_send_aim',
'im_send_icq',
'im_send_yahoo',
'im_send_msn',
'im_message',
'im_send_gt'

Lee
08-29-2005, 05:02 PM
Upgraded to v1.1. Awesome hack as usual - its use is becoming widespread around the forums as well!

But just so you know, Spike, some of the code in their still says "field10" and not "fieldXX" like it should. This makes some things harder to catch and fix since you don't say anything about a "field10" in this version.

For the alt messages, though, wouldn't it be more appropriate to have it say "Send a message via Google Talk to <user>"? The rest of the IMing icons have that as their alt message.

yj_enquirer
08-30-2005, 07:17 PM
gr8 hack.. and provided very much in time, especially GT is becoming very common, this shall go really well with the members.

Just a few questions...
1. Any chance of having the newly created custom profile field appear in the "Instant Messaging" section under the Users CP ==> Edit Profile ==> {Optional Information section} as opposed to it appearing by itself in a seperate section.

2. When I enter my GT addy, it does not appear in the "View Profile" page until and unless I include another IM ID, e.g. MSN. Is this happening for anyone else?

Cheers

Spike223
08-30-2005, 08:41 PM
Upgraded to Version 1.2.

Thanks to everyone who gave me ideas for the new version.

I am unable to display it in the Who's Online part, unfortunately, I've toyed with it for quite some time now, and it still puzzles me as to why it doesn't work.

I did fix the Precaching problem, also the one field10 i missed, and I changed and tested the new ALT tags on my forums, so everything should be in working order.

Oh, and if GT is the only IM name you have, it WILL show up in your Profile now.

Thanks to everyone for reporting these little things, this helps make the hack better for everyone!

And, MET, I think I'll have to pass on the ZIP file, this post should be enough to suffice. Thanks for the offer, though.

Spike223
08-31-2005, 01:00 AM
Upgraded to 1.3 with support on adding the GT textbox by the other four IM textboxes when editing your profile.

Lee
08-31-2005, 02:53 PM
Awesome as usual. I've been waiting for the GTalk box to get in there with the other IM fields, so this was treat. Working perfect, and I'm glad you took the alt message suggestion - it looks much nicer.

Something you may wat to consider is where Google Talk is headed in the future. If our prayers are answered, Google Talk will open up to the Jabber community with Server-to-Server support and transports. This would mean, in short, abolishing every other instant messenging system you have.

If Google decides for Server-to-Server support, this becomes a Jabber client. And more importantly, an amazingly popular VoIP-enhanced Jabber client. They might even be thinking about adding PC-to-Phone calls.

IF such happens, this hack may just become general Jabber support for vB, instead of strictly Google Talk. Or you may wish to name the field Google Talk (Jabber).

Spike223
08-31-2005, 08:56 PM
Awesome as usual. I've been waiting for the GTalk box to get in there with the other IM fields, so this was treat. Working perfect, and I'm glad you took the alt message suggestion - it looks much nicer.

Something you may wat to consider is where Google Talk is headed in the future. If our prayers are answered, Google Talk will open up to the Jabber community with Server-to-Server support and transports. This would mean, in short, abolishing every other instant messenging system you have.

If Google decides for Server-to-Server support, this becomes a Jabber client. And more importantly, an amazingly popular VoIP-enhanced Jabber client. They might even be thinking about adding PC-to-Phone calls.

IF such happens, this hack may just become general Jabber support for vB, instead of strictly Google Talk. Or you may wish to name the field Google Talk (Jabber).
When the time comes, then I'll probably rename it to be just Jabber with Google in parenthesis, there ARE other Jabber networks out there. And, besides, what Google is speculating will take them quite some time, to develop, then test and test again, fix bugs, advertise, etc. We'll see what happens, but I always keep an eye on this thread, just in case. :)

Colejo
09-06-2005, 08:35 AM
I have it installed and it works but I have one thing that doesn't look right. Under Edit Profile > Optional Information > Instant Messaging, it has the option for Google Talk. If I enter something in their and save, it won't stay there. But down under Additional Information it has the Custom Profile Field I created and I put the Google Talk name there and it saves and works. Do you know what I might have missed?

Colejo
09-06-2005, 09:47 AM
To get Google to show up under who's online couldn't you just add something to the whosonlinebit template under this:

<if condition="$vboptions['showimicons']">
<td class="alt2" align="center" nowrap="nowrap">
$userinfo[aimicon]
$userinfo[icqicon]
$userinfo[msnicon]
$userinfo[yahooicon]

turksengel
09-06-2005, 10:50 AM
do you plan to resease it for 3.5 ?

Erwin
09-06-2005, 10:56 AM
Make sure your custom profile field has the following settings:
Required? No
Editable? Yes
Private? Yes

Colejo
09-06-2005, 12:14 PM
Make sure your custom profile field has the following settings:
Required? No
Editable? Yes
Private? Yes

That's how I have it set so it's not a problem with someone else seeing it but the user has the option for their Google name it 2 spots but only the one under additional information is actually working. I went ahead and removed the addition to the template modifyprofile so now there is just the one spot to put in your google username. If anyone know how I can get it to just show up under the optional information instead of the additional information let me know. Thanks.

Spike223
09-06-2005, 11:25 PM
I have it installed and it works but I have one thing that doesn't look right. Under Edit Profile > Optional Information > Instant Messaging, it has the option for Google Talk. If I enter something in their and save, it won't stay there. But down under Additional Information it has the Custom Profile Field I created and I put the Google Talk name there and it saves and works. Do you know what I might have missed?
Check your PHP code, make sure you replaced the "fieldXX" in the PHP scripts, too.

MET920
09-07-2005, 02:24 AM
Check your PHP code, make sure you replaced the "fieldXX" in the PHP scripts, too.

Actually I also have the same problem and I'm sure I replaced all the "fieldXX" to "field7"

Spike223
09-09-2005, 07:51 PM
Make sure your profile field is under the "EDit PRofile" section, not "Options" or something else.

MET920
09-09-2005, 08:25 PM
It is

Spike223
09-10-2005, 04:39 PM
Then I dunno, really, anyone else have any suggestions?

I mean, the only other thing it could be is that you have another mod thats interfering with mine.

MET920
09-10-2005, 09:02 PM
Can you take a look at my files and see what's up? (PM me)

Fianna
09-13-2005, 02:36 AM
Ok, is it just me, or I don't see the download file for this hack. I would really like to install this hack on our vB forum.

MET920
09-13-2005, 01:16 PM
You have to follow the instructions in the first post of this thread. There is no install.html/txt file. It's all posted in the first post.

Fianna
09-14-2005, 03:25 AM
Thanks MET920.

Question though. where is:

}
}
}

}

I am having hard time finding that under includes/functions_user.php

blackmagix
09-14-2005, 03:26 PM
I've installed this hack but I have the following problem, when I enter my Google Talk email into the text box and when I click save, it wont save when I go back to [Edit Profile] the Google Talk textbox is just blank...

I can't work out where I have went wrong, please help...

http://www.forzacentral.com

Fianna
09-14-2005, 06:26 PM
The same thing is happening to me also. I put my Google Talk address in the box, and when I went back it was gone. I haven't included that extra bracket in includes/user_functions.php because I can't find it.

Spike223
09-14-2005, 09:32 PM
*sigh* I might have forgotten a code snippet...I'll look into it later tonight (CST).

MET920
09-15-2005, 10:21 AM
Alright sweet. Thanks :D

blackmagix
09-18-2005, 06:01 PM
Any solutions yet ?

Fianna
09-27-2005, 01:05 AM
I suppose any solutions are not found yet.

I also have another problem. Whenever I click on an IM icon under the avatars, the box that appears, it shows all the writings messed up. I have done everything right, so what could be the problem?

MET920
09-27-2005, 04:52 PM
He's really not giving us the support we need and not fixing the issue at hand here. I think I'll just uninstall this mod. Either way, Google Talk sucks and no one really on my forums uses it.

Fianna
10-01-2005, 12:34 PM
I got one person to help me on the forums whom that person installed this hack successfully on his forums. But my forums are giving problems, so I am uninstalling this hack as well.
I waited days to get a respose.