/com_joomleague/components/com_joomleague/helpers/route.php

https://gitlab.com/julienv/joomleague · PHP · 802 lines · 608 code · 136 blank · 58 comment · 76 complexity · 4ab3754d3c2503e585c1ccf0bc537e59 MD5 · raw file

  1. <?php
  2. /**
  3. * @copyright Copyright (C) 2006-2014 joomleague.at. All rights reserved.
  4. * @license GNU/GPL,see LICENSE.php
  5. * Joomla! is free software. This version may have been modified pursuant
  6. * to the GNU General Public License,and as distributed it includes or
  7. * is derivative of works licensed under the GNU General Public License or
  8. * other free or open source software licenses.
  9. * See COPYRIGHT.php for copyright notices and details.
  10. */
  11. // Check to ensure this file is included in Joomla!
  12. defined('_JEXEC') or die('Restricted access');
  13. // Component Helper
  14. jimport('joomla.application.component.helper');
  15. /**
  16. *
  17. */
  18. class JoomleagueHelperRoute
  19. {
  20. public static function getTeamInfoRoute( $projectid, $teamid )
  21. {
  22. $params = array( "option" => "com_joomleague",
  23. "view" => "teaminfo",
  24. "p" => $projectid,
  25. "tid" => $teamid );
  26. $query = JoomleagueHelperRoute::buildQuery( $params );
  27. $link = JRoute::_( 'index.php?' . $query, false );
  28. return $link;
  29. }
  30. public static function getProjectTeamInfoRoute( $projectid, $projectteamid, $task=null )
  31. {
  32. $params = array( "option" => "com_joomleague",
  33. "view" => "teaminfo",
  34. "p" => $projectid,
  35. "ptid" => $projectteamid );
  36. if ( ! is_null( $task ) ) {
  37. unset($params["p"]);
  38. unset($params["ptid"]);
  39. $params["pid[]"] = $projectid;
  40. $params["cid[]"] = $projectteamid;
  41. $params["task"] = $task;
  42. $params["view"] = 'projectteam';
  43. $params["hidemainmenu"] = '1';
  44. $query = JoomleagueHelperRoute::buildQuery( $params );
  45. $link = JRoute::_( "administrator/index.php?" . $query, false );
  46. } else {
  47. $query = JoomleagueHelperRoute::buildQuery( $params );
  48. $link = JRoute::_( "index.php?" . $query, false );
  49. }
  50. return $link;
  51. }
  52. public static function getRivalsRoute( $projectid, $teamid )
  53. {
  54. $params = array( "option" => "com_joomleague",
  55. "view" => "rivals",
  56. "p" => $projectid,
  57. "tid" => $teamid );
  58. $query = JoomleagueHelperRoute::buildQuery( $params );
  59. $link = JRoute::_( 'index.php?' . $query, false );
  60. return $link;
  61. }
  62. public static function getClubInfoRoute( $projectid, $clubid, $task=null )
  63. {
  64. $params = array( "option" => "com_joomleague",
  65. "view" => "clubinfo",
  66. "p" => $projectid,
  67. "cid" => $clubid );
  68. if ( ! is_null( $task ) ) {
  69. unset($params["p"]);
  70. unset($params["cid"]);
  71. unset($params["view"]);
  72. $params["pid[]"] = $projectid;
  73. $params["cid[]"] = $clubid;
  74. $params["task"] = $task;
  75. $params["hidemainmenu"] = '1';
  76. $query = JoomleagueHelperRoute::buildQuery( $params );
  77. $link = JRoute::_( "administrator/index.php?" . $query, false );
  78. } else {
  79. $query = JoomleagueHelperRoute::buildQuery( $params );
  80. $link = JRoute::_( "index.php?" . $query, false );
  81. }
  82. return $link;
  83. }
  84. public static function getClubPlanRoute( $projectid, $clubid, $task=null )
  85. {
  86. $params = array( "option" => "com_joomleague",
  87. "view" => "clubplan",
  88. "p" => $projectid,
  89. "cid" => $clubid );
  90. if ( ! is_null( $task ) ) { $params["task"] = $task; }
  91. $query = JoomleagueHelperRoute::buildQuery( $params );
  92. $link = JRoute::_( "index.php?" . $query, false );
  93. return $link;
  94. }
  95. public static function getPlaygroundRoute( $projectid, $playgroundid )
  96. {
  97. $params = array( "option" => "com_joomleague",
  98. "view" => "playground",
  99. "p" => $projectid,
  100. "pgid" => $playgroundid );
  101. $query = JoomleagueHelperRoute::buildQuery( $params );
  102. $link = JRoute::_( 'index.php?' . $query, false );
  103. return $link;
  104. }
  105. /**
  106. *
  107. * @param int $projectid
  108. * @param int $round
  109. * @param int $from
  110. * @param int $to
  111. * @param int $type
  112. */
  113. public static function getRankingRoute( $projectid, $round=0, $from=0, $to=0, $type=0, $division=0 )
  114. {
  115. $params = array( "option" => "com_joomleague",
  116. "view" => "ranking",
  117. "p" => $projectid );
  118. $params["type"] = $type;
  119. $params["r"] = $round;
  120. $params["from"] = $from;
  121. $params["to"] = $to;
  122. $params["division"] = $division;
  123. $query = JoomleagueHelperRoute::buildQuery( $params );
  124. $link = JRoute::_( 'index.php?' . $query, false );
  125. return $link;
  126. }
  127. public static function getResultsRoute($projectid, $roundid=0, $divisionid=0, $mode=0, $order=0, $task=null)
  128. {
  129. $params = array( 'option' => 'com_joomleague',
  130. 'view' => 'results',
  131. 'p' => $projectid );
  132. if ( ! is_null( $task ) ) {
  133. unset($params["p"]);
  134. $params["view"] = 'matches';
  135. $params["pid[]"] = $projectid;
  136. $params["rid[]"] = $roundid;
  137. $params["task"] = $task;
  138. $params['division'] = $divisionid;
  139. $params["hidemainmenu"] = '1';
  140. $query = JoomleagueHelperRoute::buildQuery( $params );
  141. $link = JRoute::_( "administrator/index.php?" . $query, false );
  142. } else {
  143. $params['r'] = $roundid;
  144. $params['division'] = $divisionid;
  145. $params['mode'] = $mode;
  146. $params['order'] = $order;
  147. $query = JoomleagueHelperRoute::buildQuery( $params );
  148. $link = JRoute::_( "index.php?" . $query, false );
  149. }
  150. return $link;
  151. }
  152. public static function getMatrixRoute( $projectid, $division=0, $round=0 )
  153. {
  154. $params = array( "option" => "com_joomleague",
  155. "view" => "matrix",
  156. "p" => $projectid );
  157. $params["division"] = $division;
  158. $params["r"] = $round;
  159. $query = JoomleagueHelperRoute::buildQuery( $params );
  160. $link = JRoute::_( 'index.php?' . $query, false );
  161. return $link;
  162. }
  163. public static function getResultsRankingRoute( $projectid, $round=null, $division=0 )
  164. {
  165. $params = array( "option" => "com_joomleague",
  166. "view" => "resultsranking",
  167. "p" => $projectid );
  168. if ( ! is_null( $round ) ) { $params["r"] = $round; }
  169. $params["division"] = $division;
  170. $query = JoomleagueHelperRoute::buildQuery( $params );
  171. $link = JRoute::_( 'index.php?' . $query, false );
  172. return $link;
  173. }
  174. public static function getResultsMatrixRoute( $projectid, $round=null, $division=0 )
  175. {
  176. $params = array( "option" => "com_joomleague",
  177. "view" => "resultsmatrix",
  178. "p" => $projectid );
  179. if ( ! is_null( $round ) ) { $params["r"] = $round; }
  180. $params["division"] = $division;
  181. $query = JoomleagueHelperRoute::buildQuery( $params );
  182. $link = JRoute::_( 'index.php?' . $query, false );
  183. return $link;
  184. }
  185. public static function getRankingMatrixRoute( $projectid, $round=null, $division=0 )
  186. {
  187. $params = array( "option" => "com_joomleague",
  188. "view" => "rankingmatrix",
  189. "p" => $projectid );
  190. if ( ! is_null( $round ) ) { $params["r"] = $round; }
  191. $params["division"] = $division;
  192. $query = JoomleagueHelperRoute::buildQuery( $params );
  193. $link = JRoute::_( 'index.php?' . $query, false );
  194. return $link;
  195. }
  196. public static function getResultsRankingMatrixRoute( $projectid, $round=null, $division=0 )
  197. {
  198. $params = array( "option" => "com_joomleague",
  199. "view" => "resultsrankingmatrix",
  200. "p" => $projectid );
  201. if ( ! is_null( $round ) ) { $params["r"] = $round; }
  202. $params["division"] = $division;
  203. $query = JoomleagueHelperRoute::buildQuery( $params );
  204. $link = JRoute::_( 'index.php?' . $query, false );
  205. return $link;
  206. }
  207. public static function getTeamPlanRoute( $projectid, $teamid, $division=0, $mode=null )
  208. {
  209. $params = array( "option" => "com_joomleague",
  210. "view" => "teamplan",
  211. "p" => $projectid,
  212. "tid" => $teamid,
  213. "division" => $division );
  214. if ( ! is_null( $mode ) ) { $params["mode"] = $mode; }
  215. $query = JoomleagueHelperRoute::buildQuery( $params );
  216. $link = JRoute::_( "index.php?" . $query, false );
  217. return $link;
  218. }
  219. public static function getMatchReportRoute( $projectid, $matchid = null )
  220. {
  221. $params = array( "option" => "com_joomleague",
  222. "view" => "matchreport",
  223. "p" => $projectid );
  224. if ( ! is_null( $matchid ) ) { $params["mid"] = $matchid; }
  225. $query = JoomleagueHelperRoute::buildQuery( $params );
  226. $link = JRoute::_( 'index.php?' . $query, false );
  227. return $link;
  228. }
  229. /**
  230. * return links to a team player
  231. * @param int projectid
  232. * @param int teamid
  233. * @param int personid
  234. * @param string task
  235. * @return url
  236. */
  237. public static function getPlayerRoute($projectid, $teamid, $personid, $task=null)
  238. {
  239. $params = array( "option" => "com_joomleague",
  240. "view" => "player",
  241. "p" => $projectid,
  242. "tid" => $teamid,
  243. "pid" => $personid );
  244. if(!is_null($task)) {
  245. unset($params["p"]);
  246. unset($params["tid"]);
  247. $params["pid[]"] = $projectid;
  248. $params["cid[]"] = $personid;
  249. $params["view"] = 'person';
  250. $params["task"] = $task;
  251. $params["hidemainmenu"] = 1;
  252. $query = JoomleagueHelperRoute::buildQuery( $params );
  253. $link = JRoute::_( "administrator/index.php?" . $query, false );
  254. } else {
  255. $query = JoomleagueHelperRoute::buildQuery( $params );
  256. $link = JRoute::_( "index.php?" . $query, false );
  257. }
  258. return $link;
  259. }
  260. /**
  261. * return links to a team staff
  262. * @param int projectid
  263. * @param int teamid
  264. * @param int personid
  265. * @return url
  266. */
  267. public static function getStaffRoute( $projectid, $teamid, $personid, $task=null )
  268. {
  269. $params = array( "option" => "com_joomleague",
  270. "view" => "staff",
  271. "p" => $projectid,
  272. "tid" => $teamid,
  273. "pid" => $personid );
  274. if(!is_null($task)) {
  275. unset($params["p"]);
  276. unset($params["tid"]);
  277. unset($params["pid"]);
  278. $params["pid[]"] = $projectid;
  279. $params["team"] = $teamid;
  280. $params["cid[]"] = $personid;
  281. $params["view"] = 'teamstaff';
  282. $params["task"] = $task;
  283. $params["hidemainmenu"] = 1;
  284. $query = JoomleagueHelperRoute::buildQuery( $params );
  285. $link = JRoute::_( "administrator/index.php?" . $query, false );
  286. } else {
  287. $query = JoomleagueHelperRoute::buildQuery( $params );
  288. $link = JRoute::_( "index.php?" . $query, false );
  289. }
  290. return $link;
  291. }
  292. /**
  293. * returns url to a person
  294. * @param int project id
  295. * @param int person id
  296. * @param int Type: 1 for player, 2 for staff, 3 for referee
  297. * @deprecated since 1.5
  298. * @return url
  299. */
  300. public static function getPersonRoute( $projectid, $personid, $showType )
  301. {
  302. $params = array( "option" => "com_joomleague",
  303. "view" => "person",
  304. "p" => $projectid,
  305. "pid" => $personid,
  306. "pt" => $showType );
  307. $query = JoomleagueHelperRoute::buildQuery( $params );
  308. $link = JRoute::_( 'index.php?' . $query, false );
  309. return $link;
  310. }
  311. public static function getPlayersRoute( $projectid, $teamid, $task=null, $divisionid=0, $project_team_id='')
  312. {
  313. $params = array( "option" => "com_joomleague",
  314. "view" => "roster",
  315. "p" => $projectid,
  316. "tid" => $teamid,
  317. "division" => $divisionid,
  318. );
  319. if(!is_null($task)) {
  320. unset($params["p"]);
  321. unset($params["tid"]);
  322. unset($params["division"]);
  323. $params["pid[]"] = $projectid;
  324. $params["team_id"] = $teamid;
  325. $params["project_team_id"] = $project_team_id;
  326. $params["view"] = 'projectteams';
  327. $params["task"] = $task;
  328. $params["hidemainmenu"] = 1;
  329. $query = JoomleagueHelperRoute::buildQuery( $params );
  330. $link = JRoute::_( "administrator/index.php?" . $query, false );
  331. } else {
  332. $query = JoomleagueHelperRoute::buildQuery( $params );
  333. $link = JRoute::_( "index.php?" . $query, false );
  334. }
  335. return $link;
  336. }
  337. public static function getDivisionsRoute( $projectid, $divisionid, $task=null )
  338. {
  339. $params = array( "option" => "com_joomleague",
  340. "view" => "treeone",
  341. "p" => $projectid,
  342. "division" => $divisionid );
  343. $query = JoomleagueHelperRoute::buildQuery( $params );
  344. $link = JRoute::_( 'index.php?' . $query, false );
  345. return $link;
  346. }
  347. public static function getFavPlayersRoute( $projectid )
  348. {
  349. $params = array( "option" => "com_joomleague",
  350. "view" => "players",
  351. "task" => "favplayers",
  352. "p" => $projectid );
  353. $query = JoomleagueHelperRoute::buildQuery( $params );
  354. $link = JRoute::_( 'index.php?' . $query, false );
  355. return $link;
  356. }
  357. public static function getRefereeRoute( $projectid, $personid, $task=null )
  358. {
  359. $params = array( "option" => "com_joomleague",
  360. "view" => "referee",
  361. "p" => $projectid,
  362. "pid" => $personid );
  363. if ( ! is_null( $task ) ) {
  364. unset($params['pid']);
  365. unset($params['p']);
  366. $params["pid[]"] = $projectid;
  367. $params["cid[]"] = $personid;
  368. $params["task"] = $task;
  369. $params["view"] = 'projectreferee';
  370. $params["hidemainmenu"] = 1;
  371. $query = JoomleagueHelperRoute::buildQuery( $params );
  372. $link = JRoute::_( "administrator/index.php?" . $query, false );
  373. } else {
  374. $query = JoomleagueHelperRoute::buildQuery( $params );
  375. $link = JRoute::_( "index.php?" . $query, false );
  376. }
  377. return $link;
  378. }
  379. public static function getRefereesRoute( $projectid )
  380. {
  381. $params = array( "option" => "com_joomleague",
  382. "view" => "referees",
  383. "p" => $projectid );
  384. $query = JoomleagueHelperRoute::buildQuery( $params );
  385. $link = JRoute::_( 'index.php?' . $query, false );
  386. return $link;
  387. }
  388. public static function getEventsRankingRoute( $projectid, $divisionid=0, $teamid=0, $eventid=0, $matchid=0)
  389. {
  390. $params = array( "option" => "com_joomleague",
  391. "view" => "eventsranking",
  392. "p" => $projectid );
  393. $params["division"] = $divisionid;
  394. $params["tid"] = $teamid;
  395. $params["evid"] = $eventid;
  396. $params["mid"] = $matchid;
  397. $query = JoomleagueHelperRoute::buildQuery( $params );
  398. $link = JRoute::_( 'index.php?' . $query, false );
  399. return $link;
  400. }
  401. public static function getCurveRoute($projectid, $teamid1=0, $teamid2=0, $division=0)
  402. {
  403. $params = array( "option" => "com_joomleague",
  404. "view" => "curve",
  405. "p" => $projectid );
  406. $params["tid1"] = $teamid1;
  407. $params["tid2"] = $teamid2;
  408. $params["division"] = $division;
  409. $query = JoomleagueHelperRoute::buildQuery( $params );
  410. $link = JRoute::_( 'index.php?' . $query, false );
  411. return $link;
  412. }
  413. public static function getStatsChartDataRoute( $projectid, $division=0 )
  414. {
  415. $params = array( "option" => "com_joomleague",
  416. "view" => "stats",
  417. "layout" => "chartdata",
  418. "p" => $projectid );
  419. $params["division"] = $division;
  420. $query = JoomleagueHelperRoute::buildQuery( $params );
  421. $link = JRoute::_( 'index.php?' . $query, false );
  422. return $link;
  423. }
  424. public static function getTeamStatsChartDataRoute( $projectid, $teamid )
  425. {
  426. $params = array( "option" => "com_joomleague",
  427. "view" => "teamstats",
  428. "layout" => "chartdata",
  429. "p" => $projectid,
  430. "tid" => $teamid );
  431. $query = JoomleagueHelperRoute::buildQuery( $params );
  432. $link = JRoute::_( 'index.php?' . $query, false );
  433. return $link;
  434. }
  435. public static function getStatsRoute( $projectid, $division = 0 )
  436. {
  437. $params = array( "option" => "com_joomleague",
  438. "view" => "stats",
  439. "p" => $projectid );
  440. $params["division"] = $division;
  441. $query = JoomleagueHelperRoute::buildQuery( $params );
  442. $link = JRoute::_( 'index.php?' . $query, false );
  443. return $link;
  444. }
  445. public static function getBracketsRoute( $projectid )
  446. {
  447. $params = array( "option" => "com_joomleague",
  448. "view" => "treetonode",
  449. "p" => $projectid );
  450. $query = JoomleagueHelperRoute::buildQuery( $params );
  451. $link = JRoute::_( 'index.php?' . $query, false );
  452. return $link;
  453. }
  454. public static function getStatsRankingRoute( $projectid, $divisionid = null, $teamid = null, $statid = 0, $order = null )
  455. {
  456. $params = array( "option" => "com_joomleague",
  457. "view" => "statsranking",
  458. "p" => $projectid );
  459. if ( isset( $divisionid ) ) { $params["division"] = $divisionid; }
  460. if ( isset( $teamid ) ) { $params["tid"] = $teamid; }
  461. if ($statid) { $params['sid'] = $statid; }
  462. if (strcasecmp($order, 'asc') === 0 || strcasecmp($order, 'desc') === 0) { $params['order'] = strtolower($order); }
  463. $query = JoomleagueHelperRoute::buildQuery( $params );
  464. $link = JRoute::_( 'index.php?' . $query, false );
  465. return $link;
  466. }
  467. public static function getClubsRoute( $projectid, $divisionid = null )
  468. {
  469. $params = array( "option" => "com_joomleague",
  470. "view" => "clubs",
  471. "p" => $projectid );
  472. if ( isset( $divisionid ) ) { $params["division"] = $divisionid; }
  473. $query = JoomleagueHelperRoute::buildQuery( $params );
  474. $link = JRoute::_( 'index.php?' . $query, false );
  475. return $link;
  476. }
  477. public static function getTeamsRoute( $projectid, $divisionid = null )
  478. {
  479. $params = array( "option" => "com_joomleague",
  480. "view" => "teams",
  481. "p" => $projectid );
  482. if ( isset( $divisionid ) ) { $params["division"] = $divisionid; }
  483. $query = JoomleagueHelperRoute::buildQuery( $params );
  484. $link = JRoute::_( 'index.php?' . $query, false );
  485. return $link;
  486. }
  487. public static function getTeamStatsRoute( $projectid, $teamid )
  488. {
  489. $params = array( "option" => "com_joomleague",
  490. "view" => "teamstats",
  491. "p" => $projectid,
  492. "tid" => $teamid );
  493. $query = JoomleagueHelperRoute::buildQuery( $params );
  494. $link = JRoute::_( "index.php?" . $query, false );
  495. return $link;
  496. }
  497. public static function getTeamStaffRoute( $projectid, $playerid, $showType )
  498. {
  499. $params = array( "option" => "com_joomleague",
  500. "view" => "person",
  501. "p" => $projectid,
  502. "pid" => $playerid,
  503. "pt" => $showType );
  504. $query = JoomleagueHelperRoute::buildQuery( $params );
  505. $link = JRoute::_( 'index.php?' . $query, false );
  506. return $link;
  507. }
  508. public static function getNextMatchRoute( $projectid, $matchid )
  509. {
  510. $params = array( "option" => "com_joomleague",
  511. "view" => "nextmatch",
  512. "p" => $projectid,
  513. "mid" => $matchid );
  514. $query = JoomleagueHelperRoute::buildQuery( $params );
  515. $link = JRoute::_( 'index.php?' . $query, false );
  516. return $link;
  517. }
  518. public static function getContactRoute( $contactid )
  519. {
  520. $params = array( "option" => "com_contact",
  521. "view" => "contact",
  522. "id" => $contactid );
  523. $query = JoomleagueHelperRoute::buildQuery( $params );
  524. $link = JRoute::_( 'index.php?' . $query, false );
  525. return $link;
  526. }
  527. public static function getUserProfileRouteCBE( $u_id, $p_id, $pl_id )
  528. {
  529. // Old Route to Community Builder User Page with support for CBE-JoomLeague Tab
  530. // index.php?option=com_cbe&view=userProfile&user=JOOMLA_USER_ID&jlp=PROJECT_ID&jlpid=JOOMLEAGUE_PLAYER_ID
  531. $params = array( "option" => "com_cbe",
  532. "view" => "userProfile",
  533. "user" => $u_id,
  534. "jlp" => $p_id,
  535. "jlpid" => $pl_id );
  536. $query = JoomleagueHelperRoute::buildQuery( $params );
  537. $link = JRoute::_( 'index.php?' . $query, false );
  538. return $link;
  539. }
  540. public static function getUserProfileRoute( $userid )
  541. {
  542. $params = array( "option" => "com_comprofiler",
  543. "task" => "userProfile",
  544. "user" => $userid );
  545. $query = JoomleagueHelperRoute::buildQuery( $params );
  546. $link = JRoute::_( 'index.php?' . $query, false );
  547. return $link;
  548. }
  549. public static function getIcalRoute( $projectid, $teamid=null, $pgid=null )
  550. {
  551. $params = array( "option" => "com_joomleague",
  552. "view" => "ical",
  553. "p" => $projectid );
  554. if ( !is_null( $pgid ) ) { $params["pgid"] = $pgid; }
  555. if ( !is_null( $teamid ) ) { $params["teamid"] = $teamid; }
  556. $query = JoomleagueHelperRoute::buildQuery( $params );
  557. $link = JRoute::_( "index.php?" . $query, false );
  558. return $link;
  559. }
  560. public static function buildQuery($parts)
  561. {
  562. if ($item = JoomleagueHelperRoute::_findItem($parts))
  563. {
  564. $parts['Itemid'] = $item->id;
  565. }
  566. else {
  567. $params = JComponentHelper::getParams('com_joomleague');
  568. if ($params->get('default_itemid')) {
  569. $parts['Itemid'] = intval($params->get('default_itemid'));
  570. }
  571. }
  572. return JUri::buildQuery( $parts );
  573. }
  574. /**
  575. * Determines the Itemid
  576. *
  577. * searches if a menuitem for this item exists
  578. * if not the first match will be returned
  579. *
  580. * @param array The id and view
  581. * @since 0.9
  582. *
  583. * @return int Itemid
  584. */
  585. public static function _findItem($query)
  586. {
  587. $component = JComponentHelper::getComponent('com_joomleague');
  588. $site = new JSite();
  589. $menus = $site->getMenu();
  590. $items = $menus->getItems('component', $component->id);
  591. $user = JFactory::getUser();
  592. $access = (int)$user->get('aid');
  593. if ($items) {
  594. foreach($items as $item)
  595. {
  596. if ((@$item->query['view'] == $query['view']) && ($item->published == 1) && ($item->access <= $access)) {
  597. switch ($query['view'])
  598. {
  599. case 'teaminfo':
  600. case 'roster':
  601. case 'teamplan':
  602. case 'teamstats':
  603. if ((int)@$item->query['p'] == (int) $query['p'] && (int)@$item->query['tid'] == (int) $query['tid']) {
  604. return $item;
  605. }
  606. break;
  607. case 'clubinfo':
  608. case 'clubplan':
  609. if ((int)@$item->query['p'] == (int) $query['p'] && (int)@$item->query['cid'] == (int) $query['cid']) {
  610. return $item;
  611. }
  612. break;
  613. case 'nextmatch':
  614. if ((int)@$item->query['p'] == (int) $query['p']
  615. && (int)@$item->query['tid'] == (int) $query['tid']
  616. && (int)@$item->query['mid'] == (int) $query['mid']) {
  617. return $item;
  618. }
  619. break;
  620. case 'playground':
  621. if ((int)@$item->query['p'] == (int) $query['p'] && (int)@$item->query['pgid'] == (int) $query['pgid']) {
  622. return $item;
  623. }
  624. break;
  625. case 'ranking':
  626. case 'results':
  627. case 'resultsranking':
  628. case 'matrix':
  629. case 'resultsmatrix':
  630. case 'stats':
  631. if ((int)@$item->query['p'] == (int) $query['p']) {
  632. return $item;
  633. }
  634. break;
  635. case 'statsranking':
  636. if ((int)@$item->query['p'] == (int) $query['p']) {
  637. return $item;
  638. }
  639. break;
  640. case 'player':
  641. case 'staff':
  642. if ( (int)@$item->query['p'] == (int) $query['p']
  643. && (int)@$item->query['tid'] == (int) $query['tid']
  644. && (int)@$item->query['pid'] == (int) $query['pid']) {
  645. return $item;
  646. }
  647. break;
  648. case 'referee':
  649. if ( (int)@$item->query['p'] == (int) $query['p']
  650. && (int)@$item->query['pid'] == (int) $query['pid']) {
  651. return $item;
  652. }
  653. break;
  654. case 'tree':
  655. if ((int)@$item->query['p'] == (int) $query['p'] && (int)@$item->query['division'] == (int) $query['division']) {
  656. return $item;
  657. }
  658. break;
  659. }
  660. }
  661. }
  662. }
  663. return false;
  664. }
  665. }
  666. ?>