亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? search.php

?? 這是php編的論壇的原代碼
?? PHP
?? 第 1 頁 / 共 3 頁
字號:
<?php
/***************************************************************************
 *                                search.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: search.php,v 1.1.1.1 2003/02/11 22:27:28 wei.gao Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_SEARCH);
init_userprefs($userdata);
//
// End session management
//

//
// Define initial vars
//
if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
	$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
else
{
	$mode = '';
}

if ( isset($HTTP_POST_VARS['search_keywords']) || isset($HTTP_GET_VARS['search_keywords']) )
{
	$search_keywords = ( isset($HTTP_POST_VARS['search_keywords']) ) ? $HTTP_POST_VARS['search_keywords'] : $HTTP_GET_VARS['search_keywords'];
}
else
{
	$search_keywords = '';
}

if ( isset($HTTP_POST_VARS['search_author']) || isset($HTTP_GET_VARS['search_author']))
{
	$search_author = ( isset($HTTP_POST_VARS['search_author']) ) ? $HTTP_POST_VARS['search_author'] : $HTTP_GET_VARS['search_author'];
}
else
{
	$search_author = '';
}

$search_id = ( isset($HTTP_GET_VARS['search_id']) ) ? $HTTP_GET_VARS['search_id'] : '';

$show_results = ( isset($HTTP_POST_VARS['show_results']) ) ? $HTTP_POST_VARS['show_results'] : 'posts';

if ( isset($HTTP_POST_VARS['search_terms']) )
{
	$search_terms = ( $HTTP_POST_VARS['search_terms'] == 'all' ) ? 1 : 0;
}
else
{
	$search_terms = 0;
}

if ( isset($HTTP_POST_VARS['search_fields']) )
{
	$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : 0;
}
else
{
	$search_fields = 0;
}

$return_chars = ( isset($HTTP_POST_VARS['return_chars']) ) ? intval($HTTP_POST_VARS['return_chars']) : 200;

$search_cat = ( isset($HTTP_POST_VARS['search_cat']) ) ? intval($HTTP_POST_VARS['search_cat']) : -1;
$search_forum = ( isset($HTTP_POST_VARS['search_forum']) ) ? intval($HTTP_POST_VARS['search_forum']) : -1;

$sort_by = ( isset($HTTP_POST_VARS['sort_by']) ) ? intval($HTTP_POST_VARS['sort_by']) : 0;

if ( isset($HTTP_POST_VARS['sort_dir']) )
{
	$sort_dir = ( $HTTP_POST_VARS['sort_dir'] == 'DESC' ) ? 'DESC' : 'ASC';
}
else
{
	$sort_dir =  'DESC';
}

if ( !empty($HTTP_POST_VARS['search_time']) || !empty($HTTP_GET_VARS['search_time']))
{
	$search_time = time() - ( ( ( !empty($HTTP_POST_VARS['search_time']) ) ? intval($HTTP_POST_VARS['search_time']) : intval($HTTP_GET_VARS['search_time']) ) * 86400 );
}
else
{
	$search_time = 0;
}

$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;

$sort_by_types = array($lang['Sort_Time'], $lang['Sort_Post_Subject'], $lang['Sort_Topic_Title'], $lang['Sort_Author'], $lang['Sort_Forum']);

//
// encoding match for workaround
//
$multibyte_charset = 'utf-8, big5, shift_jis, euc-kr, gb2312';

//
// Begin core code
//
if ( $mode == 'searchuser' )
{
	//
	// This handles the simple windowed user search functions called from various other scripts
	//
	if ( isset($HTTP_POST_VARS['search_username']) )
	{
		username_search($HTTP_POST_VARS['search_username']);
	}
	else
	{
		username_search('');
	}

	exit;
}
else if ( $search_keywords != '' || $search_author != '' || $search_id )
{
	$store_vars = array('search_results', 'total_match_count', 'split_search', 'sort_by', 'sort_dir', 'show_results', 'return_chars');

	//
	// Cycle through options ...
	//
	if ( $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' )
	{
		if ( $search_id == 'newposts' || $search_id == 'egosearch' || ( $search_author != '' && $search_keywords == '' )  )
		{
			if ( $search_id == 'newposts' )
			{
				if ( $userdata['session_logged_in'] )
				{
					$sql = "SELECT post_id 
						FROM " . POSTS_TABLE . " 
						WHERE post_time >= " . $userdata['user_lastvisit'];
				}
				else
				{
					redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=newposts", true));
				}

				$show_results = 'topics';
				$sort_by = 0;
				$sort_dir = 'DESC';
			}
			else if ( $search_id == 'egosearch' )
			{
				if ( $userdata['session_logged_in'] )
				{
					$sql = "SELECT post_id 
						FROM " . POSTS_TABLE . " 
						WHERE poster_id = " . $userdata['user_id'];;
				}
				else
				{
					redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=egosearch", true));
				}

				$show_results = 'topics';
				$sort_by = 0;
				$sort_dir = 'DESC';
			}
			else
			{
				$search_author = str_replace('*', '%', trim($search_author));
				
				$sql = "SELECT user_id
					FROM " . USERS_TABLE . "
					WHERE username LIKE '" . str_replace("\'", "''", $search_author) . "'";
				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, "Couldn't obtain list of matching users (searching for: $search_author)", "", __LINE__, __FILE__, $sql);
				}

				$matching_userids = '';
				if ( $row = $db->sql_fetchrow($result) )
				{
					do
					{
						$matching_userids .= ( ( $matching_userids != '' ) ? ', ' : '' ) . $row['user_id'];
					}
					while( $row = $db->sql_fetchrow($result) );
				}
				else
				{
					message_die(GENERAL_MESSAGE, $lang['No_search_match']);
				}

				$sql = "SELECT post_id 
					FROM " . POSTS_TABLE . " 
					WHERE poster_id IN ($matching_userids)";
			}

			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql);
			}

			$search_ids = array();
			while( $row = $db->sql_fetchrow($result) )
			{
				$search_ids[] = $row['post_id'];
			}
			$db->sql_freeresult($result);

			$total_match_count = count($search_ids);

		}
		else if ( $search_keywords != '' )
		{
			$stopword_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_stopwords.txt'); 
			$synonym_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_synonyms.txt'); 
		
			$split_search = array();
			$split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ?  split_words(clean_words('search', stripslashes($search_keywords), $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords);	

			$search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' );

			$word_count = 0;
			$current_match_type = 'or';

			$word_match = array();
			$result_list = array();

			for($i = 0; $i < count($split_search); $i++)
			{
				switch ( $split_search[$i] )
				{
					case 'and':
						$current_match_type = 'and';
						break;

					case 'or':
						$current_match_type = 'or';
						break;

					case 'not':
						$current_match_type = 'not';
						break;

					default:
						if ( !empty($search_terms) )
						{
							$current_match_type = 'and';
						}

						if ( !strstr($multibyte_charset, $lang['ENCODING']) )
						{
							$match_word = str_replace('*', '%', $split_search[$i]);
							$sql = "SELECT m.post_id 
								FROM " . SEARCH_WORD_TABLE . " w, " . SEARCH_MATCH_TABLE . " m 
								WHERE w.word_text LIKE '$match_word' 
									AND m.word_id = w.word_id 
									AND w.word_common <> 1 
									$search_msg_only";
						}
						else
						{
							$match_word =  addslashes('%' . str_replace('*', '', $split_search[$i]) . '%');
							$search_msg_only = ( $search_fields ) ? "OR post_subject LIKE '$match_word'" : '';
							$sql = "SELECT post_id
								FROM " . POSTS_TEXT_TABLE . "
								WHERE post_text LIKE '$match_word'
								$search_msg_only";
						}
						if ( !($result = $db->sql_query($sql)) )
						{
							message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql);
						}

						$row = array();
						while( $temp_row = $db->sql_fetchrow($result) )
						{
							$row[$temp_row['post_id']] = 1;

							if ( !$word_count )
							{
								$result_list[$temp_row['post_id']] = 1;
							}
							else if ( $current_match_type == 'or' )
							{
								$result_list[$temp_row['post_id']] = 1;
							}
							else if ( $current_match_type == 'not' )
							{
								$result_list[$temp_row['post_id']] = 0;
							}
						}

						if ( $current_match_type == 'and' && $word_count )
						{
							@reset($result_list);
							while( list($post_id, $match_count) = @each($result_list) )
							{
								if ( !$row[$post_id] )
								{
									$result_list[$post_id] = 0;
								}
							}
						}

						$word_count++;

						$db->sql_freeresult($result);
					}
			}

			@reset($result_list);

			$search_ids = array();
			while( list($post_id, $matches) = each($result_list) )
			{
				if ( $matches )
				{
					$search_ids[] = $post_id;
				}
			}	
			
			unset($result_list);
			$total_match_count = count($search_ids);
		}

		//
		// If user is logged in then we'll check to see which (if any) private
		// forums they are allowed to view and include them in the search.
		//
		// If not logged in we explicitly prevent searching of private forums
		//
		$auth_sql = '';
		if ( $search_forum != -1 )
		{
			$is_auth = auth(AUTH_READ, $search_forum, $userdata);

			if ( !$is_auth['auth_read'] )
			{
				message_die(GENERAL_MESSAGE, $lang['No_searchable_forums']);
			}

			$auth_sql = "f.forum_id = $search_forum";
		}
		else
		{
			$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata); 

			if ( $search_cat != -1 )
			{
				$auth_sql = "f.cat_id = $search_cat";
			}

			$ignore_forum_sql = '';
			while( list($key, $value) = each($is_auth_ary) )
			{
				if ( !$value['auth_read'] )
				{
					$ignore_forum_sql .= ( ( $ignore_forum_sql != '' ) ? ', ' : '' ) . $key;
				}
			}

			if ( $ignore_forum_sql != '' )
			{
				$auth_sql .= ( $auth_sql != '' ) ? " AND f.forum_id NOT IN ($ignore_forum_sql) " : "f.forum_id NOT IN ($ignore_forum_sql) ";
			}
		}

		//
		// Author name search 
		//
		if ( $search_author != '' )
		{
			$search_author = str_replace('*', '%', trim(str_replace("\'", "''", $search_author)));
		}

		if ( $total_match_count )
		{
			if ( $show_results == 'topics' )
			{
				$where_sql = '';

				if ( $search_time )
				{
					$where_sql .= ( $search_author == '' && $auth_sql == ''  ) ? " AND post_time >= $search_time " : " AND p.post_time >= $search_time ";
				}

				if ( $search_author == '' && $auth_sql == '' )
				{
					$sql = "SELECT topic_id 
						FROM " . POSTS_TABLE . "
						WHERE post_id IN (" . implode(", ", $search_ids) . ") 
							$where_sql 
						GROUP BY topic_id";
				}
				else
				{
					$from_sql = POSTS_TABLE . " p"; 

					if ( $search_author != '' )
					{
						$from_sql .= ", " . USERS_TABLE . " u";
						$where_sql .= " AND u.user_id = p.poster_id AND u.username LIKE '$search_author' ";
					}

					if ( $auth_sql != '' )
					{
						$from_sql .= ", " . FORUMS_TABLE . " f";
						$where_sql .= " AND f.forum_id = p.forum_id AND $auth_sql";
					}

					$sql = "SELECT p.topic_id 
						FROM $from_sql 
						WHERE p.post_id IN (" . implode(", ", $search_ids) . ") 
							$where_sql 
						GROUP BY p.topic_id";
				}

				if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Could not obtain topic ids', '', __LINE__, __FILE__, $sql);
				}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品嫩草影院av蜜臀| 日韩一区二区视频在线观看| 亚洲国产成人在线| 国产成人av自拍| 国产精品乱码久久久久久| a美女胸又www黄视频久久| 亚洲三级在线看| 欧美日韩日日夜夜| 久久精品国产第一区二区三区| 日韩一级免费一区| 国产成人av一区二区三区在线| 中文字幕精品一区| 91久久人澡人人添人人爽欧美| 亚洲一区二区三区四区在线观看 | 91色视频在线| 亚洲一级二级在线| 欧美mv日韩mv亚洲| 岛国一区二区三区| 亚洲国产综合人成综合网站| 日韩欧美精品在线视频| 国产成a人亚洲| 亚洲免费毛片网站| 欧美va在线播放| 91在线无精精品入口| 婷婷久久综合九色综合绿巨人| 久久这里都是精品| 色老综合老女人久久久| 日本女优在线视频一区二区| 欧美国产日韩a欧美在线观看| 日本韩国欧美在线| 精品无人区卡一卡二卡三乱码免费卡| 国产精品天美传媒| 91麻豆精品久久久久蜜臀 | 亚洲夂夂婷婷色拍ww47| 欧美不卡一区二区三区四区| 99re66热这里只有精品3直播| 天天操天天色综合| 综合电影一区二区三区 | 欧洲日韩一区二区三区| 久久国产成人午夜av影院| 亚洲色图.com| 久久无码av三级| 在线成人高清不卡| 91老司机福利 在线| 国产精品一区二区久激情瑜伽 | 欧美三区在线观看| 成人综合在线网站| 久久成人精品无人区| 亚洲一区在线视频观看| 日本一区二区三区电影| 日韩午夜电影av| 欧美美女bb生活片| 色视频成人在线观看免| 成人动漫在线一区| 国产精品影视在线观看| 亚洲一区二区三区四区在线观看 | 国产精品亚洲成人| 免费成人小视频| 亚洲成人自拍网| 1000精品久久久久久久久| 久久久99久久| 2023国产精品| 精品久久久久久久久久久久久久久| 欧美日韩一级视频| 欧美日韩久久久一区| 欧美美女激情18p| 欧美日韩小视频| 色八戒一区二区三区| av电影在线不卡| 丰满亚洲少妇av| 国产成人av一区二区三区在线| 国内成人自拍视频| 狠狠色狠狠色综合日日91app| 日本vs亚洲vs韩国一区三区| 亚洲午夜久久久久久久久久久| 亚洲免费观看高清完整版在线 | 久久久久久久久久电影| 欧美tk—视频vk| 精品国产欧美一区二区| 日韩精品一区在线观看| 欧美xxxxx裸体时装秀| 欧美成人一级视频| 久久综合成人精品亚洲另类欧美| 欧美成人性战久久| www国产成人| 国产精品人成在线观看免费| 中文在线资源观看网站视频免费不卡 | 91视频观看免费| 91亚洲资源网| 欧美三级资源在线| 日韩一区二区三区在线| 26uuu精品一区二区在线观看| 久久久久久久久免费| 中文字幕在线观看一区二区| 亚洲人午夜精品天堂一二香蕉| 亚洲人成影院在线观看| 天天亚洲美女在线视频| 美女网站色91| 成人免费av资源| 欧美写真视频网站| 日韩午夜在线观看视频| 国产亚洲视频系列| 亚洲人成网站色在线观看| 亚洲第一主播视频| 日产国产欧美视频一区精品| 国产真实乱子伦精品视频| www.亚洲免费av| 欧美剧情电影在线观看完整版免费励志电影| 欧美放荡的少妇| 国产人久久人人人人爽| 亚洲最快最全在线视频| 裸体在线国模精品偷拍| 成人天堂资源www在线| 欧美中文字幕一区二区三区| 精品三级av在线| 亚洲色图.com| 精品一区二区三区在线播放| 成人高清视频免费观看| 欧美精品国产精品| 国产欧美一区在线| 亚洲不卡一区二区三区| 国产精品白丝jk黑袜喷水| 91成人在线精品| 久久久久久免费| 亚洲18女电影在线观看| 国产成都精品91一区二区三| 欧美日韩一级片在线观看| 国产精品美女久久久久aⅴ国产馆| 午夜精品福利一区二区蜜股av| 国产不卡视频在线观看| 91精品国产aⅴ一区二区| 国产精品每日更新在线播放网址 | 成人久久视频在线观看| 91精品欧美久久久久久动漫| 国产精品区一区二区三区| 免费一级欧美片在线观看| 91免费国产视频网站| 精品国产99国产精品| 亚洲成av人片一区二区三区| 不卡视频在线观看| 欧美白人最猛性xxxxx69交| 亚洲第一主播视频| 99国产精品久久久| 国产视频亚洲色图| 久久99国产精品免费| 欧美日韩一区 二区 三区 久久精品| 国产欧美日韩不卡| 久久99精品久久久| 91精品国产麻豆| 亚洲成a人片在线不卡一二三区 | www.欧美.com| 久久久午夜电影| 精品一区二区在线视频| 日韩午夜在线观看| 日日夜夜精品视频免费| 欧美天堂亚洲电影院在线播放| 亚洲天堂久久久久久久| 国产成人亚洲综合色影视| 精品1区2区在线观看| 久久成人免费网| 欧美一区二区免费观在线| 图片区日韩欧美亚洲| 欧美在线影院一区二区| 亚洲综合成人在线视频| 91久久国产综合久久| 亚洲私人影院在线观看| 91在线国内视频| 亚洲日本va午夜在线影院| 97se亚洲国产综合自在线观| 国产精品成人一区二区艾草 | 久久婷婷国产综合精品青草| 石原莉奈在线亚洲二区| 欧美浪妇xxxx高跟鞋交| 日韩中文字幕av电影| 91精品一区二区三区在线观看| 奇米色一区二区三区四区| 日韩亚洲欧美一区二区三区| 蜜桃av噜噜一区二区三区小说| 欧美成人一级视频| 高清免费成人av| 国产精品福利在线播放| 色就色 综合激情| 香蕉av福利精品导航| 91麻豆精品国产91久久久| 老司机精品视频一区二区三区| 日韩精品中文字幕在线一区| 国产乱子伦一区二区三区国色天香| 精品国产91乱码一区二区三区| 国产精品一区二区三区乱码| 国产精品亲子伦对白| 色婷婷久久综合| 日韩高清在线不卡| 精品av综合导航| 99精品欧美一区二区三区小说| 一区二区免费视频| 日韩欧美国产综合在线一区二区三区| 国内成人精品2018免费看| 国产精品免费观看视频| 欧美精品久久99| 国产成人免费av在线|