心路历程 发表于 2006-9-11 22:21:43

好多签名图片都找不到了!!!

http://stats.equn.com/
怎么回事啊!!!

equn 发表于 2006-10-1 09:57:43

哪位是PHP高手啊? 原因不明啊 為什么不能顯示?。。

fwjmath 发表于 2006-10-1 10:03:18

给我一个 php 文件,我来看看看看能不能找出什么问题~~~
但是找不出别怪我~~~

equn 发表于 2006-10-1 10:05:56

SETI3E




<?php
function http_get($url)
{
$result = shell_exec("wget -q -O - $url");
return $result;
}

if(!$_GET){
$userid="";
}

$file = "http://setiathome.berkeley.edu/userw.php?id=";
$file .= $userid;

$map_array = array(
"BOLD" => "B",
"EMPHASIS" => "I",
"LITERAL" => "TT"
);

function startElement($parser, $name, $attrs)
{
global $map_array;
if (isset($map_array[$name])) {
echo "<$map_array[$name]>";
}
}

function endElement($parser, $name)
{
global $map_array;
if (isset($map_array[$name])) {
echo "</$map_array[$name]>";
}
}
function characterData($parser, $data)
{
global $outdata;
$outdata[]=$data;
}

$xml_parser = xml_parser_create();
// use case-folding so we are sure to find the tag in $map_array
xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");

if (!($fp = fopen($file, "r"))) {
die("could not open XML input");
}

while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d, ",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
xml_parser_free($xml_parser);


/* 发送文件头以使浏览器知道文件类型*/
header("Content-type: image/jpeg");
/* 以给定长和宽创建空白新图片 */
$im = imagecreatetruecolor(380,100);
/* 从原始大图获取资料 */
//$origImg = ImageCreateFromJPEG("seti.jpg");
//ImageCopyResized($im,$origImg,0,0,0,0,380,100,ImageSX($origImg),ImageSY($origImg));
imagefilledrectangle($im, 0, 0, 380, 150, $background_color);
$secondImg = ImageCreateFromJPEG("seti3e.jpg");
ImageCopyResized($im,$secondImg,270,0,0,0,ImageSX($secondImg),ImageSY($secondImg),ImageSX($secondImg),ImageSY($secondImg));

$origImg = ImageCreateFromJPEG("seti3e.jpg");
ImageCopyResized($im,$origImg,0,0,0,0,380,100,ImageSX($origImg),ImageSY($origImg));

$background_color = imagecolorallocate($im, 0, 0, 0);
$black = ImageColorAllocate($im, 255,255,255);
$text_color = imagecolorallocate($im, 0, 0, 0);
//$text_color = imagecolorallocate($im, 0, 0, 0);

//$text_color = imagecolorallocate($im, 0, 0, 255);

// imagestring($im, 20, 85,5, "SETI@Home", $text_color);
imagestring($im, 20, 9,5, ereg_replace('for ','',$outdata), $text_color);
for($i=4;$i<count($outdata);$i++){
imagestring($im, 20, 9,20+(15*($i-4)), $outdata[$i], $text_color);
}
//imagestring($im, 20, 0,130, $outdata, $text_color);
//imageline($im, 55, 20, 250, 20, $black);
//imagefilledrectangle($im, 0, 0, 380, 150, $background_color);

imagejpeg($im);
imagedestroy($im);

?>

fwjmath 发表于 2006-10-1 10:08:58


$file = "http://setiathome.berkeley.edu/userw.php?id=";
==>
$file = "http://setiathome.berkeley.edu/show_user.php?userid=";

试试这样子行不行??


这个是不行的~~~

[ Last edited by fwjmath on 2006-10-1 at 10:17 ]

equn 发表于 2006-10-1 10:19:44

以前是行的啊。。。你这个不包含用户名。

fwjmath 发表于 2006-10-1 10:36:30

是不是跟踪一下 outdata ?

fwjmath 发表于 2006-10-13 16:44:19

我突然想到了一个疑似的原因:是不是现在服务器不允许php页面写文件了?
因为签名的生成中需要在服务器生成文件,而现在又不能上传附件,所以有此猜测~~~

equn 发表于 2006-10-13 19:37:33

不能上传文件已经很久了,但是签名是最近才出现的问题吧。。
页: [1]
查看完整版本: 好多签名图片都找不到了!!!

论坛官方淘宝店开业啦~