public function __construct($routeInfo = array(), $matches = array(), $queryString = '', $anchor = '') { /* Depending on the friendliness setting, we can have four different url formats. Like: content.php?280-Accu-Sim-In-General/view/2 content.php?r=280-Accu-Sim-In-General/view/2 content.php/280-Accu-Sim-In-General/view/2 content/280-Accu-Sim-In-General/view/2 */ parent::__construct($routeInfo, $matches, $queryString, $anchor); if (!empty($queryString) and (empty($this->arguments['oldid']) or !is_numeric($this->arguments['oldid']) or empty($this->arguments['oldpage']) or !is_numeric($this->arguments['oldpage']))) { $queryMatches = array(); if (preg_match('#[^0-9]*(?P<oldid>[0-9]+)?(-)?(?P<urlident>[^%2F]*)?(%2Fview%2F)?(?P<oldpage>[0-9]+)?#i', $queryString, $queryMatches)) { if (!empty($queryMatches['oldid'])) { $this->arguments['oldid'] = $queryMatches['oldid']; } if (!empty($queryMatches['oldpage'])) { $this->arguments['contentpage'] = $queryMatches['oldpage']; } } } if (!empty($this->arguments['oldid']) and is_numeric($this->arguments['oldid'])) { $node = vB::getDbAssertor()->getRow('vBForum:node', array('oldid' => $this->arguments['oldid'], 'oldcontenttypeid' => array(vB_Api_ContentType::OLDTYPE_CMS_STATICPAGE, vB_Api_ContentType::OLDTYPE_CMS_ARTICLE))); if (!empty($node) and empty($node['errors'])) { $this->arguments['nodeid'] = $node['nodeid']; $this->arguments['contenttypeid'] = $node['contenttypeid']; $this->arguments['routeid'] = $node['routeid']; } } // I'm leaving this bit of comment here to remind ourselves that we need to actually ensure that articles have a meta description. // Meta Description /* $this->arguments['metadescription'] = ; */ }
public function __construct($routeInfo = array(), $matches = array(), $queryString = '') { if (!empty($routeInfo)) { parent::__construct($routeInfo, $matches, $queryString); } else { $this->arguments = array('oldid' => '$oldid', 'pagenum' => '$pagenum'); } }