function get_meta_cat($meta_key, $meta_value, $num = 16) { global $post; // tao cache $type_alohot = $meta_key; $file = DOCUMENT_TEMP . "/cached/alohot_" . $type . ".xxx"; // lấy tên file cache theo type để tránh trùng lập $expire = 86400; // 24h if (file_exists($file) && filemtime($file) > time() - $expire) { include DOCUMENT_TEMP . "/cached/alohot_" . $type_alohot . ".xxx"; } else { $q = get_query_var('paged') ? get_query_var('paged') : 1; query_posts('post_type=post&showposts=' . $num . '&meta_key=' . $meta_key . '&meta_value=' . $meta_value . '&paged=' . $q . '&order=desc'); while (have_posts()) { the_post(); $html .= '<li><div class="inner"><a href="' . get_permalink() . '" title="' . get_the_title() . '"><img src="' . img3(146, 195) . '" alt="' . get_the_title() . '"/></a><div class="info"><div class="name"><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a> </div><div class="name2">' . get_post_meta($post->ID, "phim_en", true) . '</div><div class="stats"></div></div><div class="status">' . get_post_meta($post->ID, "phim_hd", true) . '</div></div></li>'; } wp_reset_query(); $fp = fopen($file, "w"); fputs($fp, $html); fclose($fp); include DOCUMENT_TEMP . "/cached/alohot_" . $type_alohot . ".xxx"; } }
<i class="i i--size--s"><svg><use xlink:href="#i--clock"/></svg></i> </button> <button data-uk-tooltip="{pos:'bottom'}" title="Added to Watch Later" class="thumb__watch-later btn btn--size--m js-action-add-to-watch-later is-hidden" type="button"> <i class="i i--size--s i--color-green"><svg version="1.1" xmlns="http://www.w3.org/2000/svg"><use xlink:href="#i--check"/></svg></i> </button> <div class="thumb__content"> <a class="js-thumb-pagination" href="<?php the_permalink(); ?> "> <img width="220" height="165" alt="<?php the_title(); ?> " src="<?php echo img3(168, 250); ?> "> <span class="thumb__hd"> <?php echo get_post_meta($post->ID, "phim_hd", true); ?> </span> </a> <div class="thumb-overlay"> <div class="thumb-overlay__right"> <div class="thumb__duration"><?php echo get_post_meta($post->ID, "phim_tl", true); ?>
<br /> Năm Sản Xuất: <?php echo get_post_meta($post->ID, "phim_nsx", true); ?> <br /> <br /><hr /><br /> <?php echo get_excerpt_content(40, '', 0, $post->post_content); ?> " href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><img src="<?php echo img3(146, 195); ?> " alt="<?php the_title(); ?> "/></a><div class="info"><div class="name"><a href="<?php the_permalink(); ?> " title="<?php the_title(); ?> "><?php the_title(); ?> </a> </div><div class="name2"><?php echo get_post_meta($post->ID, "phim_en", true);
<div class="thumb-grid__item"> <div class="thumb thumb--video js-thumb"> <div class="thumb__content"> <a href="<?php the_permalink(); ?> " class="js-thumb-pagination"> <img width="140" height="190" alt="<?php the_title(); ?> - <?php echo get_post_meta($post->ID, "phim_en", true); ?> " src="<?php echo img3(150, 190); ?> "> </a> <div class="thumb-overlay"> <div class="thumb-overlay__right"> <div class="thumb__duration"><?php if (function_exists('the_views')) { the_views(); } ?> </div> </div> </div> </div> <a title="<?php
<div class="container " id="fnBody"> <div class="content" id="fnBodyContent"> <?php $where = "post_type = 'post'"; $most_viewed = $wpdb->get_results("SELECT DISTINCT {$wpdb->posts}.*, (meta_value+0) AS views FROM {$wpdb->posts} LEFT JOIN {$wpdb->postmeta} ON {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID WHERE post_date < '" . current_time('mysql') . "' AND post_status = 'publish' AND post_type = 'post' AND meta_key = '_count-views_all' AND post_password = '' ORDER BY views DESC LIMIT 0,20"); if ($most_viewed) { foreach ($most_viewed as $post) { $post_views = number_format_i18n(intval($post->views)); $post_url = get_permalink($post->ID); $post_title = get_the_title(); $speak = get_post_meta($post->ID, "phim_tm", true); if ($speak == 1) { $speakw = '<div class="speaker" title="Phim có thuyết minh"></div>'; } $html .= '<a href="' . get_permalink() . '"class="content-items" title="' . get_the_title() . ' - ' . get_post_meta($post->ID, "phim_en", true) . '"> <img src="' . img3(72, 100) . '" alt="' . get_the_title() . '" class="album-img" width="72" height="100" /> <h2 class="title">' . get_the_title() . '</h2> <h4>' . get_post_meta($post->ID, "phim_en", true) . '</h4> <ul class="info-des"> <li>Năm: ' . get_post_meta($post->ID, "phim_nsx", true) . '</li> <li>Lượt xem: ' . get_post_meta($post->ID, "_count-views_all", true) . '</li> </ul> </a>'; $speakw = ''; } } echo $html; ?> <!-- Lay phim -->
</h1></div></div> <div id="body-wrap" class="container"><div id="content"><div class="block" id="page-list"> <div class="blocktitle breadcrumbs"><?php the_breadcrumb(); ?> </div> <div class="blockbody"> <ul class="list-film"> <?php $where = "post_type = 'post'"; $most_viewed = $wpdb->get_results("SELECT DISTINCT {$wpdb->posts}.*, (meta_value+0) AS views FROM {$wpdb->posts} LEFT JOIN {$wpdb->postmeta} ON {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID WHERE post_date < '" . current_time('mysql') . "' AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER BY views DESC LIMIT 0,20"); if ($most_viewed) { foreach ($most_viewed as $post) { $post_views = number_format_i18n(intval($post->views)); $post_url = get_permalink($post->ID); $post_title = get_the_title(); $html .= '<li><div class="inner"><a href="' . get_permalink() . '" title="' . get_the_title() . '"><img src="' . img3(146, 195) . '" alt="' . get_the_title() . '"/></a><div class="info"><div class="name"><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a> </div><div class="name2">' . get_post_meta($post->ID, "phim_en", true) . '</div><div class="stats"></div></div><div class="status">' . get_post_meta($post->ID, "phim_hd", true) . '</div></div></li>'; } } echo $html; ?> </ul><div> <?php wp_pagenavi(); ?> </div></div></div></div> <?php get_sidebar(); get_footer();
<div id="content"> <div class="block" id="page-list"> <div class="blocktitle breadcrumbs"> <?php the_breadcrumb(); ?> <?php echo get_cat_name($cat); ?> </div> <div class="blockbody"> <ul class="list-film"> <?php while (have_posts()) { the_post(); $html .= '<li><div class="inner"><a href="' . get_permalink() . '" title="' . get_the_title() . '"><img src="' . img3(146, 195) . '" alt="' . get_the_title() . '"/></a><div class="info"><div class="name"><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a> </div><div class="name2"><h4>' . get_post_meta($post->ID, "phim_en", true) . '</h4></div><div class="stats"><span class="liked">' . get_total_rating($post->ID, "like") . ' Like</span></div></div><div class="status">' . get_post_meta($post->ID, "phim_hd", true) . '</div></div></li>'; } wp_reset_query(); echo $html; ?> </ul> </div> </div> </div> <?php get_sidebar(); ?> </div> <?php