SetTemplate("../../admin/templates/pageheader.install"); doTemplate(); } function PageFooter() { $GLOBALS["AL_CLASS_TEMPLATE"]->SetTemplate("../../admin/templates/pagefooter.install"); doTemplate(); } function doTemplate(){ ob_start(); echo $GLOBALS["AL_CLASS_TEMPLATE"]->ParseTemplate(); $tmp = ob_get_contents(); ob_end_clean(); $tmp =str_replace('images/','admin/images/',$tmp); $tmp =str_replace('styles/','admin/styles/',$tmp); echo $tmp; } PageHeader(); // dont' start straight away, let the user know what will happen and give them a "start" button $filename = "NX.1.5.update.php"; if(!isset($_POST['step'])){ // default it ?>
Update script for NX Series

This script will make changes to your MySQL database. In order to make the correct changes, please select which NX version you are updating from:


  • Add the column 'CatPass' to the categories table in order to allow for password protected categories
  • Alter your Contact Us page to fix a bug with it either not being in the database or not working
  • If you know your contact page is already working fine, have received a fix or have altered it to function, uncheck the box below. If you are not sure, and haven't altered your contact page, leave it checked.

    Yes, fix my contact page

    Yes, add the catPass field to my Database

    "; }elseif($_POST['version'] == "nx3"){ $title = "NX.0.3 through NX.0.5"; $changing = "
    1. Adding Index to database which should speed up the front page on sites with large number of articles
    "; }else{ header("Location: ".$filename); } ?>
    Update script for

    This script will make changes to your MySQL database. These are the changes:

    0) { while ($row = mysql_fetch_assoc($result)) { if($row['Field'] == 'catPass'){ $pass = true; break; } } } // already there, spit out an error if($pass == true){ echo "
    Error: The column catPass already exists, have you already run the update script?
    "; $error = true; }else{ // not there, add it mysql_query(sprintf("ALTER TABLE `%scategories` ADD `catPass` VARCHAR( 255 ) NOT NULL",$GLOBALS["AL_CFG"]["tablePrefix"])); echo "
    Added Category Password column. ".mysql_error()."

    "; } } // check if they said to fix the contact page if($_POST['fixcontact'] == 'true'){ // locate the contact page via title $query = mysql_query(sprintf("select * from %spages where Title='Contact Us' and Type='2'",$GLOBALS["AL_CFG"]["tablePrefix"])); if(mysql_num_rows($query) > 0){ // does exist, modify it if(mysql_query(sprintf("update `%spages` set Content='
    Complete the form below to contact us. If you would like a reply, please include your name and email address.
    * Name:
    * Email:
       Subject:
    * Question / Comment:



    ' where Title='Contact Us' and Type='2'",$GLOBALS["AL_CFG"]["tablePrefix"]))){ echo "
    Updated contact form success
    "; }else{ $error = true; echo "
    Error: Update contact form error ".mysql_error()."
    "; } }else{ // doesn't exist, create it if(mysql_query(sprintf("INSERT INTO `%spages` (`Title`, `Content`, `AuthorID`, `Visible`, `Status`, `Views`, `Notes`, `LastDate`, `ExternalLink`, `Type`, `ParentID`, `SortOrder`, `target`, `Image`, `MetaKeywords`, `MetaDesc`) VALUES ('Contact Us', '
    Complete the form below to contact us. If you would like a reply, please include your name and email address.
    * Name:
    * Email:
       Subject:
    * Question / Comment:



    ', 1, 1, 1, 163, '0', '2005-10-27 00:23:38', 'http://', 2, 0, 0, 0, '', '', '')",$GLOBALS["AL_CFG"]["tablePrefix"]))){ echo "
    Inserted contact form success
    "; }else{ $error = true; echo "
    Error: Insert contact form error ".mysql_error()."
    "; } } } }elseif($_POST['version'] == "nx3"){ $sql = sprintf("create index idx_order on %sarticles(StartDate, ArticleID)",$GLOBALS["AL_CFG"]["tablePrefix"]); mysql_query($sql); if(mysql_error() != ""){ if(mysql_error() == "Duplicate key name 'idx_order'"){ $error = true; echo "
    An Error has Occurred: You have already run this upgrade script. The database is reporting the Index exists!"; echo "
    "; echo "
    "; }else{ $error = true; echo "
    An Error has Occurred: "; echo mysql_error(); echo "
    "; echo "
    "; } }else{ $error = false; } }else{ header("Location: ".$filename); } if($error == true){ // if failure, tell them to email interspire echo "


    Errors were encountered while updating your copy of ArticleLive. Please contact Interspire Support for assistance.
    "; }else{ // if success, tell them to delete the update file echo "
    The update was successful! For security, please delete this upgrade script from your website. (Filename: ".$filename.")
    "; } } PageFooter(); ?>