Back to vBulletin 3.0 Add-Ons

vBGT [Google Talk Supprt]
Mod Version: 1.3, by Spike223

This modification is in the archives.
vB Version: 3.0.7 Rating: (1 vote - 5.00 average) Installs: 14
Released: 26 Aug 2005 Last Update: Never Downloads: 2
Not Supported Template Edits Code Changes Additional Files  

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:
PHP Code:
'aim'   => 'AIM'
With:
PHP Code:
'aim'   => 'AIM',
'gt'    => 'Google Talk'

Replace:
PHP Code:
case 'icq':
            
$userinfo['icq'] = trim(htmlspecialchars_uni($userinfo['icq']));
            break; 
With:
PHP Code:
case 'icq':
            
$userinfo['icq'] = trim(htmlspecialchars_uni($userinfo['icq']));
            break;
        case 
'gt':
            
$type 'gt';
            break; 
Replace:
PHP Code:
 // 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:

PHP Code:
 // 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:
PHP Code:
if (empty($userinfo["$type"]))
    {
        
// user does not have this messaging meduim defined
        
eval(print_standard_error('error_immethodnotdefined'));
    } 
With:
PHP Code:
if (empty($userinfo["$type"]) and empty($userinfo['fieldXX']))
    {
        
// user does not have this messaging meduim defined
        
eval(print_standard_error('error_immethodnotdefined'));
    } 

++ In includes/functions_user.php::

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

Replace:
PHP Code:
                }
            }
        }
    
    } 
With:
PHP Code:
                }
            }
        }
    }
    } 


++ In Template modifyprofile::

Replace:
Code:
<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:
Code:
<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:

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

Code:
<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:
Code:
<if condition="$show['hasimicons']>
With:
Code:
<if condition="$show['hasimicons'] or $userinfo[fieldXX]">
++ In template memberlist_resultsbit:

Replace:

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

Code:
<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[userid]', 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 postbit and postbit_legacy Templates::

Find:

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

Code:
<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.

Code:
<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:


Upload it to FORUM ROOT/images/misc/.

If you liked this hack, please click INSTALL!

Download

No files for download.

Supporters / CoAuthors

  • Spike223

vblts.ru supports vBulletin®, 2022-2024