function welcome_privmsg_send(&$registration_details) { global $username, $main_smarty, $current_user; include_once mnminclude . 'user.php'; include_once 'config.php'; include_once my_pligg_base . '/modules/simple_messaging/kmessaging/class.KMessaging.php'; $siteName = $main_smarty->get_config_vars('PLIGG_Visual_Name'); // User ID of Admin define('welcome_privmsg_admin_id', '1'); // Message Subject define('welcome_privmsg_subject', 'Welcome to ' . $siteName); // Message Body define('welcome_privmsg_body', 'Thanks for registering on our site!'); // Check User ID != 0 if ($registration_details['id'] > 0) { $msg_subject = sanitize(welcome_privmsg_subject, 2); $msg_body = welcome_privmsg_body; $msg_to_ID = $registration_details['id']; $msg_from_ID = welcome_privmsg_admin_id; $message = new KMessaging(true); $msg_result = $message->SendMessage($msg_subject, $msg_body, $msg_from_ID, $msg_to_ID, 0); if ($msg_result != 0) { echo "Module Error #" . $msg_result; } } else { // Unable to find User ID echo "Module Error #1"; die; } }
function welcome_privmsg_send() { global $username, $main_smarty, $current_user; include_once mnminclude . 'user.php'; include_once './3rdparty/kmessaging/class.KMessaging.php'; $siteName = $main_smarty->get_config_vars('PLIGG_Visual_Name'); // User ID of Admin define('welcome_privmsg_admin_id', '1'); // Message Subject define('welcome_privmsg_subject', 'Welcome to ' . $siteName); // Message Body define('welcome_privmsg_body', 'Thanks for registering on our site. If you have any questions, be sure to visit our FAQ section. Sincerely, Webmaster'); // Check User ID != 0 if ($current_user->user_id > 0) { $msg_subject = sanitize(welcome_privmsg_subject, 2); $msg_body = welcome_privmsg_body; $msg_to_ID = $current_user->user_id; $msg_from_ID = welcome_privmsg_admin_id; $message = new KMessaging(true); $msg_result = $message->SendMessege($msg_subject, $msg_body, $msg_from_ID, $msg_to_ID, 0); if ($msg_result != 0) { echo "Module Error #" . $msg_result; } } else { // Unable to find User ID echo "Module Error #1"; die; } }
function welcome_privmsg_send(&$registration_details) { global $username, $main_smarty, $current_user; include_once mnminclude . 'user.php'; include_once './3rdparty/kmessaging/class.KMessaging.php'; $siteName = $main_smarty->get_config_vars('PLIGG_Visual_Name'); // User ID of Admin define('welcome_privmsg_admin_id', '1'); // Message Subject define('welcome_privmsg_subject', 'geez.gr ' . $siteName); // Message Body define('welcome_privmsg_body', 'Ευχαριστούμε που έγινε μέλος στο geez.gr. Παρακαλούμε, επικοινωνήστε μαζί μας για τυχόν ερωτήσεις, προτάσεις, παρατηρήσεις, βελτιώσεις και αναφορά προβλημάτων/ bugs αφού πρώτα επισκεφθείτε τις FAQ! Κάλη Διασκέδαση, geez.gr Webmaster'); // Check User ID != 0 if ($registration_details['id'] > 0) { $msg_subject = sanitize(welcome_privmsg_subject, 2); $msg_body = welcome_privmsg_body; $msg_to_ID = $registration_details['id']; $msg_from_ID = welcome_privmsg_admin_id; $message = new KMessaging(true); $msg_result = $message->SendMessege($msg_subject, $msg_body, $msg_from_ID, $msg_to_ID, 0); if ($msg_result != 0) { echo "Module Error #" . $msg_result; } } else { // Unable to find User ID echo "Module Error #1"; die; } }
function messaging_get_message_details($msgID = '') { global $db, $current_user, $main_smarty; if ($msgID == "") { $msgID = sanitize($_REQUEST['msgid'], 2); } //echo $msgID; $message = new KMessaging(true); $array = $message->GetMessege($msgID); // check to make sure this is our message if ($array['receiver'] == $current_user->user_id) { $message->MarkAsRead($msgID); $thisuser = new User(); $thisuser->id = $array['sender']; if (!$thisuser->read()) { $main_smarty->assign('message', 'The person you are trying to send a message to does not exist!'); if (messaging_fade_lightbox) { $main_smarty->assign('js_close', "Effect.Fade('overlay');Effect.Fade('view_message', {afterFinish: function(){document.getElementById('view_message').innerHTML='loading...';}});"); } else { $main_smarty->assign('js_close', "document.getElementById('overlay').style.display = 'none';document.getElementById('view_message').style.display = 'none';document.getElementById('view_message').innerHTML='loading...';"); } $main_smarty->display(messaging_tpl_path . 'error.tpl'); die; } $array['sender_name'] = $thisuser->username; $thisuser = ""; return $array; } else { $main_smarty->assign('message', 'This is not your message!'); if (messaging_fade_lightbox) { $main_smarty->assign('js_close', "Effect.Fade('overlay');Effect.Fade('view_message', {afterFinish: function(){document.getElementById('view_message').innerHTML='loading...';}});"); } else { $main_smarty->assign('js_close', "document.getElementById('overlay').style.display = 'none';document.getElementById('view_message').style.display = 'none';document.getElementById('view_message').innerHTML='loading...';"); } $main_smarty->display(messaging_tpl_path . 'error.tpl'); die; } }
function messaging_get_message_details($msgID) { global $db, $current_user, $main_smarty; // Method for identifying modules rather than pagename define('modulename_sm', 'simple_messaging'); $main_smarty->assign('modulename_sm', modulename_sm); $message = new KMessaging(true); $array = $message->GetMessege($msgID); // check to make sure this is our message if ($array['receiver'] == $current_user->user_id) { $message->MarkAsRead($msgID); $thisuser = new User(); $thisuser->id = $array['sender']; if (!$thisuser->read()) { $main_smarty->assign('message', 'The person you are trying to send a message to does not exist!'); $main_smarty->display(messaging_tpl_path . 'error.tpl'); die; } $array['sender_name'] = $thisuser->username; $thisuser = ""; return $array; } else { $main_smarty->assign('message', 'This is not your message!'); $main_smarty->display(messaging_tpl_path . 'error.tpl'); die; } }