0)) { if(!upgrade_checkIfColumnExists('comment', 'cblog')){ $query = 'ALTER TABLE '.sql_table('comment')." ADD cblog int(11) NOT NULL default '0'"; upgrade_query('Adding cblog column in table nucleus_comment',$query); $query = 'SELECT inumber, iblog FROM '.sql_table('item').', '.sql_table('comment').' WHERE inumber=citem AND cblog=0'; $res = DB::getResult($query); foreach ( $res as $row ) { $query = 'UPDATE '.sql_table('comment')." SET cblog='".$row['iblog']."' WHERE citem='".$row['inumber']."'"; upgrade_query('Filling cblog column for item ' . $row['inumber'], $query); } } // add 'pluginURL' to config global $CONF; if (!upgrade_checkIfCVExists('PluginURL')) { $pluginURL = $CONF['AdminURL'] . "plugins/"; $query = 'INSERT INTO '.sql_table('config')." VALUES ('PluginURL', '$pluginURL');"; upgrade_query('PluginURL setting', $query); } // add 'EDITLINK' to all templates $query = 'SELECT tdnumber FROM '.sql_table('template_desc'); $res = DB::getResult($query); // get all template ids foreach ( $res as $row ) { $tid = $row['tdnumber']; // template id $query = 'INSERT INTO '.sql_table('template')." VALUES ($tid, 'EDITLINK', '\" onclick=\"<%editpopupcode%>\">edit');"; upgrade_query("Adding editlink code to template $tid",$query); } // in templates: update DATE_HEADER templates $res = DB::getResult('SELECT * FROM '.sql_table('template').' WHERE tpartname=\'DATE_HEADER\''); foreach ( $res as $row ) { $newval = str_replace('<%daylink%>','<%%daylink%%>',$row['tcontent']); $query = 'UPDATE '.sql_table('template').' SET tcontent=\''. addslashes($newval).'\' WHERE tdesc=' . $row['tdesc'] . ' AND tpartname=\'DATE_HEADER\''; upgrade_query('Updating DATE_HEADER part in template ' . $row['tdesc'], $query); } // in templates: add 'comments'-templatevar to all non-empty ITEM templates $res = DB::getResult('SELECT * FROM '.sql_table('template').' WHERE tpartname=\'ITEM\''); foreach ( $res as $row ) { if ( i18n::strpos($o->tcontent,'<%comments%>') === FALSE ) { $newval = $row['tcontent'] . '<%comments%>'; $query = 'UPDATE '.sql_table('template').' SET tcontent=\''. addslashes($newval).'\' WHERE tdesc=' . $row['tdesc'] . ' AND tpartname=\'ITEM\''; upgrade_query('Updating ITEM part in template ' . $row['tdesc'], $query); } } // new setting: NonmemberMail if (!upgrade_checkIfCVExists('NonmemberMail')) { $query = 'INSERT INTO '.sql_table('config')." VALUES ('NonmemberMail', '0');"; upgrade_query("Adding setting NonmemberMail",$query); } // new setting: ProtectMemNames if (!upgrade_checkIfCVExists('ProtectMemNames')) { $query = 'INSERT INTO '.sql_table('config')." VALUES ('ProtectMemNames', '1');"; upgrade_query("Adding setting ProtectMemNames",$query); } // create new table: nucleus_plugin_option global $upgrade_failures; if (0==$upgrade_failures && !upgrade_checkIfTableExists('plugin_option')) { $query = 'CREATE TABLE '.sql_table('plugin_option')." (opid int(11) NOT NULL, oname varchar(20) NOT NULL, ovalue varchar(128) not null, odesc varchar(255), otype varchar(8), PRIMARY KEY(opid, oname)) ENGINE=MyISAM;"; upgrade_query("Creating nucleus_plugin_option table",$query); }else{ echo "
  • Creating nucleus_plugin_option table ... NOT EXECUTED\n
    Errors occurred during upgrade process.
    "; } } ?>