SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
February 03, 2012, 10:35:53 pm

Login with username, password and session length
Members
Total Members: 9885
Latest: kievmramor
Stats
Total Posts: 27680
Total Topics: 4844
Online Today: 79
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 1
Guests: 76
Total: 77
'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.zip6425295

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
by exit
[Today at 11:08:48 am]

[February 02, 2012, 08:06:17 pm]

[February 02, 2012, 04:47:47 pm]

[February 02, 2012, 04:47:00 pm]

[February 02, 2012, 07:10:54 am]

[January 31, 2012, 07:20:52 pm]

[January 30, 2012, 08:29:00 am]

[January 30, 2012, 08:08:21 am]

[January 29, 2012, 04:18:09 pm]

[January 29, 2012, 04:13:57 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.17 seconds with 15 queries.