No announcement yet.

[Release v2] PM on add user to buddy list

  • Filter
  • Time
  • Show
Clear All
new posts

  • [Release v2] PM on add user to buddy list

    This hack automatically sends a PM to a user when he or she is added to someone's buddy list. It works both when you add via the link in a profile, and when you add via the Edit Buddy List page in the User Control Panel. It does not send a message when a user is added to someone's ignore list, nor does it send a message when a user is removed from someone's buddy list. The message is configurable, and is sent "from" the board admin or a moderator. That is also configurable.

    No demo or screenshot, since it happens behind the scenes and is never seen by anyone.

    For version: v2 beta 3 (may work with beta 1 and beta 2, however it is untested with those versions).

    Files needed: buddyadd.php, buddyupdate.php (see attached zip file).

    Files to edit: member2.php, buddyadd.php, buddyupdate.php (see instructions below).

    1] Unzip the files buddyadd.php and buddyupdate.php to your hard drive.
    2] Open member2.php in an ASCII text editor, such as Notepad (Windows), SimpleText (Mac), EditPlus, UltraEdit, TextPad, etc. (DO NOT use WYSIWYG HTML editors such as FrontPage, HotDog, DreamWeaver, etc. They will in all likelyhood screw up the file! I will not be able to support you if you edit the file in one of these programs.)
    3] Find (around line 35)
    Right under this, add
    Find (around line 155)
    Right under this, add
    4] Open buddyadd.php in an ASCII text editor (see direction #2 for more info on doing this).
    5] On the second line, change the value of $fromuserid (it's set at 1 right now) to an admin or moderator's user id. That way, if someone replies to the PM, it goes to a moderator or an admin and not the user, who has no idea that a PM was sent when they added someone to their buddy list. Next, you can change the wording of the $message if you wish. Only edit it at the top (line 3), not in the middle. Keep in mind that unless your board allows HTML in messages, you cannot use HTML in your message. However, you *can* use vBCode. The default message gives a link for the recipient to send a PM to the user that added the recipient to their buddy list, and states that the message is automated and not to reply to it. Add "\n" (without the quotes) anywhere you want a new line to appear.
    6] Repeat step #5, only in buddyupdate.php. I suggest you use the same wording in both, since both are sent upon addition to a buddy list.
    7] Save member2.php, buddyadd.php, and buddyupdate.php, and upload them all to your main forums directory.

    That's it!

    Instructions are also included in the zip file (pmonadd.txt).

    FEEDBACK WANTED! Likes/disklikes/modification requests all gladly accepted.

  • #2
    Loving it man, LOVING IT!
    MSN: [email protected] | MAIL: [email protected] | FOLIO:


    • #3
      Great! I'm glad you like it.
      Took me a while to realize (my dumbass self) that when you go through the Edit Buddy List page it uses a different function than when you add someone from their profile (getinfo) page. Once I got past that hump, and realized I couldn't use the same code on both sections it was smooth sailing. (Oh yeah, and then there was the part where it was sending me 8 emails telling me I had private messages that I didn't cause I forgot to change the email variable. Am I getting stupider??? )

      Seriously, I'm glad you're loving it.


      • #4
        You should make your settings actual settings in vB, and the message a template...


        • #5
          Nice hack man, great job as usual!


          • #6
            Originally posted by JohnM
            You should make your settings actual settings in vB, and the message a template...
            Unfortunately I'm not quite that talented just yet. I'll look into doing a better version a bit down the road.


            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.