============================================================================================================================
Modification Name: Twitter Link

Version: 1.0

Description:
This modification will offer a text area in registration and member profile to input a url to your twitter page.
This modification will display a button link to your twitter page in the member's list and in your posts.
This modification will display a text link to your twitter page in your member profile.
This modification will offer the administrator the option to edit users twitter link.

Modification Author: WormHole

Supported Version: XMB 1.9.5 SP1

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

License Note: This modification is released under the GPL License v3. 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, XMB Garage.com will not offer support for modifications not offered in our available modifications list.
============================================================================================================================
=======
Step 1:
=======
====================================
Go To Admininstration Panel --> Insert Raw SQL
====================================
=========================
Insert Code and Submit Changes
=========================

ALTER TABLE `$table_members` ADD `twitter` varchar(100) NOT NULL default '';

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

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

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

    // Twitter Link Mod Begin
    $twitter = isset($twitter) ? checkInput($twitter, '', '', 'javascript', false) : '';
    // Twitter Link Mod End

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

    $sig            = addslashes($sig);

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

    // Twitter Link Mod Begin
    $twitter = addslashes($twitter);
    // Twitter Link Mod End

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

$db->query("UPDATE $table_members SET

=================================================
Add To End Of Statement Before WHERE uid='".$member['uid']."'");
=================================================

, twitter='$twitter'

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

loadtemplates(

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

loadtemplates(
'member_profile_twitter',

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

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

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

        // Twitter Link Mod Begin
        $twitter = isset($twitter) ? checkInput($twitter, '', '', 'javascript', false) : '';
        // Twitter Link Mod End

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

        $sig           = addslashes($sig);

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

        // Twitter Link Mod Begin
        $twitter = addslashes($twitter);
        // Twitter Link Mod End

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

) VALUES ('',

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

, twitter) VALUES ('',


==================================
Find Code At End Of Above Query Statement:
==================================

)");

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

, '$twitter')");


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

            if ($memberinfo['site'] != 'http://') {
                $site = $memberinfo['site'];
            } else {
                $site = '';
            }

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

            // Twitter Link Mod Begin
            if (strpos($memberinfo['twitter'], 'http') === false) {
                $memberinfo['twitter'] = "http://$memberinfo[twitter]";
            }

            // create twitter block
            $twitterblock = '';
            if ($memberinfo['twitter'] != 'http://') {
                $twitter = $memberinfo['twitter'];
                eval('$twitterblock = "'.template('member_profile_twitter').'";');
            }
            // Twitter Link Mod End

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

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

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

        // Twitter Link Mod Begin
        $twitter = isset($twitter) ? checkInput($twitter, '', '', 'javascript', false) : '';
        // Twitter Link Mod End

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

        $sig            = addslashes($sig);

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

        // Twitter Link Mod Begin
        $twitter = addslashes($twitter);
        // Twitter Link Mod End

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

 WHERE username='$xmbuser'");

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

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

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

loadtemplates(

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

loadtemplates(
'viewthread_post_twitter',

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

            if ($post['site'] == '') {
                $site = '';
            } else {
                $post['site'] = str_replace("http://", "", $post['site']);
                $post['site'] = "http://$post[site]";
                eval('$site = "'.template('viewthread_post_site').'";');
            }

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

            // Twitter Link Mod Begin
            if ($post['twitter'] == '') {
                $twitter = "";
            } else {
                $post['twitter'] = str_replace("http://", "", $post['twitter']);
                $post['twitter'] = "http://$post[twitter]";
                eval('$twitter = "'.template('viewthread_post_twitter').'";');
            }
            // Twitter Link Mod End

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

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

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

            // Twitter Link Mod Begin
            $twitter = '';
            // Twitter Link Mod End

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

// Twitter Link Mod Begin
$lang['texttwitter'] = "Twitter:";
$lang['altvisittwitter'] = "Visit User's twitter Page";
// Twitter Link Mod End

============================================================================================================================
=======
Step 7:
=======
===============================
Go To Administration Panel --> Templates
===============================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

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

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

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

============================================================================================================================
=======
Step 8:
=======
===============================
Go To Administration Panel --> Templates
===============================
=======================
Edit Template: member_profile
=======================
==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[textmsn]</td>
<td bgcolor="$altbg2" class="tablerow"><a href="$msn" target="_blank">$msn</a></td>
</tr>

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

$twitterblock

============================================================================================================================
=======
Step 9:
=======
===============================
Go To Administration Panel --> Templates
===============================
=====================
Edit Template: member_reg
=====================
==========
Find Code:
==========

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

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

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

============================================================================================================================
========
Step 10:
========
===============================
Go To Administration Panel --> Templates
===============================
=======================
Edit Template: memcp_profile
=======================
==========
Find Code:
==========

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

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

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

============================================================================================================================
========
Step 11:
========
===============================
Go To Administration Panel --> Templates
===============================
========================
Edit Template: viewthread_post
========================
==========
Find Code:
==========

$yahoo

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

$twitter

============================================================================================================================
========
Step 12:
========
===============================
Go To Administration Panel --> Templates
===============================
==============================
Create Template: member_profile_twitter
==============================
========================
Add Code and Submit Changes
========================

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[texttwitter]</td>
<td bgcolor="$altbg2"><a href="$twitter" target="_blank">$twitter</td>
</tr>

============================================================================================================================
========
Step 13:
========
===============================
Go To Administration Panel --> Templates
===============================
===============================
Create Template: viewthread_post_twitter
===============================
========================
Add Code and Submit Changes
========================

<a href="$post[twitter]" target="_blank"><img src="$imgdir/twitter.gif" border="0" alt="$lang[altvisittwitter]" /></a>

==============================================================================================================
========
Step 14:
========

Upload image twitter.gif to all theme folders.

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