ChiaSeIT.Mobie.In

Share hàm leech Ảnh về Xtgem và tạo Thumb cho IDVN v3

Demo: http://khotruyenhay.gq
I. Hàm leech Ảnh về Xtgem

function hk_up_files($data){
preg_match_all('/\[img\](.*?)\[\/img\]/is', $data, $img);
if(!empty($img[1])){
foreach($img[1] as $i => $anh){
$anh = str_replace('

', '',$anh);
$title = rwurl(basename($anh));
$ghi=file_put_contents('img/'.$title,file_get_contents($anh));
@set_time_limit(0);
include 'set.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_URL, $auto);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_exec($ch);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_URL, ' http://xtgem.com/filebrowser');
$nd = curl_exec($ch);
preg_match('#token=(.*?)&#is', $nd, $matoken);$token = @$matoken[1];
curl_setopt($ch, CURLOPT_URL, ' http://xtgem.com/filebrowser/file_upload?file=/img');
$html = curl_exec($ch);
preg_match('#<input type="file" name="filext([a-z0-9] )" \/>#', $html, $xt);
$rd = 'filext'.$xt[1];
if(!isset($rd)) continue;
curl_setopt($ch, CURLOPT_URL, ' http://xtgem.com/filebrowser/file_upload_save?__token=&#039;.$token.&#039;&amp;file=/img&#039;);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('MAX_FILE_SIZE' => '5242880', $rd => '@img/'.$title, 'upload_more' => 'y', 'submit' => 'OK'));
curl_exec($ch);
$data=str_replace($anh, '/img/'.$title, $data);
curl_close($ch);
}
}
return $data;
}


Cách dùng:
- Vào tool post Idvn tìm file function.php, thêm code trên vào.
- Vào file incfiles/new_posts.php
Tìm

$content = md_up_files($_POST['content']);


thay thế bằng

$content = hk_up_files($_POST['content']);


II. Tạo thumb
Tạo file SimpleImage.php


<?php
header('Content-Type:image/jpeg');
class SimpleImage{
var $image;
var $image_type;
function load($filename){
$image_info=getimagesize($filename);
$this->image_type=$image_info[2];
if($this->image_type==IMAGETYPE_JPEG){
$this->image=imagecreatefromjpeg($filename);
}elseif($this->image_type==IMAGETYPE_GIF){
$this->image=imagecreatefromgif($filename);
}elseif($this->image_type==IMAGETYPE_PNG){
$this->image=imagecreatefrompng($filename);
}
}
function save($filename,$image_type=IMAGETYPE_JPEG,$compression=75,$permissions=null){
if($image_type==IMAGETYPE_JPEG){
imagejpeg($this->image,$filename,$compression);
}elseif($image_type==IMAGETYPE_GIF){
imagegif($this->image,$filename);
}elseif($image_type==IMAGETYPE_PNG){
imagepng($this->image,$filename);
}
if($permissions!=null){
chmod($filename,$permissions);
}
}
function output($image_type=IMAGETYPE_JPEG){
if($image_type==IMAGETYPE_JPEG){
imagejpeg($this->image);
}elseif($image_type==IMAGETYPE_GIF){
imagegif($this->image);
}elseif($image_type==IMAGETYPE_PNG){
imagepng($this->image);
}
}
function getWidth(){
return imagesx($this->image);
}
function getHeight(){
return imagesy($this->image);
}
function resizeToHeight($height){
$ratio=$height/$this->getHeight();
$width=$this->getWidth()*$ratio;
$this->resize($width,$height);
}
function resizeToWidth($width){
$ratio=$width/$this->getWidth();
$height=$this->getheight()*$ratio;
$this->resize($width,$height);
}
function scale($scale){
$width=$this->getWidth()*$scale/100;
$height=$this->getheight()*$scale/100;
$this->resize($width,$height);
}
function resize($width,$height){
$new_image=imagecreatetruecolor($width,$height);
imagecopyresampled($new_image,$this->image,0,0,0,0,$width,$height,$this->getWidth(),$this->getHeight());
$this->image=$new_image;
}
}
?>


Vào file incfiles/new_posts.php
Tìm đoạn

$zz = explode('''>
',$content); $zzz = explode('

',$content); $zzz = explode('[img]',$zz[0]);
$icon = $zzz[1];
if(!empty($icon)){
include 'SimpleImage.php';
$rs = basename($icon);
$image = new SimpleImage();
$image->load('img/'.$rs);
$image->resize(65,65);
$image->save('thumb/'.$rs);
include 'set.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_URL, $auto);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_exec($ch);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_URL, ' http://xtgem.com/filebrowser&#039;);
$nd = curl_exec($ch);
preg_match('#token=(.*?)&#is', $nd, $matoken);
$token = @$matoken[1];
curl_setopt($ch, CURLOPT_URL, ' http://xtgem.com/filebrowser/file_upload?file=/thumb&#039;);
$html = curl_exec($ch);
preg_match('#<input type="file" name="filext([a-z0-9] )" \/>#', $html, $xt);
$rd = 'filext'.$xt[1];
if(!isset($rd)) continue;
curl_setopt($ch, CURLOPT_URL, ' http://xtgem.com/filebrowser/file_upload_save?__token=&#039;.$token.&#039;&amp;file=/thumb&#039;);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('MAX_FILE_SIZE' => '5242880', $rd => '@thumb/'.$rs, 'upload_more' => 'y', 'submit' => 'OK'));
curl_exec($ch);
curl_close($ch);
$thumb= '/thumb/'.$rs;
}else{
$thumb = '/thumb/no.png';
}


Lưu ý: phải vào xtgem tạo 2 thư mục imgthumb ngang hàng index.
- Trên host tạo thư mục 'img' và 'thumb' ngang hàng với file function.php và SimpleImage.php .
Và điều đặc biệt quan trọng là phải cài tool hỗ trợ idvnv3.
Nguồn: nhozkitboy - 2hi.biz

Bình luận
Từ Khóa
Share hàm leech Ảnh về Xtgem và tạo Thumb cho IDVN v3 , Demo:, http://khotruyenhay.gq [b]I., Hàm, leech, Ảnh, về, Xtgem[/b] [quote]funct , Tìm hiểu Share hàm leech Ảnh về Xtgem và tạo Thumb cho IDVN v3 làm theo và học hỏi , Bài viết Hot Share hàm leech Ảnh về Xtgem và tạo Thumb cho IDVN v3 ,
Cùng Chuyên Mục
Share Tool Auto Leech Ảnh Ohdep Cho Filelist IDVN v3
Share code filelist IDVN v3 phiên bản Mod cực kì Mới lạ
Share code Tìm kiếm Bài viết cho IDVN v3
Share code filelist Viptruyen không bai-viet kèm tool Leech
Share tool Post bài Idvn v3 thêm Post Chapter cho wap Truyện
Share filelist Idvn v3 bản Mới nhất
Share Filelist VeryNice Url Thân Thiện, Giao Diện Đẹp, Kèm Tool Post
Share filelist Thất vọng by Carbon
Share tool Post, Leech bài cho Filelist Tiaxgame Upload ảnh về Xtgem kèm đóng dấu
Share code tool Post, Leech Bài cho filelist Xtgem V5 mới nhất
Chia sẻ coding miễn phí © 2017
Thiết kế: Mạnh Tuân

sitemap.xml robots.txt U-ONC-STAT
Duck hunt