vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vBGT [Google Talk Supprt] (https://vborg.vbsupport.ru/showthread.php?t=95094)

Spike223 08-25-2005 10:00 PM

vBGT [Google Talk Supprt]
 
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:
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

Quote:

Originally Posted by JsnakeJ
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!
[high]* MET920 installs
[/high]
Quote:

Originally Posted by GetGamer.com
*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

Quote:

Originally Posted by MET920
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

Quote:

Originally Posted by Spike223
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:
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' 



All times are GMT. The time now is 01:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02349 seconds
  • Memory Usage 1,818KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code_printable
  • (14)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete