News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Additional Info
Type
Package ID
karlbenson:buymeabeer
First Created
May 25, 2007, 08:27:43 PM
Last Updated
January 18, 2008, 11:03:38 PM

'Buy Me A Beer' v1.4

Allows users to reward other users for their posts by buying them a beer (via paypal)
Compatible With 1.1.2, 1.1.3, 1.1.4
Latest version v1.4
Downloads 6,167
Reviews 0
Rating 0/5
Subscribers 1
License (View License)
Author(s)
This mod has been taken over by MrBabbelen
The link for which is http://custom.simplemachines.org/mods/index.php?mod=1246


Compatibility
For SMF 1.1.x versions only

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).

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.

Features
o Adds a paypal donation field to each users profile
o Adds a clickable beer icon to take user to donation page.
o Supports Languages
- English/English-utf8
- English_British/English_British-utf8
I welcome translations for other languages. Please post the translated language strings in the Support Topic.

Installation
Simply install the package to install on the SMF Default Core Theme ONLY.
All other themes will require manual edits for Profile.template.php and Display.template.php
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:

// All the messenger type contact info.

ADD BEFORE:

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

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

ADD BEFORE:

// 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 your theme has its own versions of the language files Modifications.english.php and/or Modifications.english-utf8.php, OR if your using a language other than those supported (listed above) by the mod then you will need to copy the language strings into each custom version of those files.
$txt['pleasebuymeabeer'] = 'Buy Me A Beer';
$txt['buymeabeeralt'] = 'Buy Me A Beer Through Paypal';
$txt['buymeabeer'] = 'PayPal Address For Users To Buy You A Beer';
$txt['profile_error_bad_paypal'] = 'The PayPal Address you entered was not a valid email address';
$txt['profile_error_paypal_taken'] = 'The PayPal Address you entered is already in use by another member';
$txt['buymeabeer_desc'] = 'Allows users to reward you for your posts';


Useful Links
SMF Package Parser
Manual Installation Of Mods
How Do I Modify Files?

Customization
$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).
$priceofbeer = 5 ; // In US Dollars no cents

Donate
Has this modification helped you? Support the developer by Donating

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

Changelog
v1.0
o Initial release made per SMF user request.
v1.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
v1.2
o Fixed install bug where had previous install
v1.3
o Fixed install bug, not installing column
o Added english-utf8 support.
v1.4 - 25th December
o Added english_british/english_british-utf8 support.
Manual installation info
You have to register or login to be able to leave a review
There are currently no reviews on this customization
Advertisement: