public function ConversationToHTML() { global $conversationInfos; if ($conversationInfos["WhoIsMonitoring"] == $conversationInfos["User1"]) { $other = $conversationInfos["User2"]; $fr = $conversationInfos["User1"]; } else { $fr = $conversationInfos["User2"]; $other = $conversationInfos["User1"]; } $myMessageSeenFinder = new MessageSeenFinder(array($other, $fr)); echo "<div id=\"genel_conv_" . $other . "\" style=\"border-bottom:1px solid #c7d0d5;overflow:auto;background-color:#e6e6e6;max-width:100%;width:100%;\">"; if ($myMessageSeenFinder->Find() === "YES") { echo "<div onmouseout=\"this.style.background='#e6e6e6';\" onmouseover=\"this.style.background='#e9e9e9';\" id=\"show_conv_div_" . $other . "\" style=\"box-shadow:0 0 5px 5px #9bca3e inset;white-space:nowrap;text-overflow: ellipsis;height:115px;max-height:115px;overflow:hidden;padding:1%;font-size:17px;font-family: 'Josefin Sans', sans-serif;\">"; } else { echo "<div onmouseout=\"this.style.background='#e6e6e6';\" onmouseover=\"this.style.background='#e9e9e9';\" id=\"show_conv_div_" . $other . "\" style=\"white-space:nowrap;text-overflow: ellipsis;height:115px;max-height:115px;overflow:hidden;padding:1%;font-size:17px;font-family: 'Josefin Sans', sans-serif;\">"; } echo "<a title=\"Konuşmayı görüntülemek için tıklayın.\" id=\"show_conv_a_" . $other . "\" href=\"#conv_holder_" . $other . "\" style=\"text-decoration:none;\">"; $this->GetLastMessage(); echo "</a>"; echo "</div>"; echo "<div id=\"conv_holder_" . $other . "\" style=\"display:none;\">"; echo "<div style=\"overflow:hidden;border-bottom:1px solid #c7d0d5;\">"; echo "<a id=\"hide_conv_a_" . $other . "\" title=\"Konuşmayı küçült\" href=\"#\" style=\"decoration:none;\">"; echo "<i style=\"float:right;\" class=\"fa fa-2x fa-minus-square \"></i>\n"; echo "</a>"; echo "<span style=\"font-family: 'Josefin Sans', sans-serif;font-size:17px;color:#ec583a;float:left;\">"; echo $other . " ile senin aranda ."; echo "<span>"; echo "</div>"; echo "<div id=\"conv_" . $other . "\" style=\"border-bottom:1px solid #c7d0d5;overflow:auto;max-height:450px;\">"; $this->LoadMessages(); echo "</div>"; echo "<form class=\"\" id=\"sendmsgForm_" . $other . "\" action=\"sendmsg.php?from=" . $fr . "&to=" . $other . "\" method=\"post\">"; echo "<div id=\"SendMSGErrDIV_" . $other . "\" style=\"font-family: 'Josefin Sans', sans-serif;font-size:14px;color:#d1334e;display:none;margin-left:2%;margin-top:1%;\">"; echo "</div>"; echo "<div style=\"padding:2%;font-size:20px;font-family: 'Josefin Sans', sans-serif;\" class=\"input-group\">"; echo "<textarea id=\"messageholder_" . $other . "\" name=\"messageholder\" class=\"form-control\" rows=\"3\" style=\"resize:none;\" maxlength=\"500\" placeholder=\"" . $other . " kullanıcısına mesaj yaz\"></textarea>"; echo "<span id=\"sendMsgBut_" . $other . "\" title=\"Gönder\" class=\"input-group-addon btn btn-success\"><i class=\"fa fa-2x fa-paper-plane\"></i></span>"; echo "</div>"; echo "</form>"; echo "</div>"; echo "<form id=\"conversationHeaderUpdateForm_" . $other . "\" style=\"display:none;\" method=\"post\" action=\"conversationHeaderUpdate.php?usr1=" . $fr . "&usr2=" . $other . "\"></form>"; echo "<form id=\"conversationHeaderSeenUpdateForm_" . $other . "\" style=\"display:none;\" method=\"post\" action=\"MessageSeenHeaderUpdate.php?from=" . $fr . "&to=" . $other . "\"></form>"; echo "</div>"; echo "<script type=\"text/javascript\">"; echo "\n\t\t\t\$(document).keypress(function(e) {\n\t\t\t\t\$('#SendMSGErrDIV_" . $other . "').hide();\n \t\t\t\tif(e.which == 13 && !e.shiftKey) {\n\t\t\t\t\t\$('#sendMsgBut_" . $other . "').blur();\n\t\t\t\t\tif (\$('#conv_holder_" . $other . "').is(':visible')){\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tif (\$('#messageholder_" . $other . "').val()!='')\n \t\t\t\t\$('#sendmsgForm_" . $other . "').ajaxForm({\n\t\t\t\t\tsuccess : function(msg){\n\t\t\t\t\t\t\$('#messageholder_" . $other . "').val('');\t\n\t\t\t\t\t},\n\t\t\t\t\terror : function(){\n\t\t\t\t\t\talert(\"Mesaj gönderici ltd şti sıçtı.\");\n\t\t\t\t\t}\n\t\t\t\t}).submit();\t\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t\$('#SendMSGErrDIV_" . $other . "').html('Boş mesaj yollamak hiç hoş bir hareket değil.');\n\t\t\t\t\t\t\$('#SendMSGErrDIV_" . $other . "').show(500);\n\t\t\t\t\t}\n\t\t\t\treturn false;\n \t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\$('#hide_conv_a_" . $other . "').click(function(){\n\t\t\t\t\$('#conv_holder_" . $other . "').hide();\n\t\t\t\t\$('#show_conv_div_" . $other . "').show();\n\t\t\t\t\$('#conversationHeaderSeenUpdateForm_" . $other . "').ajaxForm({\n\t\t\t\t\tsuccess : function(msg){\n\t\t\t\t\t\tif (msg=='NO')\n\t\t\t\t\t\t\t\$('#show_conv_div_" . $other . "').css(\"box-shadow\",\"none\");\n\t\t\t\t\t},\n\t\t\t\t\terror: function(){\n\t\t\t\t\t}\n\t\t\t\t}).submit();\n\t\t\t\t\$('#genel_conv_" . $other . "').css('margin-top','');\n\t\t\t\t\$('#genel_conv_" . $other . "').css('margin-bottom','');\n\t\t\t});\n\t\t\t\$('#show_conv_a_" . $other . "').click(function(){\n\t\t\t\t\$('#show_conv_div_" . $other . "').hide();\n\t\t\t\t\$('#conv_holder_" . $other . "').show();\n\t\t\t\tvar element = document.getElementById('conv_" . $other . "');\n\t\t\t\telement.scrollTop = element.scrollHeight;\n\t\t\t\t\$('#genel_conv_" . $other . "').css('margin-top','2%');\n\t\t\t\t\$('#genel_conv_" . $other . "').css('margin-bottom','2%');\n\t\t\t});\n\t\t\t\$('#sendMsgBut_" . $other . "').click(function(){\n\t\t\t\t\$('#SendMSGErrDIV_" . $other . "').hide();\n\t\t\t\tif (\$('#messageholder_" . $other . "').val()!='')\n\t\t\t\t\$('#sendmsgForm_" . $other . "').ajaxForm({\n\t\t\t\t\tsuccess : function(msg){\n\t\t\t\t\t\t\$('#messageholder_" . $other . "').val('');\t\n\t\t\t\t\t},\n\t\t\t\t\terror : function(){\n\t\t\t\t\t\talert(\"Mesaj gönderici ltd şti sıçtı.\");\n\t\t\t\t\t}\n\t\t\t\t}).submit();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\$('#SendMSGErrDIV_" . $other . "').html('Boş mesaj yollamak hiç hoş bir hareket değil.');\n\t\t\t\t\t\$('#SendMSGErrDIV_" . $other . "').show(500);\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetInterval(function() {\n\t\t\t\tif (\$('#conv_holder_" . $other . "').is(':visible'))\n\t\t\t\t\$('#offsetForm_" . $conversationInfos["other"] . "').ajaxForm({\n\t\t\t\t\tsuccess : function(msg){\n\t\t\t\t\t\tif (msg!='NO_NEW')\n\t\t\t\t\t\t\tif(msg!='CONNECT_ERR'){\n\t\t\t\t\t\t\t\tvar count = (msg.match(/messageWrapperDIV/g) || []).length;\n\t\t\t\t\t\t\t\tvar oldcount = parseInt(\$('#offset_" . $other . "').val());\n\t\t\t\t\t\t\t\t\$('#offset_" . $other . "').val(count+oldcount);\n\t\t\t\t\t\t\t\t\$('#conv_" . $other . "').append(msg);\n\t\t\t\t\t\t\t\tvar element = document.getElementById('conv_" . $other . "');\n\t\t\t\t\t\t\t\telement.scrollTop = element.scrollHeight;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function(){\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}).submit();\t\n\t\t\t\t\$('#conversationHeaderUpdateForm_" . $other . "').ajaxForm({\n\t\t\t\t\tsuccess : function(msg){\n\t\t\t\t\t\t\$('#show_conv_a_" . $other . "').html(msg);\t\n\t\t\t\t\t},\n\t\t\t\t\terror : function(){\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}).submit();\n\t\t\t\tif (\$('#show_conv_div_" . $other . "').is(':visible'))\n\t\t\t\t\$('#conversationHeaderSeenUpdateForm_" . $other . "').ajaxForm({\n\t\t\t\t\tsuccess : function(msg){\n\t\t\t\t\t\tif (msg=='YES')\n\t\t\t\t\t\t\t\$('#show_conv_div_" . $other . "').css(\"box-shadow\",\"0 0 5px 5px #9bca3e inset\");\n\t\t\t\t\t},\n\t\t\t\t\terror: function(){\n\t\t\t\t\t}\n\t\t\t\t}).submit();\t\t\n\t\t\t}, 1000)\n\t\t"; echo "</script>"; }
<?php include_once "classes/MessageSeenFinder.class.php"; $myMessageSeenFinder = new MessageSeenFinder(array($_GET["to"], $_GET["from"])); echo $myMessageSeenFinder->Find();
<?php include_once "classes/MessageSeenFinder.class.php"; $myMessageSeenFinder = new MessageSeenFinder(array("onemsiz", $_GET["usr"])); echo $myMessageSeenFinder->FindForUpMenu();