Installing PHP Image Gallery

PHP Image Gallery is 100% HTML and JavaScript code on the client, and PHP code on the server, and can be setup on your web server in just 5 minutes, simply by following this setup guide.

1. Deploying gallery Client files.

The "phpgallery" folder and all file it contains (located in the archive) should be deployed to http://{your site}/{your application}/phpgallery/ on your web site.

2. Create Uploader object.

  1. <?php require_once "phpgallery/include_phpgallery.php" ?>      
  2. <?php      
  3.       
  4. //must declare the gallery and set property here! for ajax request       
  5. $gallery=new PhpGallery();       
  6.       
  7. $gallery->GalleryFolder="defaultalbum";  //the path to the image directory       
  8. $gallery->AllowEdit=true;         //default is false       
  9. $gallery->AllowPostComment=true; //default is false       
  10. $gallery->AllowShowComment=true; //default is true;       
  11.       
  12. //set the user info for comment poster, if not set, guest account will be used       
  13. $gallery->LogonUserID="username@server.com";       
  14. $gallery->LogonUserName="UserName";       
  15.       
  16. $gallery->Layout="Classic";       
  17. $gallery->Editor="Explorer";       
  18. $gallery->Slider="NewWin";       
  19. $gallery->Viewer="LightBox";       
  20. $gallery->Popup="Default";       
  21. $gallery->Theme="Classic";       
  22.       
  23. //handle the ajax request , if any       
  24. $gallery->ProcessAjaxPostback();       
  25.       
  26. ?>     

3. Adding gallery into page.

  1. <?php   
  2.     $gallery->Render();   
  3. ?>  

4. Adding Admin Console and Slide Show button into page.

  1. <a href="#" onclick="thegallerybrowser.ShowEditor();return false;">Admin Console</a> |    
  2. <a href="#" onclick="thegallerybrowser.ShowSlider();return false;">Start slide show</a>