} $uquery = "(" . rtrim($uquery, ',') . ")"; $append .= " AND `user_id` IN " . $uquery; } else { $sapp = ''; if (isset($filters['email']) && !empty($filters['email'])) { $email = realEscapeString($filters['email']); $sapp .= "AND `email` LIKE '%{$email}%' "; } if (isset($filters['screename']) && !empty($filters['screename'])) { $screenName = realEscapeString($filters['screename']); $sapp .= "AND `screenname` LIKE '%{$screenName}%' "; } if (!empty($sapp)) { $sapp = ' WHERE ' . ltrim($sapp, 'AND'); $request = new SnacktoolsRequest('get_users_for_admin'); $request->addParam('query', $sapp); $response = $request->request(); $responseQuery = $response->data['query']; $append .= " AND `user_id` IN " . $responseQuery; } } //$append .= " AND flags & " . Notify::FLAG_NOTIF_DATA_SAVED; $orderAlbums = isset($_SESSION['admin_filters_quizz']['order']) ? $_SESSION['admin_filters_quizz']['order'] : null; if (isset($orderAlbums->orderBy)) { $append .= ' ORDER BY `' . $orderAlbums->orderBy . '` ' . $orderAlbums->orderType . ' '; } else { $append .= ' ORDER BY `id` DESC '; } $recordsPerPage = isset($filters['records']) ? intval($filters['records']) : 10; if ($recordsPerPage < 10 || $recordsPerPage > 500) {
<?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;
<?php $request = new SnacktoolsRequest('get_user'); $request->addParam('id', $_GET['id']); $response = $request->request(); $smarty = Application::getSmarty('/admin/ajax/templates/', '/admin/ajax/templates_c/'); $smarty->assign('user', $response->data['user']); $out = $smarty->fetch('get-user-details.tpl'); Ajax::output($out);
<?php Ajax::requireLoggedIn(); $user = User::getLogged(); $request = new SnacktoolsRequest('is_premium'); $request->addParam('user_id', $user->id); $response = $request->request(); $isUserPremium = $response->data['premium'] == 1 ? true : false; if (!$isUserPremium) { exit; } $hash = isset($_POST['hash']) ? $_POST['hash'] : $_GET['hash']; if (isset($_POST['awt'])) { $allowWidgetTracking = isset($_POST['awt']) ? $_POST['awt'] : $_GET['awt']; } $notify = Notify::getByHash($hash); if (empty($notify->id) || !$notify->hasAccess()) { Ajax::outputError('You don\'t have access to this notification!'); } if (!($json = $notify->getJSONContent())) { Ajax::output('Could not generate default json params!'); } $params = json_decode($json, true); if ($allowWidgetTracking == 'false') { $params['configs']['allow_widget_tracking'] = 'false'; } else { if (isset($params['configs']['allow_widget_tracking'])) { unset($params['configs']['allow_widget_tracking']); } } if (!$notify->updateJSON_Data($params, false)) {