'!', 't' => '!', 'h' => '!', 'p' => '!' ); public function __construct() { if( defined( 'TURI' ) === false ) define( 'TURI', get_template_directory_uri() ); $this->_active = isset( $_GET['active'] ) ? $_GET['active'] : 'sns_post'; /* ページング用 */ $paged = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; $post_type = $this->_active === 'sns_page' ? 'page' : 'post'; $args = array( 'posts_per_page' => 30, // 表示件数 'paged' => $paged, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => $post_type, 'post_status' => 'publish' ); $this->_query = new WP_Query( $args ); } public function sns_cache_list() { $luxe = null; /* SNS カウント数取得 */ thk_filesystem_init(); require_once( INC . 'filters.php' ); global $luxe, $wp_filesystem; $wp_upload_dir = wp_upload_dir(); $cache_dir = $wp_upload_dir['basedir'] . '/luxe-sns/'; $cache_content = array(); $dirlist = $wp_filesystem->dirlist( $cache_dir ); $no_img_url = get_theme_mod( 'no_img', null ); foreach( (array)$dirlist as $filename => $fileinfo ) { $content = $wp_filesystem->get_contents( $cache_dir . $filename ); $cache_array = explode( "\n", $content ); while( count( $cache_array ) > 7 ) { array_pop( $cache_array ); } $url = array_shift( $cache_array ); $cache_content[$url] = $cache_array; } ?>
_active !== 'sns_home' ) $this->sns_view_pagination(); ?>
_active === 'sns_home' ? 'Feedly' : __( 'Published date', 'luxeritas' ); ?> Facebook Pinterest Hatena Pocket
_query->have_posts() ) { $no_img_url = get_theme_mod( 'no_img', null ); while( $this->_query->have_posts() ) { $this->_query->the_post(); $eve = $i % 2 === 0 ? ' eve' : ''; ?>
_active === 'sns_home' ? THK_HOME_URL : get_permalink(); $permalink_view = $permalink; if( strlen( $permalink ) >= $str_length ) { $permalink_view = mb_strimwidth( $permalink, 0, $str_length ) . "..."; } $attachment_id = false; $post_thumbnail = has_post_thumbnail(); if( $post_thumbnail === false && isset( $no_img_url ) ) { $attachment_id = thk_get_image_id_from_url( $no_img_url ); if( $attachment_id !== false ) $post_thumbnail = true; } if( $post_thumbnail === true ) { ?> No Image

_active === 'sns_home' ? bloginfo('name') : the_title(); ?>

_active === 'sns_home' ) { $feedly = 'No cache'; if( isset( $cache_content[esc_url( get_bloginfo( 'rss2_url' ) )][0] ) ) { $cnt = $cache_content[esc_url( get_bloginfo( 'rss2_url' ) )][0]; $feed_cnt = substr( $cnt, 2, strlen( $cnt ) - 2 ); $feed_cnt = apply_filters( 'thk_sns_count', $feed_cnt, 'r', $permalink ); $feedly = $feed_cnt; } $feedly_icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA'. 'BUAAAAVAgMAAADUeU0FAAAAA3NCSVQICAjb4U/gAAAADFBM'. 'VEWHvDeqxWDY8vX+/f2WF/1ZAAAABHRSTlP///8AQCqp9AA'. 'AAFNJREFUCJlj+A8CBxjQqacQakI9iPrnIA+ifrKyg6gnco'. 'wgakIlQ/0Bhn+OTxjkDzD8ZZ/FwA6k2PJA1D+HHSDB/xMCQ'. 'Er+P+FjRNIONQy7tSAKAFDeWpJacCTqAAAAAElFTkSuQmCC'; ?> _idarray ); foreach( $cache_count_array as $key => $val ) { if( $key === 'f' ) { $cnt = ''; continue; } if( ctype_digit( $val ) === true ) { echo $cnt, apply_filters( 'thk_sns_count', $val, $key, $permalink ), ''; } else { echo ''; } } } else { echo ''; } ?>
'; } elseif( $key === 't' ) { $cnt = ''; } elseif( $key === 'h' ) { $cnt = ''; } elseif( $key === 'p' ) { $cnt = ''; } else { echo '!!' . __( 'Not cached', 'luxeritas' ) . '
_active === 'sns_home' ) return; } } $this->sns_view_pagination(); } /* ページング */ public function sns_view_pagination() { $paged = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; $posts_per_page = $this->_query->get( 'posts_per_page' ); if( ( !$paged || $paged < 2 ) && $this->_query->found_posts < $posts_per_page ) return; $range = 3; //表示する件数 $showitems = ( $range * 2 ) + 1; if( empty( $paged ) ) $paged = 1; $pages = $this->_query->max_num_pages; if( empty( $pages ) ) $pages = 1; if( $pages !== 1 ) { ?>