+ Rispondi alla Discussione
Risultati da 1 a 6 di 6
  1. #1
    IL BIFOLCO L'avatar di <-DooM->
    Data Registrazione
    23-07-04
    Località
    President - First 5
    Messaggi
    55,877

    Predefinito sign con cambio immagini ciclico

    ricordo che una volta qualcuno aveva postato come cambiare l'immagine nella propria sign, andando a pescare a caso tra alcune immagini uploadate su di un sito host, solo che con il cambio forum etc. è impossibile recuperare quel topic...

    per caso qualcuno si ricorda o sa come come fare?

  2. #2
    Il Nonno L'avatar di Xadoom
    Data Registrazione
    03-01-04
    Località
    大学 of Bologna
    Messaggi
    5,413

    Predefinito Re: sign con cambio immagini ciclico

    Devi mettere tutte le img nella stessa cartella, poi prendi questo
    <?php
    /*---------------------------------------------------------------/
    / 123RandomImage v0.0.1 /
    / Based on img.php by inso (www.shi8.com) found at /
    / the phpbuilder.com code snippet library. /
    / /
    / Copyright (C) 2004 Somebody /
    / Email: microchips [at] gmail.com /
    /----------------------------------------------------------------/
    / This program is free software; you can redistribute it and/or /
    / modify it under the terms of the GNU General Public License /
    / as published by the Free Software Foundation; either version 2 /
    / of the License, or (at your option) any later version. /
    / /
    / This program is distributed in the hope that it will be useful,/
    / but WITHOUT ANY WARRANTY; without even the implied warranty of /
    / MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /
    / GNU General Public License for more details. /
    / /
    / You should have received a copy of the GNU General Public /
    / License along with this program; if not, write to the Free /
    / Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,/
    / MA 02111-1307, USA. /
    /---------------------------------------------------------------*/

    //
    // Configuration

    // Change this to the pathname of the directory where the random images reside. If for example your page is at
    // www.website.com/random.php and all the random images are in the directory www.website.com/random-imgs/ you
    // should leave this as-is. All files with a .gif (boo UNISYS!), .jpg, .jpeg or .png extension in this directory
    // will be added to the rotation
    $path = './Sign/';

    // That's all you need to configure! See http://whcontrolpanel.sourceforge.net for information on calling it from
    // webpage.

    $files=array();
    if ($handle=opendir("$path")) {
    while(false !== ($file = readdir($handle))) {
    if ($file != "." && $file != "..") {
    substr($file,-3)=='gif';
    substr($file,-3)=='jpg';
    substr($file,-3)=='jpeg';
    substr($file,-3)=='png';
    $files[count($files)] = $file;
    }
    }
    }
    closedir($handle);

    $random=rand(0,count($files)-1);
    if(substr($files[$random],-3)=='gif') header("Content-type: image/gif");
    elseif(substr($files[$random],-3)=='jpg') header("Content-type: image/jpeg");
    elseif(substr($files[$random],-3)=='jpeg') header("Content-type: image/jpeg");
    elseif(substr($files[$random],-3)=='png') header("Content-type: image/png");
    readfile("$path/$files[$random]");
    ?>
    lo copi e lo incolli sul blocco note, cambi all'inizio inserendo l'url dove stanno le img, lo rinomini con estensione .php e lo uppi su internet.
    Vieni sul forum e metti in firma il link al file php racchiuso fra i tag immagine e va

  3. #3
    La Borga L'avatar di Giux
    Data Registrazione
    31-10-03
    Località
    Cosengeles
    Messaggi
    10,854

    Predefinito Re: sign con cambio immagini ciclico

    non ho capito solo una cosa:dove precisamente all'inizio si deve inserire l'url dove stanno le img?

  4. #4
    Shogun Assoluto L'avatar di Lo Zio
    Data Registrazione
    19-06-02
    Località
    Milano
    Messaggi
    82,960

    Predefinito Re: sign con cambio immagini ciclico

    qua
    $path = './Sign/'

  5. #5

    Predefinito Re: sign con cambio immagini ciclico

    Sarabbe più fico fare un applicazione in Ajax che sfuma le immagini ogni tot secondi...

  6. #6
    IL BIFOLCO L'avatar di <-DooM->
    Data Registrazione
    23-07-04
    Località
    President - First 5
    Messaggi
    55,877

    Predefinito Re: sign con cambio immagini ciclico

    quindi devo uploadarle in un mio spazio giusto? i vari imagehack nn vanno?

    l'url dove saranno le immagini deve essere di questo tipo:
    www.miosito.it/miacartellacondentroimmagini/

    la stringa dello script va bewne così?
    $path = './Sign/'http://www.miosito.it/miacartellacon...magini/php.php;

    oppure

    $path = './http://www.miosito.it/miacartellacon...magini/php.php/'

    ?
    Ultima modifica di <-DooM->; 25-11-06 alle 14:53:37

+ Rispondi alla Discussione

Permessi di Scrittura

  • Tu non puoi inviare nuove discussioni
  • Tu non puoi inviare risposte
  • Tu non puoi inviare allegati
  • Tu non puoi modificare i tuoi messaggi
  • Il codice BB è Attivato
  • Le faccine sono Attivato
  • Il codice [IMG] è Attivato
  • Il codice HTML è Disattivato