<?php Ajax::requireLoggedIn(); if (!isset($_SESSION['items_options'])) { $_SESSION['items_options'] = array(); } $options =& $_SESSION['items_options']; if (isset($_GET['orderBy'])) { $options['orderBy'] = $_GET['orderBy']; if (!isset($options['orderType']) || $options['orderType'] == 'DESC') { $options['orderType'] = 'ASC'; } else { $options['orderType'] = 'DESC'; } } if (isset($_GET['search_type'])) { $options['search']['type'] = $_GET['search_type']; } if (isset($_GET['search_text'])) { $options['search']['text'] = $_GET['search_text']; } $p = isset($_GET['p']) ? intval($_GET['p']) : 1; $out = new stdClass(); $out->items = Notify::getNotifications(User::getLogged()->id, $options, $p); $out->filters = $options; $out->totalItems = Notify::getNotificationsCount(User::getLogged()->id, $options); $out->currentPage = $p; $out->time = getDateMysql(); Ajax::output($out);
Ajax::requireLoggedIn(); $message = isset($_GET['message']) ? $_GET['message'] : ''; if (!isset($message) || empty($message)) { Ajax::outputError("Empty message!"); } $hash = isset($_GET['hash']) ? $_GET['hash'] : ''; if (!isset($hash) || empty($hash)) { Ajax::outputError("Empty hash!"); } $user = User::getLogged(); $notification = Notify::getByHash($hash); $feedback = new UserFeedback(); $feedback->user_id = $user->id; $feedback->message = $message; $feedback->date_added = getDateMysql(); $feedback->ip = $_SERVER['REMOTE_ADDR']; $feedback->notification_id = $notification->id; $feedback->save(); $message = '<p>' . nl2br(str_replace(' ', ' ', $message)) . '</p><hr/>'; $message .= '<br/><h4>User info</h4>'; $message .= '<span>Screen name: ' . $user->screenname . '</span>'; $message .= '<br/><span>User email: ' . $user->email . '</span>'; $message .= '<br/><span>Account id: ' . $user->id . '</span>'; $message .= '<br/><span>Notification ID: ' . $notification->id . '</span>'; $message .= '<br/><span>Notification hash: ' . $notification->hash . '</span>'; $message .= '<br/><span>Notification name: ' . $notification->name . '</span>'; $message .= '<br/><span>Notification parent hash: ' . $notification->parent_hash . '</span>'; $mail = new PHPMailer(); $mail->CharSet = "UTF-8"; $mail->AddAddress($config->mail->feedbackEmail);