kasparitos Posted November 16, 2008 Report Share Posted November 16, 2008 Sveiki ! Kāds nebūtu tik labs un nevarētu pteikt ,kā var uzstaisīt lai man rādītu random flash banner . Tas nu ir tā ka , REFRESH uzspiet web lapi ,tad samainas iepriekšējā reklāma. Lūdzu palīdziet . Link to comment Share on other sites More sharing options...
p4F Posted November 16, 2008 Report Share Posted November 16, 2008 papēti rand() funkciju. Link to comment Share on other sites More sharing options...
kasparitos Posted November 16, 2008 Author Report Share Posted November 16, 2008 Man vajaga priekš .tpl faila php fails nejiet :( Link to comment Share on other sites More sharing options...
bubu Posted November 16, 2008 Report Share Posted November 16, 2008 Kas tas par tādu tpl failu? Link to comment Share on other sites More sharing options...
kasparitos Posted November 16, 2008 Author Report Share Posted November 16, 2008 (edited) Šitas man stāv iekš modules>>blockus2 BOLCKUS2.PHP <? class Blockus2 extends Module { public function __construct() { $this->name = 'blockus2'; $this->tab = 'Blocks'; $this->version = 1.0; parent::__construct(); /* The parent construct is required for translations */ $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Us2 block'); $this->description = $this->l('Adds a block with several us2 links'); } function install() { if (!parent::install() OR !$this->registerHook('rightColumn')) return false; return true; } function hookLeftColumn($params) { return $this->display(__FILE__, 'blockus2.php'); } function hookRightColumn($params) { return $this->hookLeftColumn($params); } } ?> BLOCKUS2.TPL <!-- Block us2 module --> <div id="us2_block_right" class="block"> <h4>{l s='REKLĀMA' mod='blocus2'}</h4> <ul class="block_content"> </ul> </div> <!-- /Block us2 module --> KUR LAI ES IEVIETOJU ŠITO CEDE PHP ?? <?php $imglist=''; //$img_folder is the variable that holds the path to the swf files. // see that you dont forget about the "/" at the end $img_folder = "images/"; mt_srand((double)microtime()*1000); //use the directory class $imgs = dir($img_folder); //read all files from the directory, ad them to a list while ($file = $imgs->read()) { if (eregi("swf", $file)) $imglist .= "$file "; } closedir($imgs->handle); //put all images into an array $imglist = explode(" ", $imglist); $no = sizeof($imglist)-2; //generate a random number between 0 and the number of images $random = mt_rand(0, $no); $image = $imglist[$random]; //display random swf echo '<embed src="'.$img_folder.$image.'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="520" height="120"></embed>'; ?> Edited November 16, 2008 by kasparitos Link to comment Share on other sites More sharing options...
andrisp Posted November 16, 2008 Report Share Posted November 16, 2008 TUR KUR VAJAG! Link to comment Share on other sites More sharing options...
kasparitos Posted November 16, 2008 Author Report Share Posted November 16, 2008 TUR KUR VAJAG! UN KUR TAS BŪTU ? PRIEKŠ KAM ,TAD IR DOMĀTS FORUMS ? MANUPRĀT ,LAI PALĪDZĒTU CILVĒKIEM ? Link to comment Share on other sites More sharing options...
bubu Posted November 16, 2008 Report Share Posted November 16, 2008 kasparitos: nevajag tāpēc uzreiz bļaut. Protams, ka vajag palīdzēt cilvēkiem. Bet ne jau priekšā visu izdarīt. Ja tu pats saproti, ko dari, tad tev nevajadzētu būt problēmām pielietot p4F ieteikto funkciju. Nezinu neko par tpl failiem, bet tev vienkārši tur vajag php kodā ar rand funkciju izvēlēties savu random flaš banneri, un attiecīgo mainīgo izmantot tpl failā, lai to izvadītu html'ā. Ļoti vienkārši. Ko tu tieši nesaproti no tā? Link to comment Share on other sites More sharing options...
kasparitos Posted November 16, 2008 Author Report Share Posted November 16, 2008 Lūdzu nevajag taisīt bezjēdzīgas QUOTEs Nu piedodiet ja uzbļāvu . Ja godīgi vot es visu pārējo māku , bet šo code nemāku palaist :( Kur viņš jāliek , un kas jaizmaina :( Ja varētu priekšā kaut ko uzrakstīt būtu ļoti ļoti pateicīgs ! Link to comment Share on other sites More sharing options...
Recommended Posts