News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Buy Me A Drink

Started by Keith Tysinger, April 17, 2009, 09:11:12 AM

Previous topic - Next topic

Keith Tysinger

Link to Mod

Buy Me A Drink Version: 1.1 Mod by Keith Tysinger

For SMF 2.0 Beta 4, 2.0 RC1, 2.0 RC3, and 1.1.8

Buy_me_a_drink_1_2.zip now works with 2.0 RC3 and the new Curve theme.

Buy Me a Drink allows members to buy other members a drink... or soda... or coffee... or even a cigar. This fun mod uses Paypal to transfer funds.

The member profile form is modified to allow a user to choose their favorite drink. They can choose from:

1) Drink
2) Beer
3) Coffee
4) Soda
5) Cigar

Demo: Madcoder.biz/forum

The profile is also modified to allow the user to enter another email address for their paypal account. The user can choose to allow or disallow guests from buying them a drink.

The admin center allows the moderators to:

1) Turn the mod on/off
2) Choose from small or large icons to better suit your site's theme
3) Choose dollar amount of drink

This mod displays an icon on their posts relating to their drink of choice and adds
a paypal payment screen.

Version History:

1.1 (4-30-2009) Corrected a missing double quote; this error broke the xhtml validation

Please support the evolution of this mod: buy the author a drink ;)


[email protected]


For installation of this or any other script, please contact me via contact form @ www.MadCoder.biz
Contact me for all of your website design needs.

damnitmike

I always thought this mod was cool.....kbensons version seemed to have gotten lost or forgotten.....

I'll give it a go here shortly.....

Afro

any hope for smf 1.1.8 version

GazOutEast

sam_milla - don't be so lazy - use the search function

Karl Benson's version = Buy me a Beer - it works perfectly well on 1.1.8 and gave sterling service on one of my 1.1.8 forums until it was upgraded to RC1

I am very pleased to see this version appear
Many thanks to kc2002 for updating it
I have 20:20 vision - I can see anything bigger than 20" x 20"

Keith Tysinger

#4
Thanks folks. I have never installed Karl Benson's Mod because I didn't want to plagiarize :) I borrowed his idea and created a new mod for 2.0 RC1 because I wanted a working mod for my website.... and something a little different.

I hope you enjoy it.... and the drinks! :)

Contact me for all of your website design needs.

LadyC

congratulations kc, on getting your first mod approved!

Keith Tysinger

I just added support for 1.1.8 today. The conversion was a pain and a lot of work!

I hope it works  ;D

Quote from: sam_milla on April 17, 2009, 11:34:25 AM
any hope for smf 1.1.8 version
Contact me for all of your website design needs.

Keith Tysinger

Quote from: Keith Tysinger on April 25, 2009, 11:58:19 PM
I just added support for 1.1.8 today. The conversion was a pain and a lot of work!

I hope it works  ;D

Quote from: sam_milla on April 17, 2009, 11:34:25 AM
any hope for smf 1.1.8 version

Tonight I release a new version that corrected a missing double quote ("). This caused an xhtml validation error.

The error is in the Display.template.php file. This is the corrected (one line of code) version for 2.0 RC1:

<li><a href="', $scripturl, '?action=buyme;u=', $message['member']['id'], '" title="'.$txt['buy_description_icon'] . $message['member']['buy_type']. '"><img src="' . $settings['images_url'] . '/'.$message['member']['buy_icon'].'" alt="'.$txt['buy_description_icon'].$message['member']['buy_type'].'" border="0" /></a></li>';

2.0 beta 4

<li><a href="', $scripturl, '?action=buyme;u=', $message['member']['id'], '" title="Buy me ' . $message['member']['buy_type']. '"><img src="' . $settings['images_url'] . '/'.$message['member']['buy_icon'].'" alt="Buy me '  . $message['member']['buy_type'].'" border="0" /></a></li>';

v. 1.1.8

<a href="', $scripturl, '?action=buyme;u=', $message['member']['id'], '" title="'.$txt['buy_description_icon'] . $message['member']['buy_type']. '"><img src="' . $settings['images_url'] . '/'.$message['member']['buy_icon'].'" alt="'.$txt['buy_description_icon'].$message['member']['buy_type'].'" border="0" /></a>';
Contact me for all of your website design needs.

Bob Perry of Web Presence Consulting

Hi all,

Just installed this on my site, 1.1.8 with a little over 2000 users, I think I'm going to like it a lot... however, there seems to be one minor flaw if you use the package manager to install... not really too sharp with packages yet myself, tried to fix it manually myself without success... it seems that after install everything is good except that it displays two icons for the buy_me_?? on the posted messages instead of one, any help?
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Keith Tysinger

#9
It appears that the mod was installed twice. The $themedir/Display.template.php file was modified twice.

You need to search in that file for:

if ($message['member']['buy_on'])
{
if (!$modSettings['BuyMeIcon']) echo'<br /><br />';

echo '
  <a href="', $scripturl, '?action=buyme;u=', $message['member']['id'], '" title="'.$txt['buy_description_icon'] . $message['member']['buy_type']. '"><img src="' . $settings['images_url'] . '/'.$message['member']['buy_icon'].'" alt="'.$txt['buy_description_icon'].$message['member']['buy_type'].'" border="0" /></a>';
}


There should be TWO identical lines (blocks of code) like the one above. Remove one of them and you will be all set. Just be sure to remove the whole block from if ... }

Otherwise email me the Display.template.php file and I will edit it for you and email it back to you.


Quote from: bperry921 on May 11, 2009, 03:13:33 AM
Hi all,

Just installed this on my site, 1.1.8 with a little over 2000 users, I think I'm going to like it a lot... however, there seems to be one minor flaw if you use the package manager to install... not really too sharp with packages yet myself, tried to fix it manually myself without success... it seems that after install everything is good except that it displays two icons for the buy_me_?? on the posted messages instead of one, any help?
Contact me for all of your website design needs.

benjicadena

#10
I just noticed that when you click on the buy a drink icon the following message that comes up has the word recommended misspelled. This is how the sentence comes out: "You have chosen to buy --- some coffee. The reccomended price is $; however, you may send any amount you wish. Please click on the Paypal Donate button below and you will be allowed to enter the amount you wish to pay.

It should be one c and two m's Recommended.

Keith Tysinger

Oh no. That is embarrassing. I will correct that.

It's in the $languagedir/index.english.php file

$txt['buy_reccomended']='The recommended price is';

You can edit that file or correct it in the admin panel-> language files in SMF 2.0.

Quote from: benjicadena on May 13, 2009, 04:45:39 PM
I just noticed that one you click on the buy a drink icon the following message that comes up has the word recommended misspelled. This is how the sentence comes out: "You have chosen to buy --- some coffee. The reccomended price is $; however, you may send any amount you wish. Please click on the Paypal Donate button below and you will be allowed to enter the amount you wish to pay.

It should be one c and two m's Recommended.
Contact me for all of your website design needs.

Blah blah

Hi...can the "Buy me a drink" mod be coded so that only Admins can use the feature?

Thanks in advance

Keith Tysinger

I could show you how to do a quick and dirty fix for this. Maybe a nice feature for a future version.

Quote from: Blah blah on May 14, 2009, 11:22:57 AM
Hi...can the "Buy me a drink" mod be coded so that only Admins can use the feature?

Thanks in advance
Contact me for all of your website design needs.

Blah blah


Keith Tysinger

#15
Are you using the 2.0 version? If so, edit profile-modify.php in the /source dir.


search for

      'buy_text' => array(
      'buy_guest' => array(
      'buy_email' => array(

(three changes) each of the above blocks of code will have this line:

'enabled' => $modSettings['BuyMeEnable'],

change all three to this:

'enabled' => ($modSettings['BuyMeEnable'] && $context['user']['is_admin']),

This will not allow non admins to turn on the mod in their profile.

The next version will use SMF's permissions.

Quote from: Blah blah on May 14, 2009, 02:32:17 PM
Let me hear it  :D
Contact me for all of your website design needs.

Blah blah

Thanks man  :D

great mod too btw

Xavi-Nena

Ok I am clearly blind, where do I turn this on at?

Keith Tysinger

#18
Quote from: NenaGb on May 16, 2009, 04:21:17 PM
Ok I am clearly blind, where do I turn this on at?

It should have taken you there automatically.

Admin -> Configuration -> Modifications -> Buy me a drink

Then you set it up in your profile -> modify -> forum profile

Hey if that is your picture, maybe I can buy you a drink sometime?  8)
Contact me for all of your website design needs.

Xavi-Nena

hehe it is me, thank you but since this pic was taken I have let myself go a bit...;)

also re: the mod, I cannot get the manual instructions for 1.1.8 i have to manually ad it to 2 of my files any suggestions?

Advertisement: