get_results("SELECT * FROM ".TEMPLATES_TABLE." WHERE `gall_type` = ".$gall_type." ORDER BY created DESC", 'ARRAY_A'); return $templates; } function fgallery_get_template_settings($id) { global $wpdb; $settings = $wpdb->get_var("SELECT `gall_settings` FROM ".TEMPLATES_TABLE." WHERE id = ".$id); return unserialize($settings); } function fgallery_render_template_form($gallery) { $templates = fgallery_get_templates($gallery['gall_type']); ?>


'.__('You can update existing template','fgallery').'

'; echo ''; } ?>


'.__('Choose template from the list','fgallery').''; foreach ($templates as $template) { echo '
'; echo ''; echo '
'.$template['templ_title'].'
'; echo $template['templ_description'].'
'; echo '
'; } } else { echo '

'.sprintf(__('There are no templates for %s gallery type yet. Please create new or'),fgallery_get_flash_type($gallery)).'

'; } ?>





%s gallery type','fgallery'),fgallery_get_flash_type($gallery)); ?>

insert(TEMPLATES_TABLE, array('gall_type' => $gall_type, 'gall_settings' => serialize($settings), 'created' => date("Y-m-d"), 'templ_title' => $_POST['templ_title'], 'templ_description'=>$_POST['templ_description'])); if ($wpdb->insert_id > 0) { ?> $gall_type, 'gall_settings' => serialize($settings)); if ($_POST['templ_description'] != '') { $templ_description = $_POST['templ_description']; $to_update['templ_description'] = $templ_description; } $wpdb->update(TEMPLATES_TABLE, $to_update, array('id'=>$templ_id)); ?> $value) { $name = 'sc_'.$key.'__'; foreach ($value as $key_2=>$value_2) { $attr_name = $name.$key_2; $new_value = (string)$value_2; $settings_array[$attr_name] = str_replace('0x','',$new_value); } } if (empty($settings_array)) { die('Invalid settings'); } $settings = fgallery_prepare_settings($settings_array); } else { die('Invalid template'); } } if(fgallery_save_album_settings($gall_id, $settings)) { ?> query("DELETE FROM ".TEMPLATES_TABLE." WHERE `id` = ".$templ_id); } die(); break; } } ?> > <?php bloginfo('name') ?> › <?php _e('Insert Gallery', 'fgallery'); ?> — <?php _e('WordPress'); ?> >