[問題] Random Photo (Closed)

電腦系統、網絡與軟件,以及流動電子器材。

[問題] Random Photo (Closed)

文章a252 » 2008-01-16, 12:07

I get a php code for the ramdom photo such like Bananasims's 個人簽名.
But it can't show the image at I-Circle

Here's where I upload to
http://a252.890m.com/image.php

Here's the orginal PHP Code
<?php
/*
* Author : Zeuxis Lo
* Date : 2007/07/19 19:10 PM
* Site : http://skhk.uni.cc/
*/
class SeekReadRndDir {

var $imageDir = 'image';
var $imageMaxW= 500;
var $imageMaxH= 70;

function rDir() {
$imageArr = array();
$f = opendir($this->imageDir);
while($files = readdir($f)) {
if ($files != '..' && $files != '.' && preg_match("/(jpg|gif|png)$/i", $files)) {
$imageArr[] = $files;
}
}
closedir($f);
return $imageArr;
}

function pImage($image) {
list($w, $h,,,) = getimagesize($this->imageDir.'/'.$image);

$tmp_w = $w;
$tmp_h = $h;

if ($tmp_h > $this->imageMaxH) {
$tmp_h = $this->imageMaxH;
$percent = ($h / $tmp_h);
$tmp_w = ($w / $percent);
}elseif ($tmp_w > $this->imageMaxW) {
$tmp_w = $this->imageMaxW;
$percent = ($w / $tmp_w);
$tmp_h = ($h / $percent);
}

return array('w'=>$tmp_w, 'h'=>$tmp_h);
}

function sRnd() {
$dirArr = $this->rDir();
$getRand= rand(0,count($dirArr)-1);
$getSize= $this->pImage($dirArr[$getRand]);

echo "<img src='".$this->imageDir.'/'.$dirArr[$getRand]."' width='".$getSize['w']."' height='".$getSize['h']."' />";
}

}

$o = new SeekReadRndDir;
$o ->sRnd();
?>


Please have a look what's wrong wit that

[ 本文章最後由 a252 於 2008-1-17 15:13 編輯 ]
A159-C159-D636-B457-C457-D760-C252-A252
A201-C201-D751-B401-C401-D746-C248-A248
頭像
a252
火星會員
 
文章: 771
註冊時間: 2005-11-07, 00:00
來自: 英國香港

Re: [問題] Random Photo (Closed)

文章bananasims » 2008-01-16, 12:54

如果要貼去論壇, 要 http://a252.890m.com/image.php?png
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: [問題] Random Photo (Closed)

文章a252 » 2008-01-16, 13:01

It still doesn't work...

See below with using img code
圖檔

May be the host looking for malicious content....

[ 本文章最後由 a252 於 2008-1-16 13:39 編輯 ]
A159-C159-D636-B457-C457-D760-C252-A252
A201-C201-D751-B401-C401-D746-C248-A248
頭像
a252
火星會員
 
文章: 771
註冊時間: 2005-11-07, 00:00
來自: 英國香港

Re: [問題] Random Photo (Closed)

文章bananasims » 2008-01-16, 14:24

搵其他網存=.=
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: [問題] Random Photo (Closed)

文章hang » 2008-01-16, 16:33

出到來唔係要改埋header咩?
TUSK!
頭像
hang
火星會員
 
文章: 713
註冊時間: 2005-10-29, 00:00
來自: 英屬香港

Re: [問題] Random Photo (Closed)

文章bananasims » 2008-01-16, 16:42

header('Content-Type: image/png');
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00

Re: [問題] Random Photo (Closed)

文章a252 » 2008-01-17, 15:12

I changed to use someone else's PHP code. It works now...
Thanks for helping

[ 本文章最後由 a252 於 2008-1-17 15:18 編輯 ]
A159-C159-D636-B457-C457-D760-C252-A252
A201-C201-D751-B401-C401-D746-C248-A248
頭像
a252
火星會員
 
文章: 771
註冊時間: 2005-11-07, 00:00
來自: 英國香港

Re: [問題] Random Photo (Closed)

文章bananasims » 2008-01-17, 15:39

係 Hôtel-de-Ville ...法文既名一定要用「-」連住
影像.從心 At the heart of the ímage
bananasims
太陽會員
 
文章: 13541
註冊時間: 2005-09-22, 00:00


回到 [C4] 電腦



誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 14 位訪客

cron