Visualizzazione dei risultati da 1 a 7 su 7

Discussione: Semplicissima gallery

  1. #1

    Semplicissima gallery

    Ciao vorrei sapere come si puo creare una gallery di immagini che importi semplicemente le immagini da una cartella sul server
    Ovvero io faccio l'upload di immagini sul server vado sul mio sito www.xxxxxx.com faccio partire lo script e lui automaticamente mi crea una tabella con tutte le immagini presenti nella cartella.
    Non mi serve la creazione di thumb o altre opzioni solo e semplicemente :ignore: questo

    Grazie

  2. #2
    Ciao,
    prova qui, è già tutto pronto

    http://www.stadtaus.com/en/php_scripts/gallery_script/

    non occorrono database

    Bye
    TouchWeb - Siti web - Programmazione Php/Java
    http://www.touchweb.it
    Realizzazione siti e-commerce - Piattaforma PrestaShop
    http://www.touchweb.biz

  3. #3
    ok grazie è proprio cio che cercavo, mi sapreste anche dire come faccio se voglio vedere delle immagini in swf (flash)? che non li legge VVoVe:
    se vi serve vi posto il codice dello script :master:

    Grazie a tutti

  4. #4
    devi semplicemente leggere l'estensione swf del file (substr) e se il file è un swf
    modificare automaticamente il codice

    <img ...

    con il codice standard per mostrare dei flash nelle pagine web

    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="32" height="32">
    <param name="movie" value="file.swf" />
    <param name="quality" value="high" />
    <embed src="file.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="100"></embed>
    </object>


    dovrebbe essere abbastanza semplice

    ciao
    TouchWeb - Siti web - Programmazione Php/Java
    http://www.touchweb.it
    Realizzazione siti e-commerce - Piattaforma PrestaShop
    http://www.touchweb.biz

  5. #5
    Grazie ancora però mi rimane un problemino ovvero il tag substr lo ho trovato in questa pagina di codice, ma dove devo sostituire il prugin per gli swf :ignore:
    Codice PHP:
    <?php


        
    class template{

            var 
    $var_names    = array();
            var 
    $files        = array();
            var 
    $start        '{';
            var 
    $end        '}';

        
    /***************************************
        ** Function to load a template into
        ** the class.
        ***************************************/
            
    function load_file($file_id$filename){
                
    $this->files[$file_id] = fread($fp fopen($filename'r'), filesize($filename));
                
    fclose($fp);
            }


        
    /***************************************
        ** Function to load a template into
        ** the class.
        ***************************************/
            
    function set_identifiers($start$end){
                
    $this->start $start;
                
    $this->end $end;
            }

        
    /***************************************
        ** This function is used only by the
        ** register() method, for going through
        ** arays and extracting the values.
        ***************************************/
            
    function traverse_array($file_id$array){
                while(list(,
    $value) = each($array)){
                    if(
    is_array($value)) $this->traverse_array($file_id$value);
                    else 
    $this->var_names[$file_id][] = $value;
                }
            }

        
    /***************************************
        ** Function to register a variable(s).
        ***************************************/
            
    function register($file_id$var_name){
                if(
    is_array($var_name)){
                    
    $this->traverse_array($file_id$var_name);
                }elseif(
    $var_name != ''){
                    if(
    is_long(strpos($var_name',')) == TRUE){
                        
    $var_name explode(','$var_name);
                        for(
    reset($var_name); $current current($var_name); next($var_name)) $this->var_names[$file_id][] = trim($current);
                    }else{
                        
    $this->var_names[$file_id][] = $var_name;
                    }
                }
            }

        
    /***************************************
        ** Function to include another file.
        ** eg. A header/footer.
        ***************************************/
            
    function include_file($file_id$filename){
                if(
    file_exists($filename)){
                    
    $include fread($fp fopen($filename'r'), filesize($filename));
                    
    fclose($fp);
                }else 
    $include '[ERROR: "'.$filename.'" does not exist.]';

                
    $tag substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '<include filename="'.$filename.'">'), strlen('<include filename="'.$filename.'">'));
                
    $this->files[$file_id] = str_replace($tag$include$this->files[$file_id]);
            }

        
    /***************************************
        ** Function for reading and parsing the
        ** html file for normal variables. Also
        ** now checks for include tags and if
        ** necessary calls include_file()
        ***************************************/
            
    function parse($file_id){
                
    $file_ids explode(','$file_id);
                for(
    reset($file_ids); $file_id trim(current($file_ids)); next($file_ids)){
                    while(
    is_long($pos strpos(strtolower($this->files[$file_id]), '<include filename="'))){
                        
    $pos += 19;
                        
    $endpos strpos($this->files[$file_id], '">'$pos);
                        
    $filename substr($this->files[$file_id], $pos$endpos-$pos);
                        
    $this->include_file($file_id$filename);
                    }

                    if(isset(
    $this->var_names[$file_id]) AND count($this->var_names[$file_id]) > 0){
                        for(
    $i=0$i<count($this->var_names[$file_id]); $i++){
                            
    $temp_var $this->var_names[$file_id][$i];

                            if(
    is_long(strpos($this->files[$file_id], $this->start.$temp_var.$this->end))){
                                global $
    $temp_var;
                                
    $this->files[$file_id] = str_replace($this->start.$temp_var.$this->end, $$temp_var$this->files[$file_id]);

                            }elseif(
    is_long(strpos($this->files[$file_id], $this->start.$temp_var.'()'.$this->end))){
                                global $
    $temp_var;
                                
    $arguments = array();
                                for(
    $i=0$i<count($$temp_var); $i++) $arguments[] = ${$temp_var}[$i];
                                if(
    count($arguments) > 0$arguments '"'.implode('", "'$arguments).'"'; else $arguments '';
                                eval(
    '$output = '.$temp_var.'('.$arguments.');');
                                
    $this->files[$file_id] = str_replace($this->start.$temp_var.'()'.$this->end$output$this->files[$file_id]);
                            }
                        }
                    }
                }
            }

        
    /***************************************
        ** Function for parsing an array.
        ***************************************/
            
    function parse_loop($file_id$array_name){
                global $
    $array_name;
                
    $loop_code '';

                
    $start_pos strpos(strtolower($this->files[$file_id]), '<loop name="'.$array_name.'">') + strlen('<loop name="'.$array_name.'">');
                
    $end_pos strpos(strtolower($this->files[$file_id]), '</loop name="'.$array_name.'">');

                
    $loop_code substr($this->files[$file_id], $start_pos$end_pos-$start_pos);

                
    $start_tag substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '<loop name="'.$array_name.'">'),strlen('<loop name="'.$array_name.'">'));
                
    $end_tag substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '</loop name="'.$array_name.'">'),strlen('</loop name="'.$array_name.'">'));

                if(
    $loop_code != ''){
                    
    $new_code '';
                    for(
    $i=0$i<count($$array_name); $i++){
                        
    $temp_code $loop_code;
                        while(list(
    $key,) = each(${$array_name}[$i])){
                            
    $temp_code str_replace($this->start.$key.$this->end,${$array_name}[$i][$key], $temp_code);
                        }
                        
    $new_code .= $temp_code;
                    }
                    
    $this->files[$file_id] = str_replace($start_tag.$loop_code.$end_tag$new_code$this->files[$file_id]);
                }
            }

        
    /***************************************
        ** Function for parsing a Mysql result
        ** set.
        ***************************************/
            
    function parse_sql($file_id$result_name){
                global $
    $result_name;
                
    $loop_code '';

                
    $start_pos strpos(strtolower($this->files[$file_id]), '<loop name="'.$result_name.'">') + strlen('<loop name="'.$result_name.'">');
                
    $end_pos strpos(strtolower($this->files[$file_id]), '</loop name="'.$result_name.'">');

                
    $loop_code substr($this->files[$file_id], $start_pos$end_pos-$start_pos);

                
    $start_tag substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '<loop name="'.$result_name.'">'),strlen('<loop name="'.$result_name.'">'));
                
    $end_tag substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '</loop name="'.$result_name.'">'),strlen('</loop name="'.$result_name.'">'));

                if(
    $loop_code != ''){
                    
    $new_code '';
                    
    $field_names = array();
                    for(
    $i=0$i<mysql_num_fields($$result_name); $i++) $field_names[] = mysql_field_name($$result_name,$i);
                    while(
    $row_data mysql_fetch_array($$result_nameMYSQL_ASSOC)){
                        
    $temp_code $loop_code;
                        for(
    $i=0$i<count($field_names); $i++){
                            
    $temp_code str_replace($this->start.$field_names[$i].$this->end$row_data[$field_names[$i]], $temp_code);
                        }
                        
    $new_code.= $temp_code;
                    }
                    
    $this->files[$file_id] = str_replace($start_tag.$loop_code.$end_tag$new_code$this->files[$file_id]);
                }
            }

        
    /***************************************
        ** Function for parsing a Postgres result
        ** set.
        ***************************************/
            
    function parse_pgsql($file_id$result_name){
                global $
    $result_name;
                
    $loop_code '';

                
    $start_pos strpos(strtolower($this->files[$file_id]), '<loop name="'.$result_name.'">') + strlen('<loop name="'.$result_name.'">');
                
    $end_pos strpos(strtolower($this->files[$file_id]), '</loop name="'.$result_name.'">');

                
    $loop_code substr($this->files[$file_id], $start_pos$end_pos-$start_pos);

                
    $start_tag substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '<loop name="'.$result_name.'">'),strlen('<loop name="'.$result_name.'">'));
                
    $end_tag substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '</loop name="'.$result_name.'">'),strlen('</loop name="'.$result_name.'">'));

                if(
    $loop_code != ''){
                    
    $new_code '';
                    
    $field_names = array();
                    for(
    $i=0$i<pg_numfields($$result_name); $i++) $field_names[] = pg_fieldname($$result_name,$i);
                    for(
    $i=0$i<pg_numrows($$result_name) AND $row_data pg_fetch_array($$result_name$i); $i++){
                        
    $temp_code $loop_code;
                        for(
    $j=0$j<count($field_names); $j++){
                            
    $temp_code str_replace($this->start.$field_names[$j].$this->end$row_data[$field_names[$j]], $temp_code);
                        }
                        
    $new_code.= $temp_code;
                    }
                    
    $this->files[$file_id] = str_replace($start_tag.$loop_code.$end_tag$new_code$this->files[$file_id]);
                }
            }

            
    /***************************************
            ** Function looking for if blocks
            ** added by Stephan Lüderitz
            ***************************************/
                   
    function parse_if($file_id$array_name){

                       
    $var_names explode(','$array_name);

                       for(
    $i=0$i<count($var_names); $i++){
                            
    $if_code    '';
                            
    $start_pos    strpos(strtolower($this->files[$file_id]), '<if name="'.strtolower($var_names[$i]).'">') + strlen('<if name="'.strtolower($var_names[$i]).'">');
                            
    $end_pos    strpos(strtolower($this->files[$file_id]), '</if name="'.strtolower($var_names[$i]).'">');

                            
    $if_code    substr($this->files[$file_id], $start_pos$end_pos-$start_pos);
                            
    $start_tag    substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '<if name="'.strtolower($var_names[$i]).'">'),strlen('<if name="'.strtolower($var_names[$i]).'">'));
                            
    $end_tag    substr($this->files[$file_id], strpos(strtolower($this->files[$file_id]), '</if name="'.strtolower($var_names[$i]).'">'),strlen('</if name="'.strtolower($var_names[$i]).'">'));

                            
    $new_code '';
                            if(
    $if_code != ''){
                                    global ${
    $var_names[$i]};
                                    if(@${
    $var_names[$i]})
                                        
    $new_code $if_code;

                                    
    $this->files[$file_id] = str_replace($start_tag.$if_code.$end_tag$new_code$this->files[$file_id]);
                            }
                        }
                    }

        
    /***************************************
        ** Function for printing the resulting
        ** file(s).
        ***************************************/
            
    function print_file($file_id){
                if(
    is_long(strpos($file_id',')) == TRUE){
                    
    $file_id explode(','$file_id);
                    for(
    reset($file_id); $current current($file_id); next($file_id)) echo $this->files[trim($current)];
                }else{
                    echo 
    $this->files[$file_id];
                }
            }

        
    /***************************************
        ** Function for returning the resulting
        ** file(s).
        ***************************************/
            
    function return_file($file_id){
                
    $ret '';
                if(
    is_long(strpos($file_id',')) == TRUE){
                    
    $file_id explode(','$file_id);
                    for(
    reset($file_id); $current current($file_id); next($file_id)) $ret .= $this->files[trim($current)];
                }else{
                    
    $ret .= $this->files[$file_id];
                }
                return 
    $ret;
            }

        
    /***************************************
        ** Parses and then immediately prints
        ** the file. This function added by
        ** Bruce Christensen.
        ***************************************/
            
    function pprint($file_id$replacements ''){
                
    $this->register($file_id$replacements);
                
    $this->parse($file_id);
                
    $this->print_file($file_id);
            }

        
    /***************************************
        ** Parses and then immediately returns
        ** the file's contents. Function added
        ** by Bruce Christensen.
        ***************************************/
            
    function pget($file_id$replacements ''){
                
    $this->register($file_id$replacements);
                
    $this->parse($file_id);
                return 
    $this->return_file($file_id);
            }

        
    /***************************************
        ** Loads a file, parses it, and prints it.
        ** This function added by Bruce Christensen.
        ***************************************/
            
    function pprint_file($filename$replacements ''){
                for(
    $file_id=1; isset($this->files[$file_id]); $file_id++);
                
    $this->load_file($file_id$filename);
                
    $this->pprint($file_id$replacements);
                unset(
    $this->files[$file_id]);
            }

        
    /***************************************
        ** Loads, parses and then immediately
        ** returns the file's contents.
        ** Function added by Bruce Christensen.
        ***************************************/
            
    function pget_file($filename$replacements ''){
                for(
    $file_id=1; isset($this->files[$file_id]); $file_id++);
                
    $this->load_file($file_id$filename);
                return 
    $this->pget($file_id$replacements);
            }

        } 
    // End of class
    ?>

  6. #6
    Substr è una funzione che ti permette di estrapolare una parte di stringa

    http://it.php.net/manual/it/function.substr.php

    una volta letta l'estensione del file ed aver visto che è swf allora mostri il codice che ti ho scritto


    L'operazione non è diffcile ma neanche facile.
    TouchWeb - Siti web - Programmazione Php/Java
    http://www.touchweb.it
    Realizzazione siti e-commerce - Piattaforma PrestaShop
    http://www.touchweb.biz

  7. #7
    Ciao grazie ho provato e dopo tante e tante ore ci sono riuscito ma con un piccolo problema la soluzione la avevo gia trovata dopo 10 minuti ma sfortunatamente non supporta come browser firefox (che io uso) mentre appena l'ho provato con internet explorer tutto funzionava perfettamente ma siccome gli utenti intenet che usano firefox non sono pochi cè un plugin aggiuntivo per firefoc grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.