MyBB Central

Full Version: Notification when message in Guestbook
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Notification when someone write in my Guestbook (Guestbook PlugIn) can someone make this or tell me step by step how to do it
You want PM or email?
labrocca Wrote:You want PM or email?

PM will be great
Try this function...see if it works for you. It's untested.

function mybb_central_send_pm($subject, $fromid, $toid, $message)
    global $user, $db, $mybb;

        require_once MYBB_ROOT."inc/datahandlers/pm.php";

        $pmhandler = new PMDataHandler();

        $pm = array(
            "subject" => $db->escape_string($subject),
            "message" => $db->escape_string($message),
            "icon" => -1,
            "fromid" => intval($fromid),
            "toid" => intval($toid),
            "do" => '',
            "pmid" => ''

        $pm['options'] = array(
            "savecopy" => "no",
            "saveasdraft" => 0,
            "signature" => "no",
            "disablesmilies" => "no",

        $pm['saveasdraft'] = 0;
        $pmhandler->admin_override = 1;


What do i do with the code ??? is it a PlugIn ?
It's a function. You use it like this:

mybb_central_send_pm($subject, $fromid, $toid, $message);

I haven't looked at the guestbook plugin yet so I can't say where it should go. Do you know any php?
No i dont know any php and when i need something i need a plugin to activate :o)
Overwrite the original gb.php (root) with the attached one. Tested this on MyBB 1.2.13.

Message + Subject + FromID (=1) can be changed in the file;
Default Values:
$message = "You've Got A New Entry In Your Guestbook From {$mybb->user['username']} <br /><br /> Go to Your Guestbook: <a href=\"gb.php?act=view&amp;uid={$id}\">Click</a>";
$subject = "New GuestBook Entry";
$fromid = 1;
thank you VERY VERY mutch but url link dosent work

The code use You've Got A New Entry In Your Guestbook From MulleMek <br /><br /> Go to Your Guestbook: <a href="gb.php?act=view&amp;uid=1">Click</a> and the link dosent work
You have HTML set to yes in PM's ?


Else you need to change it in a BBCode
[url] ... [/url]
Pages: 1 2