plugins/Gallery.php
changeset 0 7caf561c50ee
child 2 88c954d2846c
equal deleted inserted replaced
-1:000000000000 0:7caf561c50ee
       
     1 <?php
       
     2 /*
       
     3 Plugin Name: Snapr
       
     4 Plugin URI: http://enanocms.org/Enano.Img_Gallery
       
     5 Description: Provides an intuitive image gallery system with a browser, viewer for individual images, upload interface, and comment system integration.
       
     6 Author: Dan Fuhry
       
     7 Version: 0.1 beta 1
       
     8 Author URI: http://enanocms.org/
       
     9 */
       
    10 
       
    11 global $db, $session, $paths, $template, $plugins; // Common objects
       
    12 
       
    13 define('GALLERY_VERSION', '0.1b1');
       
    14 
       
    15 $magick_path = getConfig('imagemagick_path');
       
    16 if ( !file_exists($magick_path) || !is_executable($magick_path) )
       
    17 {
       
    18   $fn = basename(__FILE__);
       
    19   setConfig("plugin_$fn", '0');
       
    20   die('Snapr: You must have ImageMagick installed and working to use this plugin. The plugin has been disabled, please setup ImageMagick and then re-enable it.');
       
    21 }
       
    22 
       
    23 if ( !getConfig('gallery_version') )
       
    24 {
       
    25   $q = $db->sql_query('CREATE TABLE '.table_prefix.'gallery(
       
    26                         img_id int(12) NOT NULL auto_increment,
       
    27                         is_folder tinyint(1) NOT NULL DEFAULT 0,
       
    28                         folder_parent int(12) DEFAULT NULL,
       
    29                         img_title varchar(255) NOT NULL DEFAULT \'\',
       
    30                         img_desc longtext NOT NULL DEFAULT \'\',
       
    31                         print_sizes longtext NOT NULL DEFAULT \'\',
       
    32                         img_filename varchar(255) NOT NULL,
       
    33                         img_time_upload int(12) NOT NULL DEFAULT 0,
       
    34                         img_time_mod int(12) NOT NULL DEFAULT 0,
       
    35                         PRIMARY KEY ( img_id )
       
    36                       );');
       
    37   if ( !$q )
       
    38     $db->_die();
       
    39   
       
    40   setConfig('gallery_version', GALLERY_VERSION);
       
    41 }
       
    42 
       
    43 require( ENANO_ROOT . '/plugins/gallery/functions.php' );
       
    44 require( ENANO_ROOT . '/plugins/gallery/nssetup.php' );
       
    45 require( ENANO_ROOT . '/plugins/gallery/viewimage.php' );
       
    46 require( ENANO_ROOT . '/plugins/gallery/browser.php' );
       
    47 require( ENANO_ROOT . '/plugins/gallery/upload.php' );
       
    48 require( ENANO_ROOT . '/plugins/gallery/fetcher.php' );
       
    49 
       
    50 ?>