============================================================================================================================
Modification Name: LastFM Button

Version: 1.0

Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Description:
This modificaton will allow you to specify your LastFM Username in your profile settings
This modificaton will add a lastfm button to your posts that will popup a window with your lastfm playlist

Supported Version: XMB 1.9.5 SP1

Notes:
This modificaton is released under the GPL v3. A copy is provided with this software package.

Please backup your files before installing this modificaton.
Neither XMBGarage nor the author can be held responsible if your board stops functioning properly due to you installing this modificaton.
============================================================================================================================
=======
Step 1:
=======
====================================
Go To Administration Panel --> Insert Raw SQL
====================================
===================================
Paste The Following Code and Submit Changes:
===================================

ALTER TABLE `$table_members` ADD `lastfm` VARCHAR(32) NOT NULL default '';

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

// LastFM Button Mod Begin
$lang['lastfm'] = 'LastFM URL:';
$lang['lastfmalt'] = 'This User has a LastFM Playlist';
// LastFM Button Mod End

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

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

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

        // LastFM Button Mod Begin
        $lastfm = isset($lastfm) ? checkInput($lastfm, '', '', 'javascript', false) : '';
        // LastFM Button Mod End

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

        $sig           = addslashes($sig);

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

        // LastFM Button Mod Begin
        $lastfmname = addslashes($lastfmname);
        // LastFM Button Mod End

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

        $db->query("INSERT INTO $table_members (uid,

========================
Find Code In Above Statement:
========================

) VALUES ('', '$username',

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

, lastfm) VALUES ('', '$username',

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

)");

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

, '$lastfm')");

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

            if ($memberinfo['email'] != "" && $memberinfo['showemail'] == "yes") {
                $email = $memberinfo['email'];
            } else {
                $email = '';
            }

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

            // LastFM Button Mod Begin
            $lastfmblock = '';
            if ($memberinfo['lastfm'] != '') {
                $lastfm = "window.open('http://imagegen.last.fm/lastfmplain/recenttracks/".$memberinfo[lastfm].".gif','lfm_popup','height=200,width=255,resizable=yes,scrollbars=yes'); return false;";
                eval('$lastfmblock = "'.template('member_profile_lastfm').'";');
            }
            // LastFM Button Mod End

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

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

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

        // LastFM Button Mod Begin
        $lastfm = isset($lastfm) ? checkInput($lastfm, '', '', 'javascript', false) : '';
        // LastFM Button Mod End

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

        $sig            = addslashes($sig);

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

        // LastFM Button Mod Begin
        $lastfm = addslashes($lastfm);
        // LastFM Button Mod End

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

$db->query("UPDATE $table_members SET $pwtxt email='$email',

===================================================
Add To End Of Statement BEFORE  WHERE username='$xmbuser'");
===================================================

, lastfm='$lastfm'

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

loadtemplates(

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

'viewthread_post_lastfm',

=====
Find:
=====

            $yahoo = '';
            if ($post['yahoo'] != '') {
                eval('$yahoo = "'.template('viewthread_post_yahoo').'";');
            }

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

            // LastFM Button Mod Begin
            $lastfm = '';
            if ($post['lastfm'] != '') {
                eval('$lastfm = "'.template('viewthread_post_lastfm').'";');
            }
            // LastFM Button Mod End
            
==========
Find Code:
==========

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

            // LastFM Button Mod Begin
            $lastfm = '';
            // LastFM Button Mod End
            
============================================================================================================================
=======
Step 6:
=======
===============================
Go To Administration Panel --> Templates
===============================
=====================
Edit template: member_reg
=====================
==========
Find Code:
==========

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

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

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

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

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

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

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

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

<tr>
<td bgcolor="$altbg1" class="tablerow">$lang[textwebcam]</td>
<td bgcolor="$altbg2" class="tablerow"><a href="$webcam" target="_blank">$webcam</a></td>
</tr>

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

$lastfmblock

============================================================================================================================
=======
Step 9:
=======
===============================
Go To Administration Panel --> Templates
===============================
=======================
Edit template: viewthread_post
=======================
==========
Find Code:
==========

$yahoo

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

$lastfm

============================================================================================================================
=======
Step 9:
=======
===============================
Go To Administration Panel --> Templates
===============================
==================================
Create New Template: member_profile_lastfm
==================================
========================
Add Code and Submit Changes:
========================

<tr class="tablerow">
<td bgcolor="$altbg1">$lang[lastfm]</td>
<td bgcolor="$altbg2"><a href="#" onclick="$lastfm">$memberinfo[lastfm]</a></td>
</tr>

============================================================================================================================
========
Step 10:
========
===============================
Go To Administration Panel --> Templates
===============================
==================================
Create New Template: viewthread_post_lastfm
==================================
========================
Add Code and Submit Changes:
========================

<a href="#" onclick="window.open('http://imagegen.last.fm/lastfmplain/recenttracks/$post[lastfm].gif','lfm_popup','height=200,width=255,resizable=yes,scrollbars=yes'); return false;"><img src="$imgdir/lastfm.gif" alt="$lang[lastfmalt]" border="0" /></a>

============================================================================================================================
========
Step 10:
========

Upload 'lastfm.gif' from the 'Contents' folder to your forum's theme directories.

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