HEX
Server: Apache
System: Linux top 5.8.11-1.el7.elrepo.x86_64 #1 SMP Tue Sep 22 18:18:35 EDT 2020 x86_64
User: www (1000)
PHP: 7.4.33
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.018111.cn/wp-content/themes/jian/parts/home-mode/catbox.php
<?php

$mode_catbox = _cao('mode_catbox');

$slugs = ($mode_catbox['cat_id']) ? $mode_catbox['cat_id'] : array(1,1,1,1);

?>
<div class="section bgcolor-fff">
	<div class="container">
		<div class="module category-boxes owl">
			<?php foreach ( $slugs as $cat_id ) : ?>
				<div class="category-box">
					<?php $category = get_category( $cat_id );
					$args = array( 'cat' => $cat_id, 'posts_per_page' => 3 );
					///////////S CACHE ////////////////
		            if (CaoCache::is()) {
		                $_the_cache_key = 'ripro_home_catbox_posts_'.$cat_id;
		                $_the_cache_data = CaoCache::get($_the_cache_key);
		                if(false === $_the_cache_data ){
		                    $_the_cache_data = get_posts( $args ); //缓存数据
		                    CaoCache::set($_the_cache_key,$_the_cache_data);
		                }
		                $category_posts = $_the_cache_data;
		            }else{
		                $category_posts = get_posts( $args ); //缓存数据
		            }
		            ///////////S CACHE ////////////////
					$thumbnails = array();
					$index = 0;

					foreach ( $category_posts as $category_post ) :
						$thumbnail_url  = _get_post_thumbnail_url( $category_post);
						if ($thumbnail_url) {
							$thumbnails[] =$thumbnail_url;
						}else{
							$thumbnails[] = _the_theme_thumb();
						}
						$index++;
					endforeach; ?>
					<div class="entry-thumbnails">
						<div class="big thumbnail">
								<h3 class="entry-title"><?php echo esc_html( $category->cat_name ); ?></h3>
							<img class="lazyload" data-src="<?php echo esc_url( $thumbnails[0] ); ?>">
						</div>
						<div class="small">
							<div class="thumbnail">
								<?php if ( isset($thumbnails[1]) ) : ?>
									<img class="lazyload" data-src="<?php echo esc_url( $thumbnails[1] ); ?>">
								<?php else : ?>
									<img class="lazyload" data-src="<?php echo esc_url( $thumbnails[0] ); ?>">
								<?php endif; ?>
							</div>
							<div class="thumbnail">
								<?php if ( isset($thumbnails[2]) ) : ?>
									<img class="lazyload" data-src="<?php echo esc_url( $thumbnails[2] ); ?>">
								<?php else : ?>
									<img class="lazyload" data-src="<?php echo esc_url( $thumbnails[0] ); ?>">
								<?php endif; ?>
								<span>+<?php echo esc_html($category->category_count); ?></span>
							</div>
						</div>
					</div>
					<a<?php echo _target_blank();?> class="u-permalink" href="<?php echo esc_url( get_category_link( $category->cat_ID ) ); ?>"></a>
				</div>
			<?php endforeach; ?>
		</div>
	</div>
</div>