function preRender() { parent::prerender(); if (0 < $this->selectedTabIndex) { $this->villagesLinkPostfix .= '&t=' . $this->selectedTabIndex; } }
function load() { parent::load(); if (intval($this->data['create_nvil']) == 0 || $this->player->isSpy) { $this->redirect('village1.php'); return null; } $this->globalModel->resetNewVillageFlag($this->player->playerId); }
function load() { parent::load(); $allianceId = intval($this->data['alliance_id']); if ($allianceId == 0 || !$this->hasAllianceSetRoles() || !isset($_GET['uid'])) { exit(0); return null; } $uid = intval($_GET['uid']); $m = new AllianceModel(); $this->allianceData = $m->getAllianceData($allianceId); if (!$this->isMemberOfAlliance($uid)) { exit(0); return null; } if ($this->isPost()) { $roleName = isset($_POST['a_titel']) ? $_POST['a_titel'] : ''; if (trim($roleName) == '') { $roleName = '.'; } $roleNumber = 0; if (isset($_POST['e1'])) { $roleNumber |= ALLIANCE_ROLE_SETROLES; } if (isset($_POST['e2'])) { $roleNumber |= ALLIANCE_ROLE_REMOVEPLAYER; } if (isset($_POST['e3'])) { $roleNumber |= ALLIANCE_ROLE_EDITNAMES; } if (isset($_POST['e4'])) { $roleNumber |= ALLIANCE_ROLE_EDITCONTRACTS; } if (isset($_POST['e5'])) { $roleNumber |= ALLIANCE_ROLE_SENDMESSAGE; } if (isset($_POST['e6'])) { $roleNumber |= ALLIANCE_ROLE_INVITEPLAYERS; } $m->setPlayerAllianceRole($uid, $roleName, $roleNumber); } $row = $m->getPlayerAllianceRole($uid); if ($row == NULL) { exit(0); return null; } $this->playerName = $row['name']; $alliance_roles = trim($row['alliance_roles']); if ($alliance_roles == '') { $this->playerRoles = array('name' => '', 'roles' => 0); } else { list($rolesNumber, $roleName) = explode(' ', $alliance_roles, 2); $this->playerRoles = array('name' => $roleName == '.' ? '' : $roleName, 'roles' => $rolesNumber); } $m->dispose(); }
function load() { parent::load(); if (intval($this->data['new_gnews']) == 0 || $this->player->isSpy) { $this->redirect('village1.php'); return null; } $m = new NewsModel(); $this->siteNews = $m->getGlobalSiteNews(); $m->dispose(); }
function load() { parent::load(); if (isset($_GET['url']) && !empty($_GET['url'])) { $advID = base64_decode(mysql_real_escape_string(trim($_GET['url']))); if ($advID != '') { $m = new AdvertisingModel(); $url = $m->GoToBanner($advID); $m->dispose(); $this->redirect($url); return null; } } }
function load() { parent::load(); $this->Filter = new FilterWordsModel(); $m = new ChatModel(); if ($this->isPost() && isset($_POST['text'])) { $text = stripslashes(htmlspecialchars(trim($_POST['text']))); if ($text != '') { $m->SendToChat($this->data['name'], $this->player->playerId, $text); } } $m->DeleteOldChat(); $this->chats = $m->GetFromChat(); $m->dispose(); }
function load() { parent::load(); if (!$this->data['active_plus_account']) { exit(0); return null; } $this->saved = FALSE; if ($this->isPost() && isset($_POST['notes'])) { $this->data['notes'] = $_POST['notes']; $m = new NotesModel(); $m->changePlayerNotes($this->player->playerId, $this->data['notes']); $m->dispose(); $this->saved = TRUE; } }
function load() { parent::load(); $this->Filter = new FilterWordsModel(); $m = new ChatModel(); $this->chats = $m->GetFromChat(); $storCtat = array(); while ($this->chats->next()) { $text = $this->Filter->FilterWords($this->chats->row['text']); $storCtat[$this->chats->row['ID']] = array(date('g:i A', $this->chats->row['date']), $this->chats->row['username'], $text, $this->chats->row['userid']); } ksort($storCtat); foreach ($storCtat as $ChatLine) { echo '<div class="msgln">(' . $ChatLine[0] . ') <b><a href="profile.php?uid=' . $ChatLine[3] . '" target="_blank">' . $ChatLine[1] . '</a></b>: ' . $ChatLine[2] . '<br></div>'; } $m->dispose(); }
function load() { parent::load(); if (!$this->data['active_plus_account']) { exit(0); return null; } if ($this->isPost()) { $this->playerLinks = array(); $i = 0; $c = sizeof($_POST['nr']); while ($i < $c) { $name = trim($_POST['linkname'][$i]); $url = trim($_POST['linkurl'][$i]); if ($url == '' || $name == '' || $_POST['nr'][$i] == '' || !is_numeric($_POST['nr'][$i])) { continue; } $selfTarget = TRUE; if (substr($url, strlen($url) - 1) == '*') { $url = substr($url, 0, strlen($url) - 1); $selfTarget = FALSE; } if (isset($this->playerLinks[$_POST['nr'][$i]])) { ++$_POST['nr'][$i]; } $this->playerLinks[$_POST['nr'][$i]] = array('linkName' => $name, 'linkHref' => $url, 'linkSelfTarget' => $selfTarget); ++$i; } ksort($this->playerLinks); $links = ''; foreach ($this->playerLinks as $link) { if ($links != '') { $links .= ' '; } $links .= $link['linkName'] . ' ' . $link['linkHref'] . ' ' . ($link['linkSelfTarget'] ? '?' : '*'); } $m = new LinksModel(); $m->changePlayerLinks($this->player->playerId, $links); $m->dispose(); } }
function load() { parent::load(); if ($this->data['player_type'] != PLAYERTYPE_ADMIN) { exit(0); return null; } $m = new NewsModel(); $this->saved = FALSE; if ($this->isPost() && isset($_POST['news'])) { $this->siteNews = $_POST['news']; $this->saved = TRUE; $m->setGlobalPlayerNews($this->siteNews); } else { $this->siteNews = $m->getGlobalSiteNews(); } $m->dispose(); }
function load() { parent::load(); $this->msgText = ''; $this->isAdmin = $this->data['player_type'] == PLAYERTYPE_ADMIN; if (!$this->isAdmin) { exit(0); return null; } $this->villageId = isset($_GET['avid']) ? intval($_GET['avid']) : 0; if ($this->villageId <= 0) { exit(0); return null; } $m = new ResourcesModel(); if ($this->isPost()) { $r1 = isset($_POST['r1']) && 0 <= intval($_POST['r1']) ? intval($_POST['r1']) : 0 - 1; $r2 = isset($_POST['r2']) && 0 <= intval($_POST['r2']) ? intval($_POST['r2']) : 0 - 1; $r3 = isset($_POST['r3']) && 0 <= intval($_POST['r3']) ? intval($_POST['r3']) : 0 - 1; $r4 = isset($_POST['r4']) && 0 <= intval($_POST['r4']) ? intval($_POST['r4']) : 0 - 1; $m->updateVillageResources($this->villageId, array('1' => $r1, '2' => $r2, '3' => $r3, '4' => $r4)); $this->msgText = data_saved; } $row = $m->getVillageData($this->villageId); if ($row == NULL || intval($row['player_id']) == 0 || $row['is_oasis']) { exit(0); return null; } $this->villageName = $row['village_name']; $this->playerName = $row['player_name']; $this->resources = array(); $elapsedTimeInSeconds = $row['elapsedTimeInSeconds']; $r_arr = explode(',', $row['resources']); foreach ($r_arr as $r_str) { $r2 = explode(' ', $r_str); $prate = floor($r2[4] * (1 + $r2[5] / 100)) - ($r2[0] == 4 ? $row['crop_consumption'] : 0); $current_value = floor($r2[1] + $elapsedTimeInSeconds * ($prate / 3600)); if ($r2[2] < $current_value) { $current_value = $r2[2]; } $this->resources[$r2[0]] = array('current_value' => $current_value, 'store_max_limit' => $r2[2], 'store_init_limit' => $r2[3], 'prod_rate' => $r2[4], 'prod_rate_percentage' => $r2[5], 'calc_prod_rate' => $prate); } $m->dispose(); }
function load() { parent::load(); $this->pageIndex = isset($_GET['p']) && is_numeric($_GET['p']) ? intval($_GET['p']) : 0; $m = new FriendsModel(); $rowsCount = $m->getFriendsCount($this->player->playerId); $this->pageCount = 0 < $rowsCount ? ceil($rowsCount / $this->pageSize) : 1; if (isset($_GET['DFid']) && !empty($_GET['DFid'])) { $FriendID = mysql_real_escape_string(trim($_GET['DFid'])); if ($FriendID != '') { $m->DeleteFriend($FriendID, $this->player->playerId); $m->dispose(); $this->redirect('friends.php'); return null; } } if (isset($_GET['CFid']) && !empty($_GET['CFid'])) { $ConfirmID = mysql_real_escape_string(trim($_GET['CFid'])); if ($ConfirmID != '') { $m->ConfirmInvitation($ConfirmID, $this->player->playerId); $m->dispose(); $this->redirect('friends.php'); return null; } } if ($this->isPost()) { $post = array(); $post['playerId1'] = $this->player->playerId; $post['myname'] = $this->data['name']; $post['playerName'] = isset($_POST['playerName']) && $_POST['playerName'] != '' ? trim($_POST['playerName']) : trim($_POST['playerName']); if ($post['playerName'] != '') { $m->SendInvitation($post); } else { echo '<pre> Error : Wrong name'; } $m->dispose(); } $this->friends = $m->GetFriends($this->player->playerId, $this->pageIndex, $this->pageSize); $m->dispose(); }
function load() { parent::load(); $this->pageIndex = isset($_GET['p']) && is_numeric($_GET['p']) ? intval($_GET['p']) : 0; $this->isAdmin = $this->data['player_type'] == PLAYERTYPE_ADMIN; if (!$this->isAdmin) { exit(0); return null; } $m = new BadWordsModel(); $rowsCount = $m->getBadWordsCount(); $this->pageCount = 0 < $rowsCount ? ceil($rowsCount / $this->pageSize) : 1; if (isset($_GET['Dword']) && !empty($_GET['Dword'])) { $wordID = mysql_real_escape_string(trim($_GET['Dword'])); if ($wordID != '') { $m->DeleteBadWords($wordID); $m->dispose(); $this->redirect('badwords.php'); return null; } } if ($this->isPost()) { $i = 0; while ($i < count($_POST['words'])) { $words = mysql_real_escape_string(trim($_POST['words'][$i])); if ($words == '') { continue; } $this->BadWords[] = $words; ++$i; } $m->addBadWords($this->BadWords); $m->dispose(); $this->redirect('badwords.php'); return null; } $this->BadWords = $m->GetBadWords($this->pageIndex, $this->pageSize); $m->dispose(); }
function load() { parent::load(); $this->pageIndex = isset($_GET['p']) && is_numeric($_GET['p']) ? intval($_GET['p']) : 0; $this->isAdmin = $this->data['player_type'] == PLAYERTYPE_ADMIN; if (!$this->isAdmin) { exit(0); return null; } $m = new AdvertisingModel(); $rowsCount = $m->getAdvertisingCount(); $this->pageCount = 0 < $rowsCount ? ceil($rowsCount / $this->pageSize) : 1; if (isset($_GET['DAdv']) && !empty($_GET['DAdv'])) { $advID = mysql_real_escape_string(trim($_GET['DAdv'])); if ($advID != '') { $m->DeleteAdvertising($advID); $m->dispose(); $this->redirect('advertising.php'); return null; } } if ($this->isPost()) { $post = array(); $type = isset($_POST['do']) && $_POST['do'] != 'add' ? 'edit' : 'add'; $post['name'] = isset($_POST['name']) && $_POST['name'] != '' ? mysql_real_escape_string(trim($_POST['name'])) : 'SPSLink.NET'; $post['url'] = isset($_POST['url']) && $_POST['url'] != '' ? mysql_real_escape_string(trim($_POST['url'])) : 'http://www.spslink.net'; $post['cat'] = isset($_POST['cat']) && $_POST['cat'] != '' ? mysql_real_escape_string(trim($_POST['cat'])) : '1'; $post['image'] = isset($_POST['image']) && $_POST['image'] != '' ? mysql_real_escape_string(trim($_POST['image'])) : 'assets/default/img/characters.png'; $ext = strtolower(end(explode('.', mysql_real_escape_string(trim($post['image']))))); $post['type'] = $ext == 'swf' ? 'flash' : 'image'; $post['ID'] = isset($_POST['ID']) && $_POST['ID'] != '' ? mysql_real_escape_string(trim($_POST['ID'])) : 0; $m->Advertising($post, $type); $m->dispose(); $this->redirect('advertising.php'); return null; } $this->Advertisings = $m->GetAdvertisings($this->pageIndex, $this->pageSize); $m->dispose(); }
function load() { parent::load(); $this->Filter = new FilterWordsModel(); if (isset($_GET['action']) && $_GET['action'] == 'chatheartbeat') { $this->chatHeartbeat(); } if (isset($_GET['action']) && $_GET['action'] == 'sendchat') { $this->sendChat(); } if (isset($_GET['action']) && $_GET['action'] == 'closechat') { $this->closeChat(); } if (isset($_GET['action']) && $_GET['action'] == 'startchatsession') { $this->startChatSession(); } if (!isset($_SESSION['chatHistory'])) { $_SESSION['chatHistory'] = array(); } if (!isset($_SESSION['openChatBoxes'])) { $_SESSION['openChatBoxes'] = array(); } }
function load() { parent::load(); $this->myData['name'] = $this->data['name']; $this->myData['avatar'] = $this->data['avatar']; $this->myData['id'] = $this->player->playerId; $this->pageIndex = isset($_GET['p']) && is_numeric($_GET['p']) ? intval($_GET['p']) : 0; $this->uid = isset($_GET['uid']) && 0 < intval($_GET['uid']) ? intval($_GET['uid']) : $this->player->playerId; $m = new SNprofileModel(); $rowsCount = $m->getNewsCount($this->uid); $this->pageCount = 0 < $rowsCount ? ceil($rowsCount / $this->pageSize) : 1; $this->userData = $m->getuserData($this->uid); $friendId = array(); $listRows = $m->getFriendsList($this->player->playerId); while ($listRows->next()) { $id = $listRows->row['playerid1'] == $this->player->playerId ? $listRows->row['playerid2'] : $listRows->row['playerid1']; $name = $listRows->row['playerid1'] == $this->player->playerId ? $listRows->row['playername2'] : $listRows->row['playername1']; $frienddata = $m->getFriendData($id); $this->friendList[] = array($id, $name, $frienddata['avatar'], $frienddata['last_login_sec']); $friendId[] = $id; } $this->isFriend = in_array($this->uid, $friendId) || $this->uid == $this->player->playerId ? true : false; if (isset($_GET['DNid']) && !empty($_GET['DNid'])) { $NewsID = mysql_real_escape_string(trim($_GET['DNid'])); if ($NewsID != '') { if ($this->myData['id'] == $this->uid) { $m->DeleteNews($NewsID, $this->player->playerId); } $m->dispose(); $this->redirect('snprofile.php?uid=' . $this->uid); return null; } } if (isset($_GET['DCid']) && !empty($_GET['DCid'])) { $CommentID = mysql_real_escape_string(trim($_GET['DCid'])); if ($CommentID != '') { $m->DeleteComment($CommentID, $this->player->playerId); $m->dispose(); $this->redirect('snprofile.php?uid=' . $this->uid); return null; } } if ($this->isPost()) { $post = array(); if (isset($_GET['do']) && $_GET['do'] == 'News') { $post['userid'] = $this->uid; $post['message'] = isset($_POST['news']) && $_POST['news'] != '' ? trim($_POST['news']) : ''; $post['image'] = isset($_POST['image']) && $_POST['image'] != '' ? trim($_POST['image']) : ''; $post['url'] = isset($_POST['url']) && $_POST['url'] != '' ? trim($_POST['url']) : ''; $post['youtube'] = isset($_POST['youtube']) && $_POST['youtube'] != '' ? trim($_POST['youtube']) : ''; if ($this->uid == $this->player->playerId && $post['message'] != '') { $m->SendNews($post); } } else { $post['to_userid'] = $this->uid; $post['userid'] = intval($this->player->playerId); $post['username'] = $this->data['name']; $post['comment'] = isset($_POST['comment']) && $_POST['comment'] != '' ? trim($_POST['comment']) : ''; $post['topicid'] = isset($_POST['topicid']) && $_POST['topicid'] != '' ? trim($_POST['topicid']) : ''; if ($post['to_userid'] != 0 && $post['comment'] != '' && $post['userid'] != 0 && $this->isFriend) { $m->SendComment($post); } } $m->dispose(); $this->redirect('snprofile.php?uid=' . $this->uid); return null; } $News = $m->GetNews($this->uid, $this->pageIndex, $this->pageSize); $k = 0; while ($News->next()) { $Comments = $m->GetComments($News->row['ID']); $this->topics[$k]['news'] = $News->row; while ($Comments->next()) { $this->topics[$k]['news']['comment'][] = $Comments->row; } ++$k; } $m->dispose(); }
function preRender() { parent::prerender(); if (isset($_GET['uid'])) { $this->villagesLinkPostfix .= '&uid=' . intval($_GET['uid']); } if (isset($_GET['id'])) { $this->villagesLinkPostfix .= '&id=' . intval($_GET['id']); } if (isset($_GET['p'])) { $this->villagesLinkPostfix .= '&p=' . intval($_GET['p']); } if (0 < $this->selectedTabIndex) { $this->villagesLinkPostfix .= '&t=' . $this->selectedTabIndex; } }
public function preRender() { parent::prerender(); if (isset($_GET['uid'])) { $this->villagesLinkPostfix .= "&uid=" . intval($_GET['uid']); } if (0 < $this->selectedTabIndex) { $this->villagesLinkPostfix .= "&t=" . $this->selectedTabIndex; } }
public function preRender() { parent::prerender(); if (isset($_GET['id'])) { $this->villagesLinkPostfix .= "villagesLinkPostfix"; } if (isset($_GET['p'])) { $this->villagesLinkPostfix .= "villagesLinkPostfix"; } if (0 < $this->selectedTabIndex) { $this->villagesLinkPostfix .= "villagesLinkPostfix"; } }
function GPage() { parent::securegamepage(); $this->viewFile = 'logout.phtml'; $this->contentCssClass = 'logout'; }
function load() { parent::load(); $this->tribeId = $this->data['tribe_id']; // get the village buildings $b_arr = explode(',', $this->data['buildings']); $indx = 0; foreach ($b_arr as $b_str) { $indx++; $b2 = explode(' ', $b_str); $this->onLoadBuildings($this->buildings[$indx] = array('index' => $indx, 'item_id' => $b2[0], 'level' => $b2[1], 'update_state' => $b2[2])); } }
function preRender() { parent::prerender(); if (isset($_GET['id'])) { $this->villagesLinkPostfix .= '&id=' . intval($_GET['id']); } }