/** * index - Installer home * * @access public * @return void */ function index() { $this->_check_installed(); $uploads = is_writable('./uploads'); $config = is_writable('./quicksnaps_app/config'); $data['title'] = 'QuickSnaps - Installing'; $data['view'] = 'start'; $data['config_writable'] = $config ? '<span class="true">WRITABLE</span>' : '<span class="false">IS NOT WRITABLE</span>'; $data['uploads_writable'] = $uploads ? '<span class="true">WRITABLE</span>' : '<span class="false">IS NOT WRITABLE</span>'; $data['image_libs'] = installed_image_libs(); $this->load->vars($data); $this->load->view('/installer/template'); }
function index() { $this->load->helper('form'); $this->load->helper('image'); $data['themes'] = $this->Dashboard_model->get_themes(); $data['overview'] = $this->Dashboard_model->get_overview(); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && LIB == 'ImageMagick') { $data['win_imagemagick'] = TRUE; } else { $data['win_imagemagick'] = FALSE; } $data['title'] = 'Edit Gallery settings'; $data['h1'] = 'Settings'; $data['main'][] = 'admin/summary.php'; $data['main'][] = 'admin/settings_update.php'; $data['libs'] = installed_image_libs(); $this->load->vars($data); $this->load->view('admin/dashboard'); }
/** * * Create database structure * * @return void * */ function create_db() { $auth = array('id' => array('type' => 'INT', 'constraint' => 11, 'auto_increment' => TRUE), 'user' => array('type' => 'VARCHAR', 'constraint' => 12), 'pass' => array('type' => 'VARCHAR', 'constraint' => 64)); $this->dbforge->add_field($auth); $this->dbforge->add_key('id', TRUE); $this->dbforge->create_table('auth', TRUE); $settings = array('id' => array('type' => 'INT', 'constraint' => 11, 'auto_increment' => TRUE), 'name' => array('type' => 'VARCHAR', 'constraint' => 128), 'summary' => array('type' => 'TEXT'), 'default_theme' => array('type' => 'VARCHAR', 'constraint' => 64), 'per_page' => array('type' => 'INT', 'constraint' => 5), 'w' => array('type' => 'INT', 'constraint' => 4), 'h' => array('type' => 'INT', 'constraint' => 4), 'mid_w' => array('type' => 'INT', 'constraint' => 4), 'mid_h' => array('type' => 'INT', 'constraint' => 4), 'thumb_w' => array('type' => 'INT', 'constraint' => 4), 'thumb_h' => array('type' => 'INT', 'constraint' => 4), 'lib' => array('type' => 'VARCHAR', 'constraint' => 12), 'lib_path' => array('type' => 'VARCHAR', 'constraint' => 32), 'uploadify_key' => array('type' => 'VARCHAR', 'constraint' => 32)); $this->dbforge->add_field($settings); $this->dbforge->add_key('id', TRUE); $this->dbforge->create_table('settings', TRUE); $albums = array('id' => array('type' => 'INT', 'constraint' => 11, 'auto_increment' => TRUE), 'name' => array('type' => 'VARCHAR', 'constraint' => 128), 'url' => array('type' => 'VARCHAR', 'constraint' => 128), 'full_txt' => array('type' => 'TEXT'), 'theme' => array('type' => 'VARCHAR', 'constraint' => 64), 'private' => array('type' => 'INT', 'constraint' => 1), 'rank' => array('type' => 'INT', 'constraint' => 11)); $this->dbforge->add_field($albums); $this->dbforge->add_key('id', TRUE); $this->dbforge->create_table('albums', TRUE); $photos = array('id' => array('type' => 'INT', 'constraint' => 11, 'auto_increment' => TRUE), 'album' => array('type' => 'INT', 'constraint' => 11), 'name' => array('type' => 'VARCHAR', 'constraint' => 128), 'photo' => array('type' => 'VARCHAR', 'constraint' => 128), 'photo_type' => array('type' => 'VARCHAR', 'constraint' => 5), 'highlight' => array('type' => 'INT', 'constraint' => 1), 'theme' => array('type' => 'VARCHAR', 'constraint' => 64), 'rank' => array('type' => 'INT', 'constraint' => 11)); $this->dbforge->add_field($photos); $this->dbforge->add_key('id', TRUE); $this->dbforge->create_table('photos', TRUE); // Insert some default settings // First let's find the best image lib; $this->load->helper('image'); $libs = installed_image_libs(); if (array_key_exists('ImageMagick', $libs) && $libs['ImageMagick'] !== FALSE) { $lib = 'ImageMagick'; $lib_path = '/usr/bin/convert'; } elseif (array_key_exists('gd2', $libs) && $libs['gd2'] === TRUE) { $lib = 'gd2'; $lib_path = ''; } elseif (array_key_exists('gd', $libs) && $libs['gd'] === TRUE) { $lib = 'gd'; $lib_path = ''; } else { $lib = FALSE; $lib_path = FALSE; } $this->db->set('id', 1); $this->db->set('name', 'QuickSnaps Gallery'); $this->db->set('default_theme', 'polaroid'); $this->db->set('per_page', 10); $this->db->set('mid_w', 700); $this->db->set('mid_h', 400); $this->db->set('thumb_w', 120); $this->db->set('thumb_h', 120); $this->db->set('lib', $lib); $this->db->set('lib_path', $lib_path); $this->db->insert('settings'); }