Changeset 11381


Ignore:
Timestamp:
Jun 15, 2011, 4:43:42 PM (13 years ago)
Author:
mistic100
Message:

fix a Fatal Error & mistake with config param

Location:
extensions/SmartAlbums
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/SmartAlbums/admin.php

    r11380 r11381  
    1111{
    1212        $conf['SmartAlbums'] = array(
    13     'update_on_upload' => $_POST['update_on_upload'],
     13    'update_on_upload' => isset($_POST['update_on_upload']),
    1414    );   
    1515       
  • extensions/SmartAlbums/include/functions.inc.php

    r11380 r11381  
    3030  }
    3131 
    32   if (!function_exists('set_rendom_representant'))
     32  if (!function_exists('set_random_representant'))
    3333  {
    3434    include(PHPWG_ROOT_PATH.'admin/include/functions.php');
     
    5050  if (!is_array($conf['SmartAlbums'])) $conf['SmartAlbums'] = unserialize($conf['SmartAlbums']);
    5151 
    52   if ( defined('SMART_NOT_UPDATE') OR $conf['SmartAlbums']['update_on_upload'] == 'false' ) return;
     52  if ( defined('SMART_NOT_UPDATE') OR !$conf['SmartAlbums']['update_on_upload'] ) return;
    5353 
    5454  /* get categories with smart filters */
  • extensions/SmartAlbums/maintain.inc.php

    r11380 r11381  
    2525    \'SmartAlbums\',
    2626    \''.serialize(array(
    27         'update_on_upload' => false,
     27        'update_on_upload' => true,
    2828        )
    2929      ).'\',
     
    3535
    3636function plugin_activate()
    37 {
    38   global $conf;
     37{ 
     38  $sa_config = pwg_query('SELECT * FROM `' . CONFIG_TABLE . '` WHERE param = \'SmartAlbums\';');
    3939 
    40   if (!isset($conf['SmartAlbums']))
     40  if (!pwg_db_num_rows($sa_config))
    4141  {
    4242    pwg_query('
     
    4545    \'SmartAlbums\',
    4646    \''.serialize(array(
    47         'update_on_upload' => false,
     47        'update_on_upload' => true,
    4848        )
    4949      ).'\',
  • extensions/SmartAlbums/template/admin.tpl

    r11380 r11381  
    88                <ul>                   
    99                        <li>
    10                                 <span class="property">{'Update albums on file upload'|@translate}</span>
    11                                 <label><input type="radio" name="update_on_upload" value="true" {if $update_on_upload == 'true'}checked="checked"{/if}/> {'Yes'|@translate}</label>
    12                                 <label><input type="radio" name="update_on_upload" value="false" {if $update_on_upload == 'false'}checked="checked"{/if}/> {'No'|@translate}</label>
     10        <label>
     11          <span class="property">{'Update albums on file upload'|@translate}</span>
     12          <input type="checkbox" name="update_on_upload" value="true" {if $update_on_upload}checked="checked"{/if}/>
     13        </label>
    1314                        </li>
    1415                </ul>
Note: See TracChangeset for help on using the changeset viewer.