+ Reply to Thread
Results 1 to 2 of 2

Thread: php, printing thumbnail images

  1. #1
    lbrassaw is offline x10Hosting Member lbrassaw is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    6

    php, printing thumbnail images

    Hello. I am overlooking something. My code prints thumbnail images in groups of 8; but each time I click a thumbnail, that image goes to position 1 of the displayed thumbnail images. If you could point out my folly, I'd appreciate it!
    Here's the section of the code:

    if ($_GET["img"]) {
    $i = $_GET["img"];
    }
    else {
    $i = 1;
    }

    $dir = 'texture/thumbnails/';
    $filecount = 0;
    $d = dir($dir);
    while ($f = $d->read()) {
    if(($f!= ".") && ($f!= "..")) {
    if(!is_dir($f)) $filecount++;
    Last edited by lbrassaw; 05-28-2008 at 09:17 PM.

  2. #2
    phpasks is offline x10 Sophmore phpasks is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    145

    Re: php, printing thumbnail images

    Quote Originally Posted by lbrassaw View Post
    Hello. I am overlooking something. My code prints thumbnail images in groups of 8; but each time I click a thumbnail, that image goes to position 1 of the displayed thumbnail images. If you could point out my folly, I'd appreciate it!
    Here's the section of the code:

    if ($_GET["img"]) {
    $i = $_GET["img"];
    }
    else {
    $i = 1;
    }

    $dir = 'texture/thumbnails/';
    $filecount = 0;
    $d = dir($dir);
    while ($f = $d->read()) {
    if(($f!= ".") && ($f!= "..")) {
    if(!is_dir($f)) $filecount++;
    PHP Code:

    $extensions 
    = array(".JPG",".jpg"".jpeg");

    if (
    $handle1 opendir('texture/thumbnails/'))
    {
        while (
    false !== ($file1 readdir($handle1)))
        {
            if (
    in_array((strrchr(strtolower($file1), '.')),$extensions) && !is_dir($file1) && $file1!="." && $file1!=".."//Checks that the extension is on the list
            
    {
                
    $lcount++;
            }
        }

    more information for see this article
    http://www.phpasks.com/articles/howt...directory.html
    Asif Khalyani
    http://www.phpasks.com

+ Reply to Thread

Similar Threads

  1. Replies: 3
    Last Post: 03-10-2008, 12:22 PM
  2. Important PHP Information
    By Bryon in forum News and Announcements
    Replies: 0
    Last Post: 11-21-2007, 02:08 PM
  3. Images in PHP Coding?
    By TheJeffsta in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 05-19-2006, 07:09 PM
  4. [PHP] Placing the Ads in PHP Pages
    By Chris in forum Tutorials
    Replies: 22
    Last Post: 06-04-2005, 11:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers