function get_item_description($activity) { global $dbh; global $settings; if ($activity['type'] == 'backed up') { ?> <a href="<?php echo $activity['table']; ?> " target="_blank">File</a> - <?php echo byte_convert($activity['row']); echo file_exists($activity['table']) ? '' : ' - <span class="warning">Missing File!</span>'; } elseif ($activity['type'] == 'error') { $view_error = true ? ellipses($activity['sql']) : $activity['sql']; return '<a href="#" class="dialog_note" title="Error Detail" message="<b>User:</b> ' . get_username($activity['user']) . '<br><b>Page:</b> ' . $activity['table'] . '<br><b>Time:</b> ' . date('M jS Y, g:i:s a', strtotime($activity['datetime'])) . '<br><br>' . str_replace('"', '\\"', strip_tags($activity['sql'])) . '">View Error</a>: ' . $view_error; } elseif ($activity['type'] == 'installed') { return 'Directus install'; } elseif ($activity['table'] == 'directus_users') { return '<a href="users.php">' . $activity['sql'] . '</a> has been added to Directus Users'; } elseif ($activity['table'] == 'directus_media') { // Get name of media $sth = $dbh->prepare("SELECT * FROM `directus_media` WHERE `id` = :id "); $sth->bindParam(':id', $activity['row']); $sth->execute(); if ($row = $sth->fetch()) { $title = $row['title']; } $title = $title ? ellipses($title, 20) : '<i>No title</i>'; $return = '<a href="#" class="open_media" media_id="' . $activity['row'] . '">' . $title . '</a> within Directus Media'; $return .= $activity['sql'] == 'batch' ? ' - <b>Batch upload</b>' : ''; return $return; } elseif ($activity['table'] && $activity['row']) { $first_field = get_primary_field_value($activity['table'], $activity['row']); return '<a href="edit.php?table=' . $activity['table'] . '&item=' . $activity['row'] . '" title="' . ellipses(str_replace('"', '\\"', $first_field), 200) . '">' . ellipses($first_field, 20) . '</a> within ' . uc_table($activity['table']); } }
function send_email($subject, $body, $to = false, $from = false, $bcc = false) { global $settings; $subject = "[" . stripslashes($settings['cms']['site_name']) . "] " . ellipses(stripslashes($subject), 50); $body .= "\n<br>\n<br>\n<br><i>Note that this is an automatically generated e-mail.\n<br>Please do not reply to this e-mail address.</i>\n<br><a href='" . CMS_PAGE_PATH . "users.php'>Stop receiving emails</a>\n<br>\n<br>--\n<br>Directus\n<br>" . $settings['cms']['version']; $body = wordwrap(stripslashes($body), 70); $to = $to ? $to : "You <*****@*****.**>"; $from = $from ? $from : "Directus <*****@*****.**>"; //$headers = 'MIME-Version: 1.0' . "\n"; $headers = 'Content-type: text/html; charset=utf-8' . "\n"; $headers .= 'From: ' . $from . "\n"; if ($bcc && count($bcc) > 0) { $headers .= 'Bcc: ' . implode(',', $bcc) . "\n"; } $headers .= "\n"; return mail($to, $subject, $body, $headers); }
?> </span> </div> </div> </td> <td> <div class="pad_right"> <span class="subject"><a href="?id=<?php echo $message['id']; ?> "><?php echo $subject; ?> </a></span> <span class="body"><?php echo ellipses($message['last_message'], 90); ?> </span> <span class="actions"><a href="?id=<?php echo $message['id']; ?> ">View message</a> | <?php if ($message['table'] && $message['row']) { ?> <a href="edit.php?table=<?php echo $message['table'] . '&item=' . $message['row']; ?> ">Go To Item</a> | <?php } ?>