// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise. // You can get copies of the licenses here: // http://www.affero.org/oagpl.html // AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING". include('config.php'); include(mnminclude.'html1.php'); mobile_redirect(); array_push($globals['cache-control'], 'max-age=3'); if (!isset($_REQUEST['id']) && !empty($_SERVER['PATH_INFO'])) { $url_args = preg_split('/\/+/', $_SERVER['PATH_INFO']); array_shift($url_args); // The first element is always a "/" // If the first argument are only numbers, redirect to the story with that id if (is_numeric($url_args[0]) && $url_args[0] > 0) { $link = Link::from_db(intval($url_args[0])); if ($link) { header('Location: ' . $link->get_permalink()); die; } }
<?php /* * IPアクセス制限 $IP = $_SERVER['REMOTE_ADDR']; $from = strcmp($IP,'192.168.0.0'); * $to = strcmp($IP,'192.168.0.255'); if (!($from >= 0 && $to <= 0)) echo * "Access Denied"; else */ $url = mobile_redirect(); if (false !== $url) { header('Location: ' . $url); exit; } function mobile_redirect() { // 切り替え用URLです。falseにすれば対象を除外できます。 $docomo = 'http://www.pregosystem.biz/smp/login.php'; // ドコモ $au = 'http://www.pregosystem.biz/smp/login.php'; // au $sb = 'http://www.pregosystem.biz/smp/login.php'; // SoftBank $sp = 'http://www.pregosystem.biz/smp/login.php'; // スマートフォン $em = 'http://www.pregosystem.biz/smp/login.php'; // $willcom = 'http://www.pregosystem.biz/smp/login.php'; // $mobile = false; // モバイル端末 $ua = $_SERVER['HTTP_USER_AGENT']; // ドコモ