Modification Title: Gmail Addon v1.0

Modification Author: John Briggs

Gmail Graphics By: torb

Last Updated: 06/25/09

Modification Description:
This modification will provide a full addon for the popular Gmail (Google Mail) address.

Supported Version: XMB 1.9.8 SP3

Upgraded for 1.9.8 by: WormHole @ XMB Garage

Installation Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL License. A copy is provided with this software package.

Author Note:
For security purposes, Please Check: http://www.xmbgarage.com for the latest version of this modification.
Downloading this modification from other sites could cause malicious code to enter into your XMB Forum software.
As such, xmbgarage.com will not offer support for modifications not offered at our web site.

=======================================================================================================================
=======
Step 1:
=======
===================================
Go To Administration Panel-->Insert Raw SQL
===================================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

=======================================================================================================================
=======
Step 2:
=======
===================
Edit File: editprofile.php
===================
==========
Find Code:
==========

    $sig = isset($_POST['newsig']) ? checkInput($_POST['newsig'], '', $SETTINGS['sightml'], '', false) : '';

===============
Add Code Below:
===============

    //Gmail Addon Mod Begin
    $newgmail = formVar('newgmail');
    $gmail = $newgmail ? checkInput($newgmail, 'no', 'yes', 'javascript', false) : '';
    // Gmail Addon Mod End

==========
Find Code:
==========

    $sig = addslashes($sig);

===============
Add Code Below:
===============

    // Gmail Addon Mod Begin
    $gmail = addslashes($gmail);
    // Gmail Addon Mod End

==========
Find Code:
==========

    $db->query("UPDATE ".X_PREFIX."members SET email='$email'

=======================================
Find Code In-Line At End Of Above Query Statement
=======================================

 WHERE username='$user'");

================
Replace Code With:
================

, gmail='$gmail' WHERE username='$user'");

=======================================================================================================================
=======
Step 3:
=======
=================
Edit File: memcp.php
=================
==========
Find Code:
==========

        $sig = isset($_POST['newsig']) ? checkInput($_POST['newsig'], '', $SETTINGS['sightml'], '', false) : '';

===============
Add Code Below:
===============

        // Gmail Addon Mod Begin
        $newgmail = formVar('newgmail');
        $gmail = $newgmail ? checkInput($newgmail, 'no', 'yes', 'javascript', false) : '';
        // Gmail Addon Mod End

==========
Find Code:
==========

        $sig = addslashes($sig);

===============
Add Code Below:
===============

        // Gmail Addon Mod Begin
        $gmail = addslashes($gmail);
        // Gmail Addon Mod End

==========
Find Code:
==========

$db->query("UPDATE ".X_PREFIX."members SET $pwtxt

========================================
Find Code In-Line At End Of Above Query Statement
========================================

 WHERE username='$xmbuser'");

================
Replace Code With:
================

, gmail='$gmail' WHERE username='$xmbuser'");

=======================================================================================================================
=======
Step 4:
=======
==================
Edit File: member.php
==================
==========
Find Code:
==========

loadtemplates(

================
Replace Code With:
================

loadtemplates(
'member_profile_gmail',

==========
Find Code:
==========

                $sig = postedVar('sig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add Code Below:
===============

                // Gmail Addon Mod Begin
                $gmail = postedVar('gmail', 'javascript', TRUE, TRUE, TRUE);
                // Gmail Addon Mod End

=================
Find Code (2 Times):
=================

$db->query("INSERT INTO ".X_PREFIX."members (username

===================================
Find Code In-Line In Of Both Query Statements
===================================

) VALUES ('$username'

================
Replace Code With:
================

, gmail) VALUES ('$username'

=======================================
Find Code In-Line At End Of Both Query Statements
=======================================

)");

================
Replace Code With:
================

, '$gmail')");

==========
Find Code:
==========

                $emailblock = '';
                if (X_MEMBER && $memberinfo['email'] != '' && $memberinfo['showemail'] == 'yes') {
                    eval('$emailblock = "'.template('member_profile_email').'";');
                }

===============
Add Code Below:
===============
                
                // Gmail Addon Mod Begin
                // create gmail block
                $gmailblock = '';
                if (X_MEMBER && !empty($memberinfo['gmail'])) {
                    eval('$gmailblock = "'.template('member_profile_gmail').'";');
                }
                // Gmail Addon Mod End

=======================================================================================================================
=======
Step 5:
=======
===============
Edit File: misc.php
===============
==========
Find Code:
==========

loadtemplates(

================
Replace Code With:
================

loadtemplates(
'misc_mlist_row_gmail',

==========
Find Code:
==========

                $email = '';
                if (X_MEMBER && $member['email'] != '' && $member['showemail'] == 'yes') {
                    $memurl = rawurlencode($member['username']);
                    eval('$email = "'.template('misc_mlist_row_email').'";');
                }

===============
Add Code Below:
===============

                // Gmail Addon Mod Begin
                $gmail = '';
                if (X_MEMBER && !empty($member['gmail'])) {
                    eval('$gmail = "'.template('misc_mlist_row_gmail').'";');
                }
                // Gmail Addon Mod End

=======================================================================================================================
=======
Step 6:
=======
===================
Edit File: viewthread.php
===================
==========
Find Code:
==========

loadtemplates(

================
Replace Code With:
================

loadtemplates(
'viewthread_post_gmail',

==========
Find Code:
==========

            if (X_MEMBER && $post['showemail'] == 'yes') {
                eval('$email = "'.template('viewthread_post_email').'";');
            } else {
                $email = '';
            }

===============
Add Code Below:
===============

            // Gmail Addon Mod Begin
            $gmail = '';
            if (X_MEMBER && !empty($post['gmail'])) {
                eval('$gmail = "'.template('viewthread_post_gmail').'";');
            }
            // Gmail Addon Mod End

==========
Find Code:
==========

            $location = '';
            $mood = '';

===============
Add Code Below:
===============

            // Gmail Addon Mod Begin
            $gmail = '';
            // Gmail Addon Mod End

=======================================================================================================================
=======
Step 7:
=======
=======================
Edit File: /lang/English.lang.php
=======================
========================
Add To End Of File Above ?>
========================

// Gmail Addon Mod Begin
$lang['gmail'] = 'GMail&#8482;:';
$lang['gmailalt'] = 'Gmail&#8482; This Member';
// Gmail Addon Mod End

=======================================================================================================================
=======
Step 7:
=======
==========================
Go to Admin Panel --> Templates
=================================
Create New Template: member_profile_gmail
=================================
=================
Add Code & Submit
=================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[gmail]</td>
<td bgcolor="$THEME[altbg2]"><a href="mailto:$memberinfo[gmail]" title="$lang[gmailalt]">$memberinfo[gmail]</a></td>
</tr>

=======================================================================================================================
=======
Step 8:
=======
==========================
Go To Admin Panel --> Templates
==========================
=================================
Create New Template: misc_mlist_row_gmail
=================================

=================
Add Code & Submit
=================

<a href="mailto:$member[gmail]"><img src="$THEME[imgdir]/gmail.gif" border="0" alt="$lang[gmailalt]" title="$lang[gmailalt]" /></a>

=======================================================================================================================
=======
Step 9:
=======
==========================
Go To Admin Panel --> Templates
==========================
==================================
Create New Template: viewthread_post_gmail
==================================

==================
Add Code & Submit:
==================

<a href="mailto:$post[gmail]"><img src="$THEME[imgdir]/gmail.gif" border="0" alt="$lang[gmailalt]" title="$lang[gmailalt]" /></a>

=======================================================================================================================
=======
Step 10:
=======
==========================
Go To Admin Panel --> Templates
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textemail]</td>
<td bgcolor="$altbg2"><input type="text" name="newemail" size="25" value="$member[email]" /><br /><a href="http://www.network-tools.com/default.asp?prog=validate&amp;Netnic=whois.arin.net&amp;host=$member[email]" target="_blank">$lang[adminverifyemail]</a></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[gmail]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newgmail" size="25" value="$member[gmail]" /><br /><a href="http://www.network-tools.com/default.asp?prog=validate&amp;Netnic=whois.arin.net&amp;host=$member[gmail]" target="_blank">$lang[adminverifyemail]</a></td>
</tr>

=======================================================================================================================
=======
Step 11:
=======
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: memcp_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textemail]</td>
<td bgcolor="$altbg2"><input type="text" name="newemail" size="25" value="$member[email]" /></td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[gmail]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newgmail" size="25" value="$member[gmail]" /></td>
</tr>

=======================================================================================================================
=======
Step 12:
=======
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: member_profile
=======================
==========
Find Code:
==========

$emailblock

===============
Add Code Below:
===============

$gmailblock

=======================================================================================================================
=======
Step 13:
=======
==========================
Go To Admin Panel --> Templates
==========================
========================
Edit Template: viewthread_post
========================
==========
Find Code:
==========

$email

==============
Add Code After:
==============

$gmail

=======================================================================================================================
=======
Step 14:
=======
=========================================
Go to admin panel -> templates -> member_reg_optional
=========================================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[textsite]</td>
<td bgcolor="$altbg2"><input type="text" name="site" size="25" value="" /></td>
</tr>

===============
Add Code Above:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[gmail]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="gmail" size="25" /></td>
</tr>

=======================================================================================================================
=======
Step 15:
=======
==========================
Go To Admin Panel --> Templates
==========================
=======================
Edit Template: misc_mlist_row
=======================
==========
Find Code:
==========

<td bgcolor="$altbg1" class="ctrtablerow">$email</td>

===============
Add Code Below:
===============

<td bgcolor="$THEME[altbg2]" class="ctrtablerow">$gmail</td>

=======================================================================================================================
=======
Step 16:
=======

==========================
Go To Admin Panel --> Templates
==========================
===================================
Edit Templates: misc_mlist and misc_mlist_admin
===================================
==========
Find Code:
==========

<td width="10%">$lang[textemail]:</td>

===============
Add Code Below:
===============

<td width="10%">$lang[gmail]:</td>

=======================================================================================================================
=======
Step 17:
=======
==========================
Go To Admin Panel --> Templates
==============================================================
Edit Templates: misc_mlist_multipage, misc_mlist_results_none and misc_mlist_separator
==============================================================
=================
Find Code (2 Times):
=================

colspan="8"

=======================
Replace Code With (2 Times):
=======================

colspan="9"

=======================================================================================================================
========
Step 18:
========

Upload "gmail.gif" to all theme folders.

=======================================================================================================================
Enjoy!