www.webdeveloper.com
Results 1 to 2 of 2

Thread: PhotoAlbum

Hybrid View

  1. #1
    Join Date
    Nov 2013
    Posts
    2

    PhotoAlbum

    Hello my name is Timothy

    i need some help at my photo album script.

    I want that you can click on the pictures and then you can see them bigger in a pop up

    PHP Code:
    <?php
    ini_set
    ('display_errors'1); // 0 = uit, 1 = aan
    error_reporting(E_ALL);

    ##########################################
    //Even wat dingen instellen.
    $dirname"./fotoalbum/";// directory met plaatjes ten opzichte van de huidige directory
    $naast_elkaar 2;// aantal plaatjes naast elkaar
    $onder_elkaar 3;// aantal plaatjes onder elkaar
    $breedte 250;// width van de plaatjes
    $hoogte 250;// height van de plaatjes
    $img_extensions = array('jpg''JPG''gif''png''PNG''JPEG''jpeg');// de toegestane plaatjesop
    ##########################################



    function check_file($filename)
    {
        global 
    $img_extensions;
        
    $file_array explode("."$filename);
        return ((
    count($file_array) == 2) and (in_array($file_array[1], $img_extensions)));
    }

    function 
    get_file_array($dir)
    {
        
    $file_array = array();
        if(
    $handle opendir($dir))
        {
            while(
    false !== ($file readdir($handle)))
            {
                if(
    check_file($file))
                {
                    
    //Het is een plaatje, laat hem zien...
                    
    $file_array[] = $file;
                }
            }
            
    closedir($handle);
        }
        return 
    $file_array;
    }

    function 
    showImages($image_array$begin$eind)
    {
        global 
    $dirname$naast_elkaar$breedte$hoogte;
        
    $begin_check $begin;    
        
    $return '<tr>';
        while (
    $begin $eind and isset($image_array[$begin]))
        {
            
    $return .= '<td><img src="' $dirname $image_array[$begin] . '" width="' $breedte '" height="' $hoogte '"/></td>';
            
    $begin++ ;
            
    $return .= ($begin%$naast_elkaar == 0) ? '</tr><tr>' '';
        }
        return 
    $return '</tr>';
    }

    function 
    genPages($number_of_files$page_limit)
    {
        
    $pages = ($number_of_files%$page_limit == 0) ? $number_of_files $page_limit $number_of_files $page_limit 1;
        
    $i ;
        
    $return '<table><tr>';
        while (
    $i <= $pages)
        {
            
    $return .= '<td><a href="?page=' $i '">' $i '</a></td>';
            
    $i++;
        }
        return 
    $return '</tr></table>';
    }


    echo 
    '<html><body><table>';
    $page_limit $naast_elkaar $onder_elkaar;
    $file_list get_file_array($dirname);
    $page = (isset($_GET["page"])) ? $_GET['page'] : 1;
    $begin = ($page $page_limit) - $page_limit;
    $eind $page $page_limit;
    echo 
    showImages($file_list$begin$eind);
    echo 
    '</table>';
    echo 
    genPages(count($file_list), $page_limit) ;
    echo 
    '</body></html>';
    ?>
    </p>
    Here is my script i hope anybody can help me out

  2. #2
    Join Date
    Sep 2013
    Posts
    221
    Below is the link which would help you with your pronlem solutions.
    I had the same problem and this had worked fine for me.
    http://leandrovieira.com/projects/jquery/lightbox/

    Hope this helps.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles