SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
July 04, 2009, 01:47:27 pm

Login with username, password and session length
Members
Total Members: 5220
Latest: melody2127
Stats
Total Posts: 16857
Total Topics: 3233
Online Today: 61
Online Ever: 399
(March 21, 2008, 10:16:14 pm)
Users Online
Users: 3
Guests: 43
Total: 46
Sponsored Links
'Buy Me A Beer' Mod
Author: Karl Benson
Submitted by: karlbenson
Author Website:http://www.youposted.com
Date Submitted: 2007-08-08
Last Updated: 2007-08-08
Supported Version: 1.1.3, 1.1.2, 1.1.1
Short Description
Allows users to reward other users for their posts by buying them a beer (via paypal)
Downloads:
Title Downloads FileSize (bytes)
98Buy Me A Beer.zip3935295

Detailed Description:


BUY ME A BEER v1.1
By Karl Benson



Link to Mod | Comment On This Mod


Introduction
Allows users to reward other users for their posts by buying them a beer (or at least donating enough money via Paypal to buy one).

Warning!
This mod is an initial release. Please report any bugs you find, no matter how trivial.
Remember to backup your database AND files before installing any modifications, especially initial releases and betas

Installation
Simply install the package to install this modification on the Default theme.

Manual edits will be required for themes which have a custom profile (1x edit) and/or custom display template (1x edit)
AND you will need to place a copy of the image buymeabeer.gif in the image folder of each of your themes (Themes/{themename}/images/)

Open Themes/{themename}/Profile.template.php, and FIND:
Code:

// All the messenger type contact info.

ADD BEFORE:
Code:

// Paypal Address For 'Buy Me A Beer Mod
echo ' <tr>
<td width="40%"><b>', $txt['buymeabeer'], ': </b><div class="smalltext">', $txt['buymeabeer_desc'], '</div></td>
<td><input type="text" name="buymeabeer" size="24" value="', $context['member']['buymeabeer']['name'], '" /></td>
</tr><tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>
';


Open Themes/{themename}/Display.template.php, and FIND:
Code:

// Show online and offline buttons?
if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])

ADD BEFORE:
Code:

// SHOW BUY ME A BEER
if (!$message['member']['is_guest'] && $context['user']['is_logged'] && !empty($message['member']['buymeabeer']))
{
$priceofbeer = 5 ; // In US Dollars no cents
echo'<br/>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=' , htmlentities ($message['member']['buymeabeer'], ENT_NOQUOTES, "UTF-8") , '&item_name=' , htmlentities ($txt['pleasebuymeabeer'], ENT_NOQUOTES, "UTF-8") , '&amount=', $priceofbeer ,'%2e00&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8" rel="nofollow" title="', $txt['buymeabeeralt'] ,'"><img alt="', $txt['buymeabeeralt'] ,'" border="0" src="', $settings['images_url'] , '/buymeabeer.gif" border="0"/></a><br/>';
}


If you are still having trouble, I recommend the Modification Parser/ by Daniel 15

How Do I Use This Mod?
An additional option is added to the users profile to enter their paypal address.
Where the user has entered their paypal address, a 'beer glass' icon appear in the poster information area of users posts.  The alt text when hovering over the icon states 'Buy Me A Beer Through Paypal' [must be logged in to see] and when clicked takes the user to the paypal page.

Screenshots
On the profile area

In the poster information area of posts


Customisation
$5 for a beer?  Seems reasonable, but if you want to change it you can do so easily by editing the Display.template.php and FIND the line below and REPLACE the 5 with another digit (must be a whole number, no decimals).
Code:

$priceofbeer = 5 ; // In US Dollars no cents


Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Changelog
1.0 BETA
o Initial release made per SMF user request.
1.1
o Ensured it removes the buymeabeer.gif image on uninstall (as per SMF Modification Guidelines)
o Wrote out the manual edits
o Improved the readme/documentation for this mod


Bookmarks:
BlinkList  del.icio.us  Digg it  Netvouz  Simpy  Spurl 
Latest Ratings: [Add Rating]
Recent
[Today at 12:57:31 pm]

[July 02, 2009, 10:23:53 pm]

[July 02, 2009, 07:59:01 am]

[July 02, 2009, 07:58:30 am]

by Rus
[July 01, 2009, 01:34:29 pm]

[June 28, 2009, 05:50:05 pm]

[June 28, 2009, 03:33:20 pm]

[June 28, 2009, 12:13:08 am]

[June 27, 2009, 10:17:18 pm]

[June 27, 2009, 10:12:23 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
Page created in 4.68 seconds with 17 queries.