function index() { $header = new header(); $header->index("Karaoke"); $url = 'http://sannhac.com/'; $trans = new web_transfer(); $indexpage = '?film'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("sannhac.com"); $trans->getcontent($content); var_dump($content); die; $content = str_replace("<a", "<span", $content); $content = str_replace("Phim3s.Home.init();", "", $content); preg_match_all('/<div id="content">(.*?)<div id="sidebar">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $key) { } $data['content'] = $key[1]; // form security $data['csrf_test_name'] = $this->security->get_csrf_hash(); $this->load->view('karaoke/sannhac', $data); }
function sohoa($keyword) { $trans = new web_transfer(); $url = 'http://tratu.soha.vn/dict/en_vn/' . $keyword; $indexpage = '/'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("tratu.soha.vn"); $trans->getcontent($content); preg_match_all('/<div class="main-content">(.*?)<div id="DiscussProfile">/s', $content, $matches, PREG_SET_ORDER); return $matches; }
function tts() { $trans = new web_transfer(); $get = $this->input->get(); $url = "http://text-to-speech.imtranslator.net/sockets/tts.asp?speed" . $get['speed'] . "&url=" . $get['url'] . "&dir=" . $get['dir'] . "&B=1&ID=" . $get['ID'] . "&chr=" . $get['chr'] . "&vc=" . $get['vc']; $indexpage = '/'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("text-to-speech.imtranslator.net"); $trans->getcontent($content); $content = str_replace('speech.asp', 'dict/speech', $content); echo $content; }
function transfer($domain) { $url = 'http://' . $domain . '/'; $trans = new web_transfer(); $indexpage = '?film'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("mybongda.com"); $trans->getcontent($content); $content = str_replace('<div id="fra_rutgon">', '<div id="fra_rutgon" style="display:none">', $content); $content = str_replace('<div class="mtaixiu">', '<div class="mtaixiu" style="display:none">', $content); $content = str_replace('<div id="mynhan">', '<div id="mynhan" style="display:none">', $content); preg_match_all('/<div id="main_content">(.*?)<div id="other_content">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $key) { } return $key[1]; }
function nhackhongloi() { if (isset($_REQUEST['id'])) { $path = str_replace('http://nhackhongloi.org', '', $_REQUEST['id']); $url = $_REQUEST['id']; } else { $path = "/"; $url = "http://www.nhackhongloi.org/trang-chu-mobile.html"; } $indexpage = "?nhackhongloi"; $trans = new web_transfer(); $indexpage = '/'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("www.nhackhongloi.org"); $trans->getcontent($content); //start social plugin $content = str_replace('<div id="controls">', '<div class="social"><a href="https://twitter.com/share" class="twitter-share-button" data-lang="en">Tweet</a><div data-size="medium" class="g-plusone"></div><div class="fb-like" data-href="http://myweb.pro.vn/music/nhackhongloi/" data-layout="button_count" data-action="recommend" data-show-faces="true" data-share="true"></div></div>', $content); //end social plugin $content = str_replace('/xem-video-mobile.html', 'http://myweb.pro.vn/mobile/symphonny_video/', $content); $content = str_replace('trang-chu-mobile.html', 'http://myweb.pro.vn/mobile/nhackhongloi/', $content); $content = str_replace('upload/duk/icon//logo.png', 'http://myweb.pro.vn/images/mobile/mobile_header.gif', $content); $content = str_replace('<div id="social">', '<div id="social" style="display:none">', $content); $content = str_replace('style="width:100%;display:inline-block;"', 'id="fb_album_remove" style="display:none"', $content); $content = str_replace('http://www.facebook.com/nhackhongloi', 'https://www.facebook.com/elearningsocialvn?ref=hl', $content); //start change the url $content = str_replace('www.nhacthien.net', 'myweb.pro.vn/music/meditation/', $content); $content = str_replace('nhackhongloi.org', 'myweb.pro.vn/music/nhackhongloi/', $content); $content = str_replace('www.tinhkhucbathu.com', 'myweb.pro.vn/music/tinhkhucbathu/', $content); $content = str_replace('www.nhacphap.com', 'myweb.pro.vn/music/nhacphap/', $content); //end change the url $content = str_replace('/skins', 'http://www.nhackhongloi.org/skins/', $content); $content = str_replace('</body>', '<p class="append_footer_iframe"><p/></body>', $content); preg_match_all('/<body>(.*?)<p class="append_footer_iframe">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $key_music) { } $data['content'] = $key_music[0]; $this->load->view('mobile/nhackhongloi', $data); }
function karaoke() { $content = ''; if (isset($_REQUEST['search'])) { $url = "http://webzone.vn/karaoke/tim-kiem.html?keyword=" . $_REQUEST['search']; } if (!isset($_REQUEST['search'])) { $url = "http://webzone.vn/karaoke/"; } $indexpage = "?karaoke"; $trans = new web_transfer(); $indexpage = '/'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $trans->start_transfer("webzone.vn"); $trans->getcontent($content); if (!isset($_REQUEST['search'])) { for ($i = 1; $i < 809; $i++) { $content = str_replace('webzone.vn/karaoke/page/' . $i, 'myweb.pro.vn/music/karaoke?search=A', $content); } } $content = str_replace('http://webzone.vn/karaoke/tim-kiem.html?keyword', '/music/karaoke?search', $content); $content = str_replace('Kết quả tìm được', '', $content); $content = str_replace('Hiển thị kết quả trang thứ', 'Trang', $content); $content = str_replace('class="adsence"', 'class="adsence" style="display: none;', $content); $content = str_replace('glyphicon glyphicon-thumbs-up', 'fa fa-hand-o-up fa-2x', $content); preg_match_all('/<div class="main-content">(.*?)<footer class="footer">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $key) { } $data['content'] = $key[1]; $this->load->view('music/karaoke', $data); //start analytic $analytic = new analytic(); $analytic->myweb('general'); //end analytic //for web crawler $header = new header(); $header->index("Tra mã số karaoke", "/music/karaoke/", "Nhập tên, lời đầu bài hát hoặc ca sỹ"); }
function sport() { $header = new header(); $header->index("Game thể thao", "/game/play/", "Tìm kiếm game"); $url = 'http://www.miniclip.com/games/genre-3/sports/en/#t-n-G'; $trans = new web_transfer(); $indexpage = '?miniclip'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("www.miniclip.com"); $trans->getcontent($content); preg_match_all('/<section id="games-categories">(.*?)<div class="right-content">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $key) { } $data['content'] = str_replace('title', 'target="_new"', $key[1]); $this->load->view('game/sport', $data); }
function update_direct_link() { $header_title = ''; $trans = new web_transfer(); //start if if (!isset($_REQUEST['book_id'])) { if (!isset($_REQUEST['id'])) { //redirect('/book/index'); } else { $book_data = ''; if (isset($_REQUEST['book_title'])) { $book_data = $this->db->select('ebook_category.id as ID_CATEGORY,ebook_category.NAME as CATEGORY,ebook_index.*')->from('ebook_index')->join('ebook_category', 'ebook_category.id=ebook_index.ID_CATEGORY', 'inner')->where('ebook_index.NAME', $_REQUEST['book_title'])->get()->result_array(); } else { $book_data = $this->db->select('ebook_category.id as ID_CATEGORY,ebook_category.NAME as CATEGORY,ebook_index.*')->from('ebook_index')->join('ebook_category', 'ebook_category.id=ebook_index.ID_CATEGORY', 'inner')->where('ebook_index.ID', $_REQUEST['id'])->get()->result_array(); } if ($book_data) { foreach ($book_data as $key) { } $url = "http://tailieuhoctap.vn" . $key['path']; $data['book_id'] = $key['path']; $data['book_title'] = $key['NAME']; $data['category'] = $key['CATEGORY']; $data['category_id'] = $key['ID_CATEGORY']; $data['book_description'] = strip_tags($key['DESCRIPTION']); if (file_exists($key['THUMBS'])) { $data['book_thumbs'] = $key['THUMBS']; } else { $data['book_thumbs'] = '/images/ebook/book_cover_default.png'; } $data['share_id'] = $key['ID']; $book_id_comment = $key['ID']; $header_title = $key['NAME']; } else { $next_id = $_REQUEST['id'] + 1; $url_re = 'http://myweb.pro.vn/book/update_direct_link/?id=' . $next_id; redirect($url_re); } } } else { $book_id = $this->input->get_post('book_id'); $book_title = $this->input->get_post('book_title'); $book_description = $this->input->get_post('book_description'); $book_thumbs = $this->input->get_post('book_thumbs'); $check_exist = $this->db->select('*')->from('ebook_index')->where('NAME', $book_title)->get()->result_array(); $header_title = $book_title; //start check where the book exist in db $count_check = count($check_exist); $data = array('NAME' => strip_tags($book_title), 'DESCRIPTION' => strip_tags($book_title), 'THUMBS' => $book_thumbs, 'REFERER' => 'tailieuhoctapvn', 'path' => $book_id, 'ID_CATEGORY' => '8'); if ($count_check == 0) { $this->db->insert('ebook_index', $data); $data['share_id'] = $this->db->insert_id(); $book_id_comment = $this->db->insert_id(); } else { $book_data = $this->db->select('*')->from('ebook_index')->where('NAME', $_REQUEST['book_title'])->get()->result_array(); foreach ($book_data as $key) { } $data['share_id'] = $key['ID']; $book_id_comment = $key['ID']; } //end check where the book exist in db $url = "http://tailieuhoctap.vn" . $book_id; $data['book_id'] = $book_id; $data['book_title'] = $book_title; $data['book_description'] = $book_description; $data['book_thumbs'] = $book_thumbs; $data['category'] = ''; $data['category_id'] = ''; } //end else $header = new header(); $header->book($header_title); $indexpage = '/'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("tailieuhoctap.vn"); $trans->getcontent($content); $content = str_replace("Tailieuhoctap.vn", "myweb.pro.vn", $content); $content = str_replace(" - ", "", $content); $content = str_replace(" - ", "", $content); $content = str_replace('style="color:', 'style="display:none;color:', $content); $content = str_replace("display: block", "display:none", $content); $content = str_replace("noi-dung-huongdan", "noi-dung-huongdan modal hide fade", $content); $content = str_replace('onclick="huongdandown()"', '', $content); $content = str_replace('<script type="text/javascript">var addthis_config = {"data_track_addressbar":true}; var addthis_share = {description:test code};</script>', '', $content); preg_match_all('/<div class="item-page">(.*?)<div class="them">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $matches_main) { } if ($matches) { $related_content = $this->get_content_related($url); $data['content'] = $matches_main[0] . $related_content; $data['csrf_test_name'] = $this->security->get_csrf_hash(); } else { $next_id = $_REQUEST['id'] + 1; $url_re = 'http://myweb.pro.vn/book/update_direct_link/?id=' . $next_id; redirect($url_re); } if (!isset($_REQUEST['is_download'])) { $data['is_download'] = "0"; } else { $data['is_download'] = "1"; } //login pop-up if (isset($_REQUEST['type'])) { $data['type'] = $_REQUEST['type']; } if (!isset($_REQUEST['type'])) { $data['type'] = '0'; } //end $data['share'] = 'http://myweb.pro.vn/doc-sach-tham-khao?id=' . $key['ID']; $data['id_next'] = $_REQUEST['id'] + 1; if ($_REQUEST['id'] == '14571') { $data['id_next'] = '170743'; } $this->load->view('/book/update_link', $data); }
function view() { if (!isset($_REQUEST['fetch_id']) && !isset($_REQUEST['id'])) { redirect('/video/'); } if (isset($_REQUEST['fetch_id'])) { $link = $_REQUEST['fetch_id']; $data['link'] = $link; $data['name'] = $this->input->post('name'); $data['thumbs'] = $_REQUEST['thumbs']; $query = $this->db->select("*")->from('film')->where('NAME', $_REQUEST['name'])->get()->result_array(); //save in db if (count($query) == "0") { $url = 'http://phim3s.net/' . $link . 'xem-phim/'; $data_ins = array("name" => $_REQUEST['name'], 'link' => $url, 'thumb' => $_REQUEST['thumbs'], 'internal_link' => $_REQUEST['fetch_id']); $this->db->insert('film', $data_ins); $data['id'] = $this->db->insert_id(); } if (count($query) == "1") { foreach ($query as $key_video) { } $data['id'] = $key_video['id']; } //end save in db } if (isset($_REQUEST['id'])) { foreach ($this->db->select("*")->from('film')->where('id', $_REQUEST['id'])->get()->result_array() as $vid_id) { } $data['link'] = $vid_id['internal_link']; $data['name'] = $vid_id['name']; $data['id'] = $_REQUEST['id']; $data['thumbs'] = $vid_id['thumb']; $link = $vid_id['internal_link']; } $url = 'http://phim3s.net/' . $link . '/xem-phim/'; $trans = new web_transfer(); $indexpage = '?film'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("phim3s.net"); $trans->getcontent($content); $content = str_replace('data/images/flags/vn.png', '/images/vn.png', $content); $content = str_replace("<script", "<kaka", $content); $content = str_replace('<a', '<button', $content); preg_match_all('/<div class="serverlist">(.*?)<div>/s', $content, $matches, PREG_SET_ORDER); if (count($matches) == "0") { redirect('/video/'); } foreach ($matches as $key) { } $data['content'] = $key[1]; $data['film_description'] = $this->get_film_description($link); //user is login $this->load->model('log_model'); $user_log = $this->log_model->getIdUserLogin(); $is_logged_in = $this->session->userdata('is_logged_in'); if (!isset($is_logged_in) || $is_logged_in != true) { $data['is_logged'] = "0"; } else { $data['is_logged'] = "1"; } if ($this->session->userdata('username')) { $data['user_data'] = $user_log; } else { $data['user_data'] = "-1"; } //end //start analytic $analytic = new analytic(); $analytic->myweb('video'); //end analytic $data['csrf_test_name'] = $this->security->get_csrf_hash(); $this->load->view('film/view', $data); }
function run() { if (!isset($_REQUEST['try_it_yourself'])) { redirect('/lap_trinh/web/'); } $indexpage = '/'; $base = '/'; //process textarea content $trans = new web_transfer(); //start filter url $filter_url = split('=', $_REQUEST['try_it_yourself']); $filer_path = split('/', $_REQUEST['try_it_yourself']); if (count($filter_url) > 1) { $url_replace = $filter_url[1] . '.htm'; $url = 'http://www.w3schools.com/' . $_REQUEST['try_it_yourself']; } else { $url_replace = ''; $url = 'http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_default'; } $new_try_url = $filer_path[0] . "/" . $url_replace; $url_to_replace = '/lap_trinh/runIframe?url=' . $new_try_url; //end filter url $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("www.w3schools.com"); $trans->getcontent($content); //start filter //$content=str_replace('xsrc','src',$content); $content = str_replace('onclick="submitTryit()"', '', $content); $content = str_replace('img_logo.gif', 'http://myweb.pro.vn/images/avatar-hat-240.png', $content); $content = str_replace('XGSy3_Czz8k', 'qSeNdUL1Vx8', $content); $content = str_replace('http://www.youtube.com/embed/XGSy3_Czz8k', 'http://www.youtube.com/embed/gBayCA8-92A', $content); $content = str_replace('W3Schools.com', 'Learning TOEFL', $content); $content = str_replace('audi.jpeg', 'http://myweb.pro.vn/images/avatar-hat-240.png', $content); $content = str_replace('http://www.w3schools.com', 'http://myweb.pro.vn/toefl/index', $content); $content = str_replace('bookmark.swf', 'http://vuigame.vcdn.vn/upload/data/duaxejeep_1354186332.swf', $content); $content = str_replace('horse.ogg', 'http://myweb.pro.vn/music/my_oh_my.mp3', $content); $content = str_replace('horse.mp3', 'http://myweb.pro.vn/music/1A%20time%20for%20us.mp3', $content); $content = str_replace('demo_iframe.htm', 'http://myweb.pro.vn/game/', $content); $content = str_replace($url_replace, $url_to_replace, $content); $content = str_replace('Edit This Code:', 'Viết đoạn code bên dưới: ', $content); $content = str_replace('See Result', 'Chạy thử đoạn code này', $content); $content = str_replace('class="submit"', 'class="btn btn-primary"', $content); $content = str_replace('<script>submitTryit()</script>', '<div class="footer_append_server"></div>', $content); preg_match_all('/<body>(.*?)<div class="footer_append_server">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $key_1) { } //end filter $data['main'] = $key_1[0]; $data['csrf_test_name'] = $this->security->get_csrf_hash(); $this->load->view('/lap_trinh/run_code', $data); }
function detail() { $header_title = ''; $trans = new web_transfer(); //start if if (!isset($_REQUEST['book_id'])) { if (!isset($_REQUEST['id'])) { redirect('/book/index'); } else { $book_data = ''; if (isset($_REQUEST['book_title'])) { $book_data = $this->db->select('*')->from('ebook_index')->where('NAME', $_REQUEST['book_title'])->get()->result_array(); } else { $book_data = $this->db->select('*')->from('ebook_index')->where('ID', $_REQUEST['id'])->get()->result_array(); } if ($book_data) { foreach ($book_data as $key) { } $url = "http://tailieuhoctap.vn" . $key['path']; $data['book_id'] = $key['path']; $data['book_title'] = $key['NAME']; $data['book_description'] = strip_tags($key['DESCRIPTION']); if (file_exists($key['THUMBS'])) { $data['book_thumbs'] = $key['THUMBS']; } else { $data['book_thumbs'] = '/images/ebook/book_cover_default.png'; } $data['share_id'] = $key['ID']; $book_id_comment = $key['ID']; $header_title = $key['NAME']; } else { redirect("/book/index/"); } } } else { $book_id = $this->input->get_post('book_id'); $book_title = $this->input->get_post('book_title'); $book_description = $this->input->get_post('book_description'); $book_thumbs = $this->input->get_post('book_thumbs'); //load database setting $db = $this->load->database('thesis_notes', TRUE); $check_exist = $db->select('*')->from('ebook_index')->where('NAME', $book_title)->get()->result_array(); $header_title = $book_title; //start check where the book exist in db $count_check = count($check_exist); $data = array('NAME' => strip_tags($book_title), 'DESCRIPTION' => strip_tags($book_title), 'THUMBS' => $book_thumbs, 'REFERER' => 'tailieuhoctapvn', 'path' => $book_id); if ($count_check == 0) { $db->insert('ebook_index', $data); $data['share_id'] = $this->db->insert_id(); $book_id_comment = $this->db->insert_id(); } else { $book_data = $db->select('*')->from('ebook_index')->where('NAME', $_REQUEST['book_title'])->get()->result_array(); foreach ($book_data as $key) { } $data['share_id'] = $key['ID']; $book_id_comment = $key['ID']; } //end check where the book exist in db $url = "http://tailieuhoctap.vn" . $book_id; $data['book_id'] = $book_id; $data['book_title'] = $book_title; $data['book_description'] = $book_description; $data['book_thumbs'] = $book_thumbs; } //end else $header = new header(); $header->book($header_title); $indexpage = '/'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("tailieuhoctap.vn"); $trans->getcontent($content); $content = str_replace(" - ", "", $content); $content = str_replace(" - ", "", $content); $content = str_replace('style="color:', 'style="display:none;color:', $content); $content = str_replace("display: block", "display:none", $content); $content = str_replace("noi-dung-huongdan", "noi-dung-huongdan modal hide fade", $content); $content = str_replace('onclick="huongdandown()"', '', $content); $content = str_replace('<script type="text/javascript">var addthis_config = {"data_track_addressbar":true}; var addthis_share = {description:test code};</script>', '', $content); preg_match_all('/<div class="item-page">(.*?)<div class="them">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $matches_main) { } if ($matches) { $related_content = $this->get_content_related($url); $data['content'] = $matches_main[0] . $related_content; $data['csrf_test_name'] = $this->security->get_csrf_hash(); } else { redirect('book/index'); } //load comment $data_comment = $db->select('*')->from('fk_user_book_comment')->join('qtht_users', 'qtht_users.ID_U=fk_user_book_comment.ID_U', 'inner')->where('ID_BOOK', $book_id_comment)->get()->result_array(); //end //start analytic $analytic = new analytic(); $analytic->myweb('book'); //end analytic $data['data_comment'] = $data_comment; if (!isset($_REQUEST['is_download'])) { $data['is_download'] = "0"; } else { $data['is_download'] = "1"; } //login pop-up if (isset($_REQUEST['type'])) { $data['type'] = $_REQUEST['type']; } else { $data['type'] = '0'; } //end //get category $url_cate = 'http://tailieuhoctap.vn/tai-lieu-hoc-tap/'; $indexpage_cate = '/'; $base_cate = '/'; $trans->initiate_news($url_cate, $indexpage_cate); $trans->converturl($url_cate, $base_cate); $content_category = ''; $trans->start_transfer("tailieuhoctap.vn"); $trans->getcontent($content_category); $content_category = $this->filter_html($content_category); preg_match_all('/<div id="ja-left1" class="ja-col column" style="width:99.5%">(.*?)<div class="ja-moduletable moduletable tag clearfix" id="Mod52">/s', $content_category, $matches_left, PREG_SET_ORDER); foreach ($matches_left as $key_left) { } $left = '<div id="ja-left" class="column sidebar"><div class="ja-colswrap clearfix ja-l1"><div id="ja-left1" class="ja-col column" style="width:98%">' . $key_left[1] . '</div></div></div>'; //end $data['left_category'] = $left; $this->load->view('/book/detail', $data); }
function index($path) { $trans = new web_transfer(); $path = str_replace('--', '/', $path); $db = $this->load->database('thesis_notes', TRUE); $book_data = $db->select('ebook_category.id as ID_CATEGORY,ebook_category.NAME as CATEGORY,ebook_index.*')->from('ebook_index')->join('ebook_category', 'ebook_category.id=ebook_index.ID_CATEGORY', 'inner')->where('ebook_index.path', $path)->get()->result_array(); if ($book_data) { foreach ($book_data as $key) { } } else { echo '<script type="text/javascript" src="//e-vcdn.anthill.vn/delivery-ants/zone/521621655.js"></script>'; } $data['book_id'] = $key['path']; $data['book_title'] = $key['NAME']; $data['category'] = $key['CATEGORY']; $data['category_id'] = $key['ID_CATEGORY']; $data['book_description'] = strip_tags($key['DESCRIPTION']); $data['book_thumbs'] = $key['THUMBS']; $data['mime'] = $key['MIME']; $data['file_extension'] = $key['FILE_EXTENSION']; $data['share_id'] = $key['ID']; $data['share'] = 'http://myweb.pro.vn/doc-sach-tham-khao?id=' . $key['ID']; //start get site tailieuhoctap.vn data $url = "http://tailieuhoctap.vn" . $key['path']; $indexpage = '/'; $base = '/'; $trans->initiate_news($url, $indexpage); $trans->converturl($url, $base); $content = ''; $trans->start_transfer("tailieuhoctap.vn"); $trans->getcontent($content); $content = str_replace('http://tailieuhoctap.vn/images/filetype', 'http://myweb.pro.vn/images/icon', $content); $content = str_replace("Tailieuhoctap.vn", "website myweb.pro.vn", $content); $content = str_replace(" - ", "", $content); $content = str_replace(" - ", "", $content); $content = str_replace('style="color:', 'style="display:none;color:', $content); $content = str_replace("display: block", "display:none", $content); $content = str_replace("noi-dung-huongdan", "noi-dung-huongdan modal hide fade", $content); $content = str_replace('onclick="huongdandown()"', '', $content); $content = str_replace('<script type="text/javascript">var addthis_config = {"data_track_addressbar":true}; var addthis_share = {description:test code};</script>', '', $content); preg_match_all('/<div class="item-page">(.*?)<div class="them">/s', $content, $matches, PREG_SET_ORDER); foreach ($matches as $matches_main) { } if ($matches) { //$data['content']=$matches_main[0].$related_content; $data['content'] = $matches_main[0]; $data['csrf_test_name'] = $this->security->get_csrf_hash(); } else { redirect('book/index'); } //end get tailieuhoctap.vn data if (!isset($_REQUEST['is_download'])) { $data['is_download'] = "0"; } else { $data['is_download'] = "1"; } //login pop-up if (isset($_REQUEST['type'])) { $data['type'] = $_REQUEST['type']; } if (!isset($_REQUEST['type'])) { $data['type'] = '0'; } //end $header = new header(); $header->book($key['NAME']); $data['embed_url'] = 'http://myweb.pro.vn/book/pdfviewer?id=' . $key['ID']; $data['cate_name'] = $key['CATEGORY']; $data['id_cate'] = $key['ID_CATEGORY']; $data['category_names'] = array(); $this->load->view('book/detail', $data); }