Exemplo n.º 1
0
 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'] = ;
     */
 }
Exemplo n.º 2
0
 public function __construct($routeInfo = array(), $matches = array(), $queryString = '')
 {
     if (!empty($routeInfo)) {
         parent::__construct($routeInfo, $matches, $queryString);
     } else {
         $this->arguments = array('oldid' => '$oldid', 'pagenum' => '$pagenum');
     }
 }
Exemplo n.º 3
0
 protected function getNewRouteInfo()
 {
     // go to home page if path is exactly like prefix
     if (count($this->matches) == 1 and empty($this->queryParameters)) {
         $blogHomeChannelId = vB_Api::instance('blog')->getBlogChannel();
         $blogHomeChannel = vB_Library::instance('content_channel')->getBareContent($blogHomeChannelId);
         $blogHomeChannel = $blogHomeChannel[$blogHomeChannelId];
         return $blogHomeChannel['routeid'];
     }
     $this->oldcontenttypeid = vB_Api_ContentType::OLDTYPE_BLOGCHANNEL;
     return parent::getNewRouteInfo();
 }
Exemplo n.º 4
0
 protected function getNewRouteInfo()
 {
     $this->oldcontenttypeid = vB_Api_ContentType::OLDTYPE_BLOGSTARTER;
     return parent::getNewRouteInfo();
 }
Exemplo n.º 5
0
 protected function getNewRouteInfo()
 {
     $this->oldcontenttypeid = vB_Types::instance()->getContentTypeID(array('package' => 'vBForum', 'class' => 'Poll'));
     parent::getNewRouteInfo();
 }