reasonableframework/route/mobileswitcher.php

41 lines
919 B
PHP
Raw Normal View History

2019-04-28 17:47:15 +00:00
<?php
2019-04-28 18:43:13 +00:00
/**
* @file mobileswitcher.php
* @date 2019-04-29
* @author Go Namhyeon <gnh1201@gmail.com>
* @brief mobile device switcher
*/
2019-04-28 17:47:15 +00:00
loadHelper("mobiletool");
2019-05-03 00:08:17 +00:00
loadHelper("networktool");
2019-04-28 17:47:15 +00:00
2019-04-28 18:43:13 +00:00
$do = get_requested_value("do");
2019-04-28 17:47:15 +00:00
$from = get_requested_value("from");
$redirect_url = get_requested_value("redirect_url");
$dm = detect_mobile();
2019-05-03 00:08:17 +00:00
$ne = get_network_event();
2019-04-28 17:47:15 +00:00
if($from == "pc") {
$dm = 1;
} elseif($from == "mobile") {
$dm = 0;
}
$data = array(
2019-04-28 18:43:13 +00:00
"action" => $action,
2019-04-28 17:47:15 +00:00
"from" => $from,
"dm" => $dm,
"redirect_url" => get_final_link($redirect_url, array(
"action" => "mobileswitcher",
"dm" => $dm,
2019-04-28 18:43:13 +00:00
"do" => $do,
"redirect_url" => get_final_link($redirect_url, array(
"action" => "mobileswitcher",
"dm" => $dm,
), false),
2019-04-28 17:47:15 +00:00
)),
2019-05-03 00:08:17 +00:00
"ua" => get_hashed_text($ne['agent'], "base64"),
2019-04-28 17:47:15 +00:00
);
renderView("view_mobileswitcher", $data);