SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
September 02, 2010, 12:28:03 pm

Login with username, password and session length
Members
Total Members: 8368
Latest: Greg314
Stats
Total Posts: 21926
Total Topics: 4070
Online Today: 38
Online Ever: 399
(March 21, 2008, 10:16:14 pm)
Users Online
Users: 0
Guests: 39
Total: 39
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 Versions: 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.zip5435295

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:
Digg it 
Latest Ratings: [Add Rating]
Recent
[September 01, 2010, 05:22:50 pm]

[September 01, 2010, 08:36:20 am]

by Ken.
[August 31, 2010, 09:31:34 pm]

[August 31, 2010, 01:07:25 pm]

[August 31, 2010, 10:30:58 am]

[August 30, 2010, 11:36:55 am]

[August 30, 2010, 11:33:15 am]

[August 30, 2010, 02:26:09 am]

[August 29, 2010, 10:45:10 pm]

[August 29, 2010, 10:44:21 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
Page created in 0.213 seconds with 14 queries.