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%>
' .'' .'' .'' .'' .''; $template->setTemplate($name, $content); $name = 'LIST_BODY'; $content = '' .'' .'' .'' .''; $template->setTemplate($name, $content); $name = 'LIST_FOOTER'; $content = '
TitleDescriptionOwnerLast ModifiedImages
<%title%><%description%><%ownername%><%modified%><%numberofimages%>


' .'<%if(canaddalbum)%>' .'Add New Album | ' .'<%endif%>' .'<%if(canaddpicture)%>' .'' .' Add Pictures' .'<%endif%>'; $template->setTemplate($name, $content); // $name = 'ALBUM_HEADER'; $content = '<%breadcrumb%>
'; $template->setTemplate($name, $content); // $name = 'ITEM_HEADER'; $content = '<%breadcrumb%>
Previous | Next
'; $template->setTemplate($name, $content); $name = 'ITEM_BODY'; $content = '' .''; $template->setTemplate($name, $content); $name = 'ITEM_FOOTER'; $content = '
' .'

Comments

<%comments%>' .'

Add Comment

<%commentform%>'; $template->setTemplate($name, $content); $name = 'COMMENT_BODY'; $content = '
' .'

' .'<%user%> wrote:

' .'
' .'<%body%>
<%date%> <%time%>
' ; $template->setTemplate($name, $content); } setNPGoption('currentversion',75); include(dirname(__FILE__).'/np_gallery_update075.php'); ?>