|
|
|
Yazan
|
Konu: Bunu nasil kurarim? (Okunma Sayısı 455 defa)
|
Realturka
Yeni Kullanıcılar
Offline
Mesaj Sayısı: 1
|
Yaw bu sabah canım çok sıkıldı ve bi web sitesi yapayım dedim, ama HTML de PHP de bilmiyorum.. Dreamweaver yukledim, bikaç kodu okumayı başarabiliyorum gerçi ama şunu sayfaya ekleyemiyorum, nasıl yapılır? class RndImage{ /******************************************************************** * Random Image Class * Version: 1.0 * Date: 9/9/2001 * License: GPL * Author: einav brill * Contact: einavb@email.com * Description: * this simple class is used to show a random image from an array * of image paths. * Functions: * setPath(image_path) is used to set the images path. * insertRndImage(imgs) used to get a list of images path * getRndImage() return a random image path * Usage: * $rndImg = new RndImage(); * $rndImg->setPath('images/rotating_images/'); * $rndImg->insertRndImage('image_1.jpg','image_2.jpg','image_3.jpg',etc..); * HTML....<? echo $rndImg->getRndImage(); ?>.....HTML **********************************************************************/ var $_path ; var $_imgArray ;
function setPath($pathName){ $this->_path = $pathName; }
function insertRndImage($imgs) { $imgArraySize = func_num_args(); for($imgNum=0;$imgNum<$imgArraySize;$imgNum++) { $this->_imgArray[$imgNum] = $this->_path.func_get_arg($imgNum); } }
function getRndImage(){ srand ((double) microtime() * 1000000); $rndValue = rand(0,sizeof($this->_imgArray)-1); return $this->_imgArray[$rndValue]; } }
Yardımlarınız için teşekkürler
|
|
|
|
|
Logged
|
|
|
|
|
mustklc
|
Description: * this simple class is used to show a random image from an array * of image paths. * Functions: * setPath(image_path) is used to set the images path. * insertRndImage(imgs) used to get a list of images path * getRndImage() return a random image path diyor ki bu sinif, resim yollarini tasiyan bir dizideki resimleri rastgele gosterir. yani diziye resimlerin yollarini eklemelisin. (/images/..gibi) php bilmiyorsan hic ugrasma bence. madem canin sıkılıca site yapmak isityorsun sana JOOMLA önerebilirim. burdan destek alabilirsin
|
|
|
|
|
Logged
|
|
|
|
|
 |
|