function __construct() { parent::__construct(); $mainframe = JFactory::getApplication(); // Get the pagination request variables $this->season_id = $mainframe->getUserStateFromRequest('com_joomsport.sid', 'sid', 0, 'int'); $this->limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int'); $this->limitstart = $mainframe->getUserStateFromRequest('com_joomsport.limitstart_pl' . $this->season_id, 'limitstart', 0, 'int'); // In case limit has been changed, adjust limitstart accordingly $this->limitstart = $this->limit != 0 ? floor($this->limitstart / $this->limit) * $this->limit : 0; $user = JFactory::getUser(); if ($user->get('guest')) { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); if (getVer() >= '1.6') { $uopt = "com_users"; } else { $uopt = "com_user"; } $return = 'index.php?option=' . $uopt . '&view=login&return=' . $return_url; $this->mainframe->redirect($return, JText::_('BLMESS_NOT_LOGIN')); } if (!$this->season_id) { JError::raiseError(403, JText::_('Access Forbidden')); return; } }
function __construct($acl) { $this->acl = $acl; parent::__construct(); if ($this->acl == 1) { $this->season_id = $this->mainframe->getUserStateFromRequest('com_joomsport.sid', 'sid', 0, 'int'); } elseif ($this->acl == 2) { $this->season_id = $this->mainframe->getUserStateFromRequest('com_joomsport.moderseason', 'moderseason', 0, 'int'); } elseif ($this->acl == 3) { $this->_user = JFactory::getUser(); if ($this->_user->get('guest')) { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); if (getVer() >= '1.6') { $uopt = "com_users"; } else { $uopt = "com_user"; } $return = 'index.php?option=' . $uopt . '&view=login&return=' . $return_url; // Redirect to a login form $this->mainframe->redirect($return, JText::_('BLFA_MSGLOGIN')); } $cid = JRequest::getVar('cid', array(0), '', 'array'); JArrayHelper::toInteger($cid, array(0)); if ($cid[0]) { $this->id = $cid[0]; } else { JError::raiseError(403, JText::_('Access Forbidden')); return; } } if ($this->acl != 1) { $this->_lists['jsmr_mark_played'] = $this->getJS_Config('jsmr_mark_played'); $this->_lists['jsmr_editresult_yours'] = $this->getJS_Config('jsmr_editresult_yours'); $this->_lists['jsmr_editresult_opposite'] = $this->getJS_Config('jsmr_editresult_opposite'); $this->_lists['jsmr_edit_playerevent_yours'] = $this->getJS_Config('jsmr_edit_playerevent_yours'); $this->_lists['jsmr_edit_playerevent_opposite'] = $this->getJS_Config('jsmr_edit_playerevent_opposite'); $this->_lists['jsmr_edit_matchevent_yours'] = $this->getJS_Config('jsmr_edit_matchevent_yours'); $this->_lists['jsmr_edit_matchevent_opposite'] = $this->getJS_Config('jsmr_edit_matchevent_opposite'); $this->_lists['jsmr_edit_squad_yours'] = $this->getJS_Config('jsmr_edit_squad_yours'); $this->_lists['jsmr_edit_squad_opposite'] = $this->getJS_Config('jsmr_edit_squad_opposite'); } }
function getData() { $this->getPlayer(); //title $this->p_title = JText::_('BLFA_EDITFIPROF'); $this->_params = $this->JS_PageTitle($this->title ? $this->title : JText::_('BLFA_EDITFIPROF')); $this->_lists["post_max_size"] = $this->getValSettingsServ("post_max_size"); //return if ($return = JRequest::getVar('return', '', 'method', 'base64')) { $return = $return; if (!JURI::isInternal($return)) { $return = ''; } } if ($this->_user->get('guest')) { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); if (getVer() >= '1.6') { $uopt = "com_users"; } else { $uopt = "com_user"; } $return = 'index.php?option=' . $uopt . '&view=login&return=' . $return_url; // Redirect to a login form $this->mainframe->redirect($return, JText::_('BLMESS_NOT_LOGIN')); } $this->_lists["return"] = $return; $this->getJSreg(); //Player Country registration $this->_lists['country_reg'] = $this->getJS_Config('country_reg'); $this->_lists['country_reg_rq'] = $this->getJS_Config('country_reg_rq'); $this->getCountries(); //Nick registration $this->_lists['nick_reg'] = $this->getJS_Config('nick_reg'); $this->_lists['nick_reg_rq'] = $this->getJS_Config('nick_reg_rq'); //Last Name registration $this->_lists['reg_lastname'] = $this->getJS_Config('reg_lastname'); $this->_lists['reg_lastname_rq'] = $this->getJS_Config('reg_lastname_rq'); $this->_lists["teams_season"] = $this->teamsToModer(); $this->_lists["panel"] = $this->getePanel($this->_lists["teams_season"], 0, 0, 1); //$this->_lists['seas_pl_reg'] = ""; // }
function getData() { if ($this->_user->get('guest')) { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); if (getVer() == '1.6') { $uopt = "com_users"; } else { $uopt = "com_user"; } $return = 'index.php?option=' . $uopt . '&view=login&return=' . $return_url; // Redirect to a login form $this->mainframe->redirect($return, JText::_('BLMESS_NOT_LOGIN')); } //title $tourn = $this->getTournOpt($this->s_id); $this->t_single = $tourn->t_single; $this->_params = $this->JS_PageTitle($tourn->name); $season_par = $this->getSParametrs($this->s_id); $this->_lists["season_par"] = $season_par; $reg_start = mktime(substr($season_par->reg_start, 11, 2), substr($season_par->reg_start, 14, 2), 0, substr($season_par->reg_start, 5, 2), substr($season_par->reg_start, 8, 2), substr($season_par->reg_start, 0, 4)); $reg_end = mktime(substr($season_par->reg_end, 11, 2), substr($season_par->reg_end, 14, 2), 0, substr($season_par->reg_end, 5, 2), substr($season_par->reg_end, 8, 2), substr($season_par->reg_end, 0, 4)); $unable_reg = 0; if ($this->t_single) { $query = "SELECT COUNT(*) FROM #__bl_players as t , #__bl_season_players as st WHERE st.player_id = t.id AND st.season_id = " . $this->s_id; } else { $query = "SELECT COUNT(*) FROM #__bl_teams as t , #__bl_season_teams as st WHERE st.team_id = t.id AND st.season_id = " . $this->s_id; } $this->db->setQuery($query); $part_count = $this->db->loadResult(); if ($season_par->s_reg && ($part_count < $season_par->s_participant || $season_par->s_participant == 0) && ($reg_start <= time() && (time() <= $reg_end || $season_par->reg_end == '0000-00-00 00:00:00'))) { $unable_reg = 1; } $this->_lists["part_count"] = $part_count; $this->_lists["unable_reg"] = $unable_reg; $this->getcaplist(); $this->_lists["teams_season"] = $this->teamsToModer(); $this->_lists["panel"] = $this->getePanel($this->_lists["teams_season"], 0, null, 0); }
function getData() { $this->getTeamReg(); //title $this->p_title = JText::_('BLFA_NTEAM'); //$this->_params = $this->JS_PageTitle(JText::_('BLFA_NTEAM')); $this->_params = $this->JS_PageTitle($this->title ? $this->title : $this->p_title); $team_reg = $this->getJS_Config('team_reg'); if (!$team_reg) { echo JText::_('BLFA_OPTDISAB'); exit; } //return if ($return = JRequest::getVar('return', '', 'method', 'base64')) { $return = $return; if (!JURI::isInternal($return)) { $return = ''; } } if ($this->_user->get('guest')) { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); if (getVer() >= '1.6') { $uopt = "com_users"; } else { $uopt = "com_user"; } $return = 'index.php?option=' . $uopt . '&view=login&return=' . $return_url; // Redirect to a login form $this->session->set('errMess', JText::_('BLMESS_NOT_LOGIN')); $this->session->set('typeMess', 3); $this->mainframe->redirect($return); } $this->_lists["return"] = $return; $this->getJSreg(); $this->_lists["teams_season"] = $this->teamsToModer(); $this->_lists["panel"] = $this->getePanel($this->_lists["teams_season"], 0, 0, 1); }
// Create a new 'checkcode' table which will include // id, checksum, and timestamp. $qq[] = "CREATE TABLE IF NOT EXISTS `" . T_CHECKCODE . "` (\n `id` int(10) unsigned NOT NULL auto_increment,\n `checksum` varchar(255) NOT NULL default '',\n `timestamp` timestamp(14) NOT NULL,\n PRIMARY KEY (`id`)\n ) TYPE=InnoDB;"; /** * Insert these new values to the config table. They are related to the * New image stuff introduced in 0.8 * to see if you have these updates installed or not, check if one of them * exists or not. * * edit: because the whole table arch has been changed, i think its easier to * just copy the relevent data, drop the table, and recreate it again... * * but let's add a check that will prevent this from being executed more than once * just incase a user refreshes.. otherwise he'll lose his configs. */ $res = getVer(); if ($res !== "0.8") { echo "Updating config table..."; // Step 1: copy everything from bb_config into an array. /** * @todo i will use this one later. $config_vals = array( 'blogname'=>'Blog name', 'blogdescription' => 'Blog description', 'username' => 'Username', 'password'=> 'Password', 'secondPassword' => 'Second password', 'secretQuestion' => 'Secret question', 'secretAnswer' => 'Secret answer', 'email' => $db->get_var("SELECT value FROM ".T_CONFIG." WHERE name='EMAIL'"),
function del_comment() { $c_id = JRequest::getVar('cid', 0, 'get', 'int'); $user =& JFactory::getUser(); $dend = false; $db =& JFactory::getDBO(); if (getVer() >= '1.6') { $query = "SELECT group_id FROM #__user_usergroup_map WHERE user_id=" . $user->id; $db->setQuery($query); if ($db->loadresult() == 8) { $dend = true; } $query = "SELECT user_id FROM `#__bl_comments` WHERE `id` = " . $c_id; $db->setQuery($query); if ($db->loadResult() == $user->id) { $dend = true; } } else { if ($user->gid == 25) { $dend = true; } } $query = "SELECT s_id FROM #__bl_matchday as md, #__bl_match as m,#__bl_comments as c WHERE c.match_id = m.id AND md.id=m.m_id AND c.id = '" . $c_id . "'"; $db->setQuery($query); $sid = $db->loadResult(); if ($sid) { $query = "SELECT COUNT(*) FROM #__users as u, #__bl_feadmins as f WHERE f.user_id = u.id AND f.season_id=" . $sid . " AND u.id = " . intval($user->id); $db->setQuery($query); if ($db->loadResult()) { $dend = true; } } if ($user->get('guest') || !$dend) { echo 'Denide'; return false; //return; } $query = "DELETE FROM #__bl_comments WHERE id = " . $c_id; $db->setQuery($query); $db->query(); exit; // Clean output in a dirty way. }
function getData() { if ($this->_user->get('guest')) { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); if (getVer() >= '1.6') { $uopt = "com_users"; } else { $uopt = "com_user"; } $return = 'index.php?option=' . $uopt . '&view=login&return=' . $return_url; // Redirect to a login form $this->mainframe->redirect($return, JText::_('BLMESS_NOT_LOGIN')); } //title $tourn = $this->getTournOpt($this->s_id); $this->t_single = $tourn->t_single; $this->_lists['bluid'] = $this->t_single ? $this->regBluid($this->_user->id) : 0; if ($this->pay) { //if(!$this->t_single && $this->reg_team){ // $this->savePayStatus($this->reg_team,$this->_user->id,$this->s_id); //}else{ $this->savePayStatus(0,$this->_user->id,$this->s_id);} $this->savePayStatus($this->reg_team, $this->_user->id, $this->s_id); } $this->_params = $this->JS_PageTitle($tourn->name); $season_par = $this->getSParametrs($this->s_id); $this->_lists["season_par"] = $season_par; $reg_start = mktime(substr($season_par->reg_start, 11, 2), substr($season_par->reg_start, 14, 2), 0, substr($season_par->reg_start, 5, 2), substr($season_par->reg_start, 8, 2), substr($season_par->reg_start, 0, 4)); $reg_end = mktime(substr($season_par->reg_end, 11, 2), substr($season_par->reg_end, 14, 2), 0, substr($season_par->reg_end, 5, 2), substr($season_par->reg_end, 8, 2), substr($season_par->reg_end, 0, 4)); $unable_reg = 0; if ($this->t_single) { $query = "SELECT COUNT(*) FROM #__bl_players as t , #__bl_season_players as st WHERE st.player_id = t.id AND st.season_id = " . $this->s_id; } else { $query = "SELECT COUNT(*) FROM #__bl_teams as t , #__bl_season_teams as st WHERE st.team_id = t.id AND st.season_id = " . $this->s_id; } $this->db->setQuery($query); $part_count = $this->db->loadResult(); $error = $this->db->getErrorMsg(); if ($error) { return JError::raiseError(500, $error); } if ($season_par->s_reg && ($part_count < $season_par->s_participant || $season_par->s_participant == 0) && ($reg_start <= time() && (time() <= $reg_end || $season_par->reg_end == '0000-00-00 00:00:00'))) { $unable_reg = 1; } $this->_lists["part_count"] = $part_count; $this->_lists["unable_reg"] = $unable_reg; $this->getcaplist(); $this->_lists["teams_season"] = $this->teamsToModer(); $this->_lists["panel"] = $this->getePanel($this->_lists["teams_season"], 0, null, 0); //payments $this->options = new StdClass(); $this->options->paypal_email = getJS_Config('paypal_acc'); $this->options->paypalcur_val = getJS_Config('pllist_order'); $this->options->paypalval_val = getJS_Config('paypalval_val'); $this->options->paypalvalleast_val = getJS_Config('paypalvalleast_val'); $this->options->paypal_org = getJS_Config('paypal_org'); $query = "SELECT is_pay FROM #__bl_seasons WHERE published='1' AND s_id = " . $this->s_id; $this->db->setQuery($query); $this->options->paypal_on = $this->db->loadResult(); //$this->options->paypal_on = getJS_Config('paypal_on'); }
function __construct($acl) { parent::__construct(); $mainframe = JFactory::getApplication(); $this->acl = $acl; $this->t_type = new stdClass(); // Get the pagination request variables $this->limit = $mainframe->getUserStateFromRequest('com_joomsport.pl_jslimit', 'jslimit', 20, 'int'); $this->limitstart = JRequest::getVar('page', 1, '', 'int'); $this->limitstart = intval($this->limitstart) > 1 ? $this->limitstart : 1; $this->season_id = $mainframe->getUserStateFromRequest('com_joomsport.sid', 'sid', 0, 'int'); if ($this->acl == 2) { $this->season_id = $this->mainframe->getUserStateFromRequest('com_joomsport.moderseason', 'moderseason', 0, 'int'); } if ($this->acl == 2) { $this->tid = JRequest::getVar('tid', 0, '', 'int'); $this->t_single = 0; $query = "SELECT CONCAT(tr.name,' ',s.s_name) as t_name,s.s_id as id FROM #__bl_season_teams as t,#__bl_seasons as s,#__bl_tournament as tr WHERE s.published=1 AND tr.id=s.t_id AND s.s_id=t.season_id AND t.team_id=" . $this->tid . " ORDER BY s.s_id desc"; $this->db->setQuery($query); $seass = $this->db->loadObjectList(); $error = $this->db->getErrorMsg(); if ($error) { return JError::raiseError(500, $error); } if (!$this->season_id) { $this->season_id = isset($seass[0]->id) ? $seass[0]->id : ''; } $isinseas = false; for ($j = 0; $j < count($seass); $j++) { if ($this->season_id == $seass[$j]->id) { $isinseas = true; } } if (!$isinseas && count($seass)) { $this->season_id = $seass[0]->id; } } $user = JFactory::getUser(); $this->_user = $user; if ($user->get('guest')) { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); if (getVer() >= '1.6') { $uopt = "com_users"; } else { $uopt = "com_user"; } $return = 'index.php?option=' . $uopt . '&view=login&return=' . $return_url; $this->mainframe->redirect($return, JText::_('BLMESS_NOT_LOGIN')); } if ($this->acl == 2) { $this->_lists['moder_addplayer'] = $this->getJS_Config('moder_addplayer'); $query = "SELECT COUNT(*) FROM #__bl_teams as t, #__bl_moders as m WHERE m.tid=t.id AND m.uid=" . $user->id . " AND t.id=" . $this->tid; $this->db->setQuery($query); if (!$this->db->loadResult() || !$this->_lists['moder_addplayer']) { JError::raiseError(403, JText::_('Access Forbidden')); return; } } elseif ($this->acl == 1) { if (!$this->season_id) { JError::raiseError(403, JText::_('Access Forbidden')); return; } } }
function matchInvite() { $mid = JRequest::getVar('mid', 0, '', 'int'); $tid = JRequest::getVar('tid', 0, '', 'int'); $do = JRequest::getVar('do', 'reject', '', 'string'); $key = JRequest::getVar('key', '', '', 'string'); if ($return = JRequest::getVar('return', '', 'method', 'base64')) { $return = $return; if (!JURI::isInternal($return)) { $return = ''; } } if ($this->_user->get('guest')) { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); if (getVer() >= '1.6') { $uopt = "com_users"; } else { $uopt = "com_user"; } $return = 'index.php?option=' . $uopt . '&view=login&return=' . $return_url; // Redirect to a login form $this->mainframe->redirect($return, JText::_('BLMESS_NOT_LOGIN')); } $Itemid = JRequest::getInt('Itemid'); $query = "Select * FROM #__bl_players WHERE usr_id=" . $this->_user->id; $this->db->setQuery($query); $usr = $this->db->loadObject(); if ($key != md5($usr->id)) { return $messaga; die; } if (!$usr || $usr->registered != '1') { $return_url = $_SERVER['REQUEST_URI']; $return_url = base64_encode($return_url); $return = 'index.php?option=com_joomsport&task=regplayer&Itemid=' . $Itemid . '&return=' . $return_url; $this->session->set('errMess', JText::_('BLMESS_FILL_PROFILE')); $this->session->set('typeMess', 3); $this->mainframe->redirect($return); } $messaga[0] = JText::_('BLFA_MESS_STWRONG'); $messaga[1] = 2; if ($mid && $this->getJS_Config("esport_invite_match")) { if ($do == "accept") { $query = "INSERT INTO #__bl_squard(match_id,team_id,player_id,mainsquard) VALUES({$mid},{$tid},{$usr->id},'1')"; $query .= " ON DUPLICATE KEY UPDATE accepted='1'"; $this->db->setQuery($query); $this->db->query(); $messaga[0] = JText::_("BLFA_INVITETOMATCHACCEPT"); $messaga[1] = 1; } else { $query = "DELETE FROM #__bl_squard WHERE match_id={$mid} AND team_id = {$tid} AND player_id = {$usr->id}"; $this->db->setQuery($query); $this->db->query(); $messaga[0] = JText::_("BLFA_INVITETOMATCHREJECT"); $messaga[1] = 3; } } return $messaga; }
} else { echo "<img src='" . JURI::base() . "components/com_joomsport/img/ico/season-list-player-ico.gif' width='30' height='30' alt='' />"; } ?> <div class="comments-box-inner" style=""> <span class="date" nowrap="nowrap"> <?php if ($this->lists["comments_adm"] || $this->lists["usera"]->id == $this->lists["comments"][$i]->user_id) { echo "<img src='" . JURI::base() . "components/com_joomsport/img/ico/close.png' width='15' border=0 style='cursor:pointer;' onClick='javascript:delCom(" . $this->lists["comments"][$i]->id . ");' />"; } ?> <?php jimport('joomla.utilities.date'); if (getVer() > '1.6') { $tz = new DateTimeZone(JFactory::getApplication()->getCfg('offset')); $jdate = new JDate($this->lists["comments"][$i]->date_time); $jdate->setTimezone($tz); } else { $jdate = new JDate($this->lists["comments"][$i]->date_time, JFactory::getApplication()->getCfg('offset')); } //$jdate = new JDate($this->lists["comments"][$i]->date_time,JFactory::getApplication()->getCfg('offset')); //$jdate->setTimezone($tz); echo $jdate->format('Y-m-d H:i:s', true, false); //echo $this->lists["comments"][$i]->date_time; ?> </span> <h4 class="nickname">