plugins/Gallery.php
changeset 20 d8a281557365
parent 18 c1c398349651
child 26 023a21c8f47c
equal deleted inserted replaced
17:ecb96b051d08 20:d8a281557365
     8 Author URI: http://enanocms.org/
     8 Author URI: http://enanocms.org/
     9 */
     9 */
    10 
    10 
    11 global $db, $session, $paths, $template, $plugins; // Common objects
    11 global $db, $session, $paths, $template, $plugins; // Common objects
    12 
    12 
    13 define('GALLERY_VERSION', '0.1b1');
    13 define('GALLERY_VERSION', '0.1b2');
    14 
    14 
    15 $magick_path = getConfig('imagemagick_path');
    15 $magick_path = getConfig('imagemagick_path');
    16 if ( !file_exists($magick_path) || !is_executable($magick_path) )
    16 if ( !file_exists($magick_path) || !is_executable($magick_path) )
    17 {
    17 {
    18   $fn = basename(__FILE__);
    18   $fn = basename(__FILE__);
    30                         img_desc longtext NOT NULL DEFAULT \'\',
    30                         img_desc longtext NOT NULL DEFAULT \'\',
    31                         print_sizes longtext NOT NULL DEFAULT \'\',
    31                         print_sizes longtext NOT NULL DEFAULT \'\',
    32                         img_filename varchar(255) NOT NULL,
    32                         img_filename varchar(255) NOT NULL,
    33                         img_time_upload int(12) NOT NULL DEFAULT 0,
    33                         img_time_upload int(12) NOT NULL DEFAULT 0,
    34                         img_time_mod int(12) NOT NULL DEFAULT 0,
    34                         img_time_mod int(12) NOT NULL DEFAULT 0,
       
    35                         img_tags longtext DEFAULT NULL,
    35                         PRIMARY KEY ( img_id )
    36                         PRIMARY KEY ( img_id )
    36                       );');
    37                       );');
    37   
    38   
    38   if ( !$q )
    39   if ( !$q )
    39     $db->_die();
    40     $db->_die();
    48   if ( !$q )
    49   if ( !$q )
    49     $db->_die();
    50     $db->_die();
    50   
    51   
    51   setConfig('gallery_version', GALLERY_VERSION);
    52   setConfig('gallery_version', GALLERY_VERSION);
    52 }
    53 }
       
    54 if ( getConfig('gallery_version') == '0.1b1' )
       
    55 {
       
    56   $q = $db->sql_query('ALTER TABLE ' . table_prefix . 'gallery ADD COLUMN img_tags longtext DEFAULT NULL');
       
    57   if ( !$q )
       
    58     $db->_die();
       
    59   setConfig('gallery_version', '0.1b2');
       
    60 }
    53 
    61 
    54 require( ENANO_ROOT . '/plugins/gallery/functions.php' );
    62 require( ENANO_ROOT . '/plugins/gallery/functions.php' );
    55 require( ENANO_ROOT . '/plugins/gallery/nssetup.php' );
    63 require( ENANO_ROOT . '/plugins/gallery/nssetup.php' );
    56 require( ENANO_ROOT . '/plugins/gallery/viewimage.php' );
    64 require( ENANO_ROOT . '/plugins/gallery/viewimage.php' );
    57 require( ENANO_ROOT . '/plugins/gallery/browser.php' );
    65 require( ENANO_ROOT . '/plugins/gallery/browser.php' );