ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 6687


Ignore:
Timestamp:
Apr 21, 2008, 7:34:00 PM (12 years ago)
Author:
ebihara
Message:

#2271:SNS内小窓の機構を追加

Location:
OpenPNE/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/lib/smarty_plugins/modifier.t_url2cmd.php

    r6527 r6687  
    2323    $url = str_replace('&', '&', $matches[0]);
    2424    $cmd = $matches[1];
     25
     26    $openpne_url_matches = array();
     27    $parts = parse_url(OPENPNE_URL);
     28    $openpne_url = $parts['host'] . $parts['path'];
     29    $url_pattern = sprintf('/^(https?:\/\/%s)(?:index.php)?\?m=(\w+)&a=(\w+)((?:[a-zA-Z0-9_=]|&)*)$/', preg_quote($openpne_url, '/'));
     30
     31    // SNS内を指すURLの場合は cmd/openpne ディレクトリ以下の小窓を読み込む
     32    if (preg_match($url_pattern, $url, $openpne_url_matches)) {
     33        $module = $openpne_url_matches[2];
     34        $action = $openpne_url_matches[3];
     35        $cmd = 'openpne/' . $module . '_' . $action;
     36    }
    2537
    2638    $file = $cmd . '.js';
Note: See TracChangeset for help on using the changeset viewer.