YaWK  24.1
Yet another WebKit
messages.php
Go to the documentation of this file.
1 <?php
3  /**
4  * <b>Messages Plugin</b>
5  * <p>Basic Messaging functions. This class serve functions fetch and draw messages, inbox and so on</p>
6  * <p><b>Basic Features:</b></p>
7  * <ul>
8  * <li>fetch all messages</li>
9  * <li>fetch a single message</li>
10  * <li>get Inbox Data</li>
11  * <li>draw Inbox</li>
12  * <li>mark messages as spam, read, unread</li>
13  * <li>trash messages and many more</li></ul><br>
14  * <p>This plugin is definitly still in development.</i></p>
15  *
16  * @author Daniel Retzl <[email protected]>
17  * @copyright 2009-2016 Daniel Retzl
18  * @version 1.0.0/
19  * @brief The Messages Plugin Class. Allow your users to write messages to each other.
20  */
21  class messages {
22  /**
23  * @brief messages constructor - check if class is called from frontend or backend
24  * @param object $db database
25  * @param string $location frontend or backend
26  */
27  public function __construct($db, $location)
28  {
29  if (isset($location) && (!empty($location)))
30  { // check where the script is called from...
31  // get hostname
33  if ($location === "backend")
34  { // backend: set directory prefix
35  $prefix = "../";
36  }
37  else if ($location === "frontend")
38  { // frontend: no prefix needed
39  $prefix = $host.'';
40  }
41  else {
42  // default:
43  $prefix = $host.'';
44  }
45  }
46  else
47  { // if location is not set: no prefix as default
49  $prefix = '';
50  }
51 
52  echo "<script type=\"text/javascript\" src=\"$prefix"."system/plugins/messages/js/message-send.js\"></script>";
53  echo "<script type='text/javascript'>
54  function markAsSpam(msg_id)
55  {
56  $.ajax({
57  url:'$prefix"."system/plugins/messages/js/message-spam.php',
58  type:'post',
59  data:'msg_id='+msg_id,
60  success:function(data){
61  if(! data ){
62  alert('Something went wrong!');
63  return false;
64  }
65  else {
66  // hide affected row
67  $('#row-'+msg_id).css('color', '#610B0B').fadeToggle(400);
68  }
69  }
70  });
71  }
72 
73  function markAsTrash(msg_id)
74  {
75  $.ajax({
76  url:'$prefix"."system/plugins/messages/js/message-trash.php',
77  type:'post',
78  data:'msg_id='+msg_id,
79  success:function(data){
80  if(! data ){
81  alert('Something went wrong!');
82  return false;
83  }
84  else {
85  // hide affected row
86  $('#row-'+msg_id).fadeToggle(400);
87  }
88  }
89  });
90  }
91 
92  function closeMessage(msg_id)
93  {
94  $.ajax({
95  url:'$prefix"."system/plugins/messages/js/message-read.php',
96  type:'post',
97  data:'msg_id='+msg_id,
98  success:function(data){
99  if(! data ){
100  alert('Something went wrong!');
101  return false;
102  }
103  else {
104  // hide affected row
105  $('#messagebox').fadeToggle(400);
106  window.location.href = 'index.php?plugin=messages&pluginpage=mailbox';
107 
108  }
109  }
110  });
111  }
112 
113  function restoreFromTrash(msg_id)
114  {
115  $.ajax({
116  url:'$prefix"."system/plugins/messages/js/message-restore-trash.php',
117  type:'post',
118  data:'msg_id='+msg_id,
119  success:function(data){
120  if(! data ){
121  alert('Something went wrong!');
122  return false;
123  }
124  else {
125  // hide affected row
126  $('#row-'+msg_id).css('color', '#088A29').fadeToggle(400);
127  }
128  }
129  });
130  }
131 
132  function markAsDeleted(msg_id)
133  {
134  $.ajax({
135  url:'$prefix"."system/plugins/messages/js/message-delete.php',
136  type:'post',
137  data:'msg_id='+msg_id,
138  success:function(data){
139  if(! data ){
140  alert('Something went wrong!');
141  return false;
142  }
143  else {
144  // hide affected row
145  $('#row-'+msg_id).css('color', '#FF0000').fadeToggle(400);
146  }
147  }
148  });
149  }
150 
151  function markAsRead(msg_id)
152  {
153  $.ajax({
154  url:'$prefix"."system/plugins/messages/js/message-read.php',
155  type:'post',
156  data:'msg_id='+msg_id,
157  success:function(data){
158  if(! data ){
159  alert('Something went wrong!');
160  return false;
161  }
162  else {
163  // hide affected row
164  // $('#row-'+msg_id).toggleClass('bold', 'normal').fadeTo('fast', 0.8);
165  // $('#row-'+msg_id).toggleClass('normal', 'bold').fadeTo('fast', 1);
166  // $('#read-icon-'+msg_id).toggleClass('fa fa-envelope-o fa fa-envelope');
167  }
168  }
169  });
170  }
171 
172  function messageToggle(msg_id)
173  {
174  $.ajax({
175  url:'$prefix"."system/plugins/messages/js/message-toggle.php',
176  type:'post',
177  data:'msg_id='+msg_id,
178  success:function(data){
179  if(! data ){
180  alert('Something went wrong!');
181  return false;
182  }
183  else {
184  // hide affected row
185  $('#row-'+msg_id).toggleClass('bold', 'normal').fadeTo('fast', 0.8);
186  $('#row-'+msg_id).toggleClass('normal', 'bold').fadeTo('fast', 1);
187  $('#read-icon-'+msg_id).toggleClass('fa fa-envelope-o fa fa-envelope');
188  }
189  }
190  });
191  }
192  function refreshInbox(type)
193  {
194  $.ajax({
195  url:'$prefix"."system/plugins/messages/js/message-fetch.php',
196  type:'post',
197  data:'type='+type,
198  success:function(data){
199  if(! data ){
200  alert('Something went wrong!');
201  return false;
202  }
203  else {
204  // hide affected row
205  // alert('REFRESH! '+type);
206  // $('#row-'+id).fadeOut(420);
207  }
208  }
209  });
210  }
211 
212  </script>
213  <style type='text/css'>
214  .bold { font-weight: bold; }
215  .normal { font-weight: normal; opacity: 0.6; }
216  </style> ";
217  }
218 
219  /**
220  * @brief init the messaging page - check if user is logged in, else draw a login box
221  * @param object $db database
222  * @return string
223  */
224  public function init($db, $lang)
225  {
226  /** @var \YAWK\db $db */
227  // check if session vars exist
228  if (!empty(@$_SESSION['username'] && (!empty(@$_SESSION['uid']))))
229  { // check if user is logged in
230  if (\YAWK\user::isLoggedIn($db, $_SESSION['username']))
231  { // ok, load inbox
232  return self::getInbox($db, $lang);
233  }
234  else
235  { // session vars are here, but user is not set online in db atm,
236  // that should not be, so invite the user to login
237  echo "<h2>$lang[REGISTERED_ONLY]</h2>";
238  return \YAWK\user::drawLoginBox('', '');
239  }
240  }
241  else
242  { // session vars are not set. invite the user to login
243  echo "<h2>$lang[REGISTERED_ONLY]</h2>";
244  return \YAWK\user::drawLoginBox('', '');
245  }
246  }
247 
248  /**
249  * @brief get inbox and draw menu
250  * @param object $db database
251  * @return string
252  */
253  public function getInbox($db, $lang){
254  $html = "";
255  $html .= self::drawMenu($db, $lang);
256  return $html;
257  }
258 
259  /**
260  * @brief fetch messages into array
261  * @param object $db database
262  * @param string $type all, trash or spam
263  * @return array|string
264  */
265  public function fetchMessages($db, $type){
266  /** @var $db \YAWK\db */
267  $sql = '';
268  if (isset($_SESSION['username']) && isset($_SESSION['uid'])) {
269  $username = $_SESSION['username'];
270  $uid = $_SESSION['uid'];
271 
272  if ($type === "all")
273  {
274  $sql = $db->query("SELECT * FROM {plugin_msg} AS msg
275  LEFT JOIN {users} AS u ON msg.fromUID=u.id
276  WHERE toUID = '".$uid."' AND trash ='0' AND spam ='0'
277  ORDER BY msg_read,msg_date DESC");
278  }
279  elseif ($type === "trash")
280  {
281  $sql = $db->query("SELECT * FROM {plugin_msg} AS msg
282  LEFT JOIN {users} AS u ON msg.fromUID=u.id
283  WHERE toUID = '".$uid."' AND trash ='1' AND spam ='0'
284  ORDER BY msg_read,msg_date DESC");
285  }
286  elseif ($type === "spam")
287  {
288  $sql = $db->query("SELECT * FROM {plugin_msg} AS msg
289  LEFT JOIN {users} AS u ON msg.fromUID=u.id
290  WHERE toUID = '".$uid."' AND trash ='0' AND spam ='1'
291  ORDER BY msg_read,msg_date DESC");
292  }
293 
294  $messages = array();
295  while ($row = mysqli_fetch_assoc($sql)){
296  $messages[] = $row;
297  }
298  return $messages;
299  }
300  else {
301  return "Something strange has happened. Are you logged in? Please re-login.";
302  }
303  }
304 
305  /**
306  * @brief fetch a single message from database
307  * @param object $db database
308  * @param int $msg_id the message ID to get
309  * @return array|null
310  */
311  public function fetchSingleMessage($db, $msg_id)
312  { /** @var $db \YAWK\db */
313  $sql = $db->query("SELECT * FROM {plugin_msg} WHERE msg_id = '".$msg_id."'");
314  $row = mysqli_fetch_assoc($sql);
315  return $row;
316  }
317 
318 
319  /**
320  * @brief fetch related messages into array
321  * @param object $db database
322  * @param int $fromUID from user ID
323  * @param int $toUID to user ID
324  * @param int $msg_id message ID
325  * @return array|string
326  */
327  public function fetchRelatedMessages($db, $fromUID, $toUID, $msg_id)
328  { /** @var $db \YAWK\db */
329  // query related messages from db
330  if ($sql = $db->query("SELECT * FROM {plugin_msg} AS msg
331  LEFT JOIN {users} AS u ON msg.fromUID=u.id
332  WHERE fromUID = '".$fromUID."' AND msg_id NOT LIKE '".$msg_id."' AND toUID ='".$toUID."' AND trash ='0' AND spam ='0'
333  ORDER BY msg_read,msg_date DESC"))
334  { // create messages array
335  $relatedMessages = array();
336  while ($row = mysqli_fetch_assoc($sql))
337  { // fill array with data...
338  $relatedMessages[] = $row;
339  }
340  // return related messages
341  return $relatedMessages;
342  }
343  else
344  { // q failed...
345  return "Could not fetch more related messages from this user.";
346  }
347  }
348 
349  /**
350  * @brief draw html (output) related messages from array, each message as own box
351  * @param object $db database
352  * @param array $relatedMessages related messages array
353  * @return string
354  */
355  public function drawRelatedMessages($db, $relatedMessages, $lang)
356  { /** @var $db \YAWK\db */
357  $i = '';
358  $html = '';
359  if (isset($relatedMessages) && is_array($relatedMessages))
360  { // if array is set, loop data
361  foreach ($relatedMessages as $relatedMessage)
362  { // count related messages
363  $i++;
364  // build message data
365  $from = \YAWK\user::getUserNameFromID($db, $relatedMessage['fromUID']);
366  $picture = \YAWK\user::getUserImage("backend", $from, "img-circle", 64, 64);
367  $timeAgo = \YAWK\sys::time_ago($relatedMessage['msg_date'], $lang);
368  $splitDate = \YAWK\sys::splitDateShort($relatedMessage['msg_date']);
369  $html .= "
370  <div class=\"box box-primary\">
371  <div class=\"box-header with-border\">
372  <h3 class=\"box-title\">$picture &nbsp;$lang[MESSAGE] $lang[FROM] <b>$from</b> $timeAgo <small>($splitDate[month], $splitDate[day] $splitDate[year], $splitDate[time])</small> </h3>
373  <div class=\"box-tools pull-right\">
374  <span class=\"label label-primary\">$relatedMessage[msg_date]</span>
375  <button class=\"btn btn-box-tool\" data-widget=\"remove\" onclick=\"closeMessage('$relatedMessage[msg_id]')\" data-toggle=\"tooltip\" title=\"$lang[CLOSE]\"><i class=\"fa fa-times\"></i></button>
376  </div>
377  <div class=\"box-body\">
378  <h3>$relatedMessage[msg_body]</h3><hr>
379  </div>
380  </div>
381  </div>";
382  }
383  return $html;
384  }
385  }
386 
387  /**
388  * @brief view messages
389  * @param object $db database
390  * @param int $msg_id message ID
391  * @return string
392  */
393  public function MessageView($db, $msg_id, $lang)
394  {
395  $message = self::fetchSingleMessage($db, $msg_id);
396  $from = \YAWK\user::getUserNameFromID($db, $message['fromUID']);
397  $picture = \YAWK\user::getUserImage("backend", $from, "img-circle", 64, 64);
398  $timeAgo = \YAWK\sys::time_ago($message['msg_date'], $lang);
399  $splitDate = \YAWK\sys::splitDateShort($message['msg_date']);
400  self::markAsRead($db, $msg_id);
401 
402  $html = "<br><br><br>
403  <div class=\"row\">
404  <div class=\"col-md-8\"><div class=\"box box-primary\">
405  <div class=\"box-header with-border\">
406  <h3 class=\"box-title\">$picture &nbsp;$lang[MESSAGE] $lang[FROM] <b><a href=\"index.php?page=user-edit&user=$from\">$from</a></b> $timeAgo <small>($splitDate[month], $splitDate[day] $splitDate[year], $splitDate[time])</small> </h3>
407  <div class=\"box-tools pull-right\">
408  <span class=\"label label-primary\">$message[msg_date]</span>
409  <button class=\"btn btn-box-tool\" data-widget=\"remove\" onclick=\"closeMessage('$message[msg_id]')\" data-toggle=\"tooltip\" title=\"$lang[CLOSE]\"><i class=\"fa fa-times\"></i></button>
410  </div>
411  <div class=\"box-body\"><h3>$message[msg_body]</h3><hr></div></div></div></div>
412  <div class=\"col-md-4\" id=\"messagebox\">";
413  $html .= self::drawNewMessage($from, $lang); $html .="</div>
414  </div>";
415 
416  $html .= "
417  <div class=\"row\">
418  <div class=\"col-md-8\">";
419  $html .= self::drawRelatedMessages($db, self::fetchRelatedMessages($db, $message['fromUID'], $message['toUID'], $message['msg_id']), $lang);
420 
421  $html .= "</div>
422  <div class=\"col-md-4\">&nbsp;</div>
423  </div>";
424  return $html;
425  }
426 
427  /**
428  * @brief draw the complete Inbox
429  * @param string $type spam, trash or all
430  * @param array $messages messages array
431  * @return string
432  */
433  public function drawInbox($type, $messages, $lang){
434  $html = "<table class='table table-striped' id=\"table-sort\">
435  <tr style='font-weight:bold;' class='small'>
436  <td width='15%'>$lang[DATE]</td>
437  <td width='25%'>$lang[FROM] $lang[USER]</td>
438  <td width='50%'>$lang[MESSAGE] <small>($lang[PREVIEW])</small></td>
439  <td width='20%' style=\"text-align: center;\">$lang[ACTIONS]</td>
440  </tr>";
441  foreach ($messages as $email){
442  if ($email['msg_read'] === '0') { $style = "bold"; $envelope = "fa fa-envelope"; }
443  if ($email['msg_read'] === '1') { $style = "normal"; $envelope = "fa fa-envelope-o"; }
444 
445  if ($type === "trash" || $type === "spam")
446  {
447  if ($type === "spam")
448  {
449  $style = "text-danger";
450  $spam_icon = '';
451  $spam_action = '';
452  $spam_title = '';
453  }
454 
455  if ($type === "trash")
456  {
457  $spam_icon = '';
458  $spam_action = '';
459  $spam_title = '';
460  }
461 
462  $reply_icon = '';
463  $reply_action = '';
464  $reply_title = '';
465 
466  $revert_icon = "fa fa-undo";
467  $revert_action = "restoreFromTrash('$email[msg_id]')";
468  $revert_title = "$lang[RESTORE_MSG]";
469 
470  $trash_icon = "fa fa-trash";
471  $trash_action = "markAsDeleted('$email[msg_id]')";
472  $trash_title = "$lang[DEL_MSG]";
473  }
474  else
475  {
476  $revert_icon = $envelope;
477  $revert_action = "messageToggle('$email[msg_id]')";
478  $revert_title = "$lang[MARK_AS_READ]";
479 
480  $trash_icon = "fa fa-trash-o";
481  $trash_action = "markAsTrash('$email[msg_id]')";
482  $trash_title = "$lang[MOVE_TO_TRASH]";
483 
484  // $reply_icon = "fa fa-reply";
485  // $reply_action = "replyMessage('$email[msg_id]')";
486  // $reply_title = "reply";
487  // <i id=\"reply-$email[msg_id]\" class=\"$reply_icon\" onclick=\"$reply_action\" title=\"$reply_title\"></i>&nbsp;
488 
489 
490  $spam_icon = "fa fa-user-secret";
491  $spam_action = "markAsSpam('$email[msg_id]')";
492  $spam_title = "$lang[MARK_AS_SPAM]";
493  }
494  $msg_preview = substr($email['msg_body'],0 -64);
495  $html .= "
496  <tr id=\"row-$email[msg_id]\" class=\"$style\">
497  <td>$email[msg_date]</td>
498  <td><a href=\"index.php?plugin=messages&pluginpage=mailbox&msg_id=$email[msg_id]\"><div style=\"width:100%\">$email[username]</div></a></td>
499  <td><a href=\"index.php?plugin=messages&pluginpage=mailbox&msg_id=$email[msg_id]\"><div style=\"width:100%\">$msg_preview <small>[...]</small></div></a></td>
500  <td style=\"text-align:center\">
501  <i id=\"read-icon-$email[msg_id]\" class=\"$revert_icon\" onclick=\"$revert_action\" title=\"$revert_title\"></i>&nbsp;
502  <i class=\"$trash_icon\" onclick=\"$trash_action\" title=\"$trash_title\"></i>&nbsp;
503  <i class=\"$spam_icon\" onclick=\"$spam_action\" title=\"$spam_title\"></i>&nbsp;</td>
504  </tr>";
505  }
506  $html .= "</table>";
507  return $html;
508  }
509 
510  /**
511  * @brief draw html (output) messages menu
512  * @param object $db database
513  * @return string
514  */
515  public function drawMenu($db, $lang)
516  { // check if there is an active tab request
517  if (isset($_GET['active']) && (!empty($_GET['active'])))
518  { // switch vars
519  switch ($_GET['active'])
520  { // set inbox as active tab
521  case "inbox":
522  $active_inbox = "class=\"active\"";
523  $active_inbox_tab_pane = 'class="tab-pane active"';
524  $active_compose = '';
525  $active_compose_tab_pane = 'tab-pane';
526  break;
527  // set compose as active tab
528  case "compose":
529  $active_inbox = '';
530  $active_inbox_tab_pane = 'class="tab-pane"';
531  $active_compose = "class=\"active\"";
532  $active_compose_tab_pane = "class='tab-pane active'";
533  }
534  }
535  else
536  { // set inbox as default active tab
537  $active_inbox = "class=\"active\"";
538  $active_inbox_tab_pane = 'class="tab-pane active"';
539  $active_compose = '';
540  $active_compose_tab_pane = "class='tab-pane'";
541  }
542  $html = "<div>
543  <!-- Nav tabs -->
544  <ul class=\"nav nav-tabs\" role=\"tablist\">
545  <li role=\"presentation\" $active_inbox onclick=\"refreshInbox('all')\"><a href=\"#inbox\" aria-controls=\"home\" role=\"tab\" data-toggle=\"tab\">
546  <i class=\"fa fa-envelope-o\"></i> &nbsp;$lang[INBOX]</a></li>
547 
548  <li role=\"presentation\" $active_compose><a href=\"#newmessage\" aria-controls=\"newmessage\" role=\"tab\" data-toggle=\"tab\">
549  <i class=\"fa fa-plus-square-o\"></i> &nbsp;$lang[MESSAGE]</a></li>
550 
551  <li role=\"presentation\"><a href=\"#trash\" aria-controls=\"messages\" role=\"tab\" data-toggle=\"tab\">
552  <i class=\"fa fa-trash-o\"></i> &nbsp;$lang[RECYCLE_BIN]</a></li>
553 
554  <li role=\"presentation\"><a href=\"#spam\" aria-controls=\"messages\" role=\"tab\" data-toggle=\"tab\">
555  <i class=\"fa fa-user-secret\"></i> &nbsp;$lang[SPAM]</a></li>
556  </ul>
557 
558  <!-- Tab panes -->
559  <div class=\"tab-content\">
560 
561  <!-- inbox -->
562  <div role=\"tabpanel\" $active_inbox_tab_pane id=\"inbox\">
563  <h4><i class=\"fa fa-envelope-o fa-2x\"></i> &nbsp;$lang[INBOX]</h4>";
564  // get inbox
565  $html .= self::drawInbox('all', self::fetchMessages($db, 'all'), $lang);
566  $html .= "
567  </div>
568 
569  <!-- new msg -->
570  <div role=\"tabpanel\" $active_compose_tab_pane id=\"newmessage\">
571  <h4><i class=\"fa fa-envelope fa-2x\"></i> &nbsp;$lang[MSG_COMPOSE]</h4>";
572  // get new message form
573  $html .= self::drawNewMessage('', $lang);
574  $html .= "</div>
575  <!-- trash -->
576  <div role=\"tabpanel\" class=\"tab-pane\" id=\"trash\">
577  <h4><i class=\"fa fa-trash fa-2x\"></i> &nbsp;$lang[RECYCLE_BIN_HEADING]</h4>";
578  // get trashed items
579  $html .= self::drawInbox('trash', self::fetchMessages($db, 'trash'), $lang);
580  $html .="</div>
581  <!-- spam -->
582  <div role=\"tabpanel\" class=\"tab-pane\" id=\"spam\">
583  <h4><i class=\"fa fa-user-secret fa-2x\"></i> &nbsp;$lang[SPAM_HEADING]</h4>";
584  // get spam items
585  $html .= self::drawInbox('spam', self::fetchMessages($db, 'spam'), $lang);
586  $html .= "</div>
587  </div>
588  </div>";
589  return $html;
590  }
591 
592  /**
593  * @brief draw a new message
594  * @param string $to username to send
595  * @return string message fieldset
596  */
597  public function drawNewMessage($to, $lang){
598  $key = "U3E44ERG0H0M3";
599  if (isset($_GET['to']) && (!empty($_GET['to'])))
600  { // set new message recipient from given GET var
601  $to= $_GET['to'];
602  }
603  if (isset($to) && (!empty($to)))
604  {
605  $replyLabel = "$lang[REPLY_TO]";
606  $msg_to = "value=\"$to\"";
607  }
608  else
609  {
610  $replyLabel = "$lang[RECIPIENT_USERNAME]";
611  $msg_to = '';
612  }
613  return "
614  <fieldset id=\"comment_thread\" class=\"animated zoomInDown\">
615  <label for=\"msg_to\">$replyLabel</label> <input id=\"msg_to\" type=\"text\" $msg_to class=\"form-control\" name=\"msg_to\" size=\"16\" placeholder=\"to:\" maxlength=\"64\">
616  <label for=\"msg_body\">$lang[YOUR_MSG]</label> <textarea id=\"msg_body\" name=\"msg_body\" class=\"form-control\" cols=\"68\" rows=\"12\"></textarea><br>
617  <input type=\"button\" class=\"btn btn-success\" id=\"submit_post\" name=\"save_comment\" title=\"$lang[SEND]\" value=\"$lang[MSG_SEND_BTN]\">
618  <input type=\"hidden\" name=\"msg_from\" value=\"$_SESSION[username]\" id=\"msg_from\">
619  <input type=\"hidden\" name=\"fromUID\" value=\"$_SESSION[uid]\" id=\"fromUID\">
620  <input type=\"hidden\" name=\"token\" value=\"".$key."\" id=\"token\">
621  </fieldset>
622  ";
623  }
624 
625  /**
626  * @brief mark a message as read
627  * @param object $db database
628  * @param int $msg_id message ID
629  * @return bool
630  */
631  public function markAsRead($db, $msg_id)
632  { /** @var $db \YAWK\db */
633  if ($db->query("UPDATE {plugin_msg} SET msg_read = '1' WHERE msg_id = '".$msg_id."'"))
634  { // marked as read
635  return true;
636  }
637  else
638  { // q failed
639  return false;
640  }
641  }
642  }
643 }
if(!isset($db)) $uid
$prefix
Definition: actions.php:6
print $lang['FILEMAN_UPLOAD']
The Messages Plugin Class. Allow your users to write messages to each other.
Definition: messages.php:21
drawMenu($db, $lang)
draw html (output) messages menu
Definition: messages.php:515
MessageView($db, $msg_id, $lang)
view messages
Definition: messages.php:393
__construct($db, $location)
messages constructor - check if class is called from frontend or backend
Definition: messages.php:27
drawNewMessage($to, $lang)
draw a new message
Definition: messages.php:597
getInbox($db, $lang)
get inbox and draw menu
Definition: messages.php:253
drawInbox($type, $messages, $lang)
draw the complete Inbox
Definition: messages.php:433
static getSetting($db, $property)
Get and return value for property from settings database.
Definition: settings.php:470
static time_ago($userdate, $lang)
how many time is been gone since given date
Definition: sys.php:1630
static splitDateShort($date)
split a date to month, day, year and time this is the same as splitDate() but keep the months short
Definition: sys.php:1572
static getHost($db)
get hostname (url where yawk is installed) from database
Definition: sys.php:1115
static getUserImage($location, $user, $cssClass, $w, $h)
return and output user image
Definition: user.php:1079
if(!isset($db)) $msg_id
$type
$sql
Definition: message-new.php:32
$msg_to
Definition: message-new.php:19
$toUID
Definition: message-new.php:23
$fromUID
Definition: message-new.php:21
This class serves methods to create backup from files.
Definition: AdminLTE.php:2
$host
Definition: page-edit.php:65
print $_GET['id']
Definition: page-edit.php:357
$messages
Definition: messages.php:14
$email
Definition: user-new.php:94
$i