============================================================================================================================
Modification Name: PayPal Button in Posts v1.0

Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Description: This modification will add a paypal field to your profile that will display a secure paypal button in your posts. It's actually only visible for Staff.

Supported Version: XMB 1.9.5 SP1

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 v3. A copy is provided with this software package.

Author Note:
You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.
============================================================================================================================
=======
Step 1:
=======
====================================
Go To Administration Panel --> Insert Raw SQL:
====================================
===================================
Paste The Following Code and Submit Changes:
===================================

ALTER TABLE `$table_members` ADD `paypal` VARCHAR(75) NOT NULL default '';

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

loadtemplates(

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

loadtemplates(
'memcp_profile_paypal',

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

        eval('echo stripslashes("'.template('memcp_profile').'");');
        
===========
Add Above:
===========

        // PayPal Button in Posts Mod Begin
        $paypalblock = '';
        if (X_STAFF) {
            eval('$paypalblock = "'.template('memcp_profile_paypal').'";');
        }
        // PayPal Button in Posts Mod End

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

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

        // PayPal Button in Posts Mod Begin
        $paypal = isset($newpaypal) ? checkInput($newpaypal, '', '', 'javascript', false) : '';
        // PayPal Button in Posts Mod End

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

        $sig            = addslashes($sig);

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

        // PayPal Button In Posts Mod Begin
        $paypal = addslashes($paypal);
        // PayPal Button In Posts Mod End
        
==========
Find Code:
==========

        $db->query("UPDATE $table_members SET
        
=============================================
Add To End Of Line Before  WHERE username='$xmbuser'");
=============================================

, paypal='$paypal'

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

loadtemplates(

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

loadtemplates(
'viewthread_post_paypal',

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

        if ($post['author'] != 'Anonymous' && $post['username']) {
        
===============
Add Code Above:
==============

        // PayPal Button in Posts Mod Begin
        $paypal = '';
        $staffs = array('Super Administrator', 'Administrator', 'Super Moderator', 'Moderator');
        if (in_array($post['status'], $staffs) && $post['paypal'] != '') {
            eval('$paypal = "'.template('viewthread_post_paypal').'";');
        }
        // PayPal Button in Posts Mod End
        
==========
Find Code:
==========

            $mood = '';
            $onlinenow = '';
            
===============
Add Code Below:
===============

            // PayPal Button in Posts Mod Begin
            $paypal = '';
            // PayPal Button in Posts Mod End
        
============================================================================================================================
=======
Step 4:
=======
=======================
Edit File: lang/English.lang.php
=======================
========================
Add To End Of File Above  ?>
========================

// PayPal Button in Posts Mod Begin
$lang['textpaypal'] = "PayPal&#8482;:";
$lang['paypalalt'] = "Make payments with PayPal - it's fast, free and secure!";
// PayPal Button in Posts Mod End

============================================================================================================================
=======
Step 5:
=======
===============================
Go To Administration Panel --> Templates
===============================
===================================
Create New Template: viewthread_post_paypal
===================================

<br />
$lang[textpaypal]<br />
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="$post[paypal]" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="tax" value="0" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="$lang[paypalalt]" />
</form>

============================================================================================================================
=======
Step 6:
=======
===============================
Go To Administration Panel --> Templates
===============================
==================================
Create New Template: memcp_profile_paypal
==================================

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

============================================================================================================================
=======
Step 7:
=======
===============================
Go To Administration Panel --> Templates
===============================
=======================
Edit Template: memcp_profile
=======================

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

$paypalblock

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

$mood

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

$paypal

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