Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Code help

Asked Modified Viewed 4,200 times
B
Bruno
B
Bruno 10
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
asked
Junior Member

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]
} elseif (isnum($_GET['msg_send'])) {
require_once INCLUDES."flood_include.php";
if (!flood_control("message_datestamp", DB_MESSAGES, "message_from='".$userdata['user_id']."'"wink) {
$result = dbquery(
"SELECT u.user_id, u.user_name, u.user_email, u.user_level, mo.pm_email_notify, s.pm_inbox, COUNT(message_id) as message_count
FROM ".DB_USERS." u
LEFT JOIN ".DB_MESSAGES_OPTIONS." mo USING(user_id)
LEFT JOIN ".DB_MESSAGES_OPTIONS." s ON s.user_id='0'
LEFT JOIN ".DB_MESSAGES." ON message_to=u.user_id AND message_folder='0'
WHERE u.user_id='".$_GET['msg_send']."' GROUP BY u.user_id"
);
if (dbrows($result)) {
$data = dbarray($result);
if ($data['user_id'] != $userdata['user_id']) {
if ($data['user_id'] == 1 || $data['user_level'] > 101 || $data['pm_inbox'] == "0" || ($data['message_count'] + 1) <= $data['pm_inbox']) {
$result = dbquery("INSERT INTO ".DB_MESSAGES." (message_to, message_from, message_subject, message_message, message_smileys, message_read, message_datestamp, message_folder) VALUES('".$data['user_id']."','".$userdata['user_id']."','".$subject."','".$message."','".$smileys."','0','".time()."','0'wink"wink;
// BEGIN ARROWCHAT NOTIFICATION
$sql = "INSERT INTO arrowchat_notifications (to_id, author_id, author_name, type, alert_time, misc1, misc2, misc3)
VALUES ('".$data['user_id']."', '".$userdata['user_id']."', '".$userdata['user_name']."', '1', '".time()."', '".$data['message_id']."', '', ''wink";
mysql_query($sql);
// END
$send_email = isset($data['pm_email_notify']) ? $data['pm_email_notify'] : $msg_settings['pm_email_notify'];
if ($send_email == "1"wink {
$message_content = str_replace("[SUBJECT]", $subject, $locale['626']);
$message_content = str_replace("[USER]", $userdata['user_name'], $message_content);
sendemail($data['user_name'], $data['user_email'], $settings['siteusername'], $settings['siteemail'], $locale['625'], $data['user_name'].$message_content);
}
} else {
$error = "2";
}
}
} else {
redirect(FUSION_SELF."?folder=inbox&error=noresult"wink;
}
} else {
redirect(FUSION_SELF."?folder=inbox&error=flood"wink;
}
}[/syntaxhighlighter]

Hey guys I'm trying to get the "message_id" but no luck I try everything the rest works fine I just need the message_id so when you send a msg to a user he will be notify and a small popup like facebook

the upper code is from /messages.php
0 replies

3 posts

P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

Try
mysql_insert_id()
after mysql query.
0 replies
B
Bruno
B
Bruno 10
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
answered
Junior Member

Quote

PolarFox wrote:

Try
mysql_insert_id()
after mysql query.


Thanks for the quick reply but didn't work, but I finally got it to work
0 replies
— 5 months later —
S
SpaM
S
SpaM 10
SpaM - SpamFusion.
  • Junior Member, joined since
  • Contributed 33 posts on the community forums.
  • Started 11 threads in the forums
answered
Junior Member

and to do serious reviews like this?

                    $sql = "INSERT INTO arrowchat_notifications (to_id, author_id, author_name, type, alert_time, misc1)
                            VALUES ('".$data['user_id']."', '".$userdata['user_id']."', '".$userdata['user_name']."', '1', '".time()."', '".$data['comment_id']."', '', '')";
                    mysql_query($sql);


But where anger this code if it is correct or tell me if you can do it for all the comments on the entire page.

Merged on Jul 21 2013 at 20:36:02:
Nobody can help embed these codes
Edited by SpaM on 21-07-2013 21:36,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 3 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

B
B
Bruno 10
  • Junior Member, joined since
  • Contributed 48 posts on the community forums.
  • Started 13 threads in the forums
  • Started this discussions
P
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
S
S
SpaM 10
SpaM - SpamFusion.
  • Junior Member, joined since
  • Contributed 33 posts on the community forums.
  • Started 11 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet