AVRIL_START_JANCOKALIVEAVRIL_END_JANCOK
| Server IP : dzynews.com / Your IP : 216.73.217.105 Web Server : nginx/1.30.3 System : Linux cloud-tdkldl-avd6 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 User : www ( 1000) PHP Version : 8.2.31 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/dzynews.com/wp-content/themes/archive-document/ |
Upload File : |
<?php
/**
* 搜索页面
*/
get_header();
$post_type = b2_get_search_type();
unset($post_type['cpay']);
$opt_type = b2_get_option('template_top','search_menu');
$_post_type = [];
foreach ($opt_type as $k) {
if(isset($post_type[$k])){
$_post_type[$k] = $post_type[$k];
}
}
//$type 内容消毒
$type = isset($_GET['type']) && $_GET['type'] ? b2_key_sanitize($_GET['type']) : 'post';
$key = b2_key_sanitize(get_search_query());
global $wp;
$url = B2_HOME_URI.'/'.$wp->request;
$request = http_build_query($_REQUEST);
$request = $request ? '?'.$request : '';
$request = remove_query_arg('s',$request);
$url = preg_replace('#page/([^/]*)$#','', $url);
?>
<div class="tax-search box wrapper b2-radius mg-b">
<div class="search-types">
<?php
$type_url = http_build_query($_REQUEST);
$type_url = $type_url ? '?'.$type_url : '';
foreach ($_post_type as $k => $v) {
echo '<a class="'.($k === $type ? 'picked' : '').'" href="'.esc_url(add_query_arg('type',$k,$url.$type_url)).'">'.$v.'</a>';
}
?>
</div>
<?php if(isset($_post_type[$type])){ ?>
<form method="get" action="<?php echo esc_url($url.$request); ?>" autocomplete="off">
<input type="text" name="s" class="b2-radius" placeholder="<?php echo sprintf(__('在「%s」中搜索','b2'),$_post_type[$type]);?>" value="<?php echo $key; ?>">
<input type="hidden" name="type" value="<?php echo $type; ?>">
<button class="text"><?php echo b2_get_icon('b2-search-line'); ?></button>
</form>
<?php } ?>
</div>
<div class="b2-single-content wrapper single-sidebar-hidden">
<div id="primary-home" class="wrapper">
<div class="search-page-title mg-b box b2-radius">
<h2><?php echo $post_type[$type]; ?></h2>
<p><?php echo __('搜索结果:','b2'); ?></p>
</div>
<?php get_template_part( 'Search/'.$type ); ?>
</div>
</div>
<?php get_footer(); ?>