<?php Ajax::requireLoggedIn(); Ajax::output(Notify::getItemsFlags($_GET['items'], User::getLogged()->id));
<?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);
} if (isset($_SESSION['time_between_albums'])) { if ($_SESSION['time_between_albums'] + QuizComment::TIME_BETWEEN_COMMENTS > time()) { Ajax::outputError('You are posting comments too quickly. Slow down.'); } } $quiz = new Quiz($data['quiz_id']); if (empty($quiz->id)) { Ajax::outputError('Internal error'); } $comment = new QuizComment(); $comment->quiz_id = $data['quiz_id']; $comment->name = $data['name']; $comment->email = $data['email']; $comment->website = $data['website']; $comment->comment = $data['comment']; $comment->ip = $_SERVER['REMOTE_ADDR']; $comment->date = $comment->now(); if (User::isLogged()) { if (User::getLogged()->id == $quiz->user_id) { $comment->owner = 1; } } $comment->save(); $_SESSION['time_between_albums'] = time(); $out = new stdClass(); $out->id = $comment->id; $out->date = $comment->getDateFormated(); $out->name = $comment->getDisplayName(false); $out->comment = $comment->getDisplayComment(); Ajax::output($out);
<?php 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";
<?php include 'classes/user.php'; $user = new User(); $user->getLogged();
<?php ignore_user_abort(true); set_time_limit(90); Ajax::requireLoggedIn(); $id = isset($_GET['item']) ? $_GET['item'] : null; $notify = new Notify($id); if (!$notify->hasAccess()) { Ajax::outputError('You don\'t have access to this notification'); } if ($notify->isPremium()) { //Ajax::outputMyError('This notification is premium already'); } $premiumInfo = $config->premium['others']; $request = new SnacktoolsRequest('remove_points'); $request->addParam('user_id', User::getLogged()->id); $request->addParam('points', $premiumInfo['points']); $request->addParam('description', $premiumInfo['description']); $request->addParam('service_id', $premiumInfo['id']); $request->addParam('item_type', $premiumInfo['itemType']); $request->addParam('item_id', $notify->id); $response = $request->request(); if ($response->areErrors()) { Ajax::outputError($response->error); } $notify->setFlag(Notify::FLAG_PREMIUM, true); $notify->premium_type = $response->data['buy_type']; $notify->activatePremium($response->data['buy_type']); $notify->actualize('no'); $out = new stdClass(); $out->id = $notify->id;