本文整理匯總了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]) ?