Support » Fixing WordPress » php function wont work

  • i am drying to use my own php script to input my images from my gallery directory and keep getting this error message:

    Warning: opendir(http://localhost/gvestudios/wp-content/uploads/) [function.opendir]: failed to open dir: not implemented in D:\Sites\gvestudios\wp-content\themes\robinson\art.php on line 20
    There are no images in this gallery.

    here is my code”`

    $image_dir = ‘http://localhost/gvestudios/wp-content/uploads/’;
    $per_column = 6;

    /* step one: read directory, make array of files */
    if ($handle = opendir($image_dir)) {
    while (false !== ($file = readdir($handle)))
    {
    if ($file != ‘.’ && $file != ‘..’)
    {
    if(strstr($file,’-thumb’))
    {
    $files[] = $file;
    }
    }
    }
    closedir($handle);
    }

    /* step two: loop through, format gallery */
    if(count($files))
    {
    foreach($files as $file)
    {
    $count++;
    echo ‘<img src=”‘,$image_dir,$file,'” width=”100″ height=”100″ />‘;
    if($count % $per_column == 0) { echo ‘<div class=”clear”></div>’; }
    }
    }
    else
    {
    echo ‘<p>There are no images in this gallery.</p>’;
    }

    ?>`

    this works fine on ally other sites but not in wordpress….any help is appreciated

Viewing 1 replies (of 1 total)
  • I also have a big php problem:

    I’m getting errors on post pages, saying that if I save them the php will be rendered permanently unusable.

    Now the right post content can’t be found for the pages, and neither can the images!

    Please help, I’m the new admin on the galleryuccs.org site.
    Any help would be greatly appreciated!
    Millie

Viewing 1 replies (of 1 total)
  • The topic ‘php function wont work’ is closed to new replies.