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 = sql_query($query); while($o = mysql_fetch_object($res)) { $query = 'UPDATE '.sql_table('comment')." SET cblog='".$o->iblog."' WHERE citem='".$o->inumber."'"; upgrade_query('Filling cblog column for item ' . $o->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 = sql_query($query); // get all template ids while ($obj = mysql_fetch_object($res)) { $tid = $obj->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 = sql_query('SELECT * FROM '.sql_table('template').' WHERE tpartname=\'DATE_HEADER\''); while ($o = mysql_fetch_object($res)) { $newval = str_replace('<%daylink%>','<%%daylink%%>',$o->tcontent); $query = 'UPDATE '.sql_table('template').' SET tcontent=\''. addslashes($newval).'\' WHERE tdesc=' . $o->tdesc . ' AND tpartname=\'DATE_HEADER\''; upgrade_query('Updating DATE_HEADER part in template ' . $o->tdesc, $query); } // in templates: add 'comments'-templatevar to all non-empty ITEM templates $res = sql_query('SELECT * FROM '.sql_table('template').' WHERE tpartname=\'ITEM\''); while ($o = mysql_fetch_object($res)) { if (!strstr($o->tcontent,'<%comments%>')) { $newval = $o->tcontent . '<%comments%>'; $query = 'UPDATE '.sql_table('template').' SET tcontent=\''. addslashes($newval).'\' WHERE tdesc=' . $o->tdesc . ' AND tpartname=\'ITEM\''; upgrade_query('Updating ITEM part in template ' . $o->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.
    "; } } ?>