isLoggedIn() && $member->isAdmin())) exit('You are not admin.'); include_once (dirname(__FILE__).'/../config.php'); //from 0.61a to 0.75 global $NPG_CONF; $query = 'CREATE TABLE IF NOT EXISTS '.sql_table('plug_gallery_views').' ( '. 'vpictureid int unsigned not null, '. 'views int unsigned )'; sql_query($query); $query = 'CREATE TABLE IF NOT EXISTS '.sql_table('plug_gallery_views_log').' ( '. 'vlpictureid int unsigned not null, '. 'ip varchar(20), '. 'time timestamp )'; sql_query($query); //new option global $manager; if ($manager->pluginInstalled('NP_gallery')) { $plugin =& $manager->getPlugin('NP_gallery'); if ($plugin != NULL) if($plugin->getoption('deletetables')) $plugin->createOption('deletetables',__NPG_OPT_DONT_DELETE_TABLES,'yesno','no'); } //new config if (!$NPG_CONF['viewtime']) setNPGoption('viewtime', 30 * 60); //make new table $query = 'CREATE TABLE IF NOT EXISTS '.sql_table('plug_gallery_template_desc').' ( '. 'tdid int unsigned not null auto_increment PRIMARY KEY, '. 'tdname varchar(20), '. 'tddesc varchar(200) )'; sql_query($query); //if it already exists and there are no rows already, then add default $query = 'select * from '.sql_table('plug_gallery_template_desc'); $res = sql_query($query); if(!mysql_num_rows($res)) { $query = 'insert into '.sql_table('plug_gallery_template_desc').' (tdid, tdname, tddesc) values (NULL, "061default", "default templates from 0.61")'; sql_query($query); $new_id = mysql_insert_id(); if(!$NPG_CONF['template']) setNPGOption('template', $newid); } //change previous template table and add reference to template_desc $query = 'show columns from '.sql_table('plug_gallery_template').' like "tdesc"'; $res = sql_query($query); if(!mysql_num_rows($res)) { $query = 'ALTER TABLE '.sql_table('plug_gallery_template'). ' add column tdesc int unsigned first '; sql_query($query); if(!$new_id) $new_id = 1; $query = 'UPDATE '.sql_table('plug_gallery_template').' set tdesc = '.intval($new_id); sql_query($query); } $query = 'show columns from '.sql_table('plug_gallery_comment').' like "cuser"'; $res = sql_query($query); if(!mysql_num_rows($res)) { $query = 'ALTER TABLE '.sql_table('plug_gallery_comment'). ' add column cuser varchar(40), '. ' add column cmail varchar(100), '. ' add column chost varchar(60), '. ' add column cip varchar(15)'; sql_query($query); } $query = 'show columns from '.sql_table('plug_gallery_album').' like "commentsallowed"'; $res = sql_query($query); if(!mysql_num_rows($res)) { $query = 'ALTER TABLE '.sql_table('plug_gallery_album'). ' add column commentsallowed tinyint DEFAULT 1 '; sql_query($query); } //new template if (!NPG_TEMPLATE::exists('default075')) { $template = new NPG_TEMPLATE(NPG_TEMPLATE::createnew('default075','default 0.75 templates')); if(!$NPG_CONF['template']) setNPGOption('template', $template->getID()); $name = 'LIST_HEADER'; $content = '<%breadcrumb%>
Title | ' .'Description | ' .'Owner | ' .'Last Modified | ' .'Images |
---|---|---|---|---|
<%title%> | ' .'<%description%> | ' .'<%ownername%> | ' .'<%modified%> | ' .'<%numberofimages%> |
| Click to visit <%user%>\'s website or send an email">' .'<%user%> wrote:
' .'