Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 11803
Latest: VXP
New This Month: 2
New This Week: 0
New Today: 0
Stats
Total Posts: 41608
Total Topics: 7274
Most Online Today: 79
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 35
Total: 36

Author Topic: [Mod] 'Buy Me A Beer' Mod  (Read 4410 times)

0 Members and 1 Guest are viewing this topic.

Offline karlbenson

  • Member
  • *
  • Posts: 14
    • View Profile
    • Off-Topic
[Mod] 'Buy Me A Beer' Mod
« on: August 08, 2007, 06:04:55 pm »
'Buy Me A Beer' Mod
SMF Version: 1.1.3, 1.1.2, 1.1.1

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: [Select]

// All the messenger type contact info.

ADD BEFORE:
Code: [Select]

// 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: [Select]

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

ADD BEFORE:
Code: [Select]

// 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: [Select]

$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

Link to Mod

Offline drgsldr69

  • Member
  • *
  • Posts: 5
    • View Profile
Re: [Mod] 'Buy Me A Beer' Mod
« Reply #1 on: October 31, 2007, 07:06:11 am »
are there any updates for this so it will work with 1.1.4? everytime i try to install it it won't let me!!!!

 

Related Topics

  Subject / Started by Replies Last post
8 Replies
10128 Views
Last post July 18, 2008, 08:37:59 pm
by mashby
0 Replies
2047 Views
Last post June 14, 2012, 08:45:56 pm
by Fog

+- Recent Topics

Thanks mod SMF 2.1 by Monocero
November 27, 2021, 01:13:01 pm

How to change the font on a photo in SMF Gallery Pro? by SMFHacks
November 18, 2021, 09:28:11 am

Bulk Upload Many Pictures - File Name by SMFHacks
November 17, 2021, 08:58:50 am

Schedule or direct download link by SMFHacks
November 16, 2021, 10:57:33 am

Download Expire by Vincent Volmer
November 16, 2021, 02:40:47 am

prettyurls - TroubleShooting.wiki by SMFHacks
November 14, 2021, 02:18:59 pm

Error With Delete Download by mickjav
November 10, 2021, 04:49:12 pm

No ads on left or right by coyote
November 08, 2021, 04:57:13 pm

Now accepting Cryptocurrency by SMFHacks
November 05, 2021, 05:33:27 pm

Latest Version Pretty Urls SEO Pro by SMFHacks
November 04, 2021, 03:46:53 pm

Powered by EzPortal