本文整理汇总了PHP中query::url方法的典型用法代码示例。如果您正苦于以下问题:PHP query::url方法的具体用法?PHP query::url怎么用?PHP query::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类query
的用法示例。
在下文中一共展示了query::url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show () {
$url = preg_replace('/\?[^\/]+$/','', query::$get['path']);
query::$url = array_filter(explode('/', $url));
unset(query::$url[0]);
if (!query::$url[1]) {
query::$url[1] = 'index';
}
$output = 'output__'.query::$get['type'];
$output = new $output();
$data = array('main' => array());
switch (query::$get['type']) {
case 'video':
if (query::$get['num']) {
$size = sets::video('full');
} else {
$size = sets::video('thumb');
}
$data['main']['video'] =
$output->get_video(1, 'id='.query::$get['id'], $size);
$this->template = 'templates/main/video.php';
break;
case 'order':
$data['main'] =
$output->order_single(query::$get['id']);
$this->template = 'templates/main/order/single.php';
break;
case 'art':
$data['main']['art'] =
$output->get_art(1, 'id='.query::$get['id']);
$data['main']['art'][0]['rating'] =
$output->get_rating(query::$get['id']);
$data['main']['art'][0]['packs'] =
$output->get_packs(query::$get['id']);
$data['main']['art'][0]['pool'] =
$output->get_pools(query::$get['id']);
$this->template = 'templates/main/booru/single.php';
break;
default: die;
}
$data['main']['navi']['base'] = '/'.query::$get['type'].'/';
$this->postparse = '/<div[^>]*class="innerwrap[^"]*"[^>]*>.*<\/div><!-- wrapend -->/uis';
if (query::$get['num']) {
$data['main']['display']['comments'] = true;
} else {
$data['main']['display'] = array();
}
return $data;
}
示例2: explode
$url = explode('/', preg_replace('/\?[^\/]+$/', '', $request));
if (isset($url[0])) {
unset($url[0]);
}
if (empty($url[1])) {
$url[1] = 'index';
}
if (preg_match('/[^a-z\d_\_]/ui', $url[1])) {
include_once TEMPLATE_DIR.SL.'404'.SL.'fatal.php';
ob_end_flush();
exit();
}
query::$url = $url;
include_once ROOT_DIR.SL.'engine'.SL.'handle_old_urls.php';
if ($url[1] == 'confirm' || $url[1] == 'stop_emails') {
if ($url[1] == 'confirm') {
input__comment::subscribe_comments(
decrypt($url[2]),
$url[3],
$url[5] ? $url[4].'|'.$url[5] : ($url[4] == 'all' ? $url[4] : null),
($url[5] || $url[4] == 'all') ? null: $url[4]
);
} else {
input__comment::add_to_black_list(decrypt($url[2]));
}
$redirect = 'http://'.def::site('domain').'/'. (empty($url[3]) ?