Advertisement:

Author Topic: Buy Me A Drink  (Read 38379 times)

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Buy Me A Drink
« on: April 17, 2009, 09:11:12 AM »
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 ;)


Keith.Tysinger@gmail.com


For installation of this or any other script, please contact me via contact form @ www.MadCoder.biz
« Last Edit: March 15, 2010, 03:07:29 AM by Keith Tysinger »
Contact me for all of your website design needs.

Offline damnitmike

  • Semi-Newbie
  • *
  • Posts: 95
  • Gender: Male
Re: Buy Me A Drink
« Reply #1 on: April 17, 2009, 09:48:46 AM »
I always thought this mod was cool.....kbensons version seemed to have gotten lost or forgotten.....

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

Offline Afro

  • SMF Hero
  • ******
  • Posts: 1,855
  • Gender: Male
  • http://twitter.com/afrowall
    • Global Runs
Re: Buy Me A Drink
« Reply #2 on: April 17, 2009, 11:34:25 AM »
any hope for smf 1.1.8 version

Offline GazOutEast

  • Jr. Member
  • **
  • Posts: 309
  • Gender: Male
  • If it's fixed - I can break it
Re: Buy Me A Drink
« Reply #3 on: April 18, 2009, 10:33:03 AM »
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"

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Re: Buy Me A Drink
« Reply #4 on: April 20, 2009, 01:30:03 AM »
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! :)

« Last Edit: April 20, 2009, 05:02:43 AM by kc2002 »
Contact me for all of your website design needs.

Offline LadyC

  • Jr. Member
  • **
  • Posts: 270
Re: Buy Me A Drink
« Reply #5 on: April 20, 2009, 01:37:35 PM »
congratulations kc, on getting your first mod approved!

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Re: Buy Me A Drink
« Reply #6 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

any hope for smf 1.1.8 version
Contact me for all of your website design needs.

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Re: Buy Me A Drink
« Reply #7 on: April 30, 2009, 03:37:03 AM »
I just added support for 1.1.8 today. The conversion was a pain and a lot of work!

I hope it works  ;D

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.

Offline Bob Perry of Web Presence Consulting

  • Sophist Member
  • *****
  • Posts: 1,004
  • Gender: Male
  • (T)ogether (E)veryone (A)chieves (M)ore
    • Bobert921 on Facebook
    • https://www.linkedin.com/in/bperry921/ on LinkedIn
    • @bperry921 on Twitter
    • Web Presence Consulting
Re: Buy Me A Drink
« Reply #8 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?
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

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Re: Buy Me A Drink
« Reply #9 on: May 11, 2009, 01:36:12 PM »
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:

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


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?
« Last Edit: May 11, 2009, 01:40:27 PM by Keith Tysinger »
Contact me for all of your website design needs.

Offline benjicadena

  • Semi-Newbie
  • *
  • Posts: 28
  • Gender: Male
Re: Buy Me A Drink
« Reply #10 on: May 13, 2009, 04:45:39 PM »
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.
« Last Edit: May 14, 2009, 04:33:08 PM by benjicadena »

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Re: Buy Me A Drink
« Reply #11 on: May 13, 2009, 07:51:15 PM »
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.

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.

Offline Blah blah

  • Jr. Member
  • **
  • Posts: 322
Re: Buy Me A Drink
« Reply #12 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

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Re: Buy Me A Drink
« Reply #13 on: May 14, 2009, 02:28:07 PM »
I could show you how to do a quick and dirty fix for this. Maybe a nice feature for a future version.

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.

Offline Blah blah

  • Jr. Member
  • **
  • Posts: 322
Re: Buy Me A Drink
« Reply #14 on: May 14, 2009, 02:32:17 PM »
Let me hear it  :D

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Re: Buy Me A Drink
« Reply #15 on: May 15, 2009, 12:21:55 AM »
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.

Let me hear it  :D
« Last Edit: May 15, 2009, 08:18:31 AM by Keith Tysinger »
Contact me for all of your website design needs.

Offline Blah blah

  • Jr. Member
  • **
  • Posts: 322
Re: Buy Me A Drink
« Reply #16 on: May 15, 2009, 12:40:23 AM »
Thanks man  :D

great mod too btw

Offline Xavi-Nena

  • Full Member
  • ***
  • Posts: 458
  • Gender: Female
  • ♥ I am my own malfunction....Xavi-Nena ♥
Re: Buy Me A Drink
« Reply #17 on: May 16, 2009, 04:21:17 PM »
Ok I am clearly blind, where do I turn this on at?

Offline Keith Tysinger

  • Semi-Newbie
  • *
  • Posts: 58
  • Gender: Male
Re: Buy Me A Drink
« Reply #18 on: May 17, 2009, 05:12:44 AM »
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)
« Last Edit: May 17, 2009, 12:10:50 PM by Keith Tysinger »
Contact me for all of your website design needs.

Offline Xavi-Nena

  • Full Member
  • ***
  • Posts: 458
  • Gender: Female
  • ♥ I am my own malfunction....Xavi-Nena ♥
Re: Buy Me A Drink
« Reply #19 on: May 17, 2009, 09:30:35 PM »
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?