Beispiel #1
0
	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;
	}
Beispiel #2
0
$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]) ?