fbgallery

Add a pictures gallery in a page.
33 followers

fbgallery include a nice photo gallery into your website.

Also, it can be used as a showroom or as a base for a little shop.

fbgallery description and facilities

Structure

The fbgallery is structured in albums and collections (of albums).

Album

Is a page which includes thumbnails of gallery or when it is used in shop mode, will display pictures and information for a specific product.

Collection

In administration mode, a collection will display a cover for every album which exists, and will permit you to select which albums will be displayed to visitors in that collection.

The covers of albums may be sorted to be display in any order you like. Clicking on a cover of an album, will redirect the visitor to album's page.

Title and description

Every album and every collection may have a title and a description. Those can be used as page heading.

Multilingual

The fbgallery is multilingual. You can use how many languages you like.

Album's and collection's title, description and information about every picture, support translation.

Administration

Administration is separate for two levels: editors and admins. Editors are logged users and have limited rights, while administrators are a powerful category of logged users.

Available languages: English, Romanian.

Editor Panel

Editor panel is a draggable panel, which you can place it anywhere you like. It is contextual for album and collection and according with settings made by administrators.

Control Panel

Control Panel is accessible only for administrators. It is structured in 5 categories:

Gallery - structured in 6 subcategories:
    Appearance,
    Shop,
    Image resize,
    Structure,
    Options,
    Languages
Album
Collection
FancyBox
Uploader

Default values can be loaded for:

every category,
all categories in block
individual for every setting.

Every setting from Control Panel has its own help as a tooltip.

Pagination

The albums support the pagination. The number of pictures displayed in every page is selected in Control Panel. Pagination is not applicable when it is used shop mode.

If isn't used pagination, you can set how many pictures will be displayed in a row.

Uploader

Multiple files uploader, based on plupload plug-in.

The uploader is multilingual.

Unique file name can be generated to avoid overwriting existing photos in the album.

Uploader can set maximum file size dimension to be uploaded and can be set the maximum number of pictures to be uploaded in every album. Uploader limitation: In safari for windows pictures will be loaded only file by file. Not working with IE previous to version 9. Not tested in apple safari.

Picture information

Picture's title permit to use a wide range of characters, including arabic characters.

Alternatively, picture's title can be displayed as an informational box under the picture.

Use title when you need to display a very short information or use informational box when you need to display a long information, as Description, Price, Link and so on.

Informational box may be as big as you wish, and have support for plain text or html.

Wysiwyg support - cleditor

For every field which accept html, a wysiwyg editor is available with a single click.

Predefined information

Now it is possible to set predefined information for title or informational box for uploaded pictures.

Available options to be used as predefined: filename, page metatitle or predefined content.

Image removal

Multiple images can be selected to be deleted in block.

You can clear the gallery with just a click (plus confirmation).

Resizable thumbnails

The size of thumbnail can be set from Control Panel.

Thumbnail aspect

Can be set as square, landscape or portrait, from Control Panel.

Tooltips

The nice tooltip replace the ugly bubble displayed when mouse is over thumbnail. Can be used or not, selecting from Control Panel.

Themes

Supports interchangeable css themes.

Shop

Option to use album page as page for item of shop, with a bigger image as cover and a set of mini-thumbnails under the cover. Near thess pictures, you have a place to describe product from your shop page.

The shop mode will permit you to predefine some values to avoid repetition.

Files structure

Extension files structure has been changed, for a better future development.

Plugins

Included the plupload as uploader.

Included the newest version of fancybox (unfortunately last the free).

Included cleditor as wysiwyg editor.

Extension is XHTML valid;

Tested in Linux and windows.

Tested browsers: Firefox, Chrome, Opera, Safari, IE

The administration mode work with: Firefox, Chrome, Opera, Safari, IE9

Use Yii version: 1.1.8

How to...?

Install fbgallery:

Extract the archive in your protected/extensions folder (or in any other place in your application).

In the root of your website create one folder named "galleries" and make it writable. This is default option, but you can use any folder. For this, you need to set its path relative to approot in Control Panel->Gallery->Structure->Container folder for galleries.

Import in the database the file fbgallery.sql from sql folder and set in config/main.php to use "tablePrefix"=>'tbl_'. If you use another tablePrefix, change the name of tables, using your own prefix.

Use fbgallery:

Just include in your page next code:

$this->widget('application.extensions.fbgallery.fbgallery');

If you install the extension in another place, not in extensions folder, only adjust the above code.

Suggestions:

When you start to use fbgallery, decide what type of thumbnail will be used: landscape, square or portrait.

All uploaded pictures will be resized to best fit in thumbnail. If you later will change aspect of the thumbnail, this will affect how images are displayed.

Customize fbgallery if is needed:

To customize how fbgallery will treat users level, change the function personalisedMode() from /libs/general/FBAccess.php

To customize how the extension will get the page's metatitle, adjust the function getPageTitle() from fbgallery.php to meet to your need.

If you will include fbgallery into a cms, which automatic generate pages with own ID, you will customize the function getUrlRouteStructure() from fbgallery.php, to be according with your url structure.

Change the name and the information about an album or a collection?

Click on its title. An text editor will appear. Change the value and click on Save button.

Switch to shop mode?

In Control panel->Gallery->Shop click on the "Set standard shop" button.

Troubles?

Check your ini.php file to not use E_STRICT error reporting.

Before comment here to ask help, please contact and ask me, using demo site.

Total 20 comments

#7689 report it
RUgaleFF at 2012/04/09 07:02pm
Speed up

Hello, Matricks. Thanks for your great work!

I modified run() function for speed up of AJAX and upload requests, because render takes a lot of time on my tiny server. I think, you can include this in the next release.

public function run()
{
    if(isset($_SERVER["CONTENT_TYPE"]) && strstr($_SERVER["CONTENT_TYPE"], 'multipart/form-data')) //upload
    {
        if($this->levelAccess)
            return Uploader::uploadFiles();
    }
    elseif(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') //ajax
    {
        //process post requests if exists
        if($this->levelAccess === 2)
        {
            operations::processPosts();
            if(isset($_POST['function']))
                return operations::switchToFunction();
        }
    }
    else
    {
        //publish files
        $this->publishAssets();
        //render page
        $this->renderPage();
    }
}

Regards, Anatoly

#7576 report it
matricks at 2012/03/31 03:15am
@iso

Check your ini.php file to not use E_STRICT error reporting.

#7575 report it
iso at 2012/03/31 02:41am
FBAccess::setLevelAccess()

Sorry, on running this extension i get on xampp system the follwing error:

Non-static method FBAccess::setLevelAccess() should not be called statically, assuming $this from incompatible context

@matricks thanks

#6306 report it
sidewinder at 2011/12/27 09:44am
Small suggestion

If you want to use deprecated language constructions like: operations::flag($language), where flag is a non-static function, please consider suppressing errors with @ sign, instead of requiring users to reduce error reporting level. Also, it seems you left your autoincrement counters in sql file included in archive :). Other then that - good work ! ;)

#6261 report it
matricks at 2011/12/22 07:34am
About v2

@qstyler My dear friend, first: isn't neccesary to swear. If you don't like the new version, you can use the previous one. But please don't insulte me, because I made my work public to help other, not to be blamed. Second: you can use pid as before, just that now isn't more really neccesary. If you don't assign one pid, it will made it automatic, according to page url.

@Benn Indeed, there was an error, but I get it only on windows. I changed the code. Please download it again.

#6260 report it
qstyler at 2011/12/22 07:22am
Jquery errors

Please, go through all your custom javascript files and change “$” to “jQuery”. Some people (like me) don't have “$” aliast to “jQuery” function in their setups.

Thank you.

#6259 report it
qstyler at 2011/12/22 06:15am
PID

Okay, and why the *** did you get rid of PID as a parameter?

I used this thing in views of different models. I had ship and employee views. And I wanted fbgallery to have galleries for both of them. But it tried to show me same gallery for ship with id#3 and employee#3. I changed datatype of pid in gallery to varchar and set the call to

$this->widget('application.extensions.fbgallery.fbgallery',array('pid'=>'ship_'.$model->id));

Now you're getting the ID from the $_GET array! Isn't that lame? What if i'm not passing ID to the get? What if i'm using aliases or slugs there? Come on!

This is totally lame.

#6258 report it
qstyler at 2011/12/22 06:10am
oh god please come on ffs

Guys! Did you really try to test it before uploading? I spent like two days installing the previous version and making it just work.

Now the same thing!

#6257 report it
qstyler at 2011/12/22 06:02am
Trying to get property of non-object

@Benn

In the previous version of FBGallery table GaleryConfig had varchar(8) for type field in it. So it's not enough for “collection”. Go change your data type for varchar(16) and change the value of “collecti” to “collection”. This would do a trick.

#6244 report it
Benn at 2011/12/21 08:16am
Several models to use fbGallery

Hey there, First of all, very much looking forward to using the new version !! :) Now here's my question : for the moment, if I have 2 models which use fbgallery, the fallery will be the same for objects from both models with the same ID. Will there be a way in the new version to have a fbgallery dependant on the model ?

Thanks for your great work

Regards

Benn

#6242 report it
matricks at 2011/12/21 07:32am
Prepare for the new version of fbgallery

@qstyler

The new version of fbgallery is almost ready. It is totally rewrote, with a lot of new facilities, including multiuploader, pagination, multilingual, themes and more and more new posibilities. In the next days (this year) will be available for everyone. Follow the extension to see when it is updated.

#6221 report it
qstyler at 2011/12/20 04:46am
Flash uploader

Hi! Is there any flash uploader I can use with FBGallery? Would be really nice to choose multiple files but not dragging them by one.

#5801 report it
JoeWright at 2011/11/14 10:54am
Non-static method Uploader::loadUploaderConfiguration() fix

Not sure how it worked in Linux but I'm not that competent in php. Here's my quick fix.

In Uploader.php and static keyword to all functions and add a variable to replace $this with, e.g.:

public static function loadUploaderConfiguration($kGallery)
    {
        $uploaderConfig = GalleryConfig::model()->find(array('condition'=>"type='uploader'"))->config;
        $kGallery->uploaderConfig = unserialize($uploaderConfig);
    }

In FBGallery.php change calls. E.g. line 220:

    Uploader::loadUploaderConfiguration($this);

There are some other changes to make but its fairly obvious.

You will also need to add static keyword to MyFiles.php

#5631 report it
matricks at 2011/10/26 02:47pm
Tested under Linux only.

@dickreuter

Is it true. I developed/tested only under linux. I haven't windows. If somebody with windows can help me, I will be glad to update extension to work under windows too.

#5630 report it
dickreuter at 2011/10/26 01:50pm
Non-static method Uploader::loadUploaderConfiguration() should not be called statically, assuming $this from incompatible contex

Under windows this extension does not seem to work as you get the above error message. It was apparently only tested in a non-windows environment unfortunately.

#5020 report it
n13 at 2011/09/07 03:36am
hmmm... it's interesting

I set up my in application the fbgallery as it's written under my Ubuntu Linux. I also set 2 things like

Put this values in the tbl_galleries table pid = 1 id = 1

Change this line in FBGallery.php

//$pid = $_GET["id"];
 $pid = @$_GET['id'];

And it works well. Then I copied the whole application mapp from Linux to win7 htdocs. I have the same enviroment in windows. And I got the next error message:

Non-static method Uploader::loadUploaderConfiguration() should not be called statically, assuming $this from incompatible context

Can someone explain why? I think it's a windows specific problem. Any idea of that?

#4920 report it
Nebi at 2011/08/29 09:53am
Solution - Trying to get property of non-object

Solution - Trying to get property of non-object: The previous solution to add a record into database doesn't help if you're adding galleries dynamicaly.

In FBGallery.php change the line 201 - if the method unserialize doesn't have data to unserialize it throws error:

if (isset($this->gmodel->imgsOrder)) {$this->imgsOrder = unserialize($this->gmodel->imgsOrder);}
#4305 report it
n13 at 2011/06/23 08:01am
next error

I went into my database 'galleries' table and I just drop in a row and set pid = 1.

and "Trying to get property of non-object" error solved but now I get this...

Non-static method Uploader::loadUploaderConfiguration() Any soluttion? Thx

#4289 report it
Phate at 2011/06/22 01:42pm
Trying to get property of non-object Error

@ostovar

Go into your database 'galleries' table and just drop in a row and set pid = 1.

When you call your FBGallery widget use the pid you used in the table row.

#4188 report it
ostovar at 2011/06/15 06:45am
ERROR

i have an error on this line: $this->imgsOrder = unserialize($this->gmodel->imgsOrder);

the error msg is: Trying to get property of non-object

how can i pass this error?

Leave a comment

Please to leave your comment.

Create extension