Exemplo n.º 1
0
 public function getMobileUrl($url)
 {
     global $cfg_basehost;
     $channel = array('lines', 'hotels', 'cars', 'raiders', 'spots', 'photos', 'visa', 'tuan');
     $arr = explode('/', $url);
     $pathinfo = array_slice($arr, -2, 2);
     //取最后两个数据
     if (in_array($pathinfo[0], $channel)) {
         if (empty($pathinfo[1])) {
             $item = $this->tables[$pathinfo[0]][1];
             $mobileurl = $GLOBALS['cfg_basehost'] . '/shouji/' . $item . '/';
         } else {
             if (Helper_Archive::strHasStr($pathinfo[1], 'show')) {
                 $ar = explode('_', str_replace('.html', '', $pathinfo[1]));
                 $aid = $ar[1];
                 //文章aid
                 $mobileurl = self::getMobileShowUrl($pathinfo[0], $aid);
             } else {
                 $mobileurl = $cfg_basehost . '/shouji/';
                 //首页
             }
         }
     } else {
         $mobileurl = $cfg_basehost . '/shouji/';
         //首页
     }
     return $mobileurl;
 }