HEX
Server: nginx/1.28.3
System: Linux VM-0-7-opencloudos 6.6.117-45.oc9.x86_64 #1 SMP Thu Dec 4 10:26:39 CST 2025 x86_64
User: www (1000)
PHP: 8.2.28
Disabled: 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
Upload Files
File: /www/wwwroot/www.213n.cn/wp-content/themes/rk-blogger/sidebar.php
<?php

/**
 * The template for the sidebar containing the main widget area
 *
 * Author: wbolt team
 * Author URI: https://www.wbolt.com
 */
?>

<div class="sidebar">
	<div class="sb-inner sticky-top">
		<?php echo wb_insert_ad_block('sidebar', 'mb adbanner'); ?>

		<?php if (wb_dynamic_sidebar_switch() && is_active_sidebar('sidebar-def')) :
			dynamic_sidebar('sidebar-def');
		endif; ?>

		<section class="tabs mb" id="J_tabBoxSideBar">
			<ul class="tab-nav">
				<li class="nav-item current" data-index="0"><a><span>热门文章</span></a></li>
				<li class="nav-item" data-index="1"><a><span>随机文章</span></a></li>
				<li class="nav-item" data-index="2"><a><span>热门关键词</span></a></li>
			</ul>
			<div class="tab-conts">
				<div class="tab-cont current">
					<ul class="post-list rec-ul-bull recul-row-1" id="tab-posts">
						<?php
						$strdate = date('Y-m-d', strtotime('-1 year', time()));
						$q_cat = '';
						if (is_category()) {
							$q_cat = '&cat=' . $wp_query->get('cat');
						} else if (is_single()) {
							$term = wp_get_post_terms(get_the_ID(), 'category');
							//print_r($term);
							if ($term)
								$q_cat = '&cat=' . $term[0]->term_id;
							if (get_the_ID()) {
								$q_cat .= '&exclude[]=' . get_the_ID();
							}
						} else if (is_search()) {
							$q_cat = '';
						}
						$posts = get_posts("numberposts=10$q_cat&date_query[after]=$strdate&orderby=meta_value_num&meta_key=post_views_count&order=DESC");
						$idx = 0;
						foreach ($posts as $post) : $idx++; ?>
							<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
							<?php endforeach;

						$number = 10 - $idx;
						if ($number > 0) {
							$posts = get_posts("numberposts={$number}$q_cat&date_query[before]=$strdate&orderby=rand&order=DESC");
							foreach ($posts as $post) : ?>
								<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
						<?php endforeach;
						} //end if
						?>
					</ul>
				</div>
				<div class="tab-cont">
					<ul class="post-list rec-ul-bull recul-row-1" id="tab-posts">
						<?php
						$posts = get_posts("numberposts=10$q_cat&date_query[after]=$strdate&orderby=rand");

						$idx = 0;
						foreach ($posts as $post) : $idx++; ?>
							<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
							<?php endforeach;
						$number = 10 - $idx;
						if ($number > 0) {
							$posts = get_posts("numberposts=$number$q_cat&date_query[before]=$strdate&orderby=rand");
							foreach ($posts as $post) : ?>
								<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
						<?php endforeach;
						} //end if
						?>
					</ul>
				</div>
				<div class="tab-cont cont-tags" id="tab-tags">
					<div class="tag-list">
						<?php wp_tag_cloud(array(
							'largest' => 1,
							'smallest' => 1,
							'unit' => 'em',
							'orderby' => 'count',
							'order' => 'DESC',
							'number' => 30
						)); ?>
					</div>
				</div>
			</div>
		</section>

		<?php if (wb_get_links()) : ?>
			<section class="widget widget-links">
				<div class="wp-block-group">
					<h2>友情链接</h2>
					<div class="links-items">
						<?php echo wb_get_links(); ?>
					</div>
				</div>
			</section>
		<?php endif; ?>

		<?php if (wb_dynamic_sidebar_switch() && is_active_sidebar('sidebar-bottom')) :
			dynamic_sidebar('sidebar-bottom');
		endif; ?>
		<?php echo wb_insert_ad_block('sidebar_b', 'adbanner'); ?>
	</div>
</div>