ich habe da noch zweimal messagesheader($uid); stehen.
ist es so nun richtig?
function submitmessage($arrpostdata, $uid){
include("modules/Private_Messages/inboxsize-conf.php");
global $prefix, $user_prefix, $PHP_SELF, $module_name, $refresh, $bgcolor2;
$uid = (int)$uid;
if(empty($arrpostdata["to_user"]) && empty($arrpostdata["to_all"]) || (!empty($arrpostdata["to_all"]) && !mxIsAdmin())) {
prvmsgerror(_ERRMSGNOUSER);
}
if (empty($arrpostdata["to_all"])) {
$result = sql_query("select uid from ".$user_prefix."_users where uname=\"".mxAddSlashesForSQL($arrpostdata["to_user"])."\"");
list($to_userid) = sql_fetch_row($result);
if (!$to_userid) {
prvmsgerror(_PMSUSERNOTINDB);
}
}
// Milhouse_Erweiterung
$result_anzahl = sql_query("SELECT Count(*) FROM ".$prefix."_priv_msgs WHERE to_userid=$to_userid");
$qry_sent = "SELECT Count(*) FROM ".$prefix."_priv_msgs_send WHERE from_userid=$uid";
$result_sent = sql_query($qry_sent);
$count_anzahl = sql_fetch_row($result_anzahl);
$countpmsent = sql_fetch_row($result_sent);
if ($countpmsent[0] >= $sentboxsize) {
prvmsgerror(_SENTPMBOXVOLL);
}
if ($count_anzahl[0] >= $inboxsize) {
prvmsgerror(_PMBOXVOLL);
}
//Ende Erweiterung
if(!($arrpostdata["subject"])) {
prvmsgerror(_ERRMSGNOSUBJECT);
}
if (strip_tags($arrpostdata["subject"]) != $arrpostdata["subject"]) {
prvmsgerror(_ERRMSGNOHTMLINSUBJECT);
}
if(!($arrpostdata["image"])) {
prvmsgerror(_ERRMSGNOICON);
}
if(!($arrpostdata["message"])) {
prvmsgerror(_ERRMSGNOMESSAGE);
}
$arrpostdata["message"] = mxAddSlashesForSQL($arrpostdata["message"]);
$arrpostdata["subject"] = mxAddSlashesForSQL(strip_tags($arrpostdata["subject"]));
$qry1 = "INSERT INTO ".$prefix."_priv_msgs (msg_image, subject, from_userid, to_userid, msg_time, msg_text) ";
$qry_msg_sent = "INSERT INTO ".$prefix."_priv_msgs_send (msg_image, subject, to_userid, from_userid, msg_time, msg_text) "; //Gesendete PMs speichern
if (empty($arrpostdata["to_all"])) {
$cookie = mxGetUserSession();
$ignore = sql_query("select ignoreid, uname from ".$user_prefix."_users_ignorelist where uid='".$to_userid."'");
list($ignoreid, $ignorename) = sql_fetch_row($ignore);
if ($ignoreid == $uid) {
messagesheader($uid);
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"3\" width=\"100%\" bgcolor=\"$bgcolor1\">"
."<TR BGCOLOR=\"$bgcolor1\">"
."<TD><br><center>".$ignorename." möchste keine Nachrichten von dir!<br><a href=\"modules.php?name=$module_name\">"._PMSRETURNTOPMSG."</a></center><br /></TD>"
."</TR></table>";
}else{
$qry1 .= "VALUES ('".$arrpostdata["image"]."', '".$arrpostdata["subject"]."', ".$uid.", ".$to_userid.", now(), '".$arrpostdata["message"]."')";
$qry_msg_sent .= "VALUES ('".$arrpostdata["image"]."', '".$arrpostdata["subject"]."', ".$to_userid.", ".$uid.", now(), '".$arrpostdata["message"]."')";
if(!$result = sql_query($qry1)) {
prvmsgerror(_ERRMSGNOSUBMIT);
}
if ($arrpostdata["notsave"]) {
if(!$result = sql_query($qry_msg_sent)) {
prvmsgerror(_ERRMSGNOSUBMIT);
}
}
list($touser_uname,$touser_email,$user_pm_mail) = sql_fetch_row(sql_query("SELECT uname, email, user_pm_mail FROM ".$user_prefix."_users WHERE uid='$to_userid'", $dbi), $dbi);
$message = "Halle $touser_uname,\nSie haben auf GeceAlem.de eine neue Private Nachricht erhalten.
WICHTIG: Beachten Sie, dass dies nur eine Benachrichtigung ist. Bitte antworten Sie nicht auf diese E-Mail.
Ihre Nachricht können Sie hier abholen:\n
http://www.gecealem.de/modules.php?name=Private_Messages\n=================================================================================
Wenn Sie nicht per Email über neue PN's informiert werden wollen können Sie die Option hier deaktivieren:\nhttp://www.gecealem.de/modules.php?name=Your_Account&op=edithome";
$subject = "Private Nachricht auf GeceAlem.de";
if (!mxIsUserOnline($touser_uname) && ($user_pm_mail ==1))
{
mxMail($touser_email, "$subject", $message, $GLOBALS['adminmail'],"text","PM-Mail");
}
messagesheader($uid);
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"3\" width=\"100%\" bgcolor=\"$bgcolor2\">"
."<TR BGCOLOR=\"$bgcolor2\">"
."<TD><br><center>"._PMSMSGPOSTED." ".((isset($i)) ? " (".$i." User)" : "")."<br><a href=\"modules.php?name=$module_name\">"._PMSRETURNTOPMSG."</a></center><br></TD>"
."</TR></table>";
}
}
else {
if (mxIsAdmin()) {
$i = 0;
$result = sql_query("select uid from ".$user_prefix."_users where user_stat=1 AND uid>1");
while(list($to_userid) = sql_fetch_row($result)) {
$qry2 = $qry1." VALUES ('".$arrpostdata["image"]."', '".$arrpostdata["subject"]."', ".$uid.", ".$to_userid.", now(), '".$arrpostdata["message"]."')";
$result2 = sql_query($qry2);
if ($result2) $i++;
}
}
messagesheader($uid);
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"3\" width=\"100%\" bgcolor=\"$bgcolor2\">"
."<TR BGCOLOR=\"$bgcolor2\">"
."<TD><br><center>"._PMSMSGPOSTED." ".((isset($i)) ? " (".$i." User)" : "")."<br><a href=\"modules.php?name=$module_name\">"._PMSRETURNTOPMSG."</a></center><br></TD>"
."</TR></table>";
}
echo "<META http-equiv=\"Refresh\" content=\"".((isset($i)) ? ($refresh*4) : $refresh).";URL=modules.php?name=$module_name\">";
}
es funktioniert wenn man über das profil eine nachricht schickt,aber bei mir nutzen die user am meisten den button pm der über den messenger läuft,
da funktioniert es nicht