Welcome Guest, Not a member yet? Register   Sign In
CIG gallery version 0.3beta help needed
#1

[eluser]learning_php[/eluser]
Hi,

i am trying to use CIG to create a simple gallery i have added teh config and lib files to my proect and usign the following controller:

Code:
class imagegallery extends Controller {
    
    
    function imagegallery()
    {
        parent::Controller();
        $this->load->library('CIG');
        $this->cig->cache_init();
    }
    
    function index()
    {
        $data['images']=$this->cig->get_dir_list();
        $this->load->view('test_view',$data);
        
    }
    
    function album()
    {
        $data['album']=$this->cig->get_image_list();
        $this->load->view('test_view',$data);
    }
    
    function images()
    {
        $data['']=$this->cig->get_image();    
        $this->load->view('test_view',$data);
    }
        
}

but when i view the page i get teh following error:

A PHP Error was encountered

Severity: Warning

Message: getimagesize(../wedding-site/assets/albums/./cache) [function.getimagesize]: failed to open stream: Permission denied

Filename: libraries/CIG.php

Line Number: 270
A PHP Error was encountered

Severity: Warning

Message: getimagesize(../wedding-site/assets/albums/./test) [function.getimagesize]: failed to open stream: Permission denied

Filename: libraries/CIG.php

Line Number: 270
A PHP Error was encountered

Severity: Warning

Message: getimagesize(../wedding-site/assets/albums/./cache) [function.getimagesize]: failed to open stream: Permission denied

Filename: libraries/CIG.php

Line Number: 270
A PHP Error was encountered

Severity: Warning

Message: getimagesize(../wedding-site/assets/albums/./test) [function.getimagesize]: failed to open stream: Permission denied

Filename: libraries/CIG.php

Line Number: 270
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: fileList

Filename: libraries/CIG.php

Line Number: 360
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: fileList

Filename: libraries/CIG.php

Line Number: 363
#2

[eluser]Dam1an[/eluser]
What are the permissions on the photo's?
#3

[eluser]TheFuzzy0ne[/eluser]
Check the permissions for the albums/test directory and the albums/cache directory. It looks like the permissions aren't set correctly.
#4

[eluser]learning_php[/eluser]
sorry I am not sure what you mean or where to look?
#5

[eluser]TheFuzzy0ne[/eluser]
Most FTP clients allow you to right-click and select something (usually "properties"), which will tell you what the permissions mask is. I'd suggest going with 700, 770 or 777, whichever works.

700 = user gets full permissions (rwx - Read, Write and Execute)
770 = user and group get full permissions (rwx - Read, Write and Execute)
777 = user, group and other get full permissions (rwx - Read, Write and Execute)

It depends on how PHP is set up on your server, and whether or not it runs under your user account or user "nobody".

If you can tell use what FTP client you're using, we might be able to give you specific instructions.
#6

[eluser]learning_php[/eluser]
Hi,

I am not using a FTP as I am currently working my localhost?
#7

[eluser]Phil Sturgeon[/eluser]
If you are 'nix or Mac then you can use the built in terminal to set the permissions.

Type 'pwd' to see which directory you are in then use the command 'chmod 777 -R /path/to/folders'.

If you are using windows just make sure the folder is writeable by right click -> properties.
#8

[eluser]Dam1an[/eluser]
if you're using a UNIX based system, you can use chmod to change the permissions of a file/directory
In Windows, you don't seem to get the fine level of control you require (at least not natively, or have I missed something)
#9

[eluser]learning_php[/eluser]
Hi,

I right click -> properties and see that the folder is set to read only. I unselect the box and apply but when I go back into the properties read only is selected again.

Thanks
#10

[eluser]TheFuzzy0ne[/eluser]
You may need to ensure that you actually "own" the directory in order to apply permissions to it.




Theme © iAndrew 2016 - Forum software by © MyBB