I have recoded my gallery that I had, and the php is seperate from the html, which is held in a database. Everything oupputs to the html, but it's only outputting one image.. in which I'm definately not sure why.. (I'm forgetting something somewhere)

http://svcsports.com/port/index.php?a=photos

Here's the function that execute the photos.php

        function execute()
        {
                $this->tree($this->lang->photos_title);
                $this->set_title($this->lang->photos_title);

            $a = '0';
            $filepath = "./modules/gallery/thumbs/";
            $url_path = "./modules/fullsize/";
            $dir = dir($filepath);
            $z = "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" width=\"75%\">";
            while($entry=$dir->read()) {

            if($entry == "." || $entry == "..") {
                    continue;
            }

            $fp = @fopen("$filepath/$entry","r");

            if ($a == '0'){
            $b = "<tr>";
            }
            if ($a == '5'){
            $b = "<tr>";
               }
            if ($a == '10'){
            $b = "<tr>";
            }
            if ($a == '15'){
            $b = "<tr>";
            }
            $c ="<td><a href='index.php?a=photo_show&image=$entry'><img src='$filepath$entry' alt='$entry' border='0'></a></td>";
            $a = $a + 1;
            $d = "</tr></table>";
            }

            return eval($this->template('PHOTOS_FULL'));

    }

I add the variables opposed to echo, because if I echo everything.. it all shows up at the top of the page where I don't want it.. and if I echo it after the eval() then it doesn't show at all.

I think my variable-ating everything may have caused this.

Photo_show works perfect so there's no need to show that... 🙂

Again the gallery now only shows 1 image on the photo page, and I know there's atleast TWO in the gallery.

    Dang... I'm getting good at this PHP thing...

    I did this..

    function execute()
            {
                    $this->tree($this->lang->photos_title);
                    $this->set_title($this->lang->photos_title);
    
                $a = '0';
                $filepath = "./modules/gallery/thumbs/";
                $url_path = "./modules/fullsize/";
                $dir = dir($filepath);
                $b .= "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" width=\"75%\">";
                while($entry=$dir->read()) {
    
                if($entry == "." || $entry == "..") {
                        continue;
                }
    
                $fp = @fopen("$filepath/$entry","r");
    
                if ($a == '0'){
                $b .= "<tr>";
                }
                if ($a == '5'){
                $b .= "<tr>";
                   }
                if ($a == '10'){
                $b .= "<tr>";
                }
                if ($a == '15'){
                $b .= "<tr>";
                }
                $b .="<td><a href='index.php?a=photo_show&image=$entry'><img src='$filepath$entry' alt='$entry' border='0'></a></td>";
                $a = $a + 1;
                $b .= "</tr></table>";
                }
    
                return eval($this->template('PHOTOS_FULL'));
    
        }

    It works, but is there an more efficiant code saving way?

      Write a Reply...