<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: pic.php 20623 2011-6-27 13:00:00 add by L $
*/
define('APPTYPEID', 2);
define('CURSCRIPT', 'forum');
require './source/class/class_core.php';
$discuz = & discuz_core::instance();
$discuz->init();
require DISCUZ_ROOT.'./source/function/function_home.php';
require DISCUZ_ROOT.'./source/function/function_portal.php';
if(!$_G['uid'])
{
die;
}
set_time_limit(0);
$p=$_GET['p'];//p是QQ空间图片地址
if(!is_dir('./data/qqpic/')) mkdir('./data/qqpic/',0777);
$cachesort = './data/qqpic/yws_'.md5($p).'.php';
if(file_exists($cachesort)&& filesize($cachesort) > 1024) {
$result = file_get_contents($cachesort);//这个函数网上有,自己找下
} else {
$result = file_get_contents_curl($p);
$tempNamesort = tempnam('./data/qqpic','YWS');
file_put_contents($tempNamesort, $result);
@unlink($cachesort);
@rename($tempNamesort, $cachesort);
}
print_r($result);
?>
可用于discuz X2的,用来显示并保存QQ空间图片的文件~
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://www.heiqu.com/87292561b0d9c76a4261ef1f31c2fae6.html