//define('DBNAME','2015_etc'); // //require_once( ROOT.'../wp-admin/admin.php' ); include "inc/db.php"; include "inc/lib.php"; include "inc/simple_html_dom.php"; include "inc/function_string.php"; include "inc/resize-class.php"; include "inc/libimg.php"; include "inc/img.php"; $img = new img(); $lib = new lib(); $db = new db(); $catid = (int) $_GET['term_id']; $ar_cat = $lib->ar_cat_string($catid); $total_no_active1 = $lib->get_num_link_no_active($ar_cat); $total_no_active = $total_no_active1; $total_active = $lib->get_num_link_active($ar_cat); $total_link = $total_active + $total_no_active; $phantram = round($total_active * 100 / $total_link, 1); $_SESSION['total'] = $total_link; $_SESSION['da_thuc_hien'] = $total_active; $_SESSION['chua_thuc_hien'] = $total_no_active; $_SESSION['con_lai'] = $total_link - $total_active; $_SESSION['phan_tram'] = $phantram; $data['chua_thuc_hien'] = $total_no_active; $data['phantram'] = $phantram; $random = rand(20, 1000); if ($total_no_active1 == 0) { $lib->ac_active(); } else {
// Set attachment data $attachment = array('post_mime_type' => $wp_filetype['type'], 'post_title' => $game['name'], 'post_content' => '', 'post_status' => 'inherit'); //var_dump($attachment); // Create the attachment $attach_id = wp_insert_attachment($attachment, $file, $post_id); // Include image.php //require_once(dirname(__FILE__) .'/includes/image.php'); // Define attachment metadata $attach_data = wp_generate_attachment_metadata($attach_id, $file); // Assign metadata to attachment wp_update_attachment_metadata($attach_id, $attach_data); // And finally assign featured image to post set_post_thumbnail($post_id, $attach_id); die; $lib = new lib(); $total_no_active = $lib->get_num_link_no_active(); $total_active = $lib->get_num_link_active(); $total_link = $total_active + $total_no_active; $phantram = round($total_active * 100 / $total_link, 1); $_SESSION['total'] = $total_link; $_SESSION['da_thuc_hien'] = $total_active; $_SESSION['chua_thuc_hien'] = $total_no_active; $_SESSION['con_lai'] = $total_link - $total_active; $_SESSION['phan_tram'] = $phantram; echo '<meta charset="UTF-8">'; //$url = 'https://play.google.com/store/apps/category/GAME_ADVENTURE/collection/topselling_free'; //$data_content = _curl($url); $url = 'https://play.google.com/store/apps/category/GAME_STRATEGY/collection/topselling_free?authuser=0'; $data_content = postPage($url, $post); $html = str_get_html($data_content); $items = $html->find("div[class=details] h2 a[class=title]");