';
+?>
+
+
+ ';
+ echo 'Please contact the website administrator for more information.';
+}
+?>
+
+
+
+
\ No newline at end of file
diff --git a/extra/fancyurls-2/.htaccess b/extra/fancyurls-2/.htaccess
new file mode 100644
index 0000000..f2571f7
--- /dev/null
+++ b/extra/fancyurls-2/.htaccess
@@ -0,0 +1,6 @@
+
+ RewriteEngine on
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule ^(.*)$ index.php?virtualpath=$1 [L,QSA]
+
diff --git a/extra/fancyurls/.htaccess b/extra/fancyurls/.htaccess
new file mode 100644
index 0000000..69f7bf0
--- /dev/null
+++ b/extra/fancyurls/.htaccess
@@ -0,0 +1,21 @@
+
+ ForceType application/x-httpd-php
+
+
+ ForceType application/x-httpd-php
+
+
+ ForceType application/x-httpd-php
+
+
+ ForceType application/x-httpd-php
+
+
+ ForceType application/x-httpd-php
+
+
+ ForceType application/x-httpd-php
+
+
+ ForceType application/x-httpd-php
+
diff --git a/extra/fancyurls/archive b/extra/fancyurls/archive
new file mode 100644
index 0000000..4178b66
--- /dev/null
+++ b/extra/fancyurls/archive
@@ -0,0 +1,20 @@
+ 2)
+ {
+ $blogid = intval($data[1]);
+ $archive = $data[2];
+ }
+}
+
+selector();
+
+?>
\ No newline at end of file
diff --git a/extra/fancyurls/archives b/extra/fancyurls/archives
new file mode 100644
index 0000000..449323a
--- /dev/null
+++ b/extra/fancyurls/archives
@@ -0,0 +1,19 @@
+ 1)
+ {
+ $archivelist = intval($data[1]);
+ }
+}
+
+selector();
+
+?>
\ No newline at end of file
diff --git a/extra/fancyurls/blog b/extra/fancyurls/blog
new file mode 100644
index 0000000..0e398b4
--- /dev/null
+++ b/extra/fancyurls/blog
@@ -0,0 +1,19 @@
+ 1)
+ {
+ $blogid = intval($data[1]);
+ }
+}
+
+selector();
+
+?>
\ No newline at end of file
diff --git a/extra/fancyurls/category b/extra/fancyurls/category
new file mode 100644
index 0000000..c5b2c30
--- /dev/null
+++ b/extra/fancyurls/category
@@ -0,0 +1,19 @@
+ 1)
+ {
+ $catid = intval($data[1]);
+ }
+}
+
+selector();
+
+?>
\ No newline at end of file
diff --git a/extra/fancyurls/fancyurls.config.php b/extra/fancyurls/fancyurls.config.php
new file mode 100644
index 0000000..dc80c27
--- /dev/null
+++ b/extra/fancyurls/fancyurls.config.php
@@ -0,0 +1,60 @@
+
\ No newline at end of file
diff --git a/extra/fancyurls/item b/extra/fancyurls/item
new file mode 100644
index 0000000..3e3d184
--- /dev/null
+++ b/extra/fancyurls/item
@@ -0,0 +1,19 @@
+ 1)
+ {
+ $itemid = intval($data[1]);
+ }
+}
+
+selector();
+
+?>
\ No newline at end of file
diff --git a/extra/fancyurls/member b/extra/fancyurls/member
new file mode 100644
index 0000000..2cc2368
--- /dev/null
+++ b/extra/fancyurls/member
@@ -0,0 +1,19 @@
+ 1)
+ {
+ $memberid = intval($data[1]);
+ }
+}
+
+selector();
+
+?>
\ No newline at end of file
diff --git a/extra/fancyurls/special b/extra/fancyurls/special
new file mode 100644
index 0000000..43559c7
--- /dev/null
+++ b/extra/fancyurls/special
@@ -0,0 +1,17 @@
+ 1)
+ {
+ $_REQUEST['special'] = $data[1];
+ }
+}
+
+selector();
+
+?>
\ No newline at end of file
diff --git a/extra/media/media.htaccess b/extra/media/media.htaccess
new file mode 100644
index 0000000..a8011c3
--- /dev/null
+++ b/extra/media/media.htaccess
@@ -0,0 +1,5 @@
+# You may modify following line to avoid script execution completely.
+# In environment where multiple users are using Nucleus,
+# be sure that any script cannot be executed due to your server setting.
+# Note that this isn't needed when all members are super-admin.
+RemoveHandler php cgi pl py rb shtml
\ No newline at end of file
diff --git a/extra/media/readme.txt b/extra/media/readme.txt
new file mode 100644
index 0000000..b302899
--- /dev/null
+++ b/extra/media/readme.txt
@@ -0,0 +1,10 @@
+PLEASE NOTE: The media.htaccess file in this directory is intended to enhance security of your server by disallowing the running of scripts from the media folder. This will protect against rogue members, or external exploits, that rely on uploading script files to this folder for execution at a later time. Depending on the configuration of your web server, this code may not run as intended.
+
+To apply it, follow these instructions:
+
+1. Be sure that another .htaccess file does not exist in the /media folder
+2. Copy the media.htaccess file into the media folder of your Nucleus CMS installation
+3. Rename the file to .htaccess
+4. If you have an existing .htaccess file in your media folder, copy the contents from the media.htaccess file into the existing .htacces file.
+
+You can disable after installing it by renaming the file to something else, or by removing the file from that folder.
\ No newline at end of file
diff --git a/extra/skins/readme.txt b/extra/skins/readme.txt
new file mode 100644
index 0000000..b2e0434
--- /dev/null
+++ b/extra/skins/readme.txt
@@ -0,0 +1,10 @@
+PLEASE NOTE: the skins.htaccess file in this directory is intended to prohibit, for enhanced security, direct access .inc and .php files in the skin folders. Depending on the web server configuration, the code in this .htaccess file may not work as intended. In this case, your site will be displayed incorrectly, with missing content or style. Renaming the .htaccess file should fix the problem.
+
+To apply it, follow these instructions:
+
+1. Be sure that another .htaccess file does not exist in the /skins folder
+2. Copy the skins.htaccess file into the skins folder of your Nucleus CMS installation
+3. Rename the file to .htaccess
+4. If you have an existing .htaccess file in your skins folder, copy the contents from the skins.htaccess file into the existing .htacces file.
+
+You can disable after installing it by renaming the file to something else, or by removing the file from that folder.
\ No newline at end of file
diff --git a/extra/skins/skins.htaccess b/extra/skins/skins.htaccess
new file mode 100644
index 0000000..07a7544
--- /dev/null
+++ b/extra/skins/skins.htaccess
@@ -0,0 +1,4 @@
+
+Order allow,deny
+Deny from all
+
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..c3bf487
--- /dev/null
+++ b/index.php
@@ -0,0 +1,13 @@
+
diff --git a/install.php b/install.php
new file mode 100644
index 0000000..bcb26a9
--- /dev/null
+++ b/install.php
@@ -0,0 +1,1358 @@
+
Your web server is not properly configured to run PHP scripts and will not be able to install Nucleus.
0) || (count($aConfSkinsToImport) > 0) )
+ {
+ global $CONF;
+ $CONF['installscript'] = 1;
+ } // end if
+
+ if ( !class_exists('i18n', FALSE) )
+ {
+ include('nucleus/libs/i18n.php');
+
+ if ( !i18n::init('UTF-8', './nucleus/language') )
+ {
+ exit('Failed to initialize iconv or mbstring extension. Would you please contact the administrator of your PHP server?');
+ } // end if
+
+ } // end if
+
+ // we will use postVar, getVar, ... methods instead of $_GET, $_POST ...
+ include_once('nucleus/libs/vars4.1.0.php');
+
+ // include core classes that are needed for login & plugin handling
+ include_once('nucleus/libs/mysql.php');
+
+ ## added for 3.5 sql_* wrapper
+ global $MYSQL_HANDLER;
+
+ //set the handler if different from mysql (or mysqli) # $MYSQL_HANDLER = array('pdo','mysql');
+ if ( !isset($MYSQL_HANDLER) )
+ {
+ $MYSQL_HANDLER = array('mysql', '');
+ } // end if
+
+ include_once('nucleus/libs/sql/' . $MYSQL_HANDLER[0] . '.php');
+ ## end new for 3.5 sql_* wrapper
+
+ // check if mysql support is installed; this check may not make sense, as is, in a version past 3.5x
+ if ( !function_exists('mysql_query') )
+ {
+ _doError(_ERROR1);
+ } // end if
+
+ if ( postVar('action') == 'go' )
+ {
+ doInstall();
+ }
+ else
+ {
+ showInstallForm();
+ }
+
+ exit;
+
+
+ /**
+ * Display the form for installation settings
+ */
+ function showInstallForm()
+ {
+ // 0. pre check if all necessary files exist
+ doCheckFiles();
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0 )
+ {
+ showErrorMessages($errors);
+ }
+
+ // 2. try to log in to mySQL
+
+ global $MYSQL_CONN;
+
+ // this will need to be changed if we ever allow
+ $MYSQL_CONN = @sql_connect_args($mysql_host, $mysql_user, $mysql_password);
+
+ if ( $MYSQL_CONN == FALSE )
+ {
+ _doError(_ERROR15 . ': ' . sql_error() );
+ }
+
+ // 3. try to create database (if needed)
+ if ( $mysql_create == 1 )
+ {
+ sql_query('CREATE DATABASE ' . $mysql_database, $MYSQL_CONN) or _doError(_ERROR16 . ': ' . sql_error($MYSQL_CONN) );
+ }
+
+ // 4. try to select database
+ sql_select_db($mysql_database, $MYSQL_CONN) or _doError(_ERROR17);
+
+ // 5. execute queries
+ $filename = 'install.sql';
+ $fd = fopen($filename, 'r');
+ $queries = fread($fd, filesize($filename) );
+ fclose($fd);
+
+ $queries = preg_split('#(;\n|;\r)#', $queries);
+
+ $aTableNames = array(
+ 'nucleus_actionlog',
+ 'nucleus_ban',
+ 'nucleus_blog',
+ 'nucleus_category',
+ 'nucleus_comment',
+ 'nucleus_config',
+ 'nucleus_item',
+ 'nucleus_karma',
+ 'nucleus_member',
+ 'nucleus_plugin',
+ 'nucleus_skin',
+ 'nucleus_template',
+ 'nucleus_team',
+ 'nucleus_activation',
+ 'nucleus_tickets'
+ );
+
+ // these are unneeded (one of the replacements above takes care of them)
+ // 'nucleus_plugin_event',
+ // 'nucleus_plugin_option',
+ // 'nucleus_plugin_option_desc',
+ // 'nucleus_skin_desc',
+ // 'nucleus_template_desc',
+
+ $aTableNamesPrefixed = array(
+ $mysql_prefix . 'nucleus_actionlog',
+ $mysql_prefix . 'nucleus_ban',
+ $mysql_prefix . 'nucleus_blog',
+ $mysql_prefix . 'nucleus_category',
+ $mysql_prefix . 'nucleus_comment',
+ $mysql_prefix . 'nucleus_config',
+ $mysql_prefix . 'nucleus_item',
+ $mysql_prefix . 'nucleus_karma',
+ $mysql_prefix . 'nucleus_member',
+ $mysql_prefix . 'nucleus_plugin',
+ $mysql_prefix . 'nucleus_skin',
+ $mysql_prefix . 'nucleus_template',
+ $mysql_prefix . 'nucleus_team',
+ $mysql_prefix . 'nucleus_activation',
+ $mysql_prefix . 'nucleus_tickets'
+ );
+
+ // these are unneeded (one of the replacements above takes care of them)
+ // $mysql_prefix . 'nucleus_plugin_event',
+ // $mysql_prefix . 'nucleus_plugin_option',
+ // $mysql_prefix . 'nucleus_plugin_option_desc',
+ // $mysql_prefix . 'nucleus_skin_desc',
+ // $mysql_prefix . 'nucleus_template_desc',
+
+ $count = count($queries);
+
+ for ( $idx = 0; $idx < $count; $idx++ )
+ {
+ $query = trim($queries[$idx]);
+ // echo "QUERY = " . i18n::hsc($query) . "
';
+ }
+
+ // begin if: config file not written
+ if ( !$bConfigWritten )
+ {
+?>
+
+
+
+
+
<?php
+ // mySQL connection information
+ $MYSQL_HOST = '';
+ $MYSQL_USER = '';
+ $MYSQL_PASSWORD = 'xxxxxxxxxxx';
+ $MYSQL_DATABASE = '';
+ $MYSQL_PREFIX = '';
+
+ // new in 3.50. first element is db handler, the second is the db driver used by the handler
+ // default is $MYSQL_HANDLER = array('mysql','mysql');
+ //$MYSQL_HANDLER = array('mysql','mysql');
+ //$MYSQL_HANDLER = array('pdo','mysql');
+ $MYSQL_HANDLER = array('mysql','');
+
+ // main nucleus directory
+ $DIR_NUCLEUS = '';
+
+ // path to media dir
+ $DIR_MEDIA = '';
+
+ // extra skin files for imported skins
+ $DIR_SKINS = '';
+
+ // these dirs are normally sub dirs of the nucleus dir, but
+ // you can redefine them if you wish
+ $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/';
+ $DIR_LANG = $DIR_NUCLEUS . 'language/';
+ $DIR_LIBS = $DIR_NUCLEUS . 'libs/';
+
+ // include libs
+ include($DIR_LIBS.'globalfunctions.php');
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+clearCachedInfo('installedPlugins');
+ $plugin =& $manager->getPlugin($plugName);
+ $plugin->plugid = $numCurrent;
+
+ if ( !$plugin )
+ {
+ sql_query('DELETE FROM ' . sql_table('plugin') . ' WHERE `pfile` = \'' . addslashes($plugName) . '\'');
+ $numCurrent--;
+ array_push($aErrors, _ERROR22 . $plugName);
+ continue;
+ } // end if
+
+ $plugin->install();
+ } // end loop
+
+ // SYNC PLUGIN EVENT LIST
+ sql_query('DELETE FROM ' . sql_table('plugin_event') );
+
+ // loop over all installed plugins
+ $res = sql_query('SELECT `pid`, `pfile` FROM ' . sql_table('plugin') );
+
+ while ( $o = sql_fetch_object($res) )
+ {
+ $pid = $o->pid;
+ $plug =& $manager->getPlugin($o->pfile);
+
+ if ( $plug )
+ {
+ $eventList = $plug->getEventList();
+
+ foreach ( $eventList as $eventName )
+ {
+ sql_query('INSERT INTO ' . sql_table('plugin_event') . ' (`pid`, `event`) VALUES (' . $pid . ', \'' . $eventName . '\')');
+ } // end loop
+
+ } // end if
+
+ } // end loop
+
+ return $aErrors;
+ } // end function installCustomPlugs()
+
+
+ /**
+ * Install custom skins
+ * Prepares the installation of custom skins
+ */
+ function installCustomSkins(&$manager)
+ {
+ global $aConfSkinsToImport, $DIR_LIBS, $DIR_SKINS, $manager;
+
+ $aErrors = array();
+
+ if ( empty($manager) )
+ {
+ $manager = new MANAGER;
+ }
+
+ if ( count($aConfSkinsToImport) == 0 )
+ {
+ return $aErrors;
+ }
+
+ // load skinie class
+ include_once($DIR_LIBS . 'skinie.php');
+
+ $importer = new SKINIMPORT();
+
+ foreach ( $aConfSkinsToImport as $skinName )
+ {
+ $importer->reset();
+ $skinFile = $DIR_SKINS . $skinName . '/skinbackup.xml';
+
+ if ( !@file_exists($skinFile) )
+ {
+ array_push($aErrors, _ERROR23_1 . $skinFile . ' : ' . _ERROR23_2);
+ continue;
+ } // end if
+
+ $error = $importer->readFile($skinFile);
+
+ if ( $error )
+ {
+ array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);
+ continue;
+ } // end if
+
+ $error = $importer->writeToDatabase(1);
+
+ if ( $error )
+ {
+ array_push($aErrors, _ERROR24 . $skinName . ' : ' . $error);
+ continue;
+ } // end if
+
+ } // end loop
+
+ return $aErrors;
+ } // end function installCustomSkins()
+
+
+ /**
+ * Check if some important files of the Nucleus CMS installation are available
+ * Give an error if one or more files are not accessible
+ */
+ function doCheckFiles()
+ {
+ $missingfiles = array();
+ $files = array(
+ 'install.sql',
+ 'index.php',
+ 'action.php',
+ 'nucleus/index.php',
+ 'nucleus/libs/globalfunctions.php',
+ 'nucleus/libs/ADMIN.php',
+ 'nucleus/libs/BLOG.php',
+ 'nucleus/libs/COMMENT.php',
+ 'nucleus/libs/COMMENTS.php',
+ 'nucleus/libs/ITEM.php',
+ 'nucleus/libs/MEMBER.php',
+ 'nucleus/libs/SKIN.php',
+ 'nucleus/libs/TEMPLATE.php',
+ 'nucleus/libs/MEDIA.php',
+ 'nucleus/libs/ACTIONLOG.php',
+ 'nucleus/media.php'
+ );
+
+ $count = count($files);
+
+ for ( $i = 0; $i < $count; $i++ )
+ {
+
+ if ( !is_readable($files[$i]) )
+ {
+ array_push($missingfiles, _ERROR25_1 . $files[$i] . _ERROR25_2);
+ } // end if
+
+ } // end loop
+
+ if ( count($missingfiles) > 0 )
+ {
+ showErrorMessages($missingfiles);
+ } // end if
+
+ } // end function doCheckFiles()
+
+
+ /**
+ * Updates the configuration in the database
+ *
+ * @param string $name name of the config var
+ * @param string $value new value of the config var
+ * @return int
+ */
+ function updateConfig($name, $value)
+ {
+ global $MYSQL_CONN;
+ $name = addslashes($name);
+ $value = trim(addslashes($value) );
+
+ $query = 'UPDATE ' . tableName('nucleus_config')
+ . " SET `value` = '$value'"
+ . " WHERE `name` = '$name'";
+
+ sql_query($query, $MYSQL_CONN) or _doError(_ERROR26 . ': ' . sql_error($MYSQL_CONN) );
+ return sql_insert_id($MYSQL_CONN);
+ }
+
+
+ /**
+ * Replaces double backslashs
+ *
+ * @param string $input string that could have double backslashs
+ * @return string
+ */
+ function replace_double_backslash($input)
+ {
+ return str_replace('\\', '/', $input);
+ }
+
+
+ /**
+ * Checks if a string ends with a slash
+ *
+ * @param string $input
+ * @return string
+ */
+ function ends_with_slash($input)
+ {
+ return ( i18n::strrpos($input, '/') == i18n::strlen($input) - 1);
+ }
+
+
+ /**
+ * Checks if email address is valid
+ *
+ * @param string $address address which should be tested
+ * @return bool
+ */
+ function _isValidMailAddress($address)
+ {
+
+ if ( preg_match("/^[a-zA-Z0-9\._-]+@+[A-Za-z0-9\._-]+\.+[A-Za-z]{2,4}$/", $address) )
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ } // end if
+
+ }
+
+
+ /*
+ * Check if short blog names and nicknames are allowed
+ * Returns true if the given string is a valid shortname
+ * logic: only letters and numbers are allowed, no spaces allowed
+ *
+ * FIX: function eregi is deprecated since PHP 5.3.0
+ *
+ * @param string $name name which should be tested
+ * @return bool
+ */
+ function _isValidShortName($name)
+ {
+
+ if ( preg_match("/^[a-z0-9]+$/i", $name) )
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ } // end if
+
+ }
+
+
+ /*
+ * Check if a display name is allowed
+ * Returns true if the given string is a valid display name
+ *
+ * FIX: function eregi is deprecated since PHP 5.3.0
+ *
+ * @param string $name name which should be tested
+ * @return bool
+ */
+ function _isValidDisplayName($name)
+ {
+
+ if ( preg_match("/^[a-z0-9]+[a-z0-9 ]*[a-z0-9]+$/i", $name) )
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ } // end if
+
+ }
+
+
+ /**
+ * Shows error message
+ *
+ * @param string $msg error message
+ */
+ function _doError($message)
+ {
+?>
+
+
+
+
+
+
+
+
+
+
+
: ""
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
:
+
+
+
+', $msg, '';
+ }
+?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/install.sql b/install.sql
new file mode 100644
index 0000000..cd553f4
--- /dev/null
+++ b/install.sql
@@ -0,0 +1,279 @@
+CREATE TABLE `nucleus_actionlog` (
+ `timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
+ `message` varchar(255) NOT NULL default ''
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_activation` (
+ `vkey` varchar(40) NOT NULL default '',
+ `vtime` datetime NOT NULL default '0000-00-00 00:00:00',
+ `vmember` int(11) NOT NULL default '0',
+ `vtype` varchar(15) NOT NULL default '',
+ `vextra` varchar(128) NOT NULL default '',
+ PRIMARY KEY (`vkey`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_ban` (
+ `iprange` varchar(15) NOT NULL default '',
+ `reason` varchar(255) NOT NULL default '',
+ `blogid` int(11) NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_blog` (
+ `bnumber` int(11) NOT NULL auto_increment,
+ `bname` varchar(60) NOT NULL default '',
+ `bshortname` varchar(15) NOT NULL default '',
+ `bdesc` varchar(200) default NULL,
+ `bcomments` tinyint(2) NOT NULL default '1',
+ `bmaxcomments` int(11) NOT NULL default '0',
+ `btimeoffset` decimal(3,1) NOT NULL default '0.0',
+ `bnotify` varchar(128) default NULL,
+ `burl` varchar(100) default NULL,
+ `bupdate` varchar(60) default NULL,
+ `bdefskin` int(11) NOT NULL default '1',
+ `bpublic` tinyint(2) NOT NULL default '1',
+ `bconvertbreaks` tinyint(2) NOT NULL default '1',
+ `bdefcat` int(11) default NULL,
+ `bnotifytype` int(11) NOT NULL default '15',
+ `ballowpast` tinyint(2) NOT NULL default '0',
+ `bincludesearch` tinyint(2) NOT NULL default '0',
+ `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL,
+ `bfuturepost` TINYINT(2) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (`bnumber`),
+-- UNIQUE KEY `bnumber` (`bnumber`),
+ UNIQUE KEY `bshortname` (`bshortname`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO `nucleus_blog` VALUES (1, 'My Nucleus CMS', 'mynucleuscms', '', 1, 0, 0.0, '', 'http://localhost:8080/nucleus/', '', 5, 1, 1, 1, 1, 1, 0, 0, 0);
+
+CREATE TABLE `nucleus_category` (
+ `catid` int(11) NOT NULL auto_increment,
+ `cblog` int(11) NOT NULL default '0',
+ `cname` varchar(200) default NULL,
+ `cdesc` varchar(200) default NULL,
+ PRIMARY KEY (`catid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO `nucleus_category` VALUES (1, 1, 'General', 'Items that do not fit in other categories');
+
+CREATE TABLE `nucleus_comment` (
+ `cnumber` int(11) NOT NULL auto_increment,
+ `cbody` text NOT NULL,
+ `cuser` varchar(40) default NULL,
+ `cmail` varchar(100) default NULL,
+ `cemail` VARCHAR( 100 ),
+ `cmember` int(11) default NULL,
+ `citem` int(11) NOT NULL default '0',
+ `ctime` datetime NOT NULL default '0000-00-00 00:00:00',
+ `chost` varchar(60) default NULL,
+ `cip` varchar(15) NOT NULL default '',
+ `cblog` int(11) NOT NULL default '0',
+ PRIMARY KEY (`cnumber`),
+-- UNIQUE KEY `cnumber` (`cnumber`),
+ KEY `citem` (`citem`),
+ FULLTEXT KEY `cbody` (`cbody`),
+ INDEX `cblog` (`cblog`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_config` (
+ `name` varchar(20) NOT NULL default '',
+ `value` varchar(128) default NULL,
+ PRIMARY KEY (`name`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO `nucleus_config` VALUES ('DefaultBlog', '1');
+INSERT INTO `nucleus_config` VALUES ('AdminEmail', 'example@example.org');
+INSERT INTO `nucleus_config` VALUES ('IndexURL', 'http://localhost:8080/nucleus/');
+INSERT INTO `nucleus_config` VALUES ('Language', 'english');
+INSERT INTO `nucleus_config` VALUES ('SessionCookie', '');
+INSERT INTO `nucleus_config` VALUES ('AllowMemberCreate', '');
+INSERT INTO `nucleus_config` VALUES ('AllowMemberMail', '1');
+INSERT INTO `nucleus_config` VALUES ('SiteName', 'My Nucleus CMS');
+INSERT INTO `nucleus_config` VALUES ('AdminURL', 'http://localhost:8080/nucleus/nucleus/');
+INSERT INTO `nucleus_config` VALUES ('NewMemberCanLogon', '1');
+INSERT INTO `nucleus_config` VALUES ('DisableSite', '');
+INSERT INTO `nucleus_config` VALUES ('DisableSiteURL', 'http://www.this-page-intentionally-left-blank.org/');
+INSERT INTO `nucleus_config` VALUES ('LastVisit', '');
+INSERT INTO `nucleus_config` VALUES ('MediaURL', 'http://localhost:8080/nucleus/media/');
+INSERT INTO `nucleus_config` VALUES ('AllowedTypes', 'jpg,jpeg,gif,mpg,mpeg,avi,mov,mp3,swf,png');
+INSERT INTO `nucleus_config` VALUES ('AllowLoginEdit', '');
+INSERT INTO `nucleus_config` VALUES ('AllowUpload', '1');
+INSERT INTO `nucleus_config` VALUES ('DisableJsTools', '2');
+INSERT INTO `nucleus_config` VALUES ('CookiePath', '/');
+INSERT INTO `nucleus_config` VALUES ('CookieDomain', '');
+INSERT INTO `nucleus_config` VALUES ('CookieSecure', '');
+INSERT INTO `nucleus_config` VALUES ('CookiePrefix', '');
+INSERT INTO `nucleus_config` VALUES ('MediaPrefix', '1');
+INSERT INTO `nucleus_config` VALUES ('MaxUploadSize', '1048576');
+INSERT INTO `nucleus_config` VALUES ('NonmemberMail', '');
+INSERT INTO `nucleus_config` VALUES ('PluginURL', 'http://localhost:8080/nucleus/nucleus/plugins/');
+INSERT INTO `nucleus_config` VALUES ('ProtectMemNames', '1');
+INSERT INTO `nucleus_config` VALUES ('BaseSkin', '5');
+INSERT INTO `nucleus_config` VALUES ('SkinsURL', 'http://localhost:8080/nucleus/skins/');
+INSERT INTO `nucleus_config` VALUES ('ActionURL', 'http://localhost:8080/nucleus/action.php');
+INSERT INTO `nucleus_config` VALUES ('URLMode', 'normal');
+INSERT INTO `nucleus_config` VALUES ('DatabaseVersion', '350');
+INSERT INTO `nucleus_config` VALUES ('DebugVars', '0');
+INSERT INTO `nucleus_config` VALUES ('DefaultListSize', '10');
+INSERT INTO `nucleus_config` VALUES ('AdminCSS', 'original');
+
+CREATE TABLE `nucleus_item` (
+ `inumber` int(11) NOT NULL auto_increment,
+ `ititle` varchar(160) default NULL,
+ `ibody` text NOT NULL,
+ `imore` text,
+ `iblog` int(11) NOT NULL default '0',
+ `iauthor` int(11) NOT NULL default '0',
+ `itime` datetime NOT NULL default '0000-00-00 00:00:00',
+ `iclosed` tinyint(2) NOT NULL default '0',
+ `idraft` tinyint(2) NOT NULL default '0',
+ `ikarmapos` int(11) NOT NULL default '0',
+ `icat` int(11) default NULL,
+ `ikarmaneg` int(11) NOT NULL default '0',
+ `iposted` tinyint(2) NOT NULL default '1',
+ PRIMARY KEY (`inumber`),
+-- UNIQUE KEY `inumber` (`inumber`),
+ KEY `itime` (`itime`),
+ INDEX `iblog` (`iblog`),
+ INDEX `idraft` (`idraft`),
+ INDEX `icat` (`icat`),
+ FULLTEXT KEY `ibody` (`ibody`,`ititle`,`imore`)
+) ENGINE=MyISAM PACK_KEYS=0 DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_karma` (
+ `itemid` int(11) NOT NULL default '0',
+ `ip` char(15) NOT NULL default ''
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_member` (
+ `mnumber` int(11) NOT NULL auto_increment,
+ `mname` varchar(32) NOT NULL default '',
+ `mrealname` varchar(60) default NULL,
+ `mpassword` varchar(40) NOT NULL default '',
+ `memail` varchar(60) default NULL,
+ `murl` varchar(100) default NULL,
+ `mnotes` varchar(100) default NULL,
+ `madmin` tinyint(2) NOT NULL default '0',
+ `mcanlogin` tinyint(2) NOT NULL default '1',
+ `mcookiekey` varchar(40) default NULL,
+ `deflang` varchar(20) NOT NULL default '',
+ `mautosave` tinyint(2) NOT NULL default '1',
+ PRIMARY KEY (`mnumber`),
+-- UNIQUE KEY `mnumber` (`mnumber`),
+ UNIQUE KEY `mname` (`mname`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO `nucleus_member` VALUES (1, 'example', 'example', '1a79a4d60de6718e8e5b326e338ae533', 'example@example.org', 'http://localhost:8080/nucleus/', '', 1, 1, 'd767aefc60415859570d64c649257f19', '', 1);
+
+CREATE TABLE `nucleus_plugin` (
+ `pid` int(11) NOT NULL auto_increment,
+ `pfile` varchar(40) NOT NULL default '',
+ `porder` int(11) NOT NULL default '0',
+ PRIMARY KEY (`pid`),
+-- KEY `pid` (`pid`),
+ KEY `porder` (`porder`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_plugin_event` (
+ `pid` int(11) NOT NULL default '0',
+ `event` varchar(40) default NULL,
+ KEY `pid` (`pid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_plugin_option` (
+ `ovalue` text NOT NULL,
+ `oid` int(11) NOT NULL auto_increment,
+ `ocontextid` int(11) NOT NULL default '0',
+ PRIMARY KEY (`oid`,`ocontextid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_plugin_option_desc` (
+ `oid` int(11) NOT NULL auto_increment,
+ `opid` int(11) NOT NULL default '0',
+ `oname` varchar(20) NOT NULL default '',
+ `ocontext` varchar(20) NOT NULL default '',
+ `odesc` varchar(255) default NULL,
+ `otype` varchar(20) default NULL,
+ `odef` text,
+ `oextra` text,
+ PRIMARY KEY (`opid`,`oname`,`ocontext`),
+ UNIQUE KEY `oid` (`oid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE `nucleus_skin` (
+ `sdesc` int(11) NOT NULL default '0',
+ `stype` varchar(20) NOT NULL default '',
+ `scontent` text NOT NULL,
+ PRIMARY KEY (`sdesc`,`stype`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- INSERT INTO `nucleus_skin` VALUES (2, 'index', '\"?>\n\n\n <%blogsetting(name)%>\n <%blogsetting(url)%>:<%blogsetting(id)%>\n\n \" />\n <%self%>\" />\n <%version%>\n <%blog(feeds/atom/modified,1)%>\n\n <%blog(feeds/atom/entries,10)%>\n');
+-- INSERT INTO `nucleus_skin` VALUES (4, 'index', '\r\n\r\n \r\n <%version%>\r\n http://nucleuscms.org/\r\n <%sitevar(url)%>\r\n \r\n \r\n http://nucleuscms.org/documentation/devdocs/xmlrpc.html\r\n \r\n \r\n http://nucleuscms.org/documentation/devdocs/xmlrpc.html\r\n \r\n \r\n \r\n');
+-- INSERT INTO `nucleus_skin` VALUES (3, 'index', '"?>\r\n\r\n \r\n <%blogsetting(name)%>\r\n <%blogsetting(url)%>\r\n <%blogsetting(desc)%>\r\n en-us \r\n <%version%>\r\n ? \r\n Weblog\r\n http://backend.userland.com/rss\r\n \r\n <%blogsetting(url)%>/nucleus/nucleus2.gif\r\n <%blogsetting(name)%>\r\n <%blogsetting(url)%>\r\n \r\n <%blog(feeds/rss20,10)%>\r\n \r\n');
+
+CREATE TABLE `nucleus_skin_desc` (
+ `sdnumber` int(11) NOT NULL auto_increment,
+ `sdname` varchar(20) NOT NULL default '',
+ `sddesc` varchar(200) default NULL,
+ `sdtype` varchar(40) NOT NULL default 'text/html',
+ `sdincmode` varchar(10) NOT NULL default 'normal',
+ `sdincpref` varchar(50) NOT NULL default '',
+ PRIMARY KEY (`sdnumber`),
+-- UNIQUE KEY `sdnumber` (`sdnumber`),
+ UNIQUE KEY `sdname` (`sdname`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- INSERT INTO `nucleus_skin_desc` VALUES (2, 'feeds/atom', 'Atom 1.0 weblog syndication', 'application/atom+xml', 'normal', '');
+-- INSERT INTO `nucleus_skin_desc` VALUES (3, 'feeds/rss20', 'RSS 2.0 syndication of weblogs', 'text/xml', 'normal', '');
+-- INSERT INTO `nucleus_skin_desc` VALUES (4, 'xml/rsd', 'RSD (Really Simple Discovery) information for weblog clients', 'text/xml', 'normal', '');
+-- INSERT INTO `nucleus_skin_desc` VALUES (5, 'default', 'Nucleus CMS default skin', 'text/html', 'skindir', 'default/');
+
+CREATE TABLE `nucleus_team` (
+ `tmember` int(11) NOT NULL default '0',
+ `tblog` int(11) NOT NULL default '0',
+ `tadmin` tinyint(2) NOT NULL default '0',
+ PRIMARY KEY (`tmember`,`tblog`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO `nucleus_team` VALUES (1, 1, 1);
+
+CREATE TABLE `nucleus_template` (
+ `tdesc` int(11) NOT NULL default '0',
+ `tpartname` varchar(64) NOT NULL default '',
+ `tcontent` text NOT NULL,
+ PRIMARY KEY (`tdesc`,`tpartname`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- INSERT INTO `nucleus_template` VALUES (3, 'ITEM', '\r\n <%title(xml)%>\r\n <%blogurl%>index.php?itemid=<%itemid%>\r\n<%more%>]]>\r\n <%category%>\r\n<%blogurl%>index.php?itemid=<%itemid%>\r\n <%date(rfc822)%>\r\n');
+-- INSERT INTO `nucleus_template` VALUES (3, 'EDITLINK', 'edit');
+-- INSERT INTO `nucleus_template` VALUES (3, 'FORMAT_DATE', '%x');
+-- INSERT INTO `nucleus_template` VALUES (3, 'FORMAT_TIME', '%X');
+-- INSERT INTO `nucleus_template` VALUES (4, 'ITEM', '<%date(utc)%>');
+-- INSERT INTO `nucleus_template` VALUES (5, 'ITEM', '\n ]]>\n index.php?itemid=<%itemid%>\" />\n \n <%author%>\n \n <%date(utc)%>\n <%date(iso8601)%>\n <%more%>]]>\n <%blogurl%>:<%blogid%>:<%itemid%>\n');
+-- INSERT INTO `nucleus_template` VALUES (5, 'POPUP_CODE', '<%media%>');
+-- INSERT INTO `nucleus_template` VALUES (5, 'IMAGE_CODE', '<%image%>');
+-- INSERT INTO `nucleus_template` VALUES (5, 'MEDIA_CODE', '<%media%>');
+-- INSERT INTO `nucleus_template` VALUES (3, 'POPUP_CODE', '<%image%>');
+-- INSERT INTO `nucleus_template` VALUES (3, 'MEDIA_CODE', '<%media%>');
+-- INSERT INTO `nucleus_template` VALUES (3, 'IMAGE_CODE', '<%media%>');
+
+CREATE TABLE `nucleus_template_desc` (
+ `tdnumber` int(11) NOT NULL auto_increment,
+ `tdname` varchar(64) NOT NULL default '',
+ `tddesc` varchar(200) default NULL,
+ PRIMARY KEY (`tdnumber`),
+-- UNIQUE KEY `tdnumber` (`tdnumber`),
+ UNIQUE KEY `tdname` (`tdname`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- INSERT INTO `nucleus_template_desc` VALUES (4, 'feeds/atom/modified', 'Atom feeds: Inserts last modification date');
+-- INSERT INTO `nucleus_template_desc` VALUES (5, 'feeds/atom/entries', 'Atom feeds: Feed items');
+-- INSERT INTO `nucleus_template_desc` VALUES (3, 'feeds/rss20', 'Used for RSS 2.0 syndication of your blog');
+-- INSERT INTO `nucleus_template_desc` VALUES (8, 'default/index', 'Nucleus CMS default index template');
+-- INSERT INTO `nucleus_template_desc` VALUES (9, 'default/item', 'Nucleus CMS default item template');
+
+CREATE TABLE `nucleus_tickets` (
+ `ticket` varchar(40) NOT NULL default '',
+ `ctime` datetime NOT NULL default '0000-00-00 00:00:00',
+ `member` int(11) NOT NULL default '0',
+ PRIMARY KEY (`ticket`,`member`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/install_lang_english.php b/install_lang_english.php
new file mode 100644
index 0000000..92ad6a1
--- /dev/null
+++ b/install_lang_english.php
@@ -0,0 +1,157 @@
+');
+define('_ERROR25_2', ' is missing or not readable.');
+define('_ERROR26', 'Query error while trying to update config');
+define('_ERROR27', 'Error!');
+define('_ERROR28', 'Error message was');
+define('_ERROR29', 'Error message were');
+define('_ERROR30', 'Error while executing query');
+define('_ERROR31', 'Nucleus requires at least PHP version ');
+
+define('_NOTIFICATION1', 'Not available');
+
+define('_ALT_NUCLEUS_CMS_LOGO', 'Logo of Nucleus CMS');
+define('_TITLE', 'Nucleus Install');
+define('_TITLE2', 'Skin/Plugin Install Errors');
+define('_TITLE3', 'Installation Almost Complete!');
+define('_TITLE4', 'Installation complete!');
+define('_TITLE5', 'Fight against Spam');
+
+define('_HEADER1', 'Install Nucleus');
+define('_TEXT1', '
This script will help you to install Nucleus. It will set up your MySQL database tables and provide you with the information you need to enter in config.php. In order to do all this, you need to enter some information.
All fields are mandatory. Optional information can be set from the Nucleus admin-area when installation is completed.
');
+
+define('_HEADER2', 'PHP & MySQL Versions');
+define('_TEXT2', '
Below are the version numbers of the PHP interpreter and the MySQL server on your webhost. When reporting problems on the Nucleus Support Forum, please include this information.
');
+#define('_TEXT2_WARN', 'WARNING: Nucleus requires at least PHP ');
+define('_TEXT2_WARN2', 'INFORMATION: Nucleus requires at least MySQL ');
+#define('_TEXT2_WARN3', 'WARNING: You are installing NucleusCMS on a older version of PHP. PHP4 support will be depreciated in the next release, please consider upgrade to PHP5!');
+
+define('_HEADER3', 'Automatic config.php Update');
+define('_TEXT3', '
If you want Nucleus to automatically update the config.php file, you\'ll need to make it writable. You can do this by changing the file permissions to 666. After Nucleus is successfully installed, you can change the permissions back to 444 (Quick guide on how to change file permissions).
If you choose not to make your file writable (or are unable to do so): don\'t worry. The installation process will provide you with the contents of the config.php file so you can upload it yourself.
Enter your MySQL data below. This install script needs it to be able to create and fill your database tables. Afterwards, you\'ll also need to fill it out in config.php.
If you don\'t know this information, contact your system administrator for more info. Often, the hostname will be \'localhost\'. If Nucleus found a \'default MySQL host\' in the PHP settings of your server, this host is already listed in the \'hostname\' field. There\'s no guarantee that this information is correct, though.
Unless you\'re installing multiple Nucleus installations in one single database and know what you\'re doing, you really shouldn\'t change this.
All database tables generated by Nucleus will start with this prefix.
');
+
+define('_HEADER5', 'Directories and URLs');
+define('_TEXT5', '
This install script has attempted to find out the directories and URLs in which Nucleus is installed. Please check the values below and correct if necessary. The URLs and file paths should end with a slash.
');
+
+define('_TEXT5_TAB_HEAD', 'URLs and directories');
+define('_TEXT5_TAB_FIELD1', 'Site URL');
+define('_TEXT5_TAB_FIELD2', 'Admin-area URL');
+define('_TEXT5_TAB_FIELD3', 'Admin-area path');
+define('_TEXT5_TAB_FIELD4', 'Media files URL');
+define('_TEXT5_TAB_FIELD5', 'Media directory path');
+define('_TEXT5_TAB_FIELD6', 'Extra skin files URL');
+define('_TEXT5_TAB_FIELD7', 'Extra skin files directory path');
+define('_TEXT5_TAB_FIELD7_2', 'this is where imported skins can place their extra files');
+define('_TEXT5_TAB_FIELD8', 'Plugin files URL');
+define('_TEXT5_TAB_FIELD9', 'Action URL');
+define('_TEXT5_TAB_FIELD9_2', 'absolute location of the action.php file');
+define('_TEXT5_2', '
Note: Use absolute paths instead of relative paths. Usually, an absolute path will start with something like /home/username/public_html/. On Unix systems (most servers), paths should start with a slash. If you have trouble filling out this information, you should ask your administrator what to fill out.
Verify the data above, and click the button below to set up your database tables and initial data. This can take a while, so have patience. ONLY CLICK THE BUTTON ONCE !
');
+
+define('_TEXT10', '
The database tables have been initialized successfully. What still needs to be done is to change the contents of config.php. Below is how it should look like (the mysql password is masked, so you\'ll have to fill that out yourself)
');
+define('_TEXT11', '
After you changed the file on your computer, upload it to your web server using FTP. Make sure you use ASCII mode to send over the files.
');
+define('_TEXT12', 'Note: Make sure that you have no spaces at the beginning or end of the config.php file. These would cause errors to happen when performing certain actions. Thus, the first character of config.php should be "<", and the last character should be ">".');
+define('_TEXT13', '
Nucleus has been installed, and your config.php has been updated for you.
Nucleus CMS allows every visitor to write comments in blogs. So there is a high risk that spammers abuse this function. We recommend that you protect your blog with one of the following methods:
');
+define('_TEXT14_L1', 'If you don\\\'t want comments you can disable them individually for each blog: Go to the hompage of the Admin area and choose Your Weblog > Settings > Comments enabled > No.');
+define('_TEXT14_L2', 'Install one of serveral plugins that help to avoid spam comments: How can I stop comment and trackback spam? (you could bookmark this page to read it later).');
+define('_HEADER10', 'Delete your install files');
+define('_TEXT15', '
If you don\\\'t delete these files, you won\\\'t be able to open the admin area
');
+
+define('_HEADER11', 'Visit your web site');
+define('_TEXT16_H', 'Your web site is now ready to use.');
+define('_TEXT16_L1', 'Login to the admin area to configure your site');
+define('_TEXT16_L2', 'Visit your site now');
+
+define('_TEXT17', 'Go Back');
+
+define('_BUTTON1', 'Install Nucleus');
+
+define('_1ST_POST_TITLE', 'Welcome to Nucleus CMS v3.6');
+define('_1ST_POST', 'This is the first post on your Nucleus CMS. Nucleus offers you the building blocks you need to create a web presence. Whether you want to
+create a personal blog, a family page, or an online business site, Nucleus CMS can help you achieve your goals.
We\\\'ve loaded this first entry with links and information to get you started. Though you can delete this entry, it will eventually scroll off the main page as you add content to your site. Add your comments while you learn to work with Nucleus CMS, or bookmark this page so you can come back to it when you need to.');
+define('_1ST_POST2', 'Home - nucleuscms.org Welcome to the world of Nucleus CMS. In 2001 a set of PHP scripts were let loose on the open Internet. Those scripts, which took user-generated data and used it to dynamically create html pages, contained the ideas and the algorithms that are the core of today\\\'s Nucleus CMS. Though Nucleus CMS 3.5 is far more flexible and powerful than the scripts from which it emerged, it still expresses the values that guided its birth: flexibility, security, and computational elegance.
Thanks to an international community of sophisticated developers and designers, Nucleus CMS remains simple enough for anyone to learn, and expandable enough to allow you to build almost any website you can imagine. Nucleus CMS lets you integrate text, images, and user comments in a seamless package that will make your web presence as serious, professional, personal, or fun as you want it to be. We hope you enjoy its power.
Documentation - docs.nucleuscms.org The install process places a user and a developer documentation on your web server. Pop-up help is available throughout the administration area to assist you in maintaining and customizing your site. When in the Nucleus CMS admin area, click on this symbol for context-sensitive help. You can also read this documentation online under docs.nucleuscms.org.
Frequently Asked Questions - faq.nucleuscms.org If you need more information about managing, extending or troubleshooting your Nucleus CMS the Nucleus FAQ is the first place to search information. Over 170 frequently asked questions are answered from experienced Nucleus users.
Support - forum.nucleuscms.org Should you require assistance, please don\\\'t hesitate to join the 6,800+ registered users on our forums. With its built-in search capability of the 73,000+ posted articles, your answers are just a few clicks away. Remember: almost any question you think of has already been asked on the forums, and almost anything you want to do with Nucleus has been tried and explained there. Be sure to check them out.
Demonstration - demo.nucleuscms.org Want to play around, test changes or tell a friend or relative about Nucleus CMS? Visit our live demo site.
Skins - skins.nucleuscms.org The combination of multi-weblogs and skins/templates make for a powerful duo in personalizing your site or designing one for a friend, relative or business client. Import new skins to change the look of your website, or create your own skins and share them with the Nucleus community! Help designing or modifying skins is only a few clicks away in the Nucleus forums.
Plugins - plugins.nucleuscms.org Looking to add some extra functionality to the base Nucleus CMS package? Our plugin repository gives you plenty of ways to extend and expand what Nucleus CMS can do; your imagination and creativity are the only limit on how Nucleus CMS can work for you.
Development - dev.nucleuscms.org If you need more information about the Nucleus development you can find Informations in the developer documents at dev.nucleuscms.org or in the Support Forum. Sourceforge.net graciously hosts our Open Source project page which contains our software downloads and CVS repository.
Donators We would like to thank these nice people for their support. Thanks all!
License When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.');
+
+?>
diff --git a/license.txt b/license.txt
new file mode 100644
index 0000000..dcfa4c2
--- /dev/null
+++ b/license.txt
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/media/.htaccess b/media/.htaccess
new file mode 100644
index 0000000..a8011c3
--- /dev/null
+++ b/media/.htaccess
@@ -0,0 +1,5 @@
+# You may modify following line to avoid script execution completely.
+# In environment where multiple users are using Nucleus,
+# be sure that any script cannot be executed due to your server setting.
+# Note that this isn't needed when all members are super-admin.
+RemoveHandler php cgi pl py rb shtml
\ No newline at end of file
diff --git a/media/readme.txt b/media/readme.txt
new file mode 100644
index 0000000..22a1b45
--- /dev/null
+++ b/media/readme.txt
@@ -0,0 +1,16 @@
+Nucleus Media Directory
+-----------------------
+
+Uploaded images will end up in the media directory.
+
+Subdirectories work as follows:
+
+* numeric (e.g. /media/1/)
+
+Media files for a certain member (directory name is the memberid)
+
+* other directories (e.g. /media/common/)
+
+Global media collections that can be used by any member that is on a team. In order to create a new collection, simply create a new directory and assure write access is enabled for it.
+
+PLEASE NOTE: The .htaccess file in this directory is intended to enhance security of your server by disallowing the running of scripts from the media folder. This will protect against rogue members, or external exploits, that rely on uploading script files to this folder for execution at a later time. Depending on the configuration of your web server, this code may not run as intended. it can be disabled by renaming the .htaccess file.
\ No newline at end of file
diff --git a/nucleus/bookmarklet.php b/nucleus/bookmarklet.php
new file mode 100644
index 0000000..f9251dd
--- /dev/null
+++ b/nucleus/bookmarklet.php
@@ -0,0 +1,336 @@
+isLoggedIn() ) {
+ bm_loginAndPassThrough();
+ exit;
+}
+
+// on successfull login
+if ( ($action == 'login') && ($member->isLoggedIn() ) ) {
+ $action = requestVar('nextaction');
+}
+
+if ($action == '') {
+ $action = 'add';
+}
+
+sendContentType('text/html', 'bookmarklet-' . $action);
+
+// check ticket
+$action = strtolower($action);
+$aActionsNotToCheck = array('login', 'add', 'edit');
+
+if (!in_array($action, $aActionsNotToCheck) ) {
+
+ if (!$manager->checkTicket() ) {
+ bm_doError(_ERROR_BADTICKET);
+ }
+
+}
+
+// find out what to do
+switch ($action) {
+ // adds the item for real
+ case 'additem':
+ bm_doAddItem();
+ break;
+
+ // shows the edit item form
+ case 'edit':
+ bm_doEditForm();
+ break;
+
+ // edits the item for real
+ case 'edititem':
+ bm_doEditItem();
+ break;
+
+ // on login, 'action' gets changed to 'nextaction'
+ case 'login':
+ bm_doError('Something went wrong');
+ break;
+
+ // shows the fill in form
+ case 'add':
+ default:
+ bm_doShowForm();
+ break;
+}
+
+function bm_doAddItem() {
+ global $member, $manager, $CONF;
+
+ $manager->loadClass('ITEM');
+ $result = ITEM::createFromRequest();
+
+ if ($result['status'] == 'error') {
+ bm_doError($result['message']);
+ }
+
+ $blogid = getBlogIDFromItemID($result['itemid']);
+ $blog =& $manager->getBlog($blogid);
+
+ if ($result['status'] == 'newcategory') {
+ $message = 'Item was added, and a new category was created. Click here to edit the name and description of the category.';
+ $extrahead = '';
+ } else {
+ $message = _ITEM_ADDED;
+ $extrahead = '';
+ }
+
+ bm_message(_ITEM_ADDED, _ITEM_ADDED, $message,$extrahead);
+}
+
+function bm_doEditItem() {
+ global $member, $manager, $CONF;
+
+ $itemid = intRequestVar('itemid');
+ $catid = postVar('catid');
+
+ // only allow if user is allowed to alter item
+ if (!$member->canUpdateItem($itemid, $catid) ) {
+ bm_doError(_ERROR_DISALLOWED);
+ }
+
+ $body = postVar('body');
+ $title = postVar('title');
+ $more = postVar('more');
+ $closed = intPostVar('closed');
+ $actiontype = postVar('actiontype');
+ $draftid = intPostVar('draftid');
+
+ // redirect to admin area on delete (has delete confirmation)
+ if ($actiontype == 'delete') {
+ redirect('index.php?action=itemdelete&itemid=' . $itemid);
+ exit;
+ }
+
+ // create new category if needed (only on edit/changedate)
+ if (strstr($catid,'newcat') ) {
+ // get blogid
+ list($blogid) = sscanf($catid, "newcat-%d");
+
+ // create
+ $blog =& $manager->getBlog($blogid);
+ $catid = $blog->createNewCategory();
+
+ // show error when sth goes wrong
+ if (!$catid) {
+ bm_doError('Could not create new category');
+ }
+ }
+
+ // only edit action is allowed for bookmarklet edit
+ switch ($actiontype) {
+ case 'changedate':
+ $publish = 1;
+ $wasdraft = 0;
+ $timestamp = mktime(intPostVar('hour'), intPostVar('minutes'), 0, intPostVar('month'), intPostVar('day'), intPostVar('year') );
+ break;
+ case 'edit':
+ $publish = 1;
+ $wasdraft = 0;
+ $timestamp = 0;
+ break;
+ case 'backtodrafts':
+ $publish = 0;
+ $wasdraft = 0;
+ $timestamp = 0;
+ break;
+ default:
+ bm_doError('Something went wrong');
+ }
+
+ // update item for real
+ ITEM::update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, $timestamp);
+
+ if ($draftid > 0) {
+ ITEM::delete($draftid);
+ }
+
+ // show success message
+ if ($catid != intPostVar('catid') ) {
+ bm_message(_ITEM_UPDATED, _ITEM_UPDATED, 'Item was added, and a new category was created. Click here to edit the name and description of the category.', '');
+ } else {
+ bm_message(_ITEM_UPDATED, _ITEM_UPDATED, _ITEM_UPDATED, '');
+ }
+}
+
+function bm_loginAndPassThrough() {
+
+ $blogid = intRequestVar('blogid');
+ $log_text = requestVar('logtext');
+ $log_link = requestVar('loglink');
+ $log_linktitle = requestVar('loglinktitle');
+
+ ?>
+
+
+
+ Nucleus
+
+
+
+
+
+
+
+
+
+
+ ';
+ echo '';
+}
+
+function bm_doContextMenuCode() {
+ global $CONF;
+ ?>
+
+
diff --git a/nucleus/convert/PRAX.php b/nucleus/convert/PRAX.php
new file mode 100644
index 0000000..0d308fb
--- /dev/null
+++ b/nucleus/convert/PRAX.php
@@ -0,0 +1,289 @@
+,
+All Rights Reserved.
+
+License is granted to use or modify this software ("PRAX")
+for commercial or non-commercial use provided the copyright
+of the author is preserved in any distributed or derivative
+work.
+
+XML::RAX Copyright (c) 2000 Robert Hanson. All rights
+reserved. This program ("XML::RAX") is free software; you
+can redistribute and/or modify it under the terms of the
+Perl "Artistic License."
+(http://www.perl.com/language/misc/Artistic.html)
+
+For a usage synopsis, see this distribution's README.txt.
+Take a gander at sample.php (using sample.xml) for a
+live example.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
+MODIFICATIONS:
+Slightly modified by Wouter Demuynck (wouter@demuynck.org)
+*/
+
+
+class RAX {
+
+ function RAX () {
+
+ $this->record_delim = '';
+ $this->fields = array();
+ $this->records = array();
+ $this->parser;
+ $this->in_rec = 0;
+ $this->in_field = 0;
+ $this->field_data = '';
+ $this->tag_stack = array();
+ $this->xml = '';
+ $this->xml_file;
+ $this->rax_opened = 0;
+ $this->debug = 0;
+ $this->version = '0.1';
+
+ }
+
+
+ function open ($xml) {
+
+ $this->debug("open(\"$xml\")");
+
+ if ($this->rax_opened) return 0;
+
+ $this->xml = $xml;
+ $this->rax_opened = 1;
+ }
+
+
+ function openfile ($filename) {
+
+ $this->debug("openfile(\"$filename\")");
+
+ if ($this->rax_opened) return 0;
+
+ $fp = fopen($filename, "r");
+
+ if ($fp) {
+ $this->xml_file = $fp;
+ $this->rax_opened = 1;
+ return 1;
+ }
+
+ return 0;
+ }
+
+
+ function startparse () {
+
+ $this->debug("startparse()");
+
+ $this->parser = xml_parser_create();
+
+ xml_set_object($this->parser,$this);
+ xml_set_element_handler($this->parser, "startElement", "endElement");
+ xml_set_character_data_handler($this->parser, "characterData");
+ xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+
+ if (xml_parse($this->parser, '')) {
+ $this->parse_started = 1;
+ return 1;
+ }
+
+ return 0;
+ }
+
+
+ function parse () {
+
+ $this->debug("parse()");
+
+ if (!$this->rax_opened) return 0;
+ if ($this->parse_done) return 0;
+
+ if (!$this->parse_started)
+ if (!$this->startparse()) return 0;
+
+ if ($this->xml_file) {
+
+ $buffer = fread($this->xml_file, 4096);
+
+ if ( $buffer )
+ xml_parse( $this->parser, $buffer, feof($this->xml_file) );
+ else {
+ $this->parse_done = 1;
+ }
+
+ }
+ else {
+ xml_parse($this->parser, $this->xml, 1);
+ $this->parse_done = 1;
+ }
+
+ return 1;
+ }
+
+
+ function startElement($parser, $name, $attrs) {
+
+ $this->debug("startElement($name)");
+
+ array_push($this->tag_stack, $name);
+
+ if ( !$this->in_rec and !strcmp($name, $this->record_delim) ) {
+ $this->in_rec = 1;
+ $this->rec_lvl = sizeof($this->tag_stack);
+ $this->field_lvl = $this->rec_lvl + 1;
+ }
+ else if ( $this->in_rec and sizeof($this->tag_stack) == $this->field_lvl ) {
+ $this->in_field = 1;
+ }
+
+ }
+
+
+ function endElement($parser, $name) {
+
+ $this->debug("endElement($name)");
+
+ array_pop($this->tag_stack);
+
+ if ( $this->in_rec ) {
+
+ if ( sizeof($this->tag_stack) < $this->rec_lvl ) {
+ $this->in_rec = 0;
+ array_push( $this->records, new RAX_Record( $this->fields ) );
+ $this->fields = array();
+ }
+ else if ( sizeof($this->tag_stack) < $this->field_lvl ) {
+ $this->in_field = 0;
+ $this->fields[$name] = $this->field_data;
+ $this->field_data = '';
+ }
+
+ }
+
+ }
+
+
+ function characterData ($parser, $data) {
+
+ $this->debug("characterData($data)");
+
+ if ( $this->in_field )
+ $this->field_data .= $data;
+
+ }
+
+
+ function setRecord ($delim) {
+
+ $this->debug("setRecord($delim)");
+
+ if ($this->parse_started) return 0;
+
+ $this->record_delim = $delim;
+
+ return 1;
+ }
+
+
+ function readRecord () {
+
+ $this->debug("readRecord()");
+
+ while ( !sizeof($this->records) and !$this->parse_done ) $this->parse();
+
+ return array_shift($this->records);
+ }
+
+
+ function debug ($msg) {
+ if ($this->debug) print "$msg \n";
+ }
+
+ // added by Wouter Demuynck
+ function close() {
+ if ($this->rax_opened) {
+ $this->debug("Closing RAX");
+
+ fclose($this->xml_file);
+ $this->xml_file = 0;
+ $this->rax_opened = 0;
+ }
+ }
+
+}
+
+
+class RAX_Record {
+
+ function RAX_Record ( $fields ) {
+
+ $this->fields = $fields;
+
+ $this->debug = 0;
+ }
+
+
+ function getFieldnames () {
+
+ $this->debug("getFieldnames()");
+
+ return array_keys( $this->fields );
+ }
+
+
+ function getField ( $field ) {
+
+ $this->debug("getField($field)");
+
+ return trim( $this->fields[$field] );
+ }
+
+
+ function getFields () {
+
+ $this->debug("getFields()");
+
+ return array_values( $this->fields );
+ }
+
+
+ function getRow () {
+
+ $this->debug("getFields()");
+
+ return $this->fields;
+ }
+
+
+ function debug ($msg) {
+ if ($this->debug) print "$msg \n";
+ }
+
+}
diff --git a/nucleus/convert/blogger.php b/nucleus/convert/blogger.php
new file mode 100644
index 0000000..18b5ab3
--- /dev/null
+++ b/nucleus/convert/blogger.php
@@ -0,0 +1,279 @@
+isLoggedIn($thisFile)) {
+ convert_showLogin('blogger.php');
+}
+
+if (!$member->isAdmin()) {
+ convert_doError('Only Super-Admins are allowed to perform blog conversions');
+}
+
+// include PRAX lib (to read XML files easily)
+include ('PRAX.php');
+
+switch($action) {
+ case 'selectBlog':
+ bc_selectBlog(); break;
+ case 'assignMembers':
+ bc_assignMembers(); break;
+ case 'showOverview':
+ bc_showOverview(); break;
+ case 'doConvert':
+ bc_doConversion(); break;
+ case 'login': // drop through
+ default:
+ bc_BloggerToXml();
+}
+
+// step 1: get the Blogger Blog ID
+function bc_BloggerToXml() {
+ global $xmlFile, $thisFile;
+
+ convert_head();
+
+ ?>
+
Step 1: Exporting to a file
+
+
+ The first step in the conversion is to export all your Blogger entries into one single file. This is done by logging in in Blogger and by temporary changing your settings and templates.
+ The full procedure is explained below:
+
+
+
Exporting
+
+
Note: If you intend to keep using your weblog afterwards, write down the changes you made, so they can be undone afterwards. For the templates, copy paste the old ones in a textfile.
+
+
+
+ Log into Blogger and go to the blog you want to export.
+
+
+ Change the template of your blog to the following:
+
+
+ Go to the settings and change the following options:
+
+
+ Blog filename:
+
+
+ Show 900day's posts on main page
+
+
+ Under Settings : Formating, change the Timestamp Format to the date/time format MM/DD/YYYY HH:MM:SS AM|PM (that option is not listed as such, instead it has the current date filled in)
+
+
+ Archive Frequency: No Archive
+
+
+
+
+ Save the settings and publish your blog. You'll end up with a file on your server containing all of your blog items.
+
+
+ If you're running blogspot, you'll need to edit this file and take out the advertising banner code.
+
+
+
+
Importing
+
+
You now have a file called . Upload it in the same directory as the convert files (/nucleus/convert) and continue to the next step.
+
+
+
+
+
+
+
+
Step 2: Select Destination Blog
+
+
+
+
+
+ Step 4: Conversion';
+
+ echo '
Importing...
';
+ echo '
Hold on while your blog is imported...
';
+
+ // 1. get all data
+ $blogid = BlogImport::getBlogIdFromRequest();
+ $oImport = new BlogImport($blogid);
+
+ $oImport->getFromRequest('authors');
+ $oImport->getFromRequest('categories');
+ $oImport->strCallback = ''; // don't use a callback method
+
+ echo '
';
+
+ convert_foot();
+ convert_foot();
+
+}
+
+
+
+
+
+?>
diff --git a/nucleus/convert/bloggercaif.php b/nucleus/convert/bloggercaif.php
new file mode 100644
index 0000000..acdf280
--- /dev/null
+++ b/nucleus/convert/bloggercaif.php
@@ -0,0 +1,556 @@
+isLoggedIn()) {
+ convert_showLogin('bloggercaif.php');
+}
+
+if (!$member->isAdmin()) {
+ convert_doError('Only Super-Admins are allowed to perform blog conversions');
+}
+
+$ver = convert_getNucleusVersion();
+if ($ver > 210)
+ convert_doError("You should check the Nucleus website for updates to this convert tool. This one might not work with your current Nucleus installation.");
+
+// include PRAX lib (to read XML files easily)
+include ('PRAX.php');
+
+switch($action) {
+ case "assignMembers":
+ bc_assignMembers(); break;
+ case "showOverview":
+ bc_showOverview(); break;
+ case "doConversion":
+ bc_doConversion(); break;
+ case "login": // drop through
+ default:
+ bc_getBloggerBlogID();
+}
+
+// step 1: get the Blogger Blog ID
+function bc_getBloggerBlogID() {
+ global $HTTP_SERVER_VARS, $PHP_SELF;
+
+ convert_head();
+
+ ?>
+
+ Note: This conversion tool was written for Free Blogger blogs. If you use it for BloggerPro blogs, you'll lose the titles of your posts (as I currently have no information on the templating system of BloggerPro)
+
+
+
Step 1: Exporting to a file
+
+
+ The first step in the conversion is to export all your Blogger entries into one single file. This is done by logging in in Blogger and by temporary changing your settings and templates.
+ The full procedure is explained below:
+
+
+
Exporting from Blogger
+
+
Note: If you intend to keep using your weblog afterwards, write down the changes you made, so they can be undone afterwards. For the templates, copy paste the old ones in a textfile.
+
+
+
+ Log into Blogger and go to the blog you want to export.
+
+
+ Change the template of your blog to the following:
+
+
+ Go to the settings and change the following options:
+
+
+ Blog filename: blogger.xml
+
+
+ Show 900day's posts on main page
+
+
+ Date/Time Format: MM/DD/YYYY HH:MM:SS AM|PM (that option is not listed as such, instead it has the current date filled in)
+
+
+ Archive Frequency: No Archive
+
+
+
+
+ Save the settings and publish your blog. You'll end up with a blogger.xml file on your server containing all of your blog items.
+
+
+ If you're running blogspot, you'll need to edit this file and take out the advertising banner code.
+
+
+
+
Exporting comments to CAIF (Instructions for YACCS)
+
+
+
Log into YACCS
+
Export using the CAIF format. This will result in an XML file, which you should save as caif.xml on your computer.
+
+
+
Importing
+
+
+ Now you have two files (blogger.xml and caif.xml). Upload both to the same directory as the convert files (/nucleus/convert) and continue to the next step.
+
+
+
+
+
+
+
+
+
+
Step 3: Converting...
+
+
+ Please be patient. Don't hit reload! The conversion progress should be showing below.
+
";
+
+ // save mapping
+ global $mapping;
+ $mapping[$bloggerid] = $nucleus_itemid;
+
+ echo "
";
+}
+
+function bc_transformDate($date) {
+ // 7/24/2000 11:27:13 AM
+ if (eregi("(.*)/(.*)/(.*) (.*):(.*):(.*) (.*)",$date,$regs) != false) {
+ if ($regs[7] == "PM")
+ $regs[4] += 12;
+ return mktime($regs[4],$regs[5],$regs[6],$regs[1],$regs[2],$regs[3]);
+
+ } else {
+ return 0;
+ }
+
+}
+
+// mapping is an array mapping blogger IDs to nucleus itemids
+function bc_convertComments($mapping) {
+ $reader = new ReadCAIF('caif.xml',$mapping);
+}
+
+function bc_addComment($nucleus_itemid, $data) {
+ global $nucleus_blogid;
+
+ if (!$nucleus_itemid) {
+ echo "
No matching itemid found: ";
+ print_r($data);
+ echo "
";
+ return;
+ }
+
+ $c_datetime = $data['datetime'];
+ $c_name = $data['name'];
+ $c_email = $data['email'];
+ $c_uri = $data['uri'];
+ $c_ip = $data['ip'];
+ $c_text = $data['text'];
+
+ // to be sure the CDATA part is gone
+ $c_text = str_replace('','',$c_text);
+ $c_text = trim($c_text);
+
+ // get unix timestamp out of datetime thing (for yaccs, this contains an erroneous comma)
+ $c_timestamp = strtotime(str_replace(',','',$c_datetime));
+
+ // choose url or email to pass as userid
+ if ((stristr($c_uri,'http://') != false) && ($c_uri != 'http://'))
+ $c_userid = $c_uri;
+ else
+ $c_userid = $c_email;
+
+ echo '
',i18n::hsc(shorten($c_text,50,'...')),'
';
+// echo '
Date: ',strftime('%x %X',$c_timestamp),'
';
+ echo "
Name: $c_name
";
+// echo "
Email: $c_email
";
+// echo "
URI: $c_uri
";
+ echo "
UserID: $c_userid
";
+// echo "
ip: $c_ip
";
+ echo "
nucleus itemid: $nucleus_itemid
";
+// echo "
nucleus blogid: $nucleus_blogid
";
+ echo '
';
+
+ // prepare for MySQL
+ $c_timestamp = date("Y-m-d H:i:s",$c_timestamp);
+
+ // add to comments
+ convert_addToComments($c_name, $c_userid, $c_text, $nucleus_blogid, $nucleus_itemid, 0, $c_timestamp, $c_ip);
+
+
+}
+
+/* by Wouter Demuynck, slightly based on PRAX.php */
+class ReadCAIF {
+ function ReadCAIF($filename, $mapping) {
+ $this->fp = fopen($filename, 'r');
+ $this->mapping =& $mapping;
+ $this->currentItem = 0;
+ $this->tag_stack = array();
+ $this->in_rec = 0;
+ $this->in_field = 0;
+ $this->field_data = '';
+ $this->fields = array();
+
+ $this->parser = xml_parser_create();
+ xml_set_object($this->parser,$this);
+ xml_set_element_handler($this->parser, 'startElement', 'endElement');
+ xml_set_character_data_handler($this->parser, 'characterData');
+ xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+ while ($buffer = fread($this->fp, 4096))
+ xml_parse( $this->parser, $buffer, feof($this->fp) );
+ }
+
+
+ function startElement($parser, $name, $attrs) {
+ array_push($this->tag_stack, $name);
+
+// echo " BEGIN: ", implode($this->tag_stack,'->');
+ if ( !$this->in_rec and !strcmp($name, 'comment') ) {
+ $this->in_rec = 1;
+ $this->rec_lvl = sizeof($this->tag_stack);
+ $this->field_lvl = $this->rec_lvl + 1;
+ }
+ else if ( $this->in_rec and sizeof($this->tag_stack) == $this->field_lvl ) {
+ $this->in_field = 1;
+ } else if ($name == 'thread') {
+ $this->currentItem = $this->mapping[$attrs['id']];
+// echo 'THREAD START (',$this->currentItem,')';
+
+ }
+
+ }
+
+
+ function endElement($parser, $name) {
+ array_pop($this->tag_stack);
+
+// echo " END: ", implode($this->tag_stack,'->');
+
+ if ( $this->in_rec ) {
+
+ if ( sizeof($this->tag_stack) < $this->rec_lvl ) {
+ $this->in_rec = 0;
+ bc_addComment($this->currentItem, $this->fields);
+ $this->fields = array();
+
+ }
+ else if ( sizeof($this->tag_stack) < $this->field_lvl ) {
+ $this->in_field = 0;
+ $this->fields[$name] = $this->field_data;
+ $this->field_data = '';
+ }
+
+ }
+
+ }
+
+ function characterData ($parser, $data) {
+ if ( $this->in_field )
+ $this->field_data .= $data;
+
+ }
+
+
+
+}
+
+
+
+?>
\ No newline at end of file
diff --git a/nucleus/convert/functions.inc.php b/nucleus/convert/functions.inc.php
new file mode 100644
index 0000000..db3a01a
--- /dev/null
+++ b/nucleus/convert/functions.inc.php
@@ -0,0 +1,1009 @@
+ 1, 'xiffy' => 2, 'roel' => 3, '_default' => 1)
+ * @param aMapCategoryToNucleusId
+ * Similar to $aMapUserToNucleusId, but this array maps category names to
+ * category ids. Please note that the category IDs need to come from the
+ * same blog as $iBlogId
+ * example: array('general' => 11, 'funny' => 33)
+ * @param strCallback
+ * name of a callback function to be called on each item. Such a callback
+ * function should have a format like:
+ * function myCallback(&$data)
+ * where $data is an associative array with all item data ('title','body',
+ * ...)
+ */
+ function BlogImport($iBlogId = -1, $aOptions = array('ReadNamesOnly' => 0), $aMapUserToNucleusId = array(), $aMapCategoryToNucleusId = array(), $strCallback = '') {
+ global $manager;
+
+ $this->iBlog = $iBlogId;
+ if ($iBlogId != -1)
+ $this->oBlog =& $manager->getBlog($iBlogId);
+ else
+ $this->oBlog = 0;
+ $this->aOptions = $aOptions;
+ $this->aMapUserToNucleusId = $aMapUserToNucleusId;
+ $this->aMapCategoryToNucleusId = $aMapCategoryToNucleusId;
+ $this->strCallback = $strCallback;
+ $this->aMapIdToNucleusId = array();
+
+ $this->bReadNamesOnly = $this->aOptions['ReadNamesOnly'] == 1;
+ $this->aCategoryNames = array();
+ $this->aAuthorNames = array();
+
+
+ // disable magic_quotes_runtime if it's turned on
+ set_magic_quotes_runtime(0);
+
+ // debugging mode?
+ $this->bDebug = 0;
+
+ // XML file pointer
+ $this->fp = 0;
+
+ // to maintain track of where we are inside the XML file
+ $this->inXml = 0;
+ $this->inData = 0;
+ $this->inItem = 0;
+ $this->inComment = 0;
+ $this->aCurrentItem = $this->_blankItem();
+ $this->aCurrentComment = $this->_blankComment();
+
+ // character data pile
+ $this->cdata = '';
+
+ // init XML parser
+ $this->parser = xml_parser_create();
+ xml_set_object($this->parser, $this);
+ xml_set_element_handler($this->parser, 'startElement', 'endElement');
+ xml_set_character_data_handler($this->parser, 'characterData');
+ xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0);
+
+ // TODO: add data checking
+ $this->bValid = 1;
+
+ // data structures
+ $this->strErrorMessage = '';
+
+ }
+
+ /**
+ * Gets the import library version
+ */
+ function getVersion() {
+ return '0.2';
+ }
+
+ /**
+ * Returns an array with all the author names used in the file (only
+ * the authors of items are included)
+ *
+ * @require importXmlFile should be called prior to calling this
+ */
+ function getAuthorNames() {
+ return $this->aAuthorNames;
+ }
+
+ /**
+ * Returns an array with all the category names used in the file
+ *
+ * @require importXmlFile should be called prior to calling this
+ */
+ function getCategoryNames() {
+ return $this->aCategoryNames;
+ }
+
+ /**
+ * Imports an XML file into a given blog
+ *
+ * also fills $this->aMapIdToNucleusId
+ * array with info for each item having a Nucleus ID that is different
+ * from the original ID
+ * example: array(9999 => 1, 1234 => 2, 12 => 3)
+ *
+ * @param strXmlFile
+ * Location of the XML file. The XML file must be in the correct
+ * Nucleus import format
+ * @returns
+ * 0 on failure. Use getLastError() to get error message
+ * 1 on success
+ *
+ */
+ function importXmlFile($strXmlFile) {
+ $this->resetErrorMessage();
+
+ flush();
+
+ if (!$this->bValid)
+ return $this->setErrorMessage('BlogImport object is invalid');
+ if (!@file_exists($strXmlFile))
+ return $this->setErrorMessage($strXmlFile . ' does not exist');
+ if (!@is_readable($strXmlFile))
+ return $this->setErrorMessage($strXmlFile . ' is not readable');
+
+ // open file
+ $this->fp = @fopen($strXmlFile, 'r');
+ if (!$this->fp)
+ return $this->setErrorMessage('Failed to open file/URL');
+
+ // here we go!
+ $this->inXml = 1;
+
+ // parse file contents
+ while ($buffer = fread($this->fp, 4096)) {
+ $err = xml_parse( $this->parser, $buffer, feof($this->fp) );
+ if (!$err && $this->bDebug)
+ echo 'ERROR: ', xml_error_string(xml_get_error_code($this->parser)), ' ';
+ }
+
+ // all done
+ $this->inXml = 0;
+ fclose($this->fp);
+
+ return 1;
+ }
+
+ /**
+ * Identical to importXmlFile, but takes an almost-ready-for-addition array
+ *
+ * @param aData
+ * Array with item data, as prepared by import_fromXML
+ *
+ * @returns
+ * 0 on failure. Use getLastError() to get error message
+ * 1 on success
+ */
+ function importOneItem(&$aData) {
+ $this->resetErrorMessage();
+
+ // - do some logic to determine nucleus users and categories
+ // * find member id
+ // * find blog id
+ // * find category id
+ $aData['nucleus_blogid'] = $this->iBlog;
+ $aData['nucleus_catid'] = $this->_findCategoryId($aData['category']);
+ $aData['nucleus_memberid'] = $this->_findMemberId($aData['author']);
+ if ($aData['nucleus_memberid'] == 0) {
+ $aData['nucleus_memberid'] = $this->aMapUserToNucleusId['_default'];
+ }
+
+ // - apply logic to comments
+ foreach (array_keys($aData['comments']) as $key) {
+ // * find member id
+ $aData['comments'][$key]['nucleus_memberid']
+ = $this->_findMemberId($aData['comments'][$key]['author']);
+ // * extract authorid
+ if ($aData['comments'][$key]['nucleus_memberid'] == 0) {
+ $url = $aData['comments'][$key]['url'];
+ $email = $aData['comments'][$key]['email'];
+ $authid = $aData['comments'][$key]['authorid'];
+
+ if (!$authid && $url)
+ $aData['comments'][$key]['authorid'] = $url;
+ else if (!$authid && $email)
+ $aData['comments'][$key]['authorid'] = $email;
+ }
+ }
+
+ // - call callback
+ if ($this->strCallback && function_exists($this->strCallback)) {
+ call_user_func_array($this->strCallback, array(&$aData));
+ }
+
+ if ($this->bDebug) {
+ echo '
';
+ print_r($aData);
+ echo '
';
+ }
+
+ // - insert item into nucleus database
+ $iNewId = $this->sql_addToItem(
+ $aData['title'],
+ $aData['body'],
+ $aData['extended'],
+ $aData['nucleus_blogid'],
+ $aData['nucleus_memberid'],
+ $aData['timestamp'],
+ ($aData['itemstatus'] == 'open') ? 0 : 1,
+ $aData['nucleus_catid'],
+ $aData['posvotes'],
+ $aData['negvotes']
+ );
+
+ // - store id mapping if needed
+ $aData['nucleus_id'] = $iNewId;
+ if ($aData['nucleus_id'] != $aData['id'])
+ $this->aMapIdToNucleusId[$aData['id']] = $aData['nucleus_id'];
+
+ // - insert comments into nucleus database
+ foreach ($aData['comments'] as $comment) {
+ $cId = $this->sql_addToComments(
+ $comment['author'],
+ $comment['authorid'],
+ $comment['body'],
+ $aData['nucleus_blogid'],
+ $aData['nucleus_id'],
+ $comment['nucleus_memberid'],
+ $comment['timestamp'],
+ $comment['host'],
+ $comment['ip']
+ );
+ }
+
+ echo ' .'; // progress indicator
+ flush();
+
+ return 1;
+ }
+
+ function getHtmlCode($what) {
+ ob_start();
+ switch($what) {
+// ----------------------------------------------------------------------------------------
+ case 'NucleusMemberOptions':
+ $res = sql_query('SELECT mname as text, mnumber as value FROM '.sql_table('member'));
+ while ($o = mysql_fetch_object($res)) {
+ echo '';
+ }
+ break;
+// ----------------------------------------------------------------------------------------
+ case 'NucleusBlogSelect':
+ $query = 'SELECT bname as text, bnumber as value FROM '.sql_table('blog');
+ $template['name'] = 'blogid';
+ $template['selected'] = $CONF['DefaultBlog'];
+ showlist($query,'select',$template);
+ break;
+// ----------------------------------------------------------------------------------------
+ case 'ConvertSelectMembers':
+ ?>
+
Assign Members to Authors
+
+
+ Below is a list of all the authors that Nucleus could discover (only authors that have posted at least one entry are listed). Please assign a Nucleus Member to all of these authors.
+
+
+
+
+
+
Author
+
Nucleus Member
+
Blog Admin?
+
+
+ getAuthorNames();
+
+ // get HTML code for selection list
+ $optionsHtml = $this->getHtmlCode('NucleusMemberOptions');
+ $idx = 0;
+ while ($a_name = array_pop($authors)) {
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Default Member
+
+
+
+
+
+
+
+
+
+
+
+
Assign Categories
+
+
+ Below is a list of all the categories that Nucleus could discover (only categories that have been used at least once are listed). Please assign a Nucleus Category to all of these categories.
+
+
+
+
+
+
Category
+
Nucleus Category
+
+
+ getCategoryNames();
+
+ // get HTML code for selection list
+ $optionsHtml = $this->getHtmlCode('NucleusCategoryOptions');
+ $idx = 0;
+ while ($a_name = array_pop($catnames)) {
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
Choose Destination Weblog
+
+
+ There are two options: you can either choose an existing blog to add the entries into, or you can choose to create a new weblog.
+
+
+
+
+
+ getHtmlCode('NucleusBlogSelect'); ?>
+
+
+
+
+
New blog name:
+
Blog owner:
+
+
+
+
+
+
Do the conversion!
+
+
+
+
+
+
+
+ Note: Clicking the button once is enough, even if it takes a while to complete.
+
+ Creating new blog';
+ echo '
Your new weblog has been created.
';
+
+ return $nucleus_blogid;
+ } else {
+ return $blogid;
+ }
+
+ }
+
+ function getFromRequest($what) {
+ $aResult = array();
+
+ switch ($what) {
+ case 'authors':
+ $authorcount = intPostVar('authorcount');
+
+ $author = requestArray('author');
+ $memberid = requestIntArray('memberid');
+ $isadmin = requestIntArray('admin');
+
+ for ($i=0;$i<$authorcount;$i++) {
+ $authorname = undoMagic($author[$i]);
+
+ // add authors to team
+ $this->oBlog->addTeamMember(intval($memberid[$i]),intval($isadmin[$i]));
+
+ $aResult[$authorname] = $memberid[$i];
+ }
+
+ $this->aMapUserToNucleusId = $aResult;
+ break;
+ case 'categories':
+ // TODO
+ $this->aMapCategoryToNucleusId = $aResult;
+ break;
+ }
+
+ return $aResult;
+ }
+
+ function _findCategoryId($name) {
+ $catid = @$this->aMapCategoryToNucleusId[$name];
+ if (!$catid && $this->oBlog)
+ // get default category for weblog
+ $catid = $this->oBlog->getDefaultCategory();
+ return $catid;
+ }
+
+ function _findMemberId($name) {
+ $memberid = intval(@$this->aMapUserToNucleusId[$name]);
+ return $memberid;
+ }
+
+ /**
+ * Returns the last error message. Use it to find out the reason for failure
+ */
+ function getLastError() {
+ return $this->strErrorMessage;
+ }
+ function resetErrorMessage() {
+ $this->strErrorMessage = '';
+ }
+ function setErrorMessage($strMsg) {
+ $this->strErrorMessage = $strMsg;
+ return 0;
+ }
+
+ /**
+ * Called by XML parser for each new start element encountered
+ */
+ function startElement($parser, $name, $attrs) {
+ if ($this->bDebug) echo 'START: ', $name, ' ';
+
+ switch ($name) {
+ case 'blog':
+ $this->inData = 1;
+ $this->strImportFileVersion = $attrs['version'];
+ // TODO: check version number
+ break;
+ case 'item':
+ $this->inItem = 1;
+ $this->aCurrentItem = $this->_blankItem($attrs['id']);
+ if (@$attrs['commentsOnly'] == 'true')
+ $this->aCurrentItem['commentsOnly'] = 1;
+ else
+ $this->aCurrentItem['commentsOnly'] = 0;
+ break;
+ case 'timestamp':
+ if ($this->inItem || $this->inComment) {
+ // store time format
+ $this->currentTSFormat = $attrs['type'];
+ }
+ break;
+ case 'author':
+ case 'title':
+ case 'body':
+ case 'extended':
+ case 'category':
+ case 'itemstatus':
+ case 'posvotes':
+ case 'negvotes':
+ // nothing to do
+ break;
+ case 'comment':
+ if ($this->inItem) {
+ $this->inComment = 1;
+ $this->aCurrentComment = $this->_blankComment($attrs['id']);
+ }
+ break;
+ case 'email':
+ case 'url':
+ case 'authorid':
+ case 'host':
+ case 'ip':
+ // nothing to do
+ break;
+ default:
+ echo 'UNEXPECTED TAG: ' , $name , ' ';
+ break;
+ }
+
+ // character data never contains other tags
+ $this->clearCharacterData();
+
+ }
+
+ /**
+ * Called by the XML parser for each closing tag encountered
+ */
+ function endElement($parser, $name) {
+ if ($this->bDebug) echo 'END: ', $name, ' ';
+
+ switch ($name) {
+ case 'blog':
+ $this->inData = 0;
+ break;
+ case 'item':
+ if (!$this->bReadNamesOnly) {
+ // write to database
+ // TODO: check if succes or failure
+ $this->importOneItem($this->aCurrentItem);
+ }
+ $this->inItem = 0;
+
+ // initialize item structure
+ $this->aCurrentItem = $this->_blankItem();
+ break;
+ case 'timestamp':
+ $timestamp = $this->getTime($this->getCharacterData(), $this->currentTSFormat);
+ if ($this->inComment)
+ $this->aCurrentComment['timestamp'] = $timestamp;
+ else if ($this->inItem)
+ $this->aCurrentItem['timestamp'] = $timestamp;
+ break;
+ case 'author':
+ if ($this->inItem && !$this->inComment)
+ $this->_addAuthorName($this->getCharacterData());
+ if ($this->inComment)
+ $this->aCurrentComment['author'] = $this->getCharacterData();
+ else if ($this->inItem)
+ $this->aCurrentItem['author'] = $this->getCharacterData();
+ break;
+ case 'title':
+ if ($this->inComment)
+ $this->aCurrentComment['title'] = $this->getCharacterData();
+ else if ($this->inItem)
+ $this->aCurrentItem['title'] = $this->getCharacterData();
+ break;
+ case 'body':
+ if ($this->inComment)
+ $this->aCurrentComment['body'] = $this->getCharacterData();
+ else if ($this->inItem)
+ $this->aCurrentItem['body'] = $this->getCharacterData();
+ break;
+ case 'extended':
+ if ($this->inItem)
+ $this->aCurrentItem['extended'] = $this->getCharacterData();
+ break;
+ case 'category':
+ $this->_addCategoryName($this->getCharacterData());
+ if ($this->inItem && !$this->aCurrentItem['category']) {
+ $this->aCurrentItem['category'] = $this->getCharacterData();
+ }
+ break;
+ case 'itemstatus':
+ if ($this->inItem)
+ $this->aCurrentItem['itemstatus'] = $this->getCharacterData();
+ break;
+ case 'posvotes':
+ if ($this->inItem)
+ $this->aCurrentItem['posvotes'] = $this->getCharacterData();
+ break;
+ case 'negvotes':
+ if ($this->inItem)
+ $this->aCurrentItem['negvotes'] = $this->getCharacterData();
+ break;
+ case 'comment':
+ if ($this->inComment) {
+ array_push($this->aCurrentItem['comments'], $this->aCurrentComment);
+ $this->aCurrentComment = $this->_blankComment();
+ $this->inComment = 0;
+ }
+ break;
+ case 'email':
+ if ($this->inComment)
+ $this->aCurrentComment['email'] = $this->getCharacterData();
+ break;
+ case 'url':
+ if ($this->inComment)
+ $this->aCurrentComment['url'] = $this->getCharacterData();
+ break;
+ case 'authorid':
+ if ($this->inComment)
+ $this->aCurrentComment['authorid'] = $this->getCharacterData();
+ break;
+ case 'host':
+ if ($this->inComment)
+ $this->aCurrentComment['host'] = $this->getCharacterData();
+ break;
+ case 'ip':
+ if ($this->inComment)
+ $this->aCurrentComment['ip'] = $this->getCharacterData();
+ break;
+ default:
+ echo 'UNEXPECTED TAG: ' , $name, ' ';
+ break;
+ }
+ $this->clearCharacterData();
+
+ }
+
+ /**
+ * Called by XML parser for data inside elements
+ */
+ function characterData ($parser, $data) {
+ if ($this->bDebug) echo 'NEW DATA: ', i18n::hsc($data), ' ';
+ $this->cdata .= $data;
+ }
+
+ /**
+ * Returns the data collected so far
+ */
+ function getCharacterData() {
+ return $this->cdata;
+ }
+
+ /**
+ * Clears the data buffer
+ */
+ function clearCharacterData() {
+ $this->cdata = '';
+ }
+
+ /**
+ * Parses a given string into a unix timestamp.
+ *
+ * @param strTime
+ * String, formatted as given in $strFormat
+ * @param strFormat
+ * Multiple date formats are supported:
+ * 'unix': plain unix timestamp (numeric)
+ * 'blogger': for blogger import: MM/DD/YYYY hh:MM:SS AM
+ */
+ function getTime($strTime, $strFormat = 'unix') {
+ $strFormat = strtolower($strFormat);
+ switch($strFormat) {
+ case 'unix':
+ return intval($strTime);
+ case 'blogger':
+ // 7/24/2000 11:27:13 AM
+ if (eregi("(.*)/(.*)/(.*) (.*):(.*):(.*) (.*)",$strTime,$regs) != false) {
+ if (($regs[7] == "PM") && ($regs[4] != "12"))
+ $regs[4] += 12;
+
+ return mktime($regs[4],$regs[5],$regs[6],$regs[1],$regs[2],$regs[3]);
+ } else {
+ return 0;
+ }
+ }
+ }
+
+
+ function _blankItem($id = -1) {
+ return array(
+ 'id' => $id,
+ 'commentsOnly' => 0,
+ 'timestamp' => time(),
+ 'author' => '',
+ 'title' => '',
+ 'body' => '',
+ 'extended' => '',
+ 'category' => '',
+ 'itemstatus' => 'open',
+ 'posvotes' => 0,
+ 'negvotes' => 0,
+ 'comments' => array()
+ );
+ }
+
+ function _blankComment($id = -1) {
+ return array(
+ 'id' => $id,
+ 'timestamp' => time(),
+ 'author' => '',
+ 'title' => '',
+ 'body' => '',
+ 'email' => '',
+ 'url' => '',
+ 'authorid' => '',
+ 'host' => '',
+ 'ip' => ''
+ );
+ }
+
+ function _addAuthorName($name) {
+ if (!in_array($name, $this->aAuthorNames))
+ array_push($this->aAuthorNames, $name);
+ }
+
+ function _addCategoryName($name) {
+ if (!in_array($name, $this->aCategoryNames))
+ array_push($this->aCategoryNames, $name);
+ }
+
+ function sql_addToItem($title, $body, $more, $blogid, $authorid, $timestamp, $closed, $category, $karmapos, $karmaneg) {
+ $title = trim(addslashes($title));
+ $body = trim(addslashes($body));
+ $more = trim(addslashes($more));
+ $timestamp = date("Y-m-d H:i:s", $timestamp);
+
+ $query = 'INSERT INTO '.sql_table('item').' (ITITLE, IBODY, IMORE, IBLOG, IAUTHOR, ITIME, ICLOSED, IKARMAPOS, IKARMANEG, ICAT) '
+ . "VALUES ('$title', '$body', '$more', $blogid, $authorid, '$timestamp', $closed, $karmapos, $karmaneg, $category)";
+
+ mysql_query($query) or die("Error while executing query: " . $query);
+
+ return mysql_insert_id();
+ }
+
+ function sql_addToBlog($name, $shortname, $ownerid) {
+ $name = addslashes($name);
+ $shortname = addslashes($shortname);
+
+ // create new category first
+ mysql_query('INSERT INTO '.sql_table('category')." (CNAME, CDESC) VALUES ('General','Items that do not fit in another category')");
+ $defcat = mysql_insert_id();
+
+ $query = 'INSERT INTO '.sql_table('blog')." (BNAME, BSHORTNAME, BCOMMENTS, BMAXCOMMENTS, BDEFCAT) VALUES ('$name','$shortname',1 ,0, $defcat)";
+ mysql_query($query) or die("Error while executing query: " . $query);
+ $id = mysql_insert_id();
+
+ // update category row so it links to blog
+ mysql_query('UPDATE ' . sql_table('category') . ' SET cblog=' . intval($id). ' WHERE catid=' . intval($defcat));
+
+ BlogImport::sql_addToTeam($id,$ownerid,1);
+
+
+ return $id;
+ }
+
+ function sql_addToComments($name, $url, $body, $blogid, $itemid, $memberid, $timestamp, $host, $ip='') {
+ $name = addslashes($name);
+ $url = addslashes($url);
+ $body = trim(addslashes($body));
+ $host = addslashes($host);
+ $ip = addslashes($ip);
+ $timestamp = date("Y-m-d H:i:s", $timestamp);
+
+ $query = 'INSERT INTO '.sql_table('comment')
+ . ' (CUSER, CMAIL, CMEMBER, CBODY, CITEM, CTIME, CHOST, CBLOG, CIP) '
+ . "VALUES ('$name', '$url', $memberid, '$body', $itemid, '$timestamp', '$host', $blogid, '$ip')";
+
+ mysql_query($query) or die("Error while executing query: " . $query);
+
+ return mysql_insert_id();
+ }
+
+ function sql_addToTeam($blogid, $memberid, $admin) {
+
+ $query = 'INSERT INTO '.sql_table('team').' (TMEMBER, TBLOG, TADMIN) '
+ . "VALUES ($memberid, $blogid, $admin)";
+
+ mysql_query($query) or die("Error while executing query: " . $query);
+
+ return mysql_insert_id();
+ }
+
+
+
+}
+
+// some sort of version checking
+$ver = convert_getNucleusVersion();
+if ($ver > 250)
+ convert_doError("You should check the Nucleus website for updates to this convert tool. This one might not work with your current Nucleus installation.");
+
+ // make sure the request variables get reqistered in the global scope
+ // Doing this should be avoided on code rewrite (this is a potential security risk)
+ if ((phpversion() >= "4.1.0") && (ini_get("register_globals") == 0)) {
+ @import_request_variables("gp",'');
+ }
+
+ /** this function gets the nucleus version, even if the getNucleusVersion
+ * function does not exist yet
+ * return 96 for all versions < 100
+ */
+ function convert_getNucleusVersion() {
+ if (!function_exists('getNucleusVersion')) return 96;
+ return getNucleusVersion();
+ }
+
+ // TODO: remove this function (replaced by BlogImport::sql_addToItem)
+ function convert_addToItem($title, $body, $more, $blogid, $authorid, $timestamp, $closed, $category, $karmapos, $karmaneg) {
+ $title = trim(addslashes($title));
+ $body = trim(addslashes($body));
+ $more = trim(addslashes($more));
+
+ $query = 'INSERT INTO '.sql_table('item').' (ITITLE, IBODY, IMORE, IBLOG, IAUTHOR, ITIME, ICLOSED, IKARMAPOS, IKARMANEG, ICAT) '
+ . "VALUES ('$title', '$body', '$more', $blogid, $authorid, '$timestamp', $closed, $karmapos, $karmaneg, $category)";
+
+ mysql_query($query) or die("Error while executing query: " . $query);
+
+ return mysql_insert_id();
+ }
+
+
+ // TODO: remove this function (replaced by BlogImport::sql_addToBlog)
+ function convert_addToBlog($name, $shortname, $ownerid) {
+ $name = addslashes($name);
+ $shortname = addslashes($shortname);
+
+ // create new category first
+ mysql_query('INSERT INTO '.sql_table('category')." (CNAME, CDESC) VALUES ('General','Items that do not fit in another categort')");
+ $defcat = mysql_insert_id();
+
+ $query = 'INSERT INTO '.sql_table('blog')." (BNAME, BSHORTNAME, BCOMMENTS, BMAXCOMMENTS, BDEFCAT) VALUES ('$name','$shortname',1 ,0, $defcat)";
+ mysql_query($query) or die("Error while executing query: " . $query);
+ $id = mysql_insert_id();
+
+ convert_addToTeam($id,$ownerid,1);
+
+
+ return $id;
+ }
+
+ // TODO: remove this function (replaced by BlogImport::sql_addToComments)
+ function convert_addToComments($name, $url, $body, $blogid, $itemid, $memberid, $timestamp, $host, $ip='') {
+ $name = addslashes($name);
+ $url = addslashes($url);
+ $body = trim(addslashes($body));
+ $host = addslashes($host);
+ $ip = addslashes($ip);
+
+ $query = 'INSERT INTO '.sql_table('comment')
+ . ' (CUSER, CMAIL, CMEMBER, CBODY, CITEM, CTIME, CHOST, CBLOG, CIP) '
+ . "VALUES ('$name', '$url', $memberid, '$body', $itemid, '$timestamp', '$host', $blogid, '$ip')";
+
+ mysql_query($query) or die("Error while executing query: " . $query);
+
+ return mysql_insert_id();
+ }
+
+ // TODO: remove this function (replaced by BlogImport::sql_addToTeam)
+ function convert_addToTeam($blogid, $memberid, $admin) {
+
+ $query = 'INSERT INTO '.sql_table('team').' (TMEMBER, TBLOG, TADMIN) '
+ . "VALUES ($memberid, $blogid, $admin)";
+
+ mysql_query($query) or die("Error while executing query: " . $query);
+
+ return mysql_insert_id();
+ }
+
+ function convert_showLogin($type) {
+ convert_head();
+ ?>
+
+
\ No newline at end of file
diff --git a/nucleus/convert/genericImport.php b/nucleus/convert/genericImport.php
new file mode 100644
index 0000000..58f5f7d
--- /dev/null
+++ b/nucleus/convert/genericImport.php
@@ -0,0 +1,193 @@
+ generic XML
+ * - pMachineToXml.php pMachine -> generic XML
+ * - MovableTypeToXml.php MT -> generic XML
+ * Step 1:
+ * - genericImport.php generic XML -> Nucleus
+ *
+ * @license http://nucleuscms.org/license.txt GNU General Public License
+ * @copyright Copyright (C) 2002-2006 The Nucleus Group
+ * @version $Id: genericImport.php 846 2005-12-30 10:38:32Z dekarma $
+ */
+
+include("../../config.php");
+include("functions.inc.php");
+include($DIR_LIBS . "ADMIN.php");
+include($DIR_LIBS . "MEDIA.php");
+
+if (!$member->isLoggedIn()) {
+ convert_showLogin('genericImport.php');
+}
+
+if (!$member->isAdmin()) {
+ convert_doError('Only Super-Admins are allowed to perform blog conversions');
+}
+
+$ver = convert_getNucleusVersion();
+if ($ver > 250)
+ convert_doError("You should check the Nucleus website for updates to this convert tool. This one might not work with your current Nucleus installation.");
+
+// include PRAX lib (to read XML files easily)
+include ('PRAX.php');
+
+switch($action) {
+ case "assignMembers":
+ gi_assignMembers(); break;
+ case "doConversion":
+ gi_doConversion(); break;
+ case "login": // drop through
+ default:
+ gi_chooseXmlFile();
+}
+
+// step 1: Let the user choose which XML file she wants to import
+function gi_chooseXmlFile() {
+ global $HTTP_SERVER_VARS, $PHP_SELF;
+
+ convert_head();
+
+ ?>
+
+
Step 1: Choose File To Import
+
+
+ You're about to import the contents of a weblog that was created with another blogging tool than Nucleus.
+
+
+
Export to generic XML
+
+
+ Before you can start the actual import process, you'll need to export the contents from your (non-Nucleus) weblog into a generic XML file using one of the conversion scripts listed below. Such scripts are available for a variety of blog scripts:
+
+ You'll end up with an XML file (e.g. export.xml). Upload this file to the same directory as the convert files (/nucleus/convert/) and reload this page. Your file should appear in the selection box below.
+
+
+
+ (to be worked out)
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nucleus/convert/greymatter.php b/nucleus/convert/greymatter.php
new file mode 100644
index 0000000..5d09f65
--- /dev/null
+++ b/nucleus/convert/greymatter.php
@@ -0,0 +1,544 @@
+isLoggedIn()) {
+ convert_showLogin('greymatter.php');
+}
+
+if (!$member->isAdmin()) {
+ convert_doError('Only Super-Admins are allowed to perform blog conversions');
+}
+
+$ver = convert_getNucleusVersion();
+if ($ver > 210)
+ convert_doError("You should check the Nucleus website for updates to this convert tool. This one might not work with your current Nucleus installation.");
+
+switch($action) {
+ case "assignMembers":
+ gmc_assignMembers(); break;
+ case "showOverview":
+ gmc_showOverview(); break;
+ case "doConversion":
+ gmc_doConversion(); break;
+ case "login": // drop through
+ default:
+ gmc_askGreyPath();
+}
+
+function gmc_askGreyPath() {
+ global $HTTP_SERVER_VARS, $PHP_SELF;
+
+ convert_head();
+
+ // try to guess greymatter path
+ $guess = $HTTP_SERVER_VARS["PATH_TRANSLATED"];
+ $guess = str_replace("/nucleus/convert","",$guess);
+ $guess = str_replace("greymatter.php","",$guess);
+ $guess = str_replace("\\","/",$guess);
+ // add slash at end if necessary
+ if (!endsWithSlash($guess)) $guess .= '/';
+
+ if (file_exists($guess . 'gm-authors.cgi'))
+ $guess = $guess;
+ else if (file_exists($guess . 'gm/gm-authors.cgi'))
+ $guess = $guess . 'gm/';
+ else if (file_exists($guess . 'greymatter/gm-authors.cgi'))
+ $guess = $guess . 'greymatter/';
+ else if (file_exists($guess . '../gm-authors.cgi'))
+ $guess = $guess . '../';
+ else if (file_exists($guess . '../gm/gm-authors.cgi'))
+ $guess = $guess . '../gm/';
+ else if (file_exists($guess . '../greymatter/gm-authors.cgi'))
+ $guess = $guess . '../greymatter/';
+
+
+ ?>
+
Before you start
+
+
+ Before you start converting, make sure that you have created Nucleus Member accounts for all your GreyMatter authors. You'll be asked to assign Nucleus member accounts to GreyMatter authors in the next step.
+
+
+
+ If you used {{popup}} tags in GreyMatter to create popup windows with images, make sure you've set the mediadir correctly and that has the correct filepermissions to allow upload. (Nucleus will copy your images to that directory)
+
+
+
Greymatter Path
+
+
+
+
+
+
Converting...
+
+
+ Please be patient. Don't hit reload! The conversion progress should be showing below.
+
";
+}
+
+// returns $text with special greymatter markup commands expanded.
+function gm_parsecommands($text, $authorid ) {
+ // special markup characters
+ // **bold text** -> bold text
+ // __underlined text__ -> underlined text
+ // \\italic text\\ -> italic text
+ $to_replace = array(
+ "/\*\*(.*?)\*\*/is",
+ "/\\\\(.*?)\\\\/is",
+ "/__(.*?)__/is"
+ );
+ $replace_by = array(
+ "\\1",
+ "\\1",
+ "\\1"
+ );
+ $text = preg_replace($to_replace, $replace_by, $text);
+
+ // {{link url}}
+ // {{link url text}}
+ // {{linkmo url text|mouseover text}}
+ // {{email address}}
+ // {{email address text}}
+ // {{emailmo address text|mouseover text}}
+ // {{popup
+ if (strstr($text,"{{link") || stristr($text,"{{email") || stristr($text,"{{popup")) {
+ $to_replace = array(
+ "/({{linkmo) (http|https|ftp)(:\/\/\S+?) (.+?)(\|)(.+?)(}})/ies",
+ "/({{link) (http|https|ftp)(:\/\/\S+?)(}})/is",
+ "/({{link) (http|https|ftp)(:\/\/\S+?) (.+?)(}})/is",
+ "/({{emailmo) (\S+\@\S+?) (.+?)(\|)(.+?)(}})/ies",
+ "/({{email) (\S+\@\S+?)(}})/is",
+ "/({{email) (\S+\@\S+?) (.+?)(}})/is",
+ "/{{popup (\S+) (.+?) (\d+)x(\d+)}}(.*?)<\/a>/ies"
+ );
+ $replace_by = array(
+ // linkmo
+ 'gm_linkmo("\\2\\3","\\6","\\4")',
+ // link
+ "\\2\\3",
+ "\\4",
+ // emailmo
+ 'gm_linkmo("mailto:\\2","\\5","\\3")',
+ // email
+ "\\2",
+ "\\3",
+ // popup
+ 'gm_popup("\\1",$authorid,"\\5",\\3,\\4)'
+ );
+ $text = preg_replace($to_replace, $replace_by, $text);
+ }
+
+ // newlines (greymatter renders newlines as linebreaks)
+ $text = ereg_replace("\n"," ",$text); // newlines
+
+ return $text;
+}
+
+// makes sure quotes are escaped in javascript strings
+// php seems to quote the arguments as the get passed to this method by preg_replace
+// with /e modifier
+function gm_linkmo($url, $mouseover, $text) {
+ // remove slashes from text (not needed there)
+ $text = stripslashes($text);
+
+ // replace " by \' in mouseover (to avoid error)
+ $mouseover = str_replace('"',"\'",$mouseover);
+
+ return ''.$text.'';
+}
+
+// converts GM {{popup command into a link to the image
+function gm_popup($filename, $authorid, $text, $width, $height) {
+ global $grey_datapath;
+
+ $res = MEDIA::addMediaObject(MEMBER::createFromID($authorid), "$grey_datapath$filename", $filename);
+
+ if ($res != "")
+ die("error copying media files: $res");
+
+ // TODO: copy file to media directory
+ // TODO: create %popup(...)% code instead
+
+ $text = i18n::hsc(stripslashes($text));
+
+ return "<%popup($filename|$width|$height|$text)%>";
+}
+
+
+
+?>
\ No newline at end of file
diff --git a/nucleus/convert/index.html b/nucleus/convert/index.html
new file mode 100644
index 0000000..8ed8bff
--- /dev/null
+++ b/nucleus/convert/index.html
@@ -0,0 +1,36 @@
+
+
+
+ Nucleus Convert
+
+
+
+
+
Conversion from other weblog tools to Nucleus
+
+
+In order to perform these conversions, you should be a Nucleus Super-Admin. Nucleus should already be installed, and you need to have Nucleus Super-Admin rights in order to continue.
+
+
+
+Before you start the conversion, create Nucleus Members for all authors used in the other tool (e.g. for all GreyMatter authors).
+
+
+
Get Converting
+
+
+Choose the type of weblogtool you want to convert below:
+
+
+
+
\ No newline at end of file
diff --git a/nucleus/convert/livejournal.php b/nucleus/convert/livejournal.php
new file mode 100644
index 0000000..37724d6
--- /dev/null
+++ b/nucleus/convert/livejournal.php
@@ -0,0 +1,353 @@
+isLoggedIn()) {
+ convert_showLogin('livejournal.php');
+}
+
+if (!$member->isAdmin()) {
+ convert_doError('Only Super-Admins are allowed to perform blog conversions');
+}
+
+$ver = convert_getNucleusVersion();
+if ($ver > 210)
+ convert_doError("You should check the Nucleus website for updates to this convert tool. This one might not work with your current Nucleus installation.");
+
+// include PRAX lib (to read XML files easily)
+include ('PRAX.php');
+
+switch($action) {
+ case "assignMembers":
+ bc_assignMembers(); break;
+ case "showOverview":
+ bc_showOverview(); break;
+ case "doConversion":
+ bc_doConversion(); break;
+ case "login": // drop through
+ default:
+ bc_getlivejournalID();
+}
+
+// step 1: get the Blogger Blog ID
+function bc_getlivejournalID() {
+ global $HTTP_SERVER_VARS, $PHP_SELF;
+
+ convert_head();
+
+ ?>
+
+ Note: This conversion tool was written for LiveJournal blogs.
+
+
Step 1: Exporting to a file
+
+
+ The first step in the conversion is to export one month's Live Journal entries into one single file. This can be done with an export tool you can read about in the LiveJournal.com F.A.Q. here. The export tool itself can be found here. The settings you will need are as follows:
+
+
+
Format: XML
+
Encoding: Unicode
+
Fields:
+
Event
+
Subject
+
Event Time
+
(all others should be unselected)
+
+
+ Save the resulting file as ljent.xml.
+
+
+
Importing
+
+
+ Now you have a file called ljent.xml. Upload it in the same directory as the convert files (/nucleus/convert) and continue to the next step.
+
+
+
+
+
+
+
+
+
+
Step 3: Converting...
+
+
+ Please be patient. Don't hit reload! The conversion progress should be showing below.
+
";
+
+ $title = $row['subject']; // use the title when it is in the XML file
+ convert_addToItem($title, $row['event'], '', $nucleus_blogid, $nucl_id, $timestamp, 0, $catid, 0, 0);
+
+}
+
+function bc_transformDate($eventtime) {
+// 2003-07-03 23:59:00
+if (eregi("(.*)-(.*)-(.*) (.*):(.*):(.*)",$eventtime,$regs) != false) {
+return mktime($regs[4],$regs[5],$regs[6],$regs[2],$regs[3],$regs[1]);
+} else {
+return 0;
+}
+}
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/nucleus/convert/weblog.php b/nucleus/convert/weblog.php
new file mode 100644
index 0000000..3897d2b
--- /dev/null
+++ b/nucleus/convert/weblog.php
@@ -0,0 +1,217 @@
+isLoggedIn()) {
+ convert_showLogin('weblog.php');
+}
+
+if (!$member->isAdmin()) {
+ convert_doError('Only Super-Admins are allowed to perform blog conversions');
+}
+
+$ver = convert_getNucleusVersion();
+if ($ver > 210)
+ convert_doError("You should check the Nucleus website for updates to this convert tool. This one might not work with your current Nucleus installation.");
+
+// include PRAX lib (to read XML files easily)
+include ('PRAX.php');
+
+switch($action) {
+ case "login": // drop through
+ default:
+ bc_getBloggerBlogID();
+}
+
+// step 1: get the Blogger Blog ID
+function bc_getBloggerBlogID() {
+ global $HTTP_SERVER_VARS, $PHP_SELF;
+
+ convert_head();
+
+ ?>
+
+ Thanks to Eric Driesen for providing this we::blog template.
+
+ Note: This conversion tool will NOT convert your comments.
+
+
+
Step 1: Exporting to a file
+
+
+ The first step in the conversion is to export all your we::blog entries into one single file.
+ The full procedure is explained below:
+
+
+
Exporting
+
+
Note: If you intend to keep using your weblog afterwards, write down the changes you made, so they can be undone afterwards. For the templates, copy paste the old ones in a textfile.
+
+
+
+ Change the template of your blog to the following:
+
+
Edit blogger.xml and remove the header and footer of the file (the file should start with <bloggerblog> and end with </bloggerblog>)
+
+
+
Importing
+
+
+ Now you have a file called blogger.xml. Upload it in the same directory as the convert files (/nucleus/convert) and continue to the next step.
+
+
+
+
+
+
+
Note: the next steps are the same as for Blogger.com blogs, so don't be surprised to see Blogger.com mentioned.
+
+
\ No newline at end of file
diff --git a/nucleus/convert/wordpress.php b/nucleus/convert/wordpress.php
new file mode 100644
index 0000000..d458cc1
--- /dev/null
+++ b/nucleus/convert/wordpress.php
@@ -0,0 +1,258 @@
+Error: $s";
+ }
+
+ // line breaks into properly formatted paragraphs
+ function paragraph($text, $br = false) {
+ $text=trim($text);
+ $text = str_replace("\r",'',$text);
+ $text = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $text);
+ if ($text=="") return "";
+ $text = $text . "\n"; // just to make things a little easier, pad the end
+ $text = preg_replace('| \s* |', "\n\n", $text);
+ $text = preg_replace('!(<(?:table|ul|ol|li|pre|form|blockquote|h[1-6])[^>]*>)!', "\n$1", $text); // Space things out a little
+ $text = preg_replace('!((?:table|ul|ol|li|pre|form|blockquote|h[1-6])>)!', "$1\n", $text); // Space things out a little
+ $text = preg_replace("/(\r\n|\r)/", "\n", $text); // cross-platform newlines
+ $text = preg_replace("/\n\n+/", "\n\n", $text); // take care of duplicates
+ $text = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "\t
$1
\n", $text); // make paragraphs, including one at the end
+ $text = preg_replace('|
\s*?
|', '', $text); // under certain strange conditions it could create a P of entirely whitespace
+ $text = preg_replace("|
(
|", "$1", $text); // problem with nested lists
+ // blockquote
+ $text = preg_replace('|
]*)>|i', "
", $text);
+ $text = str_replace('
', '
', $text);
+ // now the hard work
+ $text = preg_replace('!
This tool will convert your WordPress blog (tested w/ 3.1.x), into Nucleus CMS weblog. First, install Nucleus, in a default install, and only after that run this tool. It will transfer all categories, posts, and comments into blog #1.
";
+ mysql_query("delete from " . sql_table('comment') . " where chost='@wordpress'",$linkblogcms);
+ $query="select * from ".$prefixwp."posts where post_status='publish' order by ID";
+ $querywp=mysql_query($query,$linkwp) or die($query);
+ echo "
rows to transfer: ".mysql_num_rows($querywp)."
";
+ echo "
";
+ $i=1;
+ while ($row=mysql_fetch_object($querywp)) {
+ echo $i++.", ";
+ // find category
+ $query = 'select * from '.$prefixwp.'term_relationships, '.$prefixwp.'term_taxonomy where '.$prefixwp.'term_relationships.term_taxonomy_id='.$prefixwp.'term_taxonomy.term_taxonomy_id and object_id='.$row->ID.' and '.$prefixwp.'term_taxonomy.taxonomy=\'category\' limit 1';
+ $catwp = mysql_query($query, $linkwp) or die($query);
+ $category = mysql_fetch_object($catwp);
+ $cat = $cate_map[$category->term_id];
+ if (empty($cat)) $cat = 1;
+
+ // insert post
+ $query=
+ "insert into " . sql_table('item') . " ".
+ "(ititle,ibody,iblog,iauthor,itime,icat) values (".
+ "'".addslashes(encoding($row->post_title))."','".addslashes(paragraph(encoding(stripslashes($row->post_content)),false))."',1,1,'".$row->post_date."',$cat)";
+ $result = mysql_query($query,$linkblogcms) or die($query);
+ $itemid=mysql_insert_id($linkblogcms);
+
+ // insert comments
+ $query="select * from ".$prefixwp."comments where comment_post_ID=".$row->ID;
+ $querywp_detail=mysql_query($query,$linkwp) or die($query);
+ while ($row_detail=mysql_fetch_object($querywp_detail)) {
+ $url=$row_detail->comment_author_email;
+ if (!empty($row_detail->comment_author_url)) $url=$row_detail->comment_author_url;
+ $query=
+ "insert into " . sql_table('comment') .
+ " (cbody,cuser,cmail,cmember,citem,ctime,cip,cblog,chost) values (".
+ "'".addslashes(paragraph(encoding(strip_tags(stripslashes($row_detail->comment_content))),true))."',".
+ "'".encoding($row_detail->comment_author)."',".
+ "'$url',".
+ "0,".
+ "$itemid,".
+ "'".$row_detail->comment_date."',".
+ "'".$row_detail->comment_author_IP."',".
+ "1,".
+ "'@wordpress')";
+ $result = mysql_query($query,$linkblogcms) or die($query);
+ }
+ }
+ echo "
+This document contains information on how to customize the Nucleus install script. It can be customized in two ways:
+
+
+
+
Automatically install skins
+
Automatically install plugins
+
+
+
Configurations
+
+
Open up the install.php script and locate the following piece of code:
+
+
// array with names of plugins to install. Plugin files must be present in the nucleus/plugin/
+ // directory.
+ //
+ // example:
+ // array('NP_TrackBack', 'NP_MemberGoodies')
+ $aConfPlugsToInstall = array();
+
+
+ // array with skins to install. skins must be present under the skins/ directory with
+ // a subdirectory having the same name that contains a skinbackup.xml file
+ //
+ // example:
+ // array('base','rsd')
+ $aConfSkinsToImport = array();
+
+
This code is all you need to change: list the names of the plugins and skins you want to auto-install in the arrays.
+
+
Including the files
+
+
Next to changing the configuration, you'll need to add the files to the zipfile distribution.
+
+
Plugins
+
+
For plugins, place the files in the nucleus/plugins/ directory. Just as when you would install a plugin manually.
+
+
For skins, place them as directories under skins/, just as you would do when importing a skin manually. Don't forget to put the skinimport.xml file in there.
+
+
Don't forget
+
+
Don't forget to test your customized install script before distributing it.
+
+
+
\ No newline at end of file
diff --git a/nucleus/documentation/devdocs/index.html b/nucleus/documentation/devdocs/index.html
new file mode 100644
index 0000000..50dbe58
--- /dev/null
+++ b/nucleus/documentation/devdocs/index.html
@@ -0,0 +1,30 @@
+
+
+
+
+ Nucleus - Development Documentation
+
+
+
+
+
+Developer Docs
+
+
+
Introduction
+
+
+This document contains information about Nucleus that is only relevant to developers.
+
+
+
+
\ No newline at end of file
diff --git a/nucleus/documentation/devdocs/plugins.html b/nucleus/documentation/devdocs/plugins.html
new file mode 100644
index 0000000..c299b6d
--- /dev/null
+++ b/nucleus/documentation/devdocs/plugins.html
@@ -0,0 +1,2512 @@
+
+
+
+
+ Nucleus - Plugin API
+
+
+
+
+
+
+Plugin API
+December 7, 2010
+
+
+
Notes:
+
+
This document should contain enough information to write basic plugins. If you have more questions, see the Plugin Development Forum
+
Methods and events introduced after Nucleus v1.5 was released have the Nucleus version in which they were introduced listed. If you use any of those functions, don't forget to adapt getMinNucleusVersion appropriately.
+
+Nucleus plugins allow just about anyone to extend the functionality that Nucleus offers, without having to alter the PHP code itself. Plugins are simple php scripts that must implement certain methods, and can easily be exchanged between Nucleus users. Installing goes as easy as adding the plugin file to the plugin directory and letting Nucleus know it's there.
+
+
+
+Some advantages of plugins are listed below:
+
+
+
+
Extra functionality can easily be added to the Nucleus framework, without having to know much details about the implementation.
+
You can install only the plugins you need, saving on the time needed to generate a page
+
+
+
+All plugin files should be placed in the directory that is listed in config.php. Commonly, this will be /your/path/nucleus/plugins/. Plugin files can be recognized by their form: NP_name.php. Some plugins require a subdirectory with the same name to store extra files or their admin area.
+
+
+
+Note: the names are case-sensitive, so they should start with NP_, not Np_ or np_. Also note that when the plugin uses a subdirectory, the name of that directory should be all lowercase.
+
+
+
+
+
+
Writing your first plugin
+
+
+Ok, lets start by writing a simple plugin. Basically, each plugin is a PHP class that inherits from the predefined class NucleusPlugin. Below is an example of a HelloWorld-plugin:
+
+
+
<?php
+
+class NP_HelloWorld extends NucleusPlugin
+{
+ // name of plugin
+ function getName()
+ {
+ return 'Hello World';
+ }
+
+ // author of plugin
+ function getAuthor()
+ {
+ return 'Wouter Demuynck';
+ }
+
+ // an URL to the plugin website
+ // can also be of the form mailto:foo@bar.com
+ function getURL()
+ {
+ return 'http://nucleuscms.org/';
+ }
+
+ // version of the plugin
+ function getVersion()
+ {
+ return '1.0';
+ }
+
+ // a description to be shown on the installed plugins listing
+ function getDescription()
+ {
+ return 'Just a sample plugin.';
+ }
+
+ function doSkinVar($skinType)
+ {
+ echo 'Hello World!';
+ }
+
+ function supportsFeature ($what)
+ {
+ switch ($what)
+ {
+ case 'SqlTablePrefix':
+ return 1;
+ case 'SqlApi':
+ return 1;
+ default:
+ return 0;
+ }
+ }
+
+}
+?>
+
+
+
+ Copy this code in a file called NP_HelloWorld.php, and put it in your plugins directory. Make sure that there are no spaces after the last ?> or before the first <?php.. NP stands for "Nucleus Plugin", if you were wondering about that.
+
+
Open the Nucleus Administration area and go into Nucleus Management/Manage Plugins
+
You'll find out that there's a HelloWorld plugin you can install. Do this. If everything worked out correctly, you'll see that your plugin is now listed in the list of installed plugins.
+
+ Now edit one of your skins and insert the following statement at a place of which you know where it will show up on the actual page.
+
<%HelloWorld%>
+ Note that the name (HelloWorld) is case sensitive!
+
+
Now visit a page that uses the skin you edited: notice the "Hello World" at the location where you've added the plugin-skinvar.
+
+
+
+So, that wasn't so hard after all. Read on to find out more.
+
+
+
+
+
+
+
+
+
The class NucleusPlugin
+
+
All Nucleus plugins must inherit from the PHP class NucleusPlugin. If this sounds complicated, don't worry, it isn't. It even makes your life easier, allowing you to only implement the methods that your plugin needs, and giving access to some auxiliary functions.
+
+
Below is an overview of the methods that the NucleusPlugin offers, and that you can re-implement in your own plugin. If you want to see the source of the class itsself, it's located at nucleus/libs/PLUGIN.php
+
+
+
Overview of the class NucleusPlugin (redefinable methods)
+
+
Method Signature
Explanation
+
+
+
getName()
+
Returns the name of the plugin. This will be the name that will show up on the list of installed plugins. You should definately redefine this method, since the default implementation returns Undefined
+
+
+
getAuthor()
+
Returns the name of author of the plugin. This name will show up on the list of installed plugins. You should definately redefine this method, since the default implementation returns Undefined
+
+
+
getURL()
+
Returns the URL of the site where the plugin can be downloaded, or where additional information about the plugin can be found. If no such site exists, a mailto:-link with the authors email address is appropriate. You should definately redefine this method, since the default implementation returns Undefined
+
+
+
getDescription()
+
Returns a longer description of the plugin. This will show up on the list of installed plugins. The default implementation returns Undefined
+
+
+
getVersion()
+
Returns the current version of the plugin. Returns 0.0 by default
+
+
+
getMinNucleusVersion()
+
(v2.0b) Returns the minimum required Nucleus version. By default, this returns 155 (v1.55). If you are using plugin features that were introduced later, please implement this function (e.g. v2.0 => 200). Please note that Nucleus v1.55 does not use this function at all, so it remains possible to install newer plugins there, even if they use newer features.
+
+
+
getMinNucleusPatchLevel()
+
(v3.1) Returns the minimum required Nucleus patch level that needs to be present when running the minimal required Nucleus version (getMinNucleusVersion). By default, this returns 0. This function is generally used when new plugin features are available only as patches to the latest released Nucleus version.
+
+
+
init()
+
Initializes the plugin. This method gets called immediately after the plugin object is created and the plugid-attribute has been set. By default, this method does nothing.
+
+
+
doSkinVar($skinType)
+
When plugins are called using the <%plugin(...)%>-skinvar, this method will be called. the $skinType parameter contains the type of skin (item, archive, ...) from where the plugin is called. Don't get confused by the fact that there's only one parameter. Multiple parameters can still be passed. More info on implementing the doSkinVar method. By default, this method does no output at all.
+
+
+
doTemplateVar(&$item)
+
Basically the same as doSkinVar, but this time for calls of the <%plugin(...)%>-var in templates (item header/body/footer and dateheader/footer). By default, this method forwards the handling to the doSkinVar-method, using template as skintype. More information on implementing the doTemplateVar method
+
+
+
doTemplateCommentsVar(&$item, &$comment)
+
(v2.0b) Basically the same as doSkinVar, but this time for calls of the <%plugin(...)%>-var in templates (comments-related parts). By default, this method forwards the handling to the doSkinVar-method, using template as skintype. More information on implementing the doTemplateCommentsVar method
+
+
+
doItemVar(&$item, &$param)
+
(v3.30) Basically the same as doSkinVar, but this time for calls of the <%plugin(...)%>-var in an item. &$item provides the full item object of the item in which the ItemVar appears and &$param the parameters of the ItemVar.
+
+
+
doIf($key, $value)
+
(v3.30) Evaluates a custom conditional statement for the if/ifnot/elseif/elseifnot skin variables. Must return either true or false. $key and $value are strings passed from the if/ifnot/elseif/elseifnot skin variable. Normally, the plugin should check whether $key has the value of $value, but other uses are possible. Plugins that make use of this method, should document its use for users of the plugin.
+
+
+
doAction($type)
+
When a plugin wants to allow user interaction, it can allow actions through action.php. This is the script that Nucleus uses itself to handle new comments and karma votes. Called with the correct parameters, the doAction-method from a plugin can be called. The $type contains an optional message type. Extra variables from the request can be accessed from within the doAction method. By default, this method returns a string No Such Action which will trigger an error message. More info on doAction.
+
+
+
install()
+
This method gets called on the moment the plugin is installed. It can perform initializing actions, such as the creation of database tables, the creation of plugin options, etc... By default, this method does nothing.
+
+
+
unInstall()
+
Called when the plugin is uninstalled. It's a good thing to clean up information your plugin created in the database at this point. By default, this method does nothing.
+
+
+
getEventList()
+
Plugins can subscribe to events. Events get generated whenever Nucleus performs a certain action. An AddItem event for example, will call all plugins that subscribed to this event. The called method will be event_AddItem($params). The $params-parameter is an associative array containing several fields of information, like the itemid for AddItem. Returns an empty array by default, indicating that the plugin does not subscribe to any event at all. More information about events.
+
+
+
getTableList()
+
This method should return an array of database tables that the plugin has created. It's used in the backup feature that Nucleus offers, so plugin tables are also included in the backup. By default, returns an empty array.
+
+
+
hasAdminArea()
+
Should return 1 if the plugin has an admin area of its own, and 0 if it doesn't. By default, 0 is returned.
+
+
+
getPluginDep()
+
(v3.2) Returns an array of plugin names. Nucleus refuses to install the plugin if any of these plugins is not installed. By default, an empty array is returned. More information on plugin dependencies.
+
+
+
+
Next to the methods that can be implemented, the class NucleusPlugin offers some extra methods which you should not implement yourself. They can be called from within your plugin using the $this->functionName() syntax.
+
+
+
Overview of the class NucleusPlugin (non-redefinable methods)
Returns the ID for this plugin (this is the ID internally used inside Nucleus)
+
+
+
getAdminURL()
+
Returns the URL of where the admin area of the plugin is located (if there is no such admin area, this information is invalid)
+
+
+
getDirectory()
+
Returns the path in the servers filesystem where the extra files for the plugin are stored (if there are no such files, this information makes no sense). The result is something like ".../nucleus/plugins/plugname/"
+
+
+
getShortName()
+
Returns the part of the plugin classname without the "NP_"-part, and in all-lowercase. This information is used in the functions getAdminURL and getDirectory
+
+
+
+
+
Skinvars
+
+
Description
+
+
+You can create your own skinvars, and call them using <%plugin(PlugName,parameters)%> or <%PlugName(parameters)%> (when this does not conflict with an existing skinvar). Parameters are comma-separated.
+
+
+
+To handle skinvars, you'll need to implement the doSkinVar method. Some samples of signatures are given below:
+
The $skinType parameter will be one of 'index', 'item', 'archive', 'archivelist', 'member', 'error', 'search', 'imagepopup' or 'template'
+
The $skinVar is actually the first parameter that's being interpreted as a type of skinvar (e.g. <%plugin(PlugName,VarType)%>)
+
You can use doSkinVar() (no parameters) and retrieve the parameters using the PHP function func_get_args(). Could be handy if you have different types of skinvars with different numbers of arguments
+
+
+
Notes
+
+
+
(v2.0b) You can find the name of the skin that's currently being parsed in the global variable $currentSkinName
+
+
+
+
+
+
Template variables
+
+
Description
+
+
+Template plugin variables work in the same way as skin plugin vars. There are two differences:
+
+
+
They are called from within templates instead of from within skins
+
They don't take a $skinType parameter. Instead, they take extra parameters with info on the item and comment that is currently being parsed:
+
+
The doTemplateVar-method gets a &$item parameter.
+
The doTemplateCommentsVar-method gets an &$item parameter as well as a &$comment parameter.
+
+ Note the ampersands!
+
+
+
+
Template variables are called in exactly the same way as skinvars (using <%plugin(PlugName,parameters)%> or <%PlugName(parameters)%>)
+
+
+
+By default, all template variables are passed on to the doSkinVar-method, using 'template' as skinType-parameter.
+
+
+
+If you want to provide your own implementation, you'll need to redefine the method doTemplateVar and/or doTemplateCommentsVar. It works in the same way as doSkinVar, except that now the skinType-parameter is missing.
+
(v2.0b) You can find the name of the template that's currently being used inside the global variable $currentTemplateName
+
+
+
+
+
+
Actions
+
+
Plugins can perform actions through action.php, the same script that's being used to receive comments and karma votes. You can call it using both GET and POST methods. Required parameters are action (should be 'plugin'), name (name of the plugin) and type (type of requested action)
+
+
To enable these actions, you should implement the doAction($actionType) method in your plugin. Extra parameters from the request can be received using requestVar('name') (requestVar takes care of magic_quotes_gpc that PHP might have added)
+
+
+When your doAction method returns a string, it will be interpreted as an error, and an error message will be shown.
+
+
+
+
+
+
+
+
Events
+
+
+Nucleus Plugins can subscribe to events that occur whenever something important happens. The plugin can then execute some actions, or output some text.
+
+
+
Example
+
+
+Below is an example of how a plugin subscribes to the PreAddComment-event, an event that is generated immediately before a comment is added to a blog.
+
This plugin replaces the text HTML in each comment by the text <acronym title="HyperText Markup Language">HTML</acronym>. The acronym-tag is a HTML-tag that allows authors to provide extra information on acronyms.
+
+
Subscribing to events
+
+
Here's the steps you need to take to subscribe to an event:
+
+
+
Add the event name to the array returned by the getEventList-method
+
Create a method with signature event_EventName($data), in which the handling of the event is done
+
+
+
Multiple plugins can subscribe to the same event. The order in which these plugins are notified is the same order as the ordening in the plugin list of the admin area. Plugins higher in the list get notified earlier on.
+
+
Parameters
+
+
The event_EventName-method gets only one parameter, $data, of which the contents differs depending on the event. It is an associative array with data. Objects and arrays that are passed in this array, are passed by reference, so the changes you make there will be remembered.
+
+
The event list below uses some colors to indicate if changes in the parameters will be seen by nucleus or not:
+
+
+
pass-by-reference: when changes are made to this kind of parameters, they will be seen by Nucleus.
+
pass-by-value: a copy of the value is made before it is sent to the plugin event handler. Changes in the contents of these variables will be discarded automatically.
+
+
+
Objects that are passed as parameters are indicates as follows: object. Most objects are also passed by reference, making them look like object by ref
+
+
Event List
+
+
+
Events on which a plugin can subscribe
+
+
Name
When
Parameters
+
+
+
InitSkinParse
+
Just before the skin is initialized
+
+
skin
+
The SKIN-object that is handling the parse
+
type
+
Type of skinpart (one of 'index', 'item', 'archive', 'archivelist', 'member', 'error', 'search', 'imagepopup', 'fileparser')
+
+
+
+
PreSkinParse
+
Immediately before the parsing of a skin begins
+
+
skin
+
The SKIN-object that is handling the parse
+
type
+
Type of skinpart (one of 'index', 'item', 'archive', 'archivelist', 'member', 'error', 'search', 'imagepopup', 'fileparser')
+
contents
+
The content of the skin
+
+
+
+
PostSkinParse
+
Immediately after parsing a skin
+
+
skin
+
The SKIN-object that is handling the parse
+
type
+
Type of skinpart (one of 'index', 'item', 'archive', 'archivelist', 'member', 'error', 'search', 'imagepopup', 'fileparser')
+
+
+
+
PreItem
+
Before an item is parsed, but after the item header has been placed
+
+
blog
+
BLOG object
+
item
+
object containing item data
+
+
+
+
PostItem
+
After an item has been parsed, but before the item footer has been parsed
+
+
blog
+
BLOG object
+
item
+
object containing item data
+
+
+
+
PreComment
+
Before a comment is shown
+
+
comment
+
associative array containing comment data
+
+
+
+
PostComment
+
After a comment has been shown
+
+
comment
+
associative array containing comment data
+
+
+
+
PreDateHead
+
Before a date header is shown
+
+
blog
+
BLOG object
+
timestamp
+
Timestamp for date header
+
+
+
+
PostDateHead
+
After a date header has been parsed
+
+
blog
+
BLOG object
+
timestamp
+
Timestamp for date header
+
+
+
+
PreDateFoot
+
Before a date footer is parsed
+
+
blog
+
BLOG object
+
timestamp
+
Timestamp for day that is closed
+
+
+
+
PostDateFoot
+
After a date footer has been parsed
+
+
blog
+
BLOG object
+
timestamp
+
Timestamp for day that is closed
+
+
+
+
LoginSuccess
+
After a successful login
+
+
member
+
MEMBER object
+
username
+
login name that was used in the login attempt
+
+
+
+
LoginFailed
+
After a failed login
+
+
username
+
login name that was used in the login attempt
+
+
+
+
Logout
+
After logout
+
+
username
+
name of the user that logged out
+
+
+
+
PreBlogContent
+
Before blog content has been inserted through a skinvar
+
+
blog
+
BLOG object
+
type
+
Type of skinvar that's being called ('blog', 'otherblog', 'archive', 'archivelist', 'item', 'searchresults', 'othersearchresults', 'categorylist', 'otherarchive', 'otherarchivelist')
+
+
+
+
PostBlogContent
+
After blog content has been inserted through a skinvar
+
+
blog
+
BLOG object
+
type
+
Type of skinvar that's being called ('blog', 'otherblog', 'archive', 'archivelist', 'item', 'searchresults', 'othersearchresults', 'categorylist', 'otherarchive', 'otherarchivelist')
+
+
+
+
PreAddComment
+
Before adding a comment to the database
+
+
comment
+
comment data (associative array)
+
spamcheck
+
the resulting datastructure of the previously called SpamCheck event (associative array)
+
+
+
+
PostAddComment
+
After adding a comment to the database
+
+
comment
+
comment data (associative array)
+
commentid
+
comment ID
+
spamcheck
+
the resulting datastructure of the previously called SpamCheck event (associative array)
+
+
+
+
PostRegister
+
After a new user has registered
+
+
member
+
New MEMBER object
+
+
+
+
PostAddItem
+
After an item has been added to the database
+
+
itemid
+
new itemid in database
+
+
+
+
PostUpdateItem
+
Immediately after an item gets updates in the database
+
+
itemid
+
item ID
+
+
+
+
PreAddItem
+
Immediately before an item is added to the database
+
+
title
+
title
+
body
+
body text
+
more
+
extended text
+
blog
+
BLOG object
+
authorid
+
ID of author
+
timestamp
+
UNIX timestamp
+
closed
+
1 (no comments allowed) or 0 (comments allowed)
+
draft
+
1 (draft) or 0 (not draft)
+
catid
+
ID fo category
+
+
+
+
PreUpdateItem
+
Immediately before an item gets updates in the database
+
+
itemid
+
item ID
+
title
+
title
+
body
+
body text
+
more
+
extended text
+
blog
+
BLOG object
+
closed
+
1 (no comments allowed) or 0 (comments allowed)
+
catid
+
ID fo category
+
+
+
+
PrepareItemForEdit
+
Called after getting an item from the database, and before presenting it to the user to be edited.
+
+
item
+
associative array containing item data
+
+
+
+
PreUpdateComment
+
Immediately before a comment is updated and saved into the database
+
+
body
+
Comment body
+
+
+
+
PrepareCommentForEdit
+
After a comment is retrieved from the database, and before it is presented to the user to be edited.
+
+
comment
+
comment data (associative array)
+
+
+
+
PrePluginOptionsEdit
+
+ (v2.0b) before the 'edit plugin options' form is created.
+ (v2.2) extra parameters
+ (v3.2) extra parameter for every option
+
+
+
context
+
(v2.2) global, blog, member, item or category
+
options
+
Array with for each option an associative array, having the following indices: name, value, oid, description, type, typeinfo, contextid, extra. Extra options can be added here (if you want to do something with them, you'll need to subscribe to PostPluginOptionsUpdate as well)
+ Using the extra-field you can add extra html (by example formcontrols) to the option. If you do so, you should compare pid with getID() and also check name before adding things to extra
+
plugid
+
plugin ID (compare with GetID() to find out if this concerns you) (only present when context is global)
+
contextid
+
context ID (blogid, memberid, catid, itemid depending on context)
+
+
+
+
+
PrePluginOptionsUpdate
+
+ (v3.2) Before the options for a plugin have been updated. (using this event you can validate/change the new value for an option)
+
+
+
context
+
(v2.2) global, member, blog, item or category
+
plugid
+
plugin ID (compare with GetID() to find out if this concerns you)
+
optionname
+
Name of the option
+
contextid
+
context ID (blogid, memberid, catid, itemid depending on context)
+
value
+
New value for the option
+
+
+
+
+
+
PostPluginOptionsUpdate
+
+ (v2.0b) After the options for a plugin have been updated.
+ (v2.2) Different parameters depending on context
+
+
+
context
+
(v2.2) global, member, blog, item or category
+
plugid
+
plugin ID (compare with GetID() to find out if this concerns you) (global context)
+
blogid
+
(v2.2) blog ID (blog context)
+
blog
+
(v2.2) BLOG object (blog context)
+
memberid
+
(v2.2) member ID (member context)
+
member
+
(v2.2) MEMBER object (member context)
+
catid
+
(v2.2) category ID (category context)
+
itemid
+
(v2.2) item ID (item context)
+
member
+
(v2.2) ITEM object (item context)
+
+
+
+
+
PostAuthentication
+
(v2.0b) After the login procedure has been completed. This occurs on each page request.
+
+
loggedIn
+
result of $member->isLoggedIn()
+
+
+
+
PreAddItemForm
+
(v2.0b) Immediately before an add item form (bookmarklet or admin area) is created.
+
+
contents
+
reference to an associative array, in which the values 'title', 'body' and 'more' can be filled with initial values for the formfields. To avoid multiple plugins to alter these values, set the 'hasBeenSet' value to 1 when you're done (and check for it before starting)
+
blog
+
reference to a BLOG object
+
+
+
+
AddItemFormExtras
+
(v2.0b) Somewhere inside the add item page or bookmarklet. Here, plugins can add their custom fields without having to alter one of the .template files.
+
+
blog
+
reference to a BLOG object
+
+
+
+
EditItemFormExtras
+
+ (v2.0b) Somewhere inside the edit item page or bookmarklet. Here, plugins can add their custom fields without having to alter one of the .template files.
+
+ Don't add too much data, and please generate valid XHTML, looking like this:
+
<h3>plugin name</h3>
+<p>your stuff</p>
+ This way, multiple plugins can add options here while things keep a good structure. Also try to use prefixes for your fieldnames, in order to avoid nameclashes (e.g. plug_tb_url)
+
+
+
blog
+
reference to a BLOG object
+
variables
+
+ (read-only) An associative array containing all sorts of information on the item that's being edited: 'itemid', 'draft', 'closed', 'title', 'body', 'more', 'author', 'authorid', 'timestamp', 'karmapos', 'karmaneg', 'catid'
+
+
itemid
+
shortcut to the item ID
+
+
+
+
BlogSettingsFormExtras
+
(v2.0) On the blog settings page. You can add your own forms here.
+
+ Don't add too much data, and please generate valid XHTML, looking like this:
+
+ This way, multiple plugins can add options here while things keep a good structure. Also try to use prefixes for your fieldnames, in order to avoid nameclashes (e.g. plug_tb_url)
+
+
+
+
blog
+
reference to a BLOG object
+
+
+
+
PreDeleteItem
+
(v2.0) Immediately before an item gets deleted in the database
+
+
itemid
+
id of the item that will be deleted
+
+
+
+
PostDeleteItem
+
(v2.0) Immediately after an item has been deleted in the database
+
+
itemid
+
id of the deleted item
+
+
+
+
PreDeleteCategory
+
(v2.0) Immediately before a category gets deleted from the database
+
+
catid
+
category ID
+
+
+
+
PostDeleteCategory
+
(v2.0) Immediately after a category has been deleted from the database
+
+
catid
+
category ID
+
+
+
+
PreDeleteBlog
+
(v2.0) Immediately before a blog gets deleted from the database
+
+
blogid
+
ID of the blog that will be deleted
+
+
+
+
PostDeleteBlog
+
(v2.0) Immediately after a blog has been deleted from the database
+
+
blogid
+
ID of the blog that was deleted from the database
+
+
+
+
PreDeleteMember
+
(v2.0) Immediately before a member gets deleted from the database
+
+
member
+
reference to the MEMBER object associated with the member that needs to be deleted
+
+
+
+
PostDeleteMember
+
(v2.0) Immediately after a member has been deleted from the database
+
+
member
+
reference to the MEMBER object associated with the member that has been deleted
+
+
+
+
PreDeleteTeamMember
+
(v2.0) Immediately before a member gets deleted from a weblog team
+
+
member
+
reference to the MEMBER object
+
blogid
+
ID of the blog
+
+
+
+
PostDeleteTeamMember
+
(v2.0) Immediately after a member has been deleted from a weblog team
+
+
member
+
reference to the MEMBER object
+
blogid
+
ID of the blog
+
+
+
+
PreDeleteComment
+
(v2.0) Immediately before a comment gets deleted from the database
+
+
commentid
+
ID of the comment that will be deleted
+
+
+
+
PostDeleteComment
+
(v2.0) Immediately after a comment has been deleted from the database
+
+
commentid
+
ID of the deleted comment
+
+
+
+
ActionLogCleared
+
(v2.0) After the action log has been cleared
+
None
+
+
+
PreDeleteTemplate
+
(v2.0) Immediately before a template gets deleted from the database
+
+
templateid
+
ID of the template that will be deleted
+
+
+
+
PostDeleteTemplate
+
(v2.0) Immediately after a template has been deleted from the database
+
+
templateid
+
ID of the deleted template
+
+
+
+
PreDeleteSkin
+
(v2.0) Immediately before a skin gets deleted from the database
+
+
skinid
+
ID of the skin that will be deleted
+
+
+
+
PostDeleteSkin
+
(v2.0) Immediately after a skin has been deleted from the database
+
+
skinid
+
ID of the deleted skin
+
+
+
+
PreDeletePlugin
+
(v2.0) Immediately before a plugin gets deleted from the database
+
+
plugid
+
ID of the plugin that will be deleted
+
+
+
+
PostDeletePlugin
+
(v2.0) Immediately after a plugin has been deleted from the database
+
+
plugid
+
ID of the deleted plugin
+
+
+
+
PreDeleteBan
+
(v2.0) Immediately before an IP ban gets deleted from the database
+
+
blogid
+
ID of the blog for which the ban will be deleted
+
iprange
+
banned IP range
+
+
+
+
PostDeleteBan
+
(v2.0) Immediately after an IP ban has been deleted from the database
+
+
blogid
+
ID of the blog for which the ban has been deleted
+
iprange
+
banned IP range
+
+
+
+
PreAddCategory
+
(v2.0) Immediately before a new category is created in the database
+
+
blog
+
reference to BLOG object
+
name
+
name of new category
+
description
+
description of new category
+
+
+
+
PostAddCategory
+
(v2.0) Immediately after a new category has been created in the database
+
+
blog
+
reference to BLOG object
+
name
+
name of new category
+
description
+
description of new category
+
catid
+
New category ID
+
+
+
+
PreAddBlog
+
(v2.0) Immediately before a new blog is created
+
+
name
+
name of new blog
+
shortname
+
shortname of new blog
+
timeoffset
+
time offset of new blog
+
description
+
description of new blog
+
defaultskin
+
ID of default skin for new blog
+
+
+
+
PostAddBlog
+
(v2.0) Immediately after a new blog has been created
+
+
blog
+
new BLOG object
+
+
+
+
PreAddPlugin
+
(v2.0) Immediately before a plugin is added
+
+
file
+
filename of the new plugin
+
+
+
+
PostAddPlugin
+
(v2.0) Immediately after a plugin has been added
+
+
plugin
+
An object of the newly added plugin
+
+
+
+
PreAddTeamMember
+
(v2.0) Immediately before a member gets added to a blog team
+
+
blog
+
BLOG object
+
member
+
MEMBER object
+
admin
+
boolean indicating if the newly added member will have blog admin rights or not
+
+
+
+
PostAddTeamMember
+
(v2.0) Immediately after a member has been added to a blog team
+
+
blog
+
BLOG object
+
member
+
MEMBER object
+
admin
+
boolean indicating if the newly added member has admin rights or not
+
+
+
+
PreAddTemplate
+
(v2.0) Immediately before a new template is created (note: this one also gets called when a template is cloned))
+
+
name
+
name of the new template
+
description
+
description of the new template
+
+
+
+
PostAddTemplate
+
(v2.0) Immediately after a new template has been created
+
+
name
+
name of the new template
+
description
+
description of the new template
+
templateid
+
ID of the new template
+
+
+
+
PreAddSkin
+
(v2.0) Immediately before a new skin is created (note: this one also gets called when a skin is cloned))
+
+
name
+
name of the new skin
+
description
+
description of the new skin
+
type
+
content type of the skin
+
includeMode
+
includeMode of the new skin
+
includePrefix
+
includePrefix of the new skin
+
+
+
+
PostAddSkin
+
(v2.0) Immediately after a new skin has been created
+
+
name
+
name of the new skin
+
description
+
description of the new skin
+
type
+
content type of the skin
+
includeMode
+
includeMode of the new skin
+
includePrefix
+
includePrefix of the new skin
+
skinid
+
ID of the new skin
+
+
+
+
PreAddBan
+
(v2.0) Immediately before a new ban is added to a weblog
+
+
blogid
+
ID of the blog
+
iprange
+
IP range to be banned
+
reason
+
textual message describing the reason for the ban
+
+
+
+
PostAddBan
+
(v2.0) Immediately after a new ban has been added
+
+
blogid
+
ID of the blog
+
iprange
+
IP range to be banned
+
reason
+
textual message describing the reason for the ban
+
+
+
+
+
PreMoveItem
+
(v2.0) Immediately before an item is moved to another blog/category
+
+
itemid
+
ID of the item
+
destblogid
+
ID of the destination blog
+
destcatid
+
ID of the destination category
+
+
+
+
PostMoveItem
+
(v2.0) Immediately after an item has been moved to another blog/category
+
+
itemid
+
ID of the item
+
destblogid
+
ID of the new blog
+
destcatid
+
ID of the new category
+
+
+
+
PreMoveCategory
+
(v2.0) Immediately before a catgeory is moved to another blog
+
+
catid
+
ID of the catgeory
+
sourceblog
+
source BLOG object
+
destblog
+
destination BLOG object
+
+
+
+
PostMoveCategory
+
(v2.0) Immediately after a catgeory has been moved to another blog
+
+
catid
+
ID of the catgeory
+
sourceblog
+
source BLOG object
+
destblog
+
destination BLOG object
+
+
+
+
MemberSettingsFormExtras
+
(v2.0) On the member settings page. You can add your own forms here.
+
+ Don't add too much data, and please generate valid XHTML, looking like this:
+
+ This way, multiple plugins can add options here while things keep a good structure. Also try to use prefixes for your fieldnames, in order to avoid nameclashes (e.g. plug_tb_url)
+
+
+
+
member
+
reference to a MEMBER object
+
+
+
+
GeneralSettingsFormExtras
+
(v2.0) On the general settings page. You can add your own forms here.
+
+ Don't add too much data, and please generate valid XHTML, looking like this:
+
+ This way, multiple plugins can add options here while things keep a good structure. Also try to use prefixes for your fieldnames, in order to avoid nameclashes (e.g. plug_tb_url)
+
+
+
None
+
+
+
AdminPrePageHead
+
(v2.5) On admin area pages, immediately before the page head is printed. This event could be used to add extra script/css includes in the head section
+
+
extrahead
+
Extra information to be included in the head section of the HTML page. Append your extras here.
+
action
+
Currently executed action or pagetype
+
+
+
+
AdminPrePageFoot
+
(v2.5) On admin area pages, immediately before the page footer is printed.
+
+
action
+
+
Currently executed action or pagetype
+
+
+
PreSendContentType
+
(v2.5) Immediately before a content type is being set in the HTTP header
+
+
contentType
+
content type (e.g. application/xhtml+xml)
+
charset
+
Character set
+
pageType
+
String indicating which type of page we're displaying: skin (skinparts), media (media library), admin-action (admin area), bookmarklet-action (bookmarklet)
+
+
+
+
QuickMenu
+
(v2.5) At the end of the Admin Area quick menu. This can be used to add extra plugin entries. To add entries, push associative arrays on the options array. An example can be found in the section about creating a plugin admin area.
+
+
options
+
Array
+
+
+
+
BookmarkletExtraHead
+
(v2.5) Somewhere inside the head section of the bookmarklet XHTML code.
+
+
extrahead
+
Information to be included in the head section of the XHTML code. Add your extras here.
+
+
+
+
FormExtra
+
(v3.2) Inside one of the comment, membermail or account activation forms. This event allows plugins to insert extra fields in the form. This event corresponds with the ValidateForm event that is fires when the form is handled.
+
+
type
+
Type of the form from which the event fired.
+
+
activation
+
additemform (note: this is not the add item form from the admin area!)
+
commentform-loggedin
+
commentform-notloggedin
+
membermailform-loggedin
+
membermailform-notloggedin
+
+
+
member
+
When type is activation, this field contains the details of the member that's being activated
+
+
+
+
ValidateForm
+
(v3.2) Called when one of the comment, membermail or account activation forms is being handled. This event allows plugins to perform their own validation on the data, and prevent further handling if something is wrong. When used together with the FormExtra field, it can be used to add extra fields to forms.
+
+
type
+
Type of the form being handled
+
+
membermail
+
comment
+
activation
+
+
+
error
+
When the plugin wants to stop the handling of the form, it needs to fill out a non-empty error string message in this error field. This error message will then be presented to the user.
+
comment
+
On comment-type forms, contains an associative array with the comment data.
+
spamcheck
+
On comment-type forms, the resulting datastructure of the previously called SpamCheck event (associative array)
+
member
+
On activation-type forms, contains information about the member being activated.
+
+
+
+
ParseURL
+
(v3.22) Called before an URL is resolved from the Nucleus Core. This event allows Plugins to interpret URLs.
+
+
type
+
Type of the page, e.g. item, blog, ...
+
info
+
The full URL which should be resolved (the name is derived from the old fashion variable pathinfo).
+
complete
+
Should be set to true if the plugin has resolved the URL and to false if the plugin hasn't resolved the URL.
+
+
+
+
GenerateURL
+
(v3.22) Called before an URL is output on the page. Allows plugins to rewrite the output URLs and offer an own URL logic.
+
+
type
+
Type of the page, e.g. item, blog, ...
+
params
+
Parameters which should be added to the URL.
+
completed
+
Should be set to true if the plugin returns an URL and to false if the plugin don't returns an URL.
+
url
+
The URL itself which should be output from Nucleus.
+
+
+
+
SpamCheck
+
(v3.3) Called when a new comment is added. This event allows anti-spam plugins to mark this comment as spam. A complete descriptions of the SpamCheck event can be found in a seperate document: SpamCheck API 2.0.
+
+
spamcheck
+
The spamcheck datastructure
+
+
+
+
PreMediaUpload
+
(v3.3) Before an uploaded media file is written to the media directory.
+
+
collection
+
The collection where the uploaded file should be saved.
+
uploadfile
+
The temporary name of the uploaded file.
+
filename
+
The filename under which the file should be saved.
+
+
+
+
PostMediaUpload
+
(v3.3) After an uploaded is written to the media directory.
+
+
collection
+
The collection to which the uploaded file has been added.
+
mediadir
+
The media directory to which the uploaded file has been written.
+
filename
+
The filename under which the file has been saved.
+
+
+
+
SendPing
+
(v3.3) Called when a new item is added and the blog is configured to send ping (need NP_Ping installed). This event is used by NP_Ping to ping various weblog listing service (i.e. pingomatic.com)
+
+
blogid
+
ID of the blog
+
+
+
+
JustPosted
+
(v3.3) Called when a future post appears on the blog the first time. The event is trigger after a skin parse is completed
+
+
blogid
+
ID of the blog
+
+
+
+
RegistrationFormExtraFields
+
(v3.40) Called from createaccount.php after basic account fields, but before FormExtra event. This event can be used by plugins to add custom fields to the registration form. Plugins that subscribe to this event should also subscribe to PostRegister event to process the added fields. The parameters should be used to fit custom fields into existing format of registration form. Plugins should output the html code needed for their extra fields. For an example of using this event, see the NP_Profile plugin.
+
+
type
+
String. Type of registration form. Normally, createaccount.php.
+
prelabel
+
HTML code or string that should be inserted before the field label.
+
postlabel
+
HTML code or string that should be inserted after the field label.
+
prefield
+
HTML code or string that should be inserted before the input field.
+
postfield
+
HTML code or string that should be inserted after the input field.
+
+
+
+
TemplateExtraFields
+
(v3.40) Called when templates are edited and updated from the admin area. Allows plugin developers to add fields to existing templates to encourage the use of the core template storage system to provide formatting for their output. It is the responsibility of the plugin authors to use the template fields they add and to provide the variables used in those fields. Plugins should also document their variables and provide for a default, either in the code or through a plugin option. Sample plugin using this event.
+
+
fields
+
Associative Array. Key should be name of the plugin, i.e. NP_TemplateTest, and value should be an associative array with keys designating the template field name, and values designating the label used for the field. Template field names should be lowercase and incorporate the plugin name to avoid duplication of template field names.
+
+
+
+
PreArchiveListItem
+
(v3.40) Called right before the archive list is displayed. Allows plugin developers to add/modify template variables in the Archive List Item field of the template used for displaying archive lists. Plugins should document the variables added.
+
+
listitem
+
Associative Array. The key represents the template variable, i.e. month, and the value of the array element is a string representing the value of the template variable. To add a variable, simply add an element to this array with a key-value pair representing the new variable.
+
+
+
+
PreCategoryListItem
+
(v3.40) Called right before the category list is displayed. Allows plugin developers to add/modify template variables in the Category List Item field of the template used for displaying category lists. Plugins should document the variables added.
+
+
listitem
+
Associative Array. The key represents the template variable, i.e. catname, and the value of the array element is a string representing the value of the template variable. To add a variable, simply add an element to this array with a key-value pair representing the new variable.
+
+
+
+
PreBlogListItem
+
(v3.40) Called right before the blog list is displayed. Allows plugin developers to add/modify template variables in the Blog List Item field of the template used for displaying blog lists. Plugins should document the variables added.
+
+
listitem
+
Associative Array. The key represents the template variable, i.e. blogname, and the value of the array element is a string representing the value of the template variable. To add a variable, simply add an element to this array with a key-value pair representing the new variable.
+
+
+
+
PreTemplateRead
+
(v3.40) Called right before a template is read and its parts returned. Allows plugin developers to change the name of the template being used. NP_MultiLanguage makes use of this event.
+
+
name
+
String containing the name of the template being called.
+
+
+
+
CustomLogin
+
(v3.40) Called right before local (Nucleus) login. Allows plugin developers to customize the login process. This simplifies external authentication and permits using something beside the displayname, i.e. email address, to be used for the login name.
+
+
login
+
String containing the name entered by user in login field. If this is other than the Nucleus mname (display name), it should be mapped by the plugin, after a successful authentication, to a valid mname corresponding to the authenticated member. Otherwise the authentication will last only one page and no cookies will be set.
+
password
+
String containing the password entered by user in password field.
+
success
+
Integer indicating whether the login is successful. 1 means success, 0 means unsuccessful. 0 is the default. The plugin should set this.
+
allowlocal
+
Integer indicating whether local authentication should be tried after an unsuccessful authentication by your plugin. 1 means yes, 0 means no. 1 is the default.
+
+
+
+
+
PrePasswordSet
+
(v3.50) Called when user tries to set password in admin area or during activation. Allows for plugins to enforce password complexity rules.
+
+
password
+
String containing the user-entered password.
+
errormessage
+
String containing the error message the user should see upon failure. Should be left blank if no validation error occurs.
+
valid
+
Boolean indicating whether the proposed password is valid. Default is true. Plugin code should check this value to verify it is not already false before processing a password
+
+
+
+
+
PostParseURL
+
(v3.60) Triggers right after the url is fully parsed (by ParseURL in globalfunctions). Useful to tweak global variables before selector() runs or to set something based on path-related globals.
+
+
type
+
Type of the page, e.g. item, blog, ...
+
info
+
The full URL which should be resolved (the name is derived from the old fashion variable pathinfo).
+
+
+
+
+
MediaUploadFormExtras
+
(v3.60) Add fields to File Upload page of Nucleus Media Manager. All output should be valid XHTML 1.0. You must also subscribe to the PreMediaUpload event and get values from your added fields using requestVar().
+
No Data is passed.
+
+
+
PreUpdateSkinPart
+
(v4.00) Triggers right before a skin part is updated.
+
+
skinid
+
The id of the skin whose part is being updated
+
type
+
The type of skin part being updated, e.g. index, item, member, error, archive, archivelist, etc... For special skin parts, the type is the name of the special skin part.
+
content
+
The new contents of the skin part that is being updated.
+
+
+
+
PreAddSkinPart
+
(v4.00) Triggers right before a new skin part is added.
+
+
skinid
+
The id of the skin whose part is being added
+
type
+
The type of skin part being added, e.g. index, item, member, error, archive, archivelist, etc... For special skin parts, the type is the name of the special skin part.
+
content
+
The contents of the skin part that is being added.
+
+
+
+
PreDeleteSkinPart
+
(v4.00) Triggers right before a skin part is deleted.
+
+
skinid
+
The id of the skin whose part is being deleted
+
type
+
The type of skin part being deleted, e.g. index, item, member, error, archive, archivelist, etc... For special skin parts, the type is the name of the special skin part.
+
+
+
+
PostUpdateSkinPart
+
(v4.00) Triggers right after a skin part is updated in the database.
+
+
skinid
+
The id of the skin whose part was updated
+
type
+
The type of skin part that was updated, e.g. index, item, member, error, archive, archivelist, etc... For special skin parts, the type is the name of the special skin part.
+
content
+
The new contents of the skin part that was updated.
+
+
+
+
PreAddSkinPart
+
(v4.00) Triggers right after a new skin part was added to the database.
+
+
skinid
+
The id of the skin whose part was added
+
type
+
The type of skin part that was added, e.g. index, item, member, error, archive, archivelist, etc... For special skin parts, the type is the name of the special skin part.
+
content
+
The contents of the skin part that was added.
+
+
+
+
PreDeleteSkinPart
+
(v4.00) Triggers right after a skin part was deleted from the database.
+
+
skinid
+
The id of the skin whose part was deleted
+
type
+
The type of skin part that was deleted, e.g. index, item, member, error, archive, archivelist, etc... For special skin parts, the type is the name of the special skin part.
+
+
+
+
+
+
+
+
Saving options
+
+
A series of methods are offered to make it easy for plugins to set and retrieve options. These options can be directly edited from inside the Nucleus admin area, taking the need away for the plugin to provide an admin area of its own, and avoiding that options need to be set inside the PHP file itself.
+
+
Options are available in different contexts:
+
+
+
Global options: Editable on the admin area from the plugins section.
+
Blog options: Editable from the blogsettings pages.
+
Category options: Editable from the blogsettings pages (on the 'edit category' page).
+
Member options: Editable on the 'edit member' pages
+
Item options: Editable on the 'add item' or 'edit item' pages
+
+
+
Option types
+
+
Several types of options are provided
+
+
+
text
+
Simple text
+
yesno
+
Either the value 'yes' or the value 'no' (on edit, shown as radio button)
+
password
+
Text field (starred on edit)
+
textarea (v2.2)
+
Text field with multiple rows and columns
+
select (v2.2)
+
Drop down menu. Needs extra info in the following form: Option 1|value1|Option 2|value2|Option 3|value3
+
+
+
+
Option meta
+
+
As of Nucleus v3.2, some option types can be limited to only accept certain values using option-metadata. This metadata is stored in the $typeExtras-field, and is a semicolon-seperated list of values. Note: In a select-option, the select list must be the first value in $typeExtras.
+
+
+
key
+
explanation
+
+
datatype
+
Using 'datatype' you can give some extra hints to Nucleus about the datatype you want to use. Currently only 'numerical' is available. 'numerical' will cause Nucleus to only accept numerical values for this option (using both client-side and server-side check) (available for optiontypes: 'select' and 'text')
+
+
access
+
If set to 'readonly', the option will not be editable (available for optiontypes: 'text' and 'textarea')
+ If set to 'hidden', the option will be completely hidden for the end-user (available for optiontypes: 'text')
+
+
+
some examples:
+
// following code creates a text-option that only accepts numerical values
+$this->createBlogOption('FooBar', 'foobar', 'text', '0', 'datatype=numerical');
+// following code creates a select-option that only accepts numerical values
+$this->createItemOption('FooBar', 'foobar', 'select', '0', '0|0|1|1|2|2;datatype=numerical');
+// following code creates a textarea-option that is readonly
+$this->createOption('FooBar', 'foobar', 'textarea', 'This textarea is readonly', 'access=readonly');
+
+
+
Restrictions
+
+
+
The name of an option can contain a maximum of 20 characters
+
The description of an option can contain a maximum of 255 characters
+
The value for an option has no limit (Prior to v2.5 the limit was 128 characters)
+
The characters '=', '|' and ';' can not be used inside a select list (for a select-option), or in option-metadata
Returns the top of the values for a given option. The result is an array where every element is an array with a value ('value') for each memberid ('id') (parameters: see getBlogOptionTop)
Returns the top of the values for a given option. The result is an array where every element is an array with a value ('value') for each categoryid ('id') (parameters: see getBlogOptionTop)
Returns the top of the values for a given option. The result is an array where every element is an array with a value ('value') for each itemid ('id') (parameters: see getBlogOptionTop)
+
+
+Note: You can't call these functions from inside constructors of plugin classes. If you want to execute them when the plugin is loaded, place them in the init() method instead.
+
+
+
Database tables
+
+
Access to Nucleus tables
+
+
Up to v2.0, accessing the nucleus tables was just a matter of performing an SQL query on one of the nucleus_ tables. Since it is possible to use a custom table name in Nucleus versions >2.0, some precautions are needed in plugin development:
+
+
As of v3.5, Nucleus is moving toward support for database handlers different from MySQL, such as PDO. Though, this support is beta in version 3.5, plugin developers need to start making their plugins compatible with the new sql_* api used to implement the generic database calls.
+Essentially, you need onnly replace any mysql_* functions with sql_*, e.g. mysql_fetch_assoc($result) becomes sql_fetch_assoc($result).
+you must do this for every interaction with the database. Be sure to indicate that you support the SqlApi feature as indicated below, and that you set the minNucleusVersion to 350, like this: function getMinNucleusVersion( return '350';)
+
+
+
Instead of using a fixed tablename like nucleus_item, use the global function sql_table('item') to generate the prefixed tablename
+
Make sure your plugin returns 1 (true) when supportsFeature('SqlTablePrefix') is called on it. If it doesn't, you won't be able to load the plugin on Nucleus versions > 2.0 when a custom prefix has been set (as a precaution)
+
v3.5+. Make sure your plugin returns 1 (true) when supportsFeature('SqlApi') is called on it. If it doesn't, you won't be able to load the plugin on Nucleus versions > 3.5 when a user is using a non-mysql database backend (as a precaution)
+
+
+
Note that the sql_table global function in not available in Nucleus versions up to v2.0. If you use this method and want your plugin to work on Nucleus versions <= 2.0, add the following snippet of code on top of your plugin class:
+
+
<?php
+
+// plugin needs to work on Nucleus versions &=2.0 as well
+if (!function_exists('sql_table'))
+{
+ function sql_table($name) {
+ return 'nucleus_' . $name;
+ }
+}
+
+class NP_HelloWorld extends NucleusPlugin {
+...
+}
+
+?>
+
+
Your own tables
+
+
If your plugin needs database tables of it's own, you should create them in the install method and remove them in the unInstall method.
+
+
Some pointers
+
+
Consider using a table name like nucleus_plug_plugname to avoid conflicts with other plugins. Generate them through sql_table('plug_plugname') to make it work with custom prefixes
+
You don't need to make a database connection yourself. You can execute queries using the Nucleus function sql_query() which is a wrapper for the PHP command mysql_query()
+
If you do make a database connection yourself, make sure to restore the connection with the Nucleus database afterwards. You can do this by calling sql_connect() at the end of your function. It might also be good to do this from the constructor, to avoid reconnecting constantly. You could then save your link identifier in $this->db and pass that along with every query.
+
Also redefine the getTableList() method to make sure your table gets backed up when using the backup function.
+
It's a good idea to make the removal of your database tables optional. This will allow your users to temporarily remove your plugin without losing the data. For instance, you may need to make changes to options or database tables requiring that the install() method be run to execute code neccessary to modify existing tables or options. This will require that your users uninstall the old version and then install the new version and losing their data in the process. To make the deletion of your tables optional, you can add an option like this in install():
+
$this->createOption('del_uninstall', 'Delete NP_MyPlugin data tables on uninstall?', 'yesno','no');
+ and this snippet in uninstall():
+
if ($this->getOption('del_uninstall') == 'yes') {
+ foreach ($this->getTableList() as $table) {
+ sql_query("DROP TABLE $table");
+ }
+}
+
+
+
+
+
Plugin Admin Area
+
+
As of Nucleus v2.5, plugins can create admin area pages that integrate with the Nucleus admin area. These pages can be accessed either from the plugin admin page, or the quickmenu on the left.
+
+
Basics
+
+
To provide an admin area, you'll need to take these steps:
+
+
+
Create a subdirectory of the plugins directory, and name it pluginname if your plugin is NP_PluginName. Note that the name should be lowercase!
+
+ In that directory, create a file called index.php, which looks like this:
+
<?php
+
+ // if your 'plugin' directory is not in the default location,
+ // edit this variable to point to your site directory
+ // (where config.php is)
+ $strRel = '../../../';
+
+ include($strRel . 'config.php');
+ if (!$member->isLoggedIn())
+ doError('You\'re not logged in.');
+
+ include($DIR_LIBS . 'PLUGINADMIN.php');
+
+ // create the admin area page
+ $oPluginAdmin = new PluginAdmin('PluginName');
+ $oPluginAdmin->start();
+
+ echo '<h2>Plugin Name</h2>';
+
+ echo '<p>Page contents here<p>';
+
+ $oPluginAdmin->end();
+
+?>
+
+
+ Subscribe to the QuickMenu event and add this code in your plugin:
+
Optional. Make the QuickMenu entry optional, and restrict who sees it. The following assumes that an option, of type yesno and called quickmenu, exists in install(). It also will restrict viewing of the QuickMenu entry to super-admins and to blog-admins.
+
function event_QuickMenu(&$data) {
+ // only show when option enabled
+ if ($this->getOption('quickmenu') != 'yes') return;
+ global $member;
+ if (!$member->isAdmin() && !count($member->getAdminBlogs())) return;
+ array_push($data['options'],
+ array('title' => 'PluginName',
+ 'url' => $this->getAdminURL(),
+ 'tooltip' => 'Administer NP_PluginName'));
+}
+
+
+
+
Considerations
+
+
+
Don't just add an entry to the quick menu because it is possible. Imagine having 100 plugins installed, which all add an entry in the menu. This would result in a real mess. So, even if you add an entry in the menu, please consider adding an option (global or member-level) to enable/disable the quick menu entry.
+
The $strRel variable in the index.php needs to be adapted manually if the plugins directory is not located in nucleus/plugins/
+
Make sure your admin area outputs valid XHTML. If not, the page will be broken in Gecko-based (Mozilla etc) browsers.
+
+
+
The PluginAdmin class
+
+
The purpose of the PluginAdmin is to help you. Once created, you can use $oPluginAdmin->plugin to access the instance of your plugin.
+
+
Plugin HelpPage
+
+
As of Nucleus v3.2 plugins can provide a helppage with an overview of the plugins' functionality, the available skinvars and templatevars, where to get more info,...
+
+
The helppage will be accessible from the plugin overview in the admin area.
+
+
Basics
+
To provide a helppage, you'll need take these steps:
+
+
Create a subdirectory of the plugins directory, and name it pluginname if your plugin is NP_PluginName. Note that the name should be lowercase! This is actually the same directory as for the admin area.
+
In that directory, create a file called help.html. In this file you can document your plugin. This is a good template to start from:
+
<h3>Plugin overview</h3>
+
+<p>The only purpose of this plugin is to show how the plugin helppages work</p>
+
+<h3>Installation</h3>
+
+<p>If you can read this you correctly installed the plugin :-)</p>
+
+<h3>SkinVars</h3>
+
+<p>Because this plugin is only a testcase it doesn't has any skinvars/templatevars but suppose it would have:
+
+<ul><li><b><%HelpPageTestCase1%></b>: does something</li>
+<li><b><%HelpPageTestCase1(foobar)%></b>: does something else</li></ul></p>
+
+<h3>Support and Bug reports</h3>
+
+<p>For additional support and/or bug reports please use this forum thread:
+<a href="http://forum.nucleuscms.org/viewtopic.php?t=<TOPIC_ID_GOES_HERE>">
+http://forum.nucleuscms.org/viewtopic.php?t=<TOPIC_ID_GOES_HERE></a></p>
+
+<h3>Version History</h3>
+
+<ul><li>Version 0.1: initial testcaseversion</li>
+<li>Version 0.0: pre-initial version ;-)</li></ul>
+
+
Return a value larger than 0 for supportsFeature('HelpPage'):
+
Starting from 3.2, a new plugin interface is added to allow one to declare any dependency on other plugin(s). This is useful for any
+plugin that requires another plugin to function. It is particularly useful for a plugin to detect broken dependencies that prevent if from functioning properly.
+
+
How to write a plugin that utilizes this function
+
+
Let's start from a real world example:
+
+
NP_PageLinkList depends on NP_BlogWithOffset to function, so we want to make sure a user cannot install NP_PageLinkList whithout first installing
+NP_BlogWithOffset. With this API, Nucleus offers a way for a plugin to detect any missing dependency before it is installed.
+
+
In this case, we want to code into NP_PageLinkList to mark that it requires NP_BlogWithOffset. When the plugin is installed, the core calls a
+function in the plugin called getPluginDep(). This function returns a list of plugin it requires, and the core will check against all installed plugins and
+refuse to install the plugin if a dependency is missing.
+
+
All we have to do is add this function to NP_PageLinkList:
+
+
function getPluginDep() {
+ return array('NP_BlogWithOffset');
+}
+
+
The plugin dependency check also prevent a plugin from being uninstalled if other plugins have a dependancy on it.
+
+
Internationalizing Your Plugin
+
+
Internationalization of a plugin allows your plugin to be easily used by people all over the world, people who do not
+speak the same language as you do. It requires a little additional work for you, but makes translating the output of your plugin
+as easy as translating a few phrases in a text file. Below is a description of the standard method suggested for use by Nucleus plugins.
+Thanks to Andy Matsubara for the instructions.
+
+
+
Develop your plugin
+
+At first, it is easier to develop it in your language. Use of language files is recommended after the plugin becomes stable.
+
Create plugin directory
+
+If your plugin name is NP_AbcDef, the plugin directory name is abcdef (always lower case).
+
Create language files
+
+Create the language files in the directory of your plugin. The name of the language file must be the same as that of the Nucleus language file name. For example, english.php is for English and default use. japanese-utf8.php for Japanese(UTF-Cool,japanese-euc.php for Japanese(EUC-JP).
+
Define strings
+
+Define strings like below in the language file:
+
+
<?php
+define('_ABCDEF_MESSAGENAME', 'actual strings in the language');
+ . . .
+?>
+
+You have to define them for all static strings in your plugin. As defined name is used globally in the environment, it is recommended to have a prefix derived from the plugin name(in this case _ABCDEF).
+
Replace static strings
+
+Replace static strings in your plugin with the defined names so they will change according to the language file.
+
Create init method
+
+Make the init method in the plugin like below
+
+
function init() {
+ // include language file for this plugin
+ $language = preg_replace( '#[\\|/]#', '', getLanguageName());
+ if (file_exists($this->getDirectory().$language.'.php'))
+ include_once($this->getDirectory().$language.'.php');
+ else
+ include_once($this->getDirectory().'english.php');
+ }
+
+This logic is same as Nucleus language file setting.
+
Add language files
+
+As English is the default language, it is recommended to have at least the English version.
+
+
+
+
+
Formatting your SkinVar output
+
+
Some great plugin ideas never receive general use simply because the output generated by the doSkinVar() method is not flexible enough to meet the needs of
+different skins or URL schemes. Nucleus provides some tools to help you generalize your output in ways that allow each user to fit it to his or her needs.
+
+
To create links to Nucleus pages, such as blogs, categories, items, member details, action.php, admin area, or the plugin admin page, use the built in Nucleus functions
+and global variables described below:
+
+
+
Functions and variables useful in creating links to Nucleus pages
+
+
Name
What
Parameters
Description
+
+
+
$CONF['AdminURL']
+
Global variable
+
None
+
Full URL to the Nucleus Admin Area
+
+
+
$CONF['PluginURL']
+
Global variable
+
None
+
Full URL to the Nucleus plugins directory. Use it to link to a plugin's admin page, like this $CONF['PluginURL'].'pluginname/'
+
+
+
$CONF['ActionURL']
+
Global variable
+
None
+
Full URL to the Nucleus action.php file
+
+
+
$CONF['MediaURL']
+
Global variable
+
None
+
Full URL to the Nucleus media folder
+
+
+
$CONF['SkinsURL']
+
Global variable
+
None
+
Full URL to the Nucleus skins folder
+
+
+
$CONF['IndexURL']
+
Global variable
+
None
+
Full URL to the main Nucleus directory.
+
+
+
$DIR_NUCLEUS
+
Global variable
+
None
+
Full system path to the Nucleus Admin folder
+
+
+
$DIR_SKINS
+
Global variable
+
None
+
Full system path to the Nucleus skins folder
+
+
+
$DIR_MEDIA
+
Global variable
+
None
+
Full system path to the Nucleus media folder
+
+
+
$DIR_PLUGINS
+
Global variable
+
None
+
Full system path to the Nucleus plugins folder
+
+
+
$DIR_LANG
+
Global variable
+
None
+
Full system path to the Nucleus language folder
+
+
+
$DIR_LIBS
+
Global variable
+
None
+
Full system path to the Nucleus libs folder
+
+
+
getAdminURL()
+
method, PLUGIN class
+
None
+
Returns the URL of where the admin area of the plugin is located (if there is no such admin area, this information is invalid)
+
+
+
getDirectory()
+
method, PLUGIN class
+
None
+
Returns the full system path where the extra files for the plugin are stored (if there are no such files, this information makes no sense). The result is something like ".../nucleus/plugins/plugname/"
+
+
+
createItemLink($itemid, $extra = '')
+
Global function
+
$itemid Integer. ID of item being linked.
+ $extra Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+
+
Returns the full URL, in scheme chosen by user, of item indicated by $itemid
+
+
+
createMemberLink($memberid, $extra = '')
+
Global function
+
$memberid Integer. ID of member being linked.
+ $extra Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+
+
Returns the full URL, in scheme chosen by user, of member page indicated by $memberid
+
+
+
createCategoryLink($catid, $extra = '')
+
Global function
+
$catid Integer. ID of category being linked.
+ $extra Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+
+
Returns the full URL, in scheme chosen by user, of category index page indicated by $catid
+
+
+
createArchiveListLink($blogid = '', $extra = '')
+
Global function
+
$blogid Integer. ID of blog whose archivelist is being linked.
+ $extra Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+
+
Returns the full URL, in scheme chosen by user, of archivelist page indicated by $blogid
+
+
+
createArchiveLink($blogid, $archive, $extra = '')
+
Global function
+
$blogid Integer. ID of blog whose archive is being linked.
+ $archive String. Valid archive parameter for date (year-month) being linked.
+ $extra Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+
+
Returns the full URL, in scheme chosen by user, of archive page indicated by $blogid and $archive
+
+
+
createBlogidLink($blogid, $extra = '')
+
Global function
+
$blogid Integer. ID of blog being linked.
+ $extra Associative Array. Containing key-value pairs corresponding to additional parameters-values that should appear in the link.
+
+
Returns the full URL, in scheme chosen by user, of main index page indicated by $blogid
+
+
+
+
Using a template to format your output is always a good idea. You may want to output an unordered list, but another user may want the same data
+separated by a simple character, or other unique format. Nucleus provides two ways to create and store the template data. In both
+examples below, we will be creating a template with 2 variables, <%foo%> and <%bar%>.
+
+
+
Using Plugin Options. This method may be the simplest and will work on all versions 3.2 and higher. It's
+ big disadvantage is that plugin options are deleted during an uninstall, so your users may lose customizations during an upgrade of
+ your plugin. Simply create an option in the install() method like the following:
+
$this->createOption('my_template',
+ 'Template used to format output of plugin.',
+ 'textarea',
+ '<li><%foo%> loves <%bar%></li>');
+ Then in the doSkinVar() method, determine the values of foo and bar and fill the template like this:
+
Using Nucleus Core Template System. This method will only work with versions 3.4 and higher. It has the advantage of
+ being using the database-stored template system and can be exported like other template fields. For a full sample plugin using this method,
+ see this thread from the support forum. A summary is given here.
+ First, create the option in install() as in method 1, but now we will use it as a default.
+
$this->createOption('my_template',
+ 'Template used to format output of plugin.',
+ 'textarea',
+ '<li><%foo%> loves <%bar%></li>');
+ Then, subscribe to the TemplateExtraFields event like this:
+
function getEventList() { return array('TemplateExtraFields'); }
+ Then, create a event_TemplateExtraFields method in your plugin, like this:
+
function event_TemplateExtraFields(&$data) {
+ /* Add an element in the $data['fields'] array using your plugin name as the key
+ and an associative array containing the field name and field label*/
+ /* note that your field names should be lowercase and include the name
+ of your template as shown below. This will ensure that all template field names are unique. */
+ $data['fields']['NP_TemplateTest'] = array(
+ 'templatetest_body'=>'TemplateTest Body'
+ );
+}
+ Then, in the doSkinVar() method, you need to retrieve the template and fill it. Note the skinvar now needs to take
+ the template name as a parameter.
+
+ Here, the user needs to go to the template he wants to use and enter the formatting he desires into the TemplateTest Body field.
+ For our purposes, we are using the default/index template. He may enter something like this:
+
<li><%foo%> loves <%bar%>!!!</li>
+ And using a SkinVar like <%TemplateTest(default/index)%> will output this:
+
Formatting Items Using Regular Template. This applies only to versions 3.40 and higher and for
+ plugins which output items. It has the advantage of using the existing Item fields in the core template system,
+ just like the <%blog%> SkinVar does. This requires the use of a method in the BLOG class called
+ readLogFromList() and requires that you input an array of itemids and a template name. If you need to
+ add variables to the template, you can do so using the doTemplateVar() method. Here is an example of
+ a doSkinVar() method that uses this technique. It takes 4 itemids as parameters, then outputs those four
+ items using the default/index template
+
This document uses some visual styles to indicate the type of columns. An overview is listed below:
+
+
+
primary
+
Primary keys
+
+
foreign
+
Foreign keys (click to go to the references value in other columns). Please note that MySQL does not enforce foreign key restrictions.
+
+
toremove
+
Tables/columns that will probably be removed in upcoming Nucleus version, in favor of plugins that provide the same functionality.
+
+
fulltext
+
There is a fulltext index on the column (used for searches).
+
+
+
+
+
Table nucleus_blog
+
+
+
Column Name
+
Type
+
Default
+
Description
+
+
+
bnumber
+
int(11)
+
+
Blog ID
+
+
+
bname
+
varchar(60)
+
''
+
Blog Name
+
+
+
bshortname
+
varchar(15)
+
''
+
Short Blog Name (as used in skinvars <%blog%> etc.)
+
+
+
bdesc
+
varchar(200)
+
NULL
+
Blog Description
+
+
+
bcomments
+
tinyint(2)
+
'1'
+
Enable comments (1=true, 0=false)
+
+
+
bmaxcomments
+
int(11)
+
'0'
+
Maximum amount of comments to show on index skintypes (inline comments). The default value (0) means that there is no limit. If you don't use inline comments, you shouldn't edit this.
+
+
+
btimeoffset
+
decimal(3,1)
+
'0.0'
+
Time offset to use. The items will be stored in the database using the correct time (server time+offset).
+
+
+
bnotify
+
varchar(128)
+
NULL
+
Notify e-mail address. On certain events (see bnotifytype for the exact definition of these events), a notification e-mail is sent out to this e-mail address.
+
+
+
burl
+
varchar(100)
+
NULL
+
Blog URL
+
+
+
bupdate
+
varchar(60)
+
NULL
+
Update file that needs to be altered each time a new item is posted to the weblog. Its an absolute path of a file on the server.
Default category. This category will be selected by default when no other category is selected.
+
+
+
bnotifytype
+
int(11)
+
'15'
+
+ Which events to send notification e-mails on (see bnotify for the specification of the e-mail address). It's a combination of three values (multiply the values to get the notify type):
+
+
3: New comment
+
5: New karma vote
+
7: New item
+
+ Default = New comments & New karma votes (3*5=15)
+
+
+
+
ballowpast
+
tinyint(2)
+
'0'
+
Allow backdating of items and editing the timestamp of an item (1=true/0=false)
+
+
+
bincludesearch
+
tinyint(2)
+
'0'
+
Always include in search queries, even if the query is on another blog (1=true/0=false)
+
+
+
breqemail
+
tinyint(2)
+
'0'
+
Require non-members to supply an email address when adding comments (1=true/0=false)
+
+
+
bfuturepost
+
tinyint(2)
+
'0'
+
Whether blog has future posts awaiting publishing (1=true/0=false)
E-mail address. This should always be a valid address.
+
+
+
murl
+
varchar(100)
+
NULL
+
URL of members site
+
+
+
mnotes
+
varchar(100)
+
NULL
+
Extra notes (members can fill these out themselves)
+
+
+
madmin
+
tinyint(2)
+
'0'
+
Is super-admin? (1=true/0=false; super-admins have all rights; there must be at least one super-admin in the system)
+
+
+
mcanlogin
+
tinyint(2)
+
'1'
+
Can logon to admin area? (1=true/0=false)
+
+
+
mcookiekey
+
varchar(40)
+
NULL
+
A copy of the key that is stored in the users cookie. This key is used to log on. When a member logs on, a random cookiekey is generated. One copy goes into the database, another one goes into a cookie on the users computer. (together with the username).
+
+
+
deflang
+
varchar(20)
+
''
+
Language file to use for this member. When empty, uses the default site language.
+
+
+
+
+
+
+
Table nucleus_team
+
+
For each team member of a blog, there is a row in this table.
Is blog admin? (0=false/1=true; each blog must have at least one admin)
+
+
+
+
+
Table nucleus_plugin
+
+
+
Column Name
+
Type
+
Default
+
Description
+
+
pid
+
int(11)
+
+
Plugin ID
+
+
+
pfile
+
varchar(40)
+
''
+
Filename (e.g. NP_CommentControl) of plugin. This must be a file in the plugins directory (.php extension).
+
+
+
porder
+
int(11)
+
'0'
+
Order in which the plugins are called, and in which they are displayed on the plugins page. A lower order number places the plugin earlier in the list.
+
+
+
+
Table nucleus_plugin_event
+
+
A cache that remembers which plugins are registered to which events. Thsi information is stored to avoid having to load all plugins on each requests just to find out which events they want to have. More info on plugins events
other template fields as added by plugins using TemplateExtraFields event
+
+
+
+
+
tcontent
+
text
+
+
Contents of templatepart
+
+
+
+
+
Table nucleus_template_desc
+
+
+
Column Name
+
Type
+
Default
+
Description
+
+
tdnumber
+
int(11)
+
+
Template ID
+
+
+
tdname
+
varchar(64)
+
''
+
Name of template
+
+
+
tddesc
+
varchar(200)
+
NULL
+
Template description
+
+
+
+
Table nucleus_actionlog
+
+
[[general purpose description]]
+
+
+
Column Name
+
Type
+
+
Description
+
+
timestamp
+
datetime
+
'0000-00-00 00:00:00'
+
Time of action
+
+
+
message
+
varchar(255)
+
''
+
Action message
+
+
+
+
+
+
Table nucleus_config
+
+
Nucleus stores some global options in the nucleus_config table. They can be accessed at any time using $CONF['OptionName'] (the values are read on each request and stored in a global array named $CONF)
+
+
+
Column Name
+
Type
+
Default
+
Description
+
+
name
+
varchar(20)
+
''
+
Option name
+
+
+
value
+
varchar(128)
+
NULL
+
Option value
+
+
+
+
Available Options
+
+
An overview of available options is given below:
+
+
Options for yes/no options are represented using 1/0 (1=yes/true, 0=no/false)
Allow members to edit their login name and password?
+
+
AllowUpload
+
1
+
Allow file uploads?
+
+
DisableJsTools
+
2
+
+ Style of the javascript toolbar:
+
+
0: full featured (IE)
+
1: toolbar disabled
+
2: simpler (Gecko)
+
+
+
+
CookiePath
+
/
+
Path to set cookie on
+
+
CookiePrefix
+
+
String to prefix cookie names with. This is useful when multiple Nucleus installs are on the same domain, as it prevents login sessions to interfere with each other.
+
+
CookieDomain
+
+
Domain to set cookie on
+
+
CookieSecure
+
0
+
Secure cookie (https)
+
+
MediaPrefix
+
1
+
If true, the uploaded files get the current date in their filename.
+
+
MaxUploadSize
+
1048576
+
Max. size of uploaded files (in bytes)
+
+
NonmemberMail
+
0
+
Allow non-members to send e-mail messages to site members?
+
+
PluginURL
+
+
URL of plugin folder. Should end with a slash.
+
+
ProtectMemNames
+
1
+
When this option is enabled, non-logged in members cannot add comments using the same name as registered members. The reason to do this would be to avoid guest impersonating members.
The option tells Nucleus which skin to fall back to when no such decision can be automatically made. This happens when skin parts are empty, when no blog or skin is implicitly/explicitly selected.
+
+
SkinsURL
+
+
URL of skins folder. Should end with a slash.
+
+
ActionURL
+
+
URL of action.php script.
+
+
URLMode
+
normal
+
either normal or pathinfo
+
+
DatabaseVersion
+
250
+
Last Nucleus version for which the database structure has been updated (introduced in Nucleus v2.5)
+
+
DebugVars
+
0
+
Whether unresolved variables should be displayed in skins (introduced in Nucleus v3.4)
+
+
DefaultListSize
+
10
+
Set the size of lists in the admin area (introduced in Nucleus v3.4)
+
+
Table nucleus_tickets
+
+
Nucleus uses the nucleus_tickets to prevent against certain security issues. In particular: each action on the admin area that affects the settings or database contents, requires a ticket. These tickets are generated when requesting an admin area page and passed along with the form. Tickets are destroyed one hour after their creation.
+
+
+
Column Name
+
Type
+
Default
+
Description
+
+
ticket
+
varchar(40)
+
+
Unique ticket, valid for one particular member. A typical ticket looks like this: 65303a785423b4d53c7b3e6579766f26
Time of ticket creation. A ticket is valid no longer than one hour.
+
+
+
+
+
Table nucleus_activation
+
+
When a new member registers, Nucleus doesn't allow that member to log in before his account is activated. This activation is done by sending out an activation link to the members email address. The nucleus_activation table keeps track of the activations that are in progress.
+
+
+
Column Name
+
Type
+
Default
+
Description
+
+
vkey
+
varchar(40)
+
+
Activation key. This key needs to be passed to the member activation code. A typical key looks like this: 41cf637d4fbeeff954b4ca70b8bde9dd
Time at which activation key was generated. Each activation key is valid no longer than 2 days.
+
+
vtype
+
varchar(15)
+
+
Type of activation.
+
+
forgot: member forgot his password.
+
register: new member registration.
+
addresschange: member changed his e-mail address.
+
+
+
+
vextra
+
varchar(128)
+
+
Extra information. For an addresschange type of activation, this contains oldemailaddress/x with x either 0 or 1 and refering to the previous value of the mcanlogin field in the member table. (untill fully re-activated, a user cannot login)
+
+
+
+
+
Table nucleus_karma
+
+
This table will most likely be removed in future Nucleus version, in favor of plugins with the same functionality.
+
+
This table keeps track of IP addresses that have already voted for an item. This way, each IP address can cast only one vote.
+This document contains information on the XML-RPC interface that Nucleus provides, and the error messages it spits out. Please note that the specification of this interface might still undergo changes in the future.
+
+
+
+The URL for the Nucleus XML-RPC interface is:
+
+http://www.yourserver.com/yourpath/nucleus/xmlrpc/server.php
+
+
+
+
The Blogger API (XML-RPC)
+
+
+Nucleus implements the Blogger API. This allows for tools and services that can communicate with Blogger, to be able to also communicate with Nucleus. Because the way Nucleus works, some interpretations of parameters are slightly different, see the notes below for more info. The structure of method calls and responses are, of course, exactly the same as the methods at Blogger.
+
+
+
+Here's the list of available methods. Click them to get more information (links go to either the Blogger API or the Blogger API Mailinglist).
+
+Since Nucleus is structured somewhat differently inside, there are some differences in the way parameters are handled. An overview:
+
+
+
+
Appkeys are ignored.
+
Next to the body of a post, a Nucleus-item also has a title and a category. Blogger only has the body (known as 'contents'). To be able to use the extra parts, you can use <title> and <category> in the contents you send to Nucleus. These tags are only added in the getRecentPosts call
+
What is known under Blogger as 'templates', is known under Nucleus as 'skins'. There can be more than one skin on the system, and each skin can be used by different blogs. The blogger.setTemplate and blogger.getTemplate methods will affect the default skin for the chosen blog, as selected in the Nucleus blog settings. The 'main' and 'archiveIndex' template types refer to the nucleus skinparts 'index' and 'archivelist'
+
The publish parameter is used to determine wether a new post is to be added as a draft or not. When using blogger.editPost, the publish parameter is ignored unless it turns a draft into a published item
+
When using the getUserInfo call, the 'lastname' in the result will be empty and 'firstname' will contain the full name. This is because Nucleus does not make a difference between first name and last name
+
The getRecentPostst-method returns authorName and title as extra parameters. Blogger has been returning these also (although undocumented)
+
+
+
+
metaWeblog API
+
+
+Since v1.1, Nucleus also supports the metaWeblog API, which is an extention to the Blogger API.
+
+
+
In Nucleus v2.5, support was added for the newMediaObject and getRecentPosts methods as well (they weren't in the original metaWeblog specification)
+
+
+A list of available methods is listed below (see the specification for more info):
+
+
+
+
metaWeblog.newPost
+
metaWeblog.editPost
+
metaWeblog.getPost
+
metaWeblog.getCategories
+
metaWeblog.newMediaObject (v2.5)
+
metaWeblog.getRecentPosts (v2.5)
+
+
+
As of Nucleus v3.22 we also support the mt_text_more and mt_allow_comments extensions to the metaWeblog API. This means that if you use an application that also supports these extensions, such as Ecto, you can also edit the extended body and determine whether or not you want to allow comments for an item.
+
+
+
Movable Type API
+
+
Since v2.5, Nucleus supports the methods from the Movable Type API.
+
+
The list of available methods is listed below:
+
+
+
mt.supportedMethods
+
mt.supportedTextFilters
+
mt.publishPost
+
mt.getCategoryList
+
mt.getPostCategories
+
mt.setPostCategories
+
mt.getRecentPostTitles
+
mt.getTrackbackPings
+
+
+
Some notes:
+
+
+
Nucleus only supports one category for each item. This means that all categories except the 'primary' category for an item will be ignored.
+
Trackback is not implemented in the Nucleus core (it's avalailable as a plugin instead). Because of this, mt.getTrackbackPings will return an empty array by default.
+
Nucleus doesn't have text filters, so mt.getSupportedTextFilters returns an empty array.
+
+
+
Error Codes
+
+
+Below is an overview of the types of errors you can get back from the methods:
+
+
+
+
+
Error Code
+
Error Message
+
+
+
801
+
Login Error (probably bad username/password combination)
+
+
+
802
+
No Such Blog
+
+
+
803
+
Not a Team Member
+
+
+
804
+
Cannot add Empty Items
+
+
+
805
+
Amount parameter must be in range 1..20 (getRecentItems)
+
+
+
806
+
No Such Item
+
+
+
807
+
Not Allowed to Alter Item
+
+
+
808
+
Invalid media type
+
+
+
809
+
File is too large (max. upload filesize)
+
+
+
810
+
Other error on newMediaObject (message will contain more info about what happened)
+
+
+
other codes < 100
+
Errors encountered by the Useful Inc. XML-RPC implementation
+
+
+
other codes > 100
+
Errors encountered by the XML parser
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nucleus/documentation/help.html b/nucleus/documentation/help.html
new file mode 100644
index 0000000..5c18c0a
--- /dev/null
+++ b/nucleus/documentation/help.html
@@ -0,0 +1,4570 @@
+
+
+
+
+
+ Nucleus Admin Help
+
+
+
+
+
+
Nucleus Popup Help
+
Please hold on while the page is being downloaded (about 100KB).
+
+
+
+
+
+
+
Add Later/Earlier
+
Add Later
+
The 'Add Later' option on add-item forms allows you to mark an item to become visible only at the exact time you've specified. Before that time has come, the item will not be viewable anywhere in the public part of your site.
+
This date must be in the future, unless the 'Allow posting to the past' option is enabled for the blog to which you want to add the item.
+
Allow posting to the past
+
When enabled, you'll be allowed to specify the date on which an item should be added, and to edit the timestamp of already existing items.
+
+
+
+
Change post date/time
+
+The 'Update Timestamp' option allows you to change the posting date and/or time of an item. If you changed the content of an item, this is a way bring the story back to the top of your front page.
+
But, the unique id connected to the item will not change, so your visitors can still find out that the item was originally posted later than items with a lower id.
+
+
+
+
+
Autosave
+
The Autosave function saves an item as a draft after 10 minutes editing. It should avoid that unsaved changes get lost. It is usefull for users that work for a long time on an item and often forget to save their work.
+
If you want to invoke Autosave before the 10 minutes are past, you can press the 'Auto save now' button at the end of the form.
+
The Autosave function can be enabled and disabled in the member options.
+
+
+
+
+
Drafts
+
+Draft items are not yet viewable in the public blog. They might come in handy when you are working on a story, and something comes in between. Your draft items will be listed on the main page, so you can continue your work when you have the time to do so.
+
When editing drafts, choose the 'Add now' radiobutton and hit the 'Edit item' button to make them visible.
+
+
+
+
+
Extended part
+
+Items have an optional extended part that you can use for continued stories. e.g. when a story is too long to put on the main page of your blog, you can write an introduction in the body part and the rest in the extended part. When viewing your main blog page, you will then see 'read more' links (as defined by the templates).
+
+
+If you want to write an introduction only for some of your items, you could use the smartbody template variable to make a selection out of the body text and the extended text.
+
+
+
+
+
Short Blog Name
+
+The short blog name is used mainly in the admin area to indicate which items are associated with which blog.
+
+
+It can also be used in alternative index files, to make a second weblog available:
+
+The default skin selected in the blog settings is the skin that should be used when the blog is displayed, and there is no other skin selected (through arguments in the URL)
+
+
+
+
+
+
Notify Address
+
+This option contains one or multiple e-mail addresses to which notification e-mails should be sent when new comments are added. Leave empty if you don't want notification. The given e-mail addresses must, of course, be valid.
+
+
+If you're using multiple addresses, you should use a semicolon (;) as a separator.
+
+
+Note: As the maximum length of the settings fields is 128 characters, there's only a limited amount of e-mail addresses you can list.
+
+
+Note: When you set up your own e-mail address as notification address, you won't get notified of the items/comments that you wrote yourself. Assuming that you know what you wrote, that shouldn't be a problem.
+
+
+
+
+
Max Amount of Comments
+
+This is the maximum number of comments that will be shown on the main page. This is NOT a restriction on the total number of comments that can be made. On the detail pages, all comments will be shown, even if there are more than the maximum amount chosen.
+
+
Note:
+Inside templates, this variable can be overridden by an optional parameter of the comments templatevar.
+
+
+
+
+
Time Offset
+
+If the time on your server is not equal to the time where you live, you might want to add an offset to the server time in order to get the correct time. Use negative values to subtract (negation sign). The current server time is listed as a reference.
+
+
Example
+
If your local time is 20:35 and the server time is listed as 14:35, you'll need to set the time offset equal to 6 in order to get your blog time to 20:35
+
+
Note: Fractional offsets can be used as well, for people living in half time zones. e.g. an offset of 1.5 equals an offset of 1 hour and 30 minutes.
+
+
+
+
Update File
+
+Nucleus can edit a file for you whenever a new item is added to the blog. The contents of that file will be a timestamp of the last change. The use of such a file could be useful for services which check a file on your server once in a while to see if there were updates, and generate 'updated weblogs' from that. Pointing them to your main blog could cause false update warnings to be sent out when visitors add comments or when you change something to the skins or templates.
+
+
+When you don't need an update file, just leave the field empty.
+
+
+Please note that the location of the update file is relative to the admin-area, so you might want to use an absolute path (something like /path/to/your/website/update.txt). Also make sure the update file already exists and is writable (chmod it to 666 if you want to be sure).
+
+
+
+
+
Blog Admin
+
+Blog administrators have the following extra rights:
+
+
+
+
They can manage the team
+
They can edit blog settings
+
They can edit/delete all items by all authors (from the blog of which they are admin)
+
They can delete the blog
+
+
+
+A blog can have multiple admins, but there must be at least one admin at all times.
+
+
+
+
+
+
Administrator Privileges
+
+
+A so called super-admin has full access to all functions and all weblogs, even if she is not on the blog team.
+
+
+
+On top of that: a super-admin has the right to create new weblogs, to change general settings, to change templates, to change skins and to manage the members (creation/ manipulation/ deletion of members).
+
+
+
+Usually, there will be only one super-admin, the site administrator.
+
+
+
+
+
+
Can Login?
+
+As a superadmin, you can disallow individual members to login to the admin area.
+
+
+
+
+
Default Blog
+
+This is the blog that will be used when no other blog has been specified in the request.
+
+
+
+
+
Base Skin
+
+
The option tells Nucleus which skin to fall back to when no such decision can be automatically made. This happens when skin parts are empty, when no blog or skin is implicitly/explicitly selected.
+
Most users don't need to worry about this setting.
+
+
+
+
Cookies
+
+
Cookie Lifetime
+
+When a member logs in, a cookie is stored in his browser, so she doesn't need to log in again when she comes back the next day. The lifetime of this cookie decided when it will become invalid:
+
+
Session cookies get deleted when you exit the browser
+
Cookies with a lifetime of one month will stay on the computer until you don't use/visit the site for a month. Using this option, you'll never have to login again (unless you've logged out yourself, or logged in from another computer)
+
+
+
Cookie Path & Cookie Domain
+
+These settings are advanced settings. Normally, you shouldn't change them at all. In that case, cookie path is a simple slash ('/') and cookie domain is empty.
+
+
+
Secure Cookies
+
+Normally, this should be set to 'no'. You should only set it to 'yes' when you have a HTTPS url and want cookies only to be sent over such a https connection.
+
+
+
'Last Visit' Cookie
+
+You can setup Nucleus to store a cookie in which the time of the visitors last visit is stored. This can be used to put indications next to new items
+
+
+
+
+
+
+
Language
+
+You can choose a language to be used when nucleus creates content for you. The content generated by Nucleus includes the admin-area, the error messages, forms in skins, ...
+
+
+
+There are two places where a language can be chosen: the global site settings include a language option.
+Next to that, logged in members can override this setting if they want to.
+
+
+
+When both of these settings are invalid, 'english' is used as the default language.
+
+
+
Note: Extra language files can be downloaded from the Nucleus Website. (opens a new window)
+
+
+
+
+
Account Creation
+
+You can either allow or disallow your visitors to create their own 'member' account. They won't be allowed to add items to a blog (unless the admin adds them to a team), but they can login to the administration area and change their settings, and even delete or modify the comments they made.
+
+For the privacy of your members, you can hide all e-mail addresses and allow members to send an e-mail message to each other through the script. The message that will be sent out will however contain the e-mail addresses of both users, so they can then do continued communication through regular e-mail. This service can be disabled.
+
+
+
Non-members
+
+By default, non members cannot use the message service (because there's no way to check the validity of the e-mail address they enter). You can relax this restriction by allowing non-members to use the message service too. When submitting a message, they will be asked to enter their e-mail address, which will show up in the From: headers of the e-mail you receive.
+
+
+
+
+
+
Disable Site
+
+It's possible to disable your entire Nucleus site. You might want to do this when you are doing some configuration, or when something went horribly wrong :-)
+
+
+The URL that needs to be configured is an URL to which the visitor will be redirected.
+
+
+Exceptions: the admin-area is still available, and super-admins can still see the entire site. (don't forget to re-enable your site afterwards ;-))
+
+
+
+
+
+
URL Mode
+
Using this option, you can switch between URL styles:
+
+
Normal: URLs looking like http://host/index.php?itemid=1234
+
Fancy: URLs looking like http://host/item/1234
+
+
Note: In order to get the 'Fancy URL' mode working, some extra actions are required. They're described in the Tips & Suggestions (opens in new window)
+
+
+
+
+
Default List Size
+
(3.40) Using this option, you can set the default size of lists in the Admin Area. Value should be an integer. 10 is a good default for most users.
+
+
+
+
Debug Vars
+
(3.40) Using this option, you can set whether unresolved Vars (SkinVars, TemplateVars, ItemVars) are shown on the blog. Default is No.
+
+
+
+
Templates: Items
+
+When items are shown, the following setup is repeated for each item:
+
+
+
+item header
+item body
+item footer
+
+
+
These three blocks all refer to a template-part, which define what the result looks like.
+This is the template that will be used to format the morelink templatevar that is available in the item templates. Available variables are the same as in the item templates.
+
+
+When there's no extended part of the item, the <%morelink%> templatevar will have no effect.
+
+
+
Example
+
<a href="<%itemlink%>">[Read More!]</a>
+
+
+
+
+
+
Templates: Archive Lists
+
+
The archive lists are formatted as listed below:
+
+
archivelist header
+ archivelist listitem (repeated for each archive)
+archivelist footer
+
+
+Available variables: (in the header and footer, only blogid is allowed)
+
+
+
+
Name
+
Description
+
+
blogid
+
ID of the weblog
+
+
archivelink
+
link to the archive, which you can embed in a <a href=".."> tag.
+
+
month
+
Number of the month (2 digits: 01-12)
+
+
year
+
Year (4 digits)
+
+
day
+
Day of month (2 digits; only when in day mode)
+
+
+
A more flexible way to add the date of the archive to the listitem, is to use strftime variables. If you find this too complicated, use the following:
+
+
<a href="<%archivelink%>">%B, %Y</a><br />
+
+
+
To change the language to your local settings, change the locale.
+This is actually not a template-part, it's a setting. Setting it allows the date and time preferences when to be localized. Names of months and days will be in the desired language, etc.
+
+
+
+The possible values depend according to which machine Nucleus is running on. Some possible values are
+
+These are used to format dates and times into the <%date%> and <%time%> vars (see template vars). The formatting is done according to the locale
+
+
+
+More info on the available vars. If want to get started quickly, use "%x" to format the date and "%X" to format the time.
+
+
+
+
+
+
Template: Date headers/footers
+
+
+The date header and date footer can contain date and time vars. More info on the available vars. If you want to get started quickly, use "%x" to format the date. The language which is used to format the date, is determined by the locale-setting in the template.
+
+
+In the date header, the template variable <%%daylink%%> is allowed to insert a link to the archive for that day. Note the double '%'! It's necessary to avoid %d to be expanded as the current day of the month. Also, if you just want to add a '%' character somewhere, you should also put it twice ('%%') or it will be gone on your website.
+
+
+
+Sample for date header:
+
+
+
+<div class="day">
+<h1>%d %B</h1>
+
+
+
+Sample for date footer:
+
+
+
+</div>
+
+
+
And another example for the date head using daylink
+The highlighting is used when performing searches. This is actually used in a regular expression, so you might want to escape some characters by putting a backslash before them. The place where the highlighted word will come, is indicated by "\0".
+
+
+
Example
+
+
<span style='background-color:yellow'>\0</span>
+
+
+
+
+
Templates: nothing found
+
+
+Shown when a search has been performed and no results were found.
+
+
+
Available variables:
+
+
+
Name
+
Description
+
+
blogid
+
ID of the weblog
+
+
query
+
the query that was used in the search
+
+
+
Example
+
+
No search results found for <b><%query%></b>
+
+
+
+
+
Templates: Comment body
+
+This is the part of the template used to display a single comment. In this template-part, comments-related templatevars are available.
+
+
Example
+
<h2>Comment by <%userlink%>:</h2>
+
+<p><%body%></p>
+
+<div class="metadata">
+ (from <%host%> on <%date%> at <%time%>)
+</div>
+These templates are used to format links to popup image windows and media objects (non-pictures). The available variables for each of the templates are described below
+
+
+
Popup Link Code
+
+
+
Name
+
Description
+
+
popuplink
+
an <a href... link ready to use
+
+
rawpopuplink
+
only the url inside href="..."
+
+
popupcode
+
javascript code to open window
+
+
text
+
the alternate text (link text)
+
+
width
+
image width
+
+
height
+
image width
+
+
popuptext
+
(=same as text)
+
+
link
+
direct link to the image (URL)
+
+
media
+
a non-popup A-tag to the image, ready to use.
+
+
+
+
Inline Image Code
+
+
+
Name
+
Description
+
+
image
+
an IMG-tag, ready to use
+
+
link
+
direct link to the image (URL)
+
+
text
+
the alternate text (link text)
+
+
width
+
image width
+
+
height
+
image width
+
+
media
+
an A-tag to the image, ready to use.
+
+
+
Media Object Link Code
+
+
+
Name
+
Description
+
+
media
+
an A-tag, ready to use
+
+
link
+
direct link to the file (URL)
+
+
text
+
the alternate text (link text)
+
+
+
+
+
+
Templates: Member Extra
+
+This is a template you can use to add an extra indication that a comment-author is a member. It ends up in the <%authtext%> variable for use in the comment body
+
+This is the format of the link that will be added at the end of <%short%>, which is a variable for use in the comment body
+
+
+
Inside this template-part, some comments-related variables are available (except for the <%short%> variable).
+
+
Example:
+
+
+ <a href="<%itemlink%>">[more]</a>
+
+
+
+
+
+
Templates: commentword
+
+Most likely, you'll rather want to write "1 comment" than "1 comment(s)". The "One comment" and "Many comments" template parts can be used for this purpose. They will be used to fill the <%commentword%> variable that you can use elsewhere.
+
+
+
+If there is only 1 comment, <%commentword%> will be equal to the contents of the "one comment" part. If there are many comments (more than one), <%commentword%> will be equal to the contents of the "two (or more) comments" part.
+
+
+
+Typical values are "comment" and "comments". No special variables can be used here.
+
+This skinpart is used to show special, non-blog, content on your site. It can be used to show static content, or to wrap other
+dynamic applications, like forms, inside the skin of your blog. It is accessed by the name of the special skin part, in this way
+(assuming the special skin part is named fred):
+
+<html>
+ <head>
+ <title>My Weblog</title>
+ </head>
+ <body>
+
+ <h1>About My Site</h1>
+ <p>This page was published in order
+ to provide a platform to publicize the plight
+ of the peeping-polly parrot whose present
+ prognosis is perturbingly pessimistic.</p>
+
+ </body>
+</html>
+
+
+
+ This will show the text of the body as indicated above. Also, many SkinVars work on special pages, so you can make
+ the page look just like the other pages and use SkinVars to show an index of the whole site, or a list of members, etc...
+
+
+
+
+
+
+
+
Shortnames & Display Names
+
+Weblogs, templates and skin should all have a short name next to the full name or description.
+
+
+
+A short name consists of only the characters a-z and 0-9, and cannot contain spaces
+
+
+
+Display names are used for members. They can contain a-z, A-Z, 0-9 and spaces, but the spaces cannot be placed at the beginning or end of the name.
+
+
+
+
+
+
+
+
+
+
Template: 'New' indication
+
+When the 'last visit' cookie option is activated, the contents of the 'Indication of new item'-template is copied into the <%new%> variable for items that have been added since the last visit. The <%new%> variable can e.g. be used in the item body-template.
+
+
+
+When the 'last visit' cookie is disabled, or the item is not 'new', this template part will not be used.
+
+
+
+
+
+
Time variables overview
+
+
The following conversion specifiers are recognized in the format string (taken from the PHP documentation for the strftime function). More info in the Open Group Specification
+
+
+
%a - abbreviated weekday name according to the current locale
+
%A - full weekday name according to the current locale
+
%b - abbreviated month name according to the current locale
+
%B - full month name according to the current locale
+
%c - preferred date and time representation for the current locale
+
%d - day of the month as a decimal number (range 00 to 31)
+
%H - hour as a decimal number using a 24-hour clock (range 00 to 23)
+
%I - hour as a decimal number using a 12-hour clock (range 01 to 12)
+
%j - day of the year as a decimal number (range 001 to 366)
+
%m - month as a decimal number (range 1 to 12)
+
%M - minute as a decimal number
+
%p - either `am' or `pm' according to the given time value, or the corresponding strings for the current locale
+
%S - second as a decimal number
+
%U - week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week
+
%W - week number of the current year as a decimal number, starting with the first Monday as the first day of the first week
+
%w - day of the week as a decimal, Sunday being 0
+
%x - preferred date representation for the current locale without the time
+
%X - preferred time representation for the current locale without the date
+
%y - year as a decimal number without a century (range 00 to 99)
+
%Y - year as a decimal number including the century
+
%Z - time zone or name or abbreviation
+
%% - a literal `%' character
+
+
+
+
+
+
Ping weblog listing services
+
+When updating your weblog, you can choose to send an update notification (ping) to various weblog listing services. They provides a list of recently updated weblogs to everyone who requests it. Lots of websites are using this data, so you might receive some extra hits when enabling the ping.
+
+
Note: For this feature to work correctly, you need to fill out both the weblog URL and the weblog name in the blogsettings.
+
+
+
+
+
+
+
Always include in search
+
+
When the 'include in search' option is selected, the weblog will always be included in searches, even if the search is done on another weblog.
+
+
As an example, suppose you have two blogs called 'lifelog' and 'linkdump', with the 'include in search' enabled for 'linkdump'. Now, a search query on 'lifelog' will also search through 'linkdump', while a search query on 'linkdump' will only search entries in 'linkdump'
+
+
+
+
+
+
+
Convert Linebreaks
+
+By default, Nucleus converts linebreaks in your items to <br /> tags, so a linebreak will also show up in your (X)HTML output
+
+
+Advanced users, or users striving for the semantic web (br tags don't add any information, they're just used for markup), might find this feature annoying, and turn this feature off.
+
+
+
+
+
+
Media
+
+Nucleus allows you to upload media files (images, video, sound, ...) to your website
+
+
+Some settings are needed to do this:
+
+
+
Media dir: location on the server where the media files will be saved (local filesystem)
+
Media URL: location of the media files
+
Allow upload: It's possible to disable file upload
+
Allowed filetypes for upload: a bunch of extensions uploaded files can have (seperated by commas, case insensitive)
+
Max. upload file size: Puts a limit on the size of uploaded files
+
Prefix Media Files: When this option is turned on, uploaded file will be prefixed with the current date. Uploading a file named 'bunny.jpg' on April 8, 2003 will then result in a file named 20030408-bunny.jpg. The reason why you might want to do this, is when you're uploading tons of files, and don't want problems with duplicate names.
+
+
+
+Each member has his own private collection of media files. Next to that, subdirectories that are under the media dir are seen as global collections (shared between members).
+
+
+
Uploading is only possible when a member is on the team of at least one of the blogs, to prevent abuse.
+
+
+
+
+
Protect Member Names
+
When this option is enabled, non-logged in members cannot add comments using the same name as registered members. The reason to do this would be to avoid guest impersonating members.
+
+
+
+
+
Plugin URL
+
This setting is the base URL for plugin admin areas. Usually it will look like the following
+
http://hostname.com/nucleus/plugins/
+
+
+
+
Skins URL
+
This setting is the base URL for the Nucleus skins directory. Usually it will look like the following
+
http://hostname.com/skins/
+
+
+
+
Action URL
+
This setting is the absolute URL of the action.php script that comes with Nucleus. Usually it will look like the following
+
http://hostname.com/actions.php
+
+
+
+
+
+
Adding items
+
When adding items to a weblog, there are four kinds of template variables that you can use in the body text, title or extended part:
Usually, these tags are inserted by the 'insert media' button in the JavaScript toolbar
+
+
+
+
+
+
+
+
+
+
Skinvar: referer
+
Inserts the refering URL (can be empty)
+
Arguments
+
None
+
Skintypes
+
all
+
Examples
+
+<a href="<%referer%>">back</a>
+
+
+
+
+
+
+
Skinvar: itemid
+
Inserts the ID of the currently selected item
+
Arguments
+
None
+
Skintypes
+
item
+
Examples
+
+<%itemid%>
+
+
+
+
+
+
+
+
Skinvar: itemlink
+
+
Adds a permanent link for the item.
+
+
Arguments
+
+
+ Optional
+
+
linktext: when present, a full <a href... tag will be outputted, rather than a raw link
+
+
+
Skintypes
+
+
item
+
+
Examples
+
+
+<%itemlink%>
+
+
+
+
+
+
Skinvar: itemtitle
+
Inserts the title of the item, with HTML-stripped off and entities encoded
+
Arguments
+
None
+
Skintypes
+
item
+
Examples
+
+<%itemtitle%>
+
+
+
+
+
+
+
Skinvar: archivedate
+
Inserts a formatted date for an archive date. Using no parameters, this will either insert '15 august 2002' or 'august 2002' if the archive is for august 2002
+Archive for <%archivedate%>
+Archive for <%archivedate(dutch)%>
+Archive for <%archivedate(en,%B %Y)%>
+
+
+
+
+
+
+
+
Skinvar: blog
+
+
+Inserts the most recently added items of the currently active blog (usually the default one) into the skin.
+
+
+
Arguments
+
+ Required:
+
+
template: name of the template to use
+
+ Optional:
+
+
amount: the amount of items to show (default = 10). Can also contain an offset telling Nucleus to start only from the given item. e.g. 10(5) shows 10 items starting from item 5
+Shows a list of all blogs that are defined in your Nucles CMS.
+
+
+
Arguments
+
+ Required:
+
+
template: name of the template to use
+
+ Optional:
+
+
bnametype: whether the Blog Name (name) or the Short Blog Name (shortname) of the Blog is used. Default setting is the Blog name (name).
+
+
+
orderby: (3.40) Attribute of the blog used for determinig the order in which the blogs are listed. Supported values are number, name, shortname, description. Default is number.
+
+
+
direction: (3.40) Direction of the sorting, asc for ascending order, or desc for descending order. Default is asc.
+
+Inserts the most recently added items of a given blog into the skin.
+
+
+
Arguments
+
+ Required:
+
+
blogname: name of the blog to show
+
template: name of the template to use
+
+ Optional:
+
+
amount: the amount of items to show (default = 10). Can also contain an offset telling Nucleus to start only from the given item. e.g. 10(5) shows 10 items starting from item 5
+Shows the searchresult in a give blog for the current query, using the given template
+
+
+
Arguments
+
+ Required:
+
+
blogname: name of the blog to use
+
template: name of the template to use
+
+ Optional:
+
+
maxresults: maximum amount of results to show
+
+
+
+
Skintypes
+
+
+search
+
+
+
Examples
+
+
+<%othersearchresults(myblog,mytemplate)%>
+
+
+
+
+
+
+
+
+
+
+
+
+
Skinvar: query
+
+
+Inserts the current search query.
+
+
+
Arguments
+
+None
+
+
+
Skintypes
+
+
+search
+
+
+
Examples
+
+
+<%query%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Skinvar: version
+
+
Inserts the current Nucleus version.
+
+
Arguments
+
+
+None
+
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%version%>
+
+
+
+
+
+
+
+
Skinvar: charset
+
+
Inserts the character set encoding used by the current language file.
+
+
Arguments
+
+
+None
+
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%charset%>
+
+
+
+
+
+
+
+
+
+
+
Skinvar: previtem
+
+
+Inserts the ID of the previous item in the blog
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+item
+
+
+
Examples
+
+
+<%previtem%>
+
+
+
+
+
+
+
+
+
+
+
+
Skinvar: nextitem
+
+
+Inserts the ID of the next item in the blog
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+item
+
+
+
Examples
+
+
+<%nextitem%>
+
+
+
+
+
+
+
+
Skinvar: nextitemtitle
+
+
+Inserts the title of the next item in the blog
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+item
+
+
+
Examples
+
+
+<%nextitemtitle%>
+
+
+
+
+
+
+
+
Skinvar: previtemtitle
+
+
+Inserts the title of the previous item in the blog
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+item
+
+
+
Examples
+
+
+<%previtemtitle%>
+
+
+
+
+
+
+
+
+
+
Skinvar: prevarchive
+
+
+Inserts the archive attribute that corresponds to the archive of either 1 day or 1 month back. This value can be used inside URLs to select an archive.
+
+
+
+
If the shown archive is for one specific day, the value has the form YYYY-MM-DD
+
If the shown archive is for a full month, the value has the form YYYY-MM
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+archive
+
+
+
Examples
+
+
<a href="index.php?archive=<%prevarchive%>>....
+
+
+
+
+
+
+
+
+
+
+
Skinvar: nextarchive
+
+
+Inserts the archive attribute that corresponds to the archive of either 1 day or 1 month further in time. This value can be used inside URLs to select an archive.
+
+
+
+
If the shown archive is for one specific day, the value has the form YYYY-MM-DD
+
If the shown archive is for a full month, the value has the form YYYY-MM
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+archive
+
+
+
Examples
+
+
<a href="index.php?archive=<%nextarchive%>>....
+
+
+
+
+
+
+
Skinvar: archivetype
+
+
+Either day or month, indicating which type of archive is currently being shown
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+archive
+
+
+
+
+
+
+
+
+
+
+
Skinvar: todaylink
+
+
+Inserts a link to the main page of the weblog. Takes into account the currently selected blog and category.
+
+
+
Arguments
+
+ Optional
+
+
linktext: when present, a full <a href... tag will be outputted, rather than a raw link
+
+
+
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%todaylink%>
+
+
+
+
+
+
+
+
+
+
+
+
+
Skinvar: archivelink
+
+
+Inserts a link to the archive for the currently selected blog and category (or the default blog when no blog selected)
+
+
+
Arguments
+
+
+ Optional
+
+
linktext: when present, a full <a href... tag will be outputted, rather than a raw link
+
+
+
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%archivelink%>
+
+
+
+
+
+
+
+
+
+
+
+
Skinvar: nextlink
+
+
+Inserts a link to the next item (on item pages) or to the next archive (on archive pages)
+
+
+
Arguments
+
+ Optional
+
+
linktext: when present, a full <a href... tag will be outputted, rather than a raw link
+
amount: for search and index skins: the amount of items to go forward/backward
+
recount: for search and index skins: set to yes to force extra query to recount items on page.
+ This is useful for more complex pages where the blog skinvar may be called multiple times because of the use of the offset.
+ Try setting this if nextlink seems to be not advancing the expected number of items.
+Inserts some info about on the currently logged in member. On member detail pages, extra options are available to show the same information for the requested member.
+
+
+
When the visitor is not logged in, the your... parameters will insert nothing
+
+
Arguments
+
+
type: which information to show.
+
Information on the logged in member:
+
+
yourname: nickname of the member (the one used to login)
+
yourrealname: full name of the member
+
yournotes: extra information a member can set for him/herself
+
yoururl: URL of the members website
+
youremail: email address
+
yourid: ID
+
yourprofileurl: URL of the members profile (member details) page
+
+
Information on the requested member (only available on member detail pages):
+
+
name: nickname of the member (the one used to login)
+
realname: full name of the member
+
notes: extra information a member can set for him/herself
+
url: URL of the members website
+
email: email address of the member
+
id: ID
+
+
+
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%if(loggedin)%>
+you are <%member(yourrealname)%>
+<%endif%>
+
+
+
+
+
+
+
+
+
+
+
+
Skinvar: preview
+
+
+Inserts an item-preview into the page, using a given template (to be used in conjunction with additemform)
+
+
+
Arguments
+
+
template: name of the template to be used
+
+
+
Skintypes
+
+
+index
+
+
+
Examples
+
+
+<%preview(mytemplate)%>
+
+
+
+
+
+
+
+
+
Skinvar: adminurl
+
+
Inserts the full URL to the Admin Area
+
+
Arguments
+
None
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<a href="<%adminurl%>">Admin Area</a>
+
+
+
+
+
+
+
+
+
+
Skinvar: additemform
+
+
+Shows an add-item form for the currently selected blog (usually the default one). Mostly used in conjunction with preview
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+index
+
+
+
Examples
+
+
+<%additemform%>
+
+
+
+
+
+
+
+
+
+
+
+
Skin/Templatevar: include
+
+
+Includes a textfile into the output. The contents of the file is not parsed in any way, so you cannot use skin/templatevars or use PHP code (see parsedinclude and phpinclude if you want parsed includes)
+
+
+
Arguments
+
+
filename: the name of the file to be included (either relative to the position of index.php, or absolute). Note that an URL can also be used here.
+Includes a php-file into the output. The contents of the file is parsed by the PHP parser, so be careful. Nucleus skin/templatevars are not parsed! (see parsedinclude and include for other include options).
+
+
+
Arguments
+
+
filename: the name of the file to be included (either relative to the position of index.php, or absolute)
Your file will be included using the standard php include() command. This command will be called from inside a class method, so you'll need to declare which global variables you want to access yourself. Most of the standard variables are automatically declared global by Nucleus itself.
+For others variables, you'll need to add 'global $varname;' explicitly in your code
+
+
+
+
+
+
+
+
+
Skin/Templatevar: parsedinclude
+
+
+Includes a file into the output. The contents of the file is parsed by the Nucleus skin/template parser, so you can use skin/templatevars. (see phpinclude and include for other include options)
+
+
+
Arguments
+
+
filename: the name of the file to be included (either relative to the position of index.php, or absolute)
Adds a loginform, or shows a "You are karma (Log out)" message
+
+
Arguments
+
+ None
+
+
+
Skintypes
+
+
all
+
+
Examples
+
+
<%loginform%>
+
+
+
+
+
+
+
+
+
Skinvar: commentform
+
+
+Adds a commentform to an item page.
+
+
+
Arguments
+
+ Optional:
+
+
destinationurl: sets the URL to where Nucleus needs to redirect after adding the comment (by default, Nucleus redirects to the item detail page for the item)
Used by imported skins to put a link relative to the skins-URL. Use it in conjunction with the IncludePrefixparser property to get the best results
+
+
Arguments
+
+
+
filename: filename of which you want the correct URL
+
+
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%skinfile(mystyle.css)%>
+
+
+
+
+
+
+
+
+
Skin/Templatevar: skinname
+
+
Inserts the name of the skin that's currently being used.
+
+
Arguments
+
+None
+
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%skinname%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Skinvars: if/ifnot/else/elseif/elseifnot/endif
+
+
Inserts a content block only when certain conditions are fullfilled. Can be used in the item and comment fields of templates as of 3.60, as well as in Item bodies (same as item template fields).
+
+
Arguments
+
Only the if, ifnot, elseif, and elseifnot skinvars have options
+
+
+
+
type: type of condition
+
name: name of option (optional)
+
value: value to be checked (optional)
+
+
+
Condition types
+
+
+
category: condition is fullfilled when a category is selected
+
+
category: checks if any category is selected
+
category,catname,CategoryName: checks if the current category is CategoryName
+
category,catid,CategoryId: checks if the current category is CategoryId
+
+
+
blogsetting: checks if the value name blogsetting equals value (the name is the column name from the nucleus_blog sql table)
+
loggedin: condition is fullfilled if visiting member is currently logged in
+
onteam: condition is fullfilled if visiting member is currently logged in & member of the blog team of the current blog (or the blog given in the name parameter)
+
admin: condition is fullfilled if visiting member is currently logged in & member with blog admin rights to the current blog (or the blog given in the name parameter)
+
nextitem: true if there is a more recent item available for the current weblog (item skintype)
+
previtem: true if there is an older item available for the current weblog (item skintype)
+
archivenextexists: true if there is a more recent archive available for the current weblog (archive skintype)
+
archiveprevexists: true if there is an older archive available for the current weblog (archive skintype)
+
skintype: checks if the current skin type is equal to value (index, search, item, archive, archivelist, ...). For special skin parts, the skin type is the name of the special skin part.
+
hasplugin: checks if the a plugin is installed, or if a plugin option has been set to a specific value
+
+
hasplugin,PluginName: checks if plugin is available
+
hasplugin,PluginName,OptionName: checks if a plugin option is not set to 'no'
+
hasplugin,PluginName,OptionName=value: checks if a plugin option is set to a specific value
+
+
+
PluginName: checks if the a plugin is installed, and executes doIf() method of plugin to check condition of name/value pair. This allows plugins to do conditional checks in a skin. See documentation for your plugin to determine what conditionals it can perform and the syntax required for its use.
+
+
PluginName,AttributeName: uses PluginName plugin to check if AttributeName has empty value
+
PluginName,AttributeName,AttributeValue: uses PluginName plugin to check if AttributeName is AttributeValue
+
+
+
itemcategory: checks conditions related to the category of the current item (item and comment template fields only)
+
+
itemcategory: checks if current item has a category (always true)
+
itemcategory,catname,CategoryName: checks if the category of the current item is CategoryName
+
itemcategory,catid,CategoryId: checks if the id of the item's category is CategoryId
+
+
+
itemblogsetting: checks if the value name blogsetting of the current item's blog equals value (the name is the column name from the nucleus_blog sql table) (item and comment template fields only)
+
author: checks conditions related to the author of the current item (item and comment template fields only)
+
+
author: checks if the current visitor is the author of the item
+
author,isadmin: checks if the author of the item is an admin of the blog
+
author,name,AuthorName: checks if the user name of the item's author is AuthorName
+
author,isauthor: checks if the comment author is also the author of the item. (comment template fields only)
+
author,isonteam: checks if the comment author is a member of blog team of current item. (comment template fields only)
+<%if(category,catname,Off Topic)%>
+Welcome to the 'Off Topic' category.
+<%endif%>
+
+
+
+<%ifnot(loggedin)%>
+Access Denied!
+<%elseif(admin)%>
+Welcome O Mighty Admin of this Blog!
+<%elseif(onteam)%>
+Welcome O Worthy Blog Team Member!
+<%else%>
+Welcome O Humble Site Member!
+<%endif%>
+
+
+
Notes
+
+
If you want something to be displayed only if a condition is not fullfilled, you can use a construct like this:
+Inserts the filename of the page currently being displayed (index.php or whatever you changed it to)
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%self%>
+
+
+
+
+
+
+
+
Skinvar: addlink
+
+
+Inserts a URL to the new item bookmarklet form. Only shown for members who have rights on the current blog.
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<dd><a href="<%addlink%>" onclick="<%addpopupcode%>" title="Add an item to your blog">Add an item</a></dd>
+
+
+
+
+
+
+
Skinvar: addpopupcode
+
+
+Inserts javascript code to open a bookmarklet in an popup window. Use with <%addlink%>
+
+
+
Arguments
+
None
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<dd><a href="<%addlink%>" onclick="<%addpopupcode%>" title="Add an item to your blog">Add an item</a></dd>
+
+
+
+
+
+
+
+
Skinvar: sticky
+
+
+Inserts the indicated item into the skin.
+
+
+
Arguments
+
+ Required:
+
+
itemid: id of the item to show
+
template: name of the template to use
+
+
+
+
Skintypes
+
+
+all
+
+
+
Examples
+
+
+<%sticky(11,default/index)%>
+
+
+
+
+
+
+
+
+
Template variables: Overview
+
+
What?
+
+
Template variables largely work in exact the same way as skin variables, with the only difference that they are being used inside templates. The variables are called using <%varname%>, and include some text depending on the variable function. Some variables also have extra optional parameters.
+
+
Available variables
+
+
+These template variables be used in the following template-parts: item header, item body, item footer, date header, date footer, morelink, editlink (The variables image, popup and media can also be used inside weblog items.)
+
Comments-related template-parts (comments header, comments body, comments footer, one comment, two comments, comments read more, no comments, too much comments) have a different set of available variables:
a smart link to either the e-mail or URL for non members, or the member detail page for members. Note: this link already includes the <a href="..."> and </a> tags ! (when no valid URL or e-mail is available, only the name of the member will be shown)
+
+
userlinkraw
+
same as above, but without the <a href.., empty when no valid URL or e-mail available
+
+
useremail
+
the e-mail address of the user, empty if the e-mail address was not provided by the user
+
+
userwebsite
+
the URL of the users website, empty if the URL was not provided by the user
+
+
userwebsitelink
+
a smart link to URL for non members, or the member detail page for members. Note: this link already includes the <a href="..."> and </a> tags ! (when no valid URL, only the name of the member will be shown)
Inserts karma votes data. Karma votes are a method to vote the 'karma' of an item. With a single click, the visitor can vote either positive or negative. The total of all these votes gives an idea of how much an item is liked by the visitors
+
+
Arguments
+
+
+
Optional:
+
+
what: Choose a type of information to be displayed:
+
+
totalscore: the total karma vote score (=amount of positive votes minus the amount of negative votes) (default)
+
pos: total number of positive votes
+
neg: total number of negative votes
+
votes: total number of votes
+
posp: percentage of votes that is positive
+
negp: percentage of votes that is negative
+
+
+
+
+
+
Examples
+
<%karma(posp)%> out of <%karma(votes)%> were positive
+
+
+
+
+
+
+
+
+
Templatevar: templateitemtitle
+
+
On comments-releated templateparts, inserts the title of the associated item.
+Examines the current item and then decides to show either the body text or the expanded text.
+
+
+
When the extended part is empty, the body part is chosen. Otherwise the extended part is shown.
+
+
+
Part
Empty?
+
+
Body
No
No
+
+
Extended
Yes
No
+
+
smartbody=
body part
extended part
+
+
+
Example use
+
+
The body text could be interpreted as your full text, and the extended part could be interpreted as an 'introduction' or 'exerpt', which you want to show on the front page.
+
In the template used on the front page, you would use <%smartbody%> to insert an excerpt (if there is one), or the full text (if no excerpt). In the template for detailed items, <%body%> can then be used instead of the usual <%body%> + <%more%>, since <%body%> will contain the full item anyway.
+
+
+
+
+
+
+
+
+
+
Templatevar: morelink
+
+
+Inserts a link to the detail page for the item, as defined in the template (link to extended entry). This is empty when there is no extended part.
+
+
+
Note that the contents of the 'link to extended entry' templatepart is also parsed and can thus also contain templatevariables.
+Inserts the title of the item, with HTML tags-stripped off, and shortened to 100 characters. When the text needs to be shortened, "..." is added at the end of the text.
+
+
+
+This variable was originally intended for use in the XML-RSS skin that comes with Nucleus, but can also be of use in other situations.
+
+
+
Arguments
+
+
+
Optional:
+
+
Name
+
Contents
+
+
MaxChars
+
Maximum amount of characters to keep (defaults to 100)
+
+
+
+
+
Examples
+
+
+<%syndicate_title%>
+<%syndicate_title(25)%>
+
+
+
+
+
+
+
Templatevar: syndicate_description
+
+
+Inserts the body of the item, with HTML tags-stripped off, and shortened to 250 characters. When the text needs to be shortened, "..." is added at the end of the text.
+
+
+
+This variable was originally intended for use in the XML-RSS skin that comes with Nucleus, but can also be of use in other situations.
+
+
+
Arguments
+
+
+
Optional:
+
+
Name
+
Contents
+
+
MaxChars
+
Maximum amount of characters to keep (defaults to 250)
Inserts an inline image into an item body or template.
+
+
In normal use, the image-templatevar is generated automatically when adding images through the media library. You can call it from within templates too, though. Note that in this last case, the image will come out of the media dir of the current item's author.
+
+
Arguments
+
+
+
Required:
+
+
Name
+
Contents
+
+
filename
+
Name of the image file (file gets)
+
+
width
+
Width of the image (pixels or percentage)
+
+
height
+
Height of the image
+
+
text
+
alt-text for the image
+
+
+
Note: for the image, popup and media tags, the parameters must be separated by the '|' character, not by a comma!
+
+
+
Examples
+
+
+<%image(myphoto.jpg|100|200|this is me)%>
+<%image(myphoto.jpg|50%|50%|this is me, but smaller)%>
+
+
+
+
+
+
+
+
+
Templatevar: popup
+
+
Inserts a popup image into an item body or template.
+
+
In normal use, the popup-templatevar is generated automatically when adding images through the media library. You can call it from within templates too, though. Note that in this last case, the image will come out of the media dir of the current item's author.
+
+
Arguments
+
+
+
Required:
+
+
Name
+
Contents
+
+
filename
+
Name of the image file (file gets)
+
+
width
+
Width of the image (pixels or percentage)
+
+
height
+
Height of the image
+
+
text
+
alt-text for the image
+
+
+
Note: for the image, popup and media tags, the parameters must be separated by the '|' character, not by a comma!
+
+
+
Examples
+
+
+<%popup(myphoto.jpg|100|200|this is me)%>
+<%popup(myphoto.jpg|50%|50%|this is me, but smaller)%>
+
+
+
+
+
+
+
+
+
Templatevar: media
+
+
Inserts a media object into an item body or template.
+
+
In normal use, the media-templatevar is generated automatically when adding images through the media library. You can call it from within templates too, though. Note that in this last case, the object will come out of the media dir of the current item's author.
+
+
Arguments
+
+
+
Required:
+
+
Name
+
Contents
+
+
filename
+
Name of the image file (file gets)
+
+
text
+
descriptive text for the media object
+
+
+
Note: for the image, popup and media tags, the parameters must be separated by the '|' character, not by a comma!
+
+
+
Examples
+
+
<%media(mysong.mp3|listen to my new song)%>
+
+
+
+
+
+
+
Templatevar: edit
+
+
+From within your template, you can add an 'edit item' link by using this template variable. By default, it will link to a popup-bookmarklet-window, but that behaviour can be changed through the editlink template.
+
+
+
Note: only logged in members that are allowed to edit the item will see this link. In other cases, the edit-templatevar does nothing at all.
+To open a popup window for the 'edit link' window, you'll need to add some javascript code to your link. To avoid having to enter this code in the 'edit link'-template, you can insert it using the editpopupcode-templatevar.
+
+Nucleus allows you to install custom plugins, adding extra functionality. Plugins can do different things:
+
+
+
Act as a skin variable
+
Act as a template variable
+
Hook into events generated by Nucleus. The 'move up' and 'move down' links in 'manage plugins' screen can be used to define the order in which plugins will be called when such an event occurs. The first plugin in the list will be called first, the last one will be called last.
+
Act as actors when called through action.php
+
+
+Note that the responsibility for plugins is entirely with the plugin author. He should make sure that everything works fine.
+
+
+
+There are two main repositories where you can find plugins for Nucleus CMS:
+
+Neither or these repositories is entirely complete. You will find some plugins in one, but not in the other, and vice versa.
+Do not be scared off of one or the other on account of language, as there are a few free translation services on the Internet that
+will help you get by.
+
+Another resource that will help you while working with plugins is the search function at the
+support forum. You will even find some
+smaller plugins on the forum that never made it to the wiki.
+
+
+
+
+
+
+
+
+
Parser Properties
+
+
The available parser options are described below.
+
+
+
Parser properties
+
+
Option Name
+
Values
+
+
IncludeMode
+
+
+
normal: normal behaviour; included files are taken relative to the directory/url of the .php file generating the page.
+
skindir: included files are taken relative to the skindir/skinurl
This property is a prefix that get's added in front of each filename you want to include. For example, if the prefix is base/ and you want to include somefile.txt, you'll end up including base/somefile.txt
+
This property is intended to be used in conjunction with the IncludeMode property. This way, a skin imported to skindir/somename/ can set IncludeMode to skindir and IncludePrefix to somename/
The IncludePrefix and IncludeMode properties can be set globally for a skin in the general settings of a skin. Also note that from the moment a property is set, it applies to all parsed data, thus also for templates.
Remove the file vars4.0.6.php from the core which was used to support PHP versions lower than 4.1.0 (kg)
+
ADD: class i18n to support other languages (sakamocchi)
+
ADD: a new class Link with a collection of all functions which create links (kg).
+
ADD: on overview page, list drafts from other authors for blogs for which user has admin rights. Suggestion from WTFranklin. (ftruscot).
+
FIX: Comments are disabled when publishing over the XML-RPC API (kg)
+
More and improved comments in the classes BaseActions, BLOG, BODYACTIONS, SKIN and PARSER (kg)
+
FIX: Replaced deprecated $variable =& new CLASS() with $variable = new CLASS() to work for PHP 5.3 in strict mode. May break PHP4 installs, but nucleus ended support for PHP4 in 3.50. (ftruscot)
+
FIX: Escaped newline characters in New Item Notification. Use fix from Japanese team (Mocchi).
+
FIX: Javascript parse error when autosave is turned off. Use fix from Japanese team (Mocchi).
+
+
+
+ Nucleus v3.64 (March 14, 2011)
+
+
ADD: labels in the installation form (kg)
+
FIX: minor problems with invalid XHTML in the installation form (kg)
+
+
+
+ Nucleus v3.63 (March 1, 2011)
+
+
FIX: security issue in createaccount.php. Thanks Katsumi. (ftruscot)
+
FIX: call of special skin parts using fancy url scheme like special/specialname was not working. Thanks slightlysome. (ftruscot)
+
FIX: extra params in generated links with fancy urls on were not using the designated keys. Thanks slightlysome. (ftruscot)
+
ADD: catiscurrent variable to Category List Header and Footer. Thanks slightlysome. (ftruscot)
+
+
+
+ Nucleus v3.62 (January 6, 2011)
+
+
CHANGE: add redundant safeguards against security issues caused by case where register_globals is on and the config.php file is missing (Rare!!!) (ftruscot)
+
CHANGE: make CONF variable, AdminCSS, to hold name of admin area style to use. default to original. (ftruscot)
+
FIX: use of strripos in cleanFileName() not PHP4 compatible, switched to use of strrpos() since no functionality lost. (ftruscot)
+
FIX: replace ereg* functions in remaining core files, including core plugins. (ftruscot).
+
FIX: multiple newlines in comment body being reduced to only one newline. (gRegor)
+
FIX: highlight() function still using ereg* functions. (ftruscot)
+
CHANGE: cleanFileName() function simplified to replace all but a-z0-9-. (ftruscot)
+
FIX: install problem when only mysqli _* is available. (ftruscot)
+
FIX: fix comment body text not appearing on Edit Comment form (gRegor)
+
+
+
+ Nucleus v3.61 (December 19, 2010)
+
+
FIX: fix comment body being lost (ftruscot)
+
FIX: fix edit comment form formatting (ftruscot)
+
FIX: fix search title and body of items not displayed in search results (ftruscot)
+
+
+
+ Nucleus v3.60
+
+
ADD: MediaUploadFormExtras event to nucleus/media.php to allow plugin to add extra fields to media uploader form. See NP_ImageLimitSize (0.20+) for example of using event. (ftruscot)
+
CHANGE: use sql_real_escape_string() function in place of addslashes() in all but 2 places where sql_real_escape_string() doesn't make sense. (ftruscot)
+
ADD: mysql_real_escape_string() function to wrapper for mysqli (libs/mysql.php). (ftruscot)
+
FIX: globalfunctions.php. PostParseUrl event only firing when using urlmode=pathinfo (fancyurls). (ftruscot)
+
FIX: sql_affected_rows() function in nucleus/libs/sql/mysql.php. Was causing error in ban deletion. (ftruscot)
+
CHANGE: ACTIONS::_searchlink() to improve creation of next/prev link for index skin parts. Also, add $navigationItems global that can be set by plugin to affect next/prev link when plugin lists items on index page, see NP_Ordered 1.37. (ftruscot)
+
ADD: if-else-elseif-ifnot-ifelsenot-endif to the Item Body actions. Same as in Item Templates. see help.html for details. (ftruscot)
+
ADD: cleanFileName() function to globalfunctions.php and then use in nucleus/media and in MEDIA.php to clean up filenames of uploaded files to avoid problems with spaces and other characters. Thanks WillyP. (ftruscot)
+
ADD: global $currentcomentid and $currentcommentarray during item template processing so can get comment info in phpinclude called from comment template. (ftruscot)
+
ADD: if-else-elseif-ifnot-ifelsenot-endif to the comment field templates. see help.html for details. (ftruscot)
+
ADD: global $currentitemid during item template processing so can get item info in phpinclude called from item template. (ftruscot)
+
ADD: if-else-elseif-ifnot-ifelsenot-endif to the item field templates. see help.html for details. (ftruscot)
+
FIX: bug where categorylist with blogname parameter did not work on member, error, or special skin parts. (ftruscot)
+
FIX: bug in commentform skinvar where form showing to nonmembers when bpublic=0. Thanks WillyP. (ftruscot)
+
CHANGE: length of bnotify column in blog table to 128 characters to allow for longer lists of notification recipients. (ftruscot)
+
ADD: recount parameter to nextlink skinvar to force recalculation of iAmountOnPage for nextlink instead of using amountfound from last blog skinvar. Helpful in more advanced situations where multiple blog skinvars used on single page. (ftruscot)
+
FIX: tightened security around includes in PLUGINADMIN class. (ehui)
+
ADD: globalfunctions: include_libs() and include_plugins() to be used to safely include libs and plugins. (ehui).
+
REMOVE: config.php. rename to config.php.sample to avoid overwrite during upgrade. config.php created by build.xml during generation of full install package and modified by install.php. (ehui)
+
FIX: tune db tables in sqlinstall. (ehui)
+
ADD: yourprofileurl parameter value to member skinvar to produce url to logged on member's profile for use in link to member profile. (ftruscot)
+
FIX: Fixes to NP_SecurityEnforcer suggested by cacher at Japanese Forum. (ftruscot)
+
FIX: When changing settings for a member, call to PrePasswordSet event was happening even if password not being changed. Admin.php, action_changemembersettings() method. (ftruscot)
+
ADD: PostParseURL event to globalfunctions. Triggers right after url is fully parsed (by ParseURL in globalfunctions). Useful to tweak global variables before selector() runs or to set something based on path-related globals. Used by new version of NP_EventBlog (min 3.60) to display future posts (events) on item pages skin part. (ftruscot)
+
CHANGE: selector() itemid, change itemexists check to be aware of allowDrafts and allowFuture. (ftruscot)
+
ADD: $CONF settings for allowDrafts and allowFuture so can set selector to permit showing of these items if needed. Can be set in config.php or in plugin event (probably authentication related for timing). (ftruscot)
+
CHANGE: BLOG::readLogFromList() and BLOG::getSqlItemList() methods to add parameters permitting drafts or future items to be shown. (ftruscot)
+
FIX: unloaded ITEM class error casued by NP_Ping when creating new weblog. See here (ftruscot)
+
FIX: convert/livejournal.php set to use sql_table for prefixes. suggested by quandary (see here). (ftruscot)
+
FIX: improvements to isValidMailAddress() function as suggested by quandary here (ftruscot)
+
+
+
+ Nucleus v3.51 (November 1, 2009)
+
+
FIX: fix warning caused by unreachable code in PDO (admun)
+
FIX: fix typo in NP_Ping (admun)
+
FIX: fix typo in XMLRPC api (admun)
+
FIX: Bug in upgrade procedure where no check to verify new column does not currently exist before running the add query. See this thread (ftruscot)
+
FIX: Bug where activation not completed. See this thread (ftruscot)
+
+
+
+ Nucleus v3.50 (September 19, 2009)
+
+
FIX: enhancements to language and input escaping in NP_SecurityEnforcer as suggeted in Japanese forum. (ftruscot)
+
FIX: bug in install.php when shell_exec not available and bug in MANAger.php when certain language constant not defined. Suggestions by shizuki, added by ftruscot.
+
ADD: Comment template variable userwebsitelink which acts like userlink, but only shows web address and never email. (ftruscot)
+
ADD: 2 Category List template variables, catiscurrent and its synonym, currentcat. (ftruscot)
+
ADD: code to warn if using a non-mysql database handler and a plugin does not supportsFeature 'SqlApi'. (ftruscot)
+
CHANGE: set php setting, display_errors, to 0 when not in debug mode to keep users with poorly configured servers from displaying errors on the page. (ftruscot)
+
FIX: PHP5.3 warning caused by MANAGER::notify(). See this thread. (ftruscot)
+
FIX: bookmarklet unaware of character set being used. Fix suggested by wgroleau. (ftruscot)
+
FIX: super-admin disallowed from uploading files if not on any teamlists. (ftruscot)
+
ADD: $CONF['ActivationDays'] variable to control days before activation expire. Manually set in config.php if needed (no admin interface). (ftruscot)
+
CHANGE:Notify ITEM link after karma votes(ACTION.php). (shizuki)
+
CHANGE:Remove bsendping col from nucleus_blog table(install.sql/upgrade3.5.php). (shizuki)
+
ADD:sql_field_name function for backup class(mysql.php/pdo.php). (shizuki)
+
FIX:Fix short open tag(NP_Ping.php). (shizuki)
+
CHANGED: NP_Ping and related infrastructure changes. (admun)
+
ADDED: upgrade code for 3.5 in upgrades folder. Includes notices about end of PHP4 support and info on 2 new plugins included in plugins folder. (ftruscot)
+
CHANGED: modified upgrade functions to use 3 digit version indicators everywhere. i.e. 340 instead of 34. (ftruscot)
+
CHANGED: increased length of displayname, mname, to 32 characters. (ftruscot)
+
CHANGED: modified install.php and sql_* handlers to allow installation using PDO. Activation is manual and not intended for public consumption in 3.50. Only tested for pdo-mysql handler. (ftruscot)
+
ADDED/CHANGED: extended sql_* api to cover all mysql_* functions used in core. Functions loaded from nucleus/libs/sql/ folder. See here. (ftruscot)
+
ADDED: NP_Text plugin to core installation. Makes distribution of internationalised plugins easier. See this thread. (ftruscot)
+
ADDED: links in plugins help of help.html to link to two main plugin repositories. See this thread. (ftruscot)
+
ADDED: selectSpecialSkinType() function to globalfunctions.php. (ftruscot)
+
ADDED: Check in ADMIN.php pagehead() function to display alert if newer version is available. new function, getLatestVersion() in globalfunctions.php, and new files on nucleuscms.org, version_check.php, to serve latest version. (ftruscot)
+
ADDED: skinvar for all skin types to display a sticky item from any blog anywhere. (ftruscot)
+
REMOVED: check on canlogin during forgotpassword process. See this thread. Suggestion by phillip_r. (ftruscot)
+
ADDED: div with id of adminwrapper around contents of admin page for improved control of admin page look. See this thread. Suggestion by monkeybrain. (ftruscot)
+
ADDED: NP_SecurityEnforcer plugin to core installation. It can be set to enforce password length and complexity rules, as well as maximum failed login attempts. Put in plugin so can be superceded later by better techniques. (ftruscot)
+
CHANGED: LoginSuccess event in globalfunctions.php to inlcude username in the data array to specify the login name entered by the user. (ftruscot)
+
FIXED: backup.php, _backup_dump_structure() function, to use SHOW CREATE TABLE name, to generate table creation SQL. Adds ENGINE, AUTO_INCREMENT, and DEFAULT CHARSET. (ftruscot)
+
ADDED: PrePasswordSet event in ADMIN.php to allow plugin to enforce any password length or complexity rules for improved security. (ftruscot)
+
FIXED: When inclusion tried to do the special skin type by skin of error types, $skinid wasn't set.(yu/shizuki)
+
CHANGED: move send update ping option override to NP_Ping
+
ADDED: Year-based archives and archivelists, adds archiveyearlist and otherarchiveyearlist skin vars (ftruscot)
+
+
+
+ Nucleus v3.41 (March 15, 2009)
+
+
FIXED: Reduce PHP Notices caused by undefined variables and wrong offsets (shizuki, kaigreve)
+
FIXED: additional changes in the language files english.php and english-utf8.php to reflect modifications since version 3.30 (kaigreve)
+
FIXED: SQL error in MEMBER::write() where mautosave not forced to be integer. See Problem with 3.40. (ftruscot)
+
CHANGED: Modify Fix SQL error when new blog add by shizuki, to give a default english value for category name, category desc, first item title, and first item body in case where user does not have updated language file. (ftruscot)
+
FIXED: Fix SQL Error when new blog add. (shizuki)
+
CHANGED: Mod Change link URI of 'help icon' to full URI (documentation/help.html to $CONF['AdminURL'].'documentation/help.html') (shizuki)
+
ADDED: getTeamBlogs() method to MEMBER class to retrieve list of blogs to which a member has team rights (ftruscot)
+
FIXED: rearrange english.php and english-utf8.php files so all new-to-3.40 contants are grouped together at top (ftruscot)
+
FIXED: Add missing language item to english-utf-8.php (admun)
+
FIXED: CONF['Self'] merging error in globalfunctions.php (admun)
+
+
+
+ Nucleus v3.40 (February 14, 2009)
+
+
ADDED: check cmail column to separate to URL and cemail when Nucleus upgrade to 3.3 or later. (kimitake/katsumi)(added by shizuki from Ver.jp)
+
CHANGED: Comment count at items list display via 'sprintf()'. (shizuki)
+
ADDED: instructions for manually adding .htaccess files to media and skins folder after upgrade. (ftruscot)
+
FIXED: the unwished ping after adding an item to a new category (what you have written here: http://forum.nucleuscms.org/viewtopic.php?p=89142#89142)(shizuki)
+
FIXED: Few hardcoded strings moved to langage file(shizuki)
+
CHANGED: Ease the solution for the new member option for autosave draft(kaigreve)
+
CHANGED: Move System overview in the menu of the admin area under the entry for the configuration (ADMIN.php)
+
CHANGED: Shorten menu entry to 'System info' and correct 'enable' to 'enabled' (english.php)
+
CHANGED: height of page class in help.html to avoid overlaps on long help topics. (ftruscot)
+
ADDED: .htaccess file in skins/ and nucleus/libs/ to fight possible script execution due to certain apache configurations. (Code recommended by Katsumi, added to svn by ftruscot)
+
ADDED: .htaccess file in media/ to fight possible script execution due to certain apache configurations. (Code recommended by Katsumi, added to svn by ftruscot)
+
ADDED: New member option to decide whether the autosave draft function is used or not (kaigreve)
+
CHANGED: Additional improvements and updates in devdocs and help.html (ftruscot)
+
ADDED: Warning for PHP 4.x depreciated during upgrade(admun)
+
ADDED: Documentation, as needed, for changes below. (ftruscot)
+
ADDED: BLOG::readLogFromList() and BLOG::getSqlItemList() to allow using the core item display mechanisms for customized lists of items. Will be used primarily by plugins. (ftruscot)
+
CHANGED: MEMBER::login() to add CustomLogin event. Provides hook for plugins to perform authentication from external sources. (ftruscot)
+
ADDED: Upgrade scripts for version 3.40. Lengthen nucleus_template.tpartname column to 64. Lengthen nucleus_template_desc.tdname to 64. (ftruscot)
+
ADDED: Warning for PHP 4.x depreciated (admun)
+
FIXED: MySQL version check failure in install.php (admun)
+
FIXED: bugs in last fix of directory traversal vulnerability in Nucleus media manager. Fix code providedby kmorimatsu inserted by ftruscot.
+
FIXED: directory traversal vulnerability in Nucleus media manager. Fix code provided by kmorimatsu inserted by ftruscot.
+
FIXED: cuser field of non-member comments being blanked out intermittentlyOld comments from field is gone. Caused by registration with names longer than 16 characters. Enforce 16 character limit in createaccount.php, ADMIN.php, ACTION.php (ftruscot)
CHANGED: (#84(JP)): To avoid showing ticket in the URL, redirect to pluginlist, instead. (kmorimatsu)
+
CHANGED: make ItemVars case insentive to ease the usage (work with plugins that use the function doItemVar) (kaigreve)
+
ADDED: new event in TEMPLATE.php called PreTemplateRead to allow plugin developers to change name of template being used. This is obscure and probably won't be publicized, but I need it for NP_MultiLanguage to allow mapping of templates depending on language being viewed, permitting translations of all parts of a template and localization of dates. (ftruscot)
+
ADDED: three new events in BLOG.php called PreArchiveListItem, PreCategoryListItem, and PreBlogListItem to allow plugin developers to modify or add template variables to the ArchiveList Item, Category List Item and Blog List Item template fields (ftruscot)
ADDED: add description of the doIf function to the plugin documentation (ftruscot)
+
FIXED: fix description of if/else/endif skin variables to documentation, inlcuding ifnot, elseif, and elseifnot (ftruscot)
+
ADDED: add description of charset skin variable to documentation. (ftruscot)
+
ADDED: add global configuration, DefaultListSize, which sets and maintains a custom value for length of item/comment lists in the admin area (ftruscot)
+
FIXED: fix content type of bookmarklet.php file to text/html to conform with other pages (ftruscot)
+
ADDED: new event in createaccount.php called RegistrationFormExtraFields to allow fields from plugins onto registration form (ftruscot)
+
FIXED: CONF['Self'] fix (admun)
+
ADDED: Add a link to the front end that allows to add an item in a bookmarklet popup window (two new skinvars addlink and addpopupcode needed) (kaigreve)
+
ADDED: add a cancel button to the bookmarklet add and edit forms (kaigreve)
+
CHANGED: Move the submit button in the bookmarklet edit from to the end of the button bar (logical order) (kaigreve)
+
ADDED: Add the possibility to move a published item back to drafts (kaigreve)
+
ADDED: more and improved comments in classes NucleusPlugin, BACKUP, ITEM and ITEMACTIONS (kaigreve)
+
CHANGED: Use ISO date for backup filename and add hour, minute and second (kaigreve)
+
CHANGED: Put backup functions in an own class Backup (kaigreve)
+
FIXED: add default values for the parse_bloglist function to avoid warnings (kaigreve)
+
FIXED: fix case sensitive function name createDraftFromRequest in class ACTION (admun)
+
ADDED: add description of the doItemVar function to the plugin documentation (kaigreve)
+
ADDED: add language file install_lang_english.php to install process (admun)
+
ADDED: add option to install NP_Ping during installation (admun)
+
FIXED: remove bug in the plugin api: function clearOptionValueCache hasn't worked correct with the getOption function (kaigreve)
+
ADDED: add global configuration DebugVars which decides if unresolved Vars (SkinVars, TemplateVars, ItemVars) are shown on the blog (kaigreve)
+
FIXED: Fix getNotifyFromMailAddress to use email field now that we've separated email/url fields (gregorlove)
+
CHANGED: extend skinvar Bloglist with parameters to specify the sort order (kaigreve)
+
ADDED: add comment URL and email to "edit comment" form and make them editable (gregorlove)
+
ADDED: new event in ADMIN.php called TemplateExtraFields to allow plugin developers to add fields to templates. This should encourage plugin authors to make use of the core template storage to provide formatting for their output. This event just presents the extra fields on the template edit form and stores data entered there into the nucleus_template table. It is the responsibility of the plugin authors to use the template fields they add and to provide the variables used in those fields. Plugins should also document their variables and provide for a default, either in the code or through a plugin option. (ftruscot)
+
+
+
+ Nucleus v3.33 (August 20, 2008)
+
+
FIXED: Security issue (Thanks to Bradley Bell)
+
+
+
+ Nucleus v3.32 (January 26, 2008)
+
+
FIXED: An XSS issue
+
+
+
+ Nucleus v3.31 (October 22, 2007)
+
+
ADDED: add createaccount.html with a redirect to createaccount.php for backward compatibility with the old location of the form
+
CHANGED: protect the 'create account form' against abuse: show the form only if needed and add FormExtra (e.g. Captcha) and ValidateForm (to validate input) events (ftruscot and kaigreve)
+
FIXED: bug in upgrade script (admun)
+
CHANGED: update xmlrpc client to version 2.2, this version supports PHP 5.2.x (kimitake)
+
CHANGED: use require instead of include for the file inclusion (kimitake)
+
CHANGED: rollback benchmark default skin (admun)
+
FIXED: possible security problem in NP_Ping (admun)
+
+
+
+ Nucleus v3.3 (August 7, 2007)
+
+
ADDED: NP_Ping sends ping for future post via JustPosted event (admun)
+
ADDED: JustPosted event (admun)
+
ADDED: move weblogs.com ping function into plugin (admun)
+
+ ADDED: Serveral changes and fixes from Nucleus Japan (details in the log files of the Nucleus repository at sourceforge.net)
+
CHANGED(JP): (#48(JP)): Super-admin always can login to admin page (Kimitake)
+
ADDED: (#45 from the Japanese Tracker): include code from NP_0TicketForPlugin in the core (Changes from Nucleus Japan)(Katsumi)
+
+
+
ADDED: Sanitize parameters such as $_GET and $_SERVER['REQUEST_URI'] etc. to avoid XSS (from Nucleus Japan)
+
ADDED: new events for Media upload: PreMediaUpload and PostMediaUpload (kaigreve)
+
ADDED: new skinvar bloglist (kaigreve)
+
ADDED: new method for URL rewriting with the global variable virtualpath, new .htaccess file can be found in the folder extra/fancyurl-2, more information forum(Another approach to Fancy URLs) (kaigreve and Legolas)
ADDED: NP_SkinFiles plugin installed on full install
+
FIXED: Installing plugins through install.php failed (karma)
+
FIXED: whitespace at start/end got trimmed on skin edit/import (karma)
+
ADDED: title-attributes on inline/popup images (moraes)
+
ADDED: New default skin (Ivan, hcgtv, moraes, ...)
+
ADDED: fr 1081569, <%if(category,catid,1)%> support (moraes)
+
ADDED: support for rel="nofollow" (Rakaz)
+
FIXED: bug 1058978, subscription list of updated plugin showed the updated subscriptions while the old subscription-list was still in the database. Nucleus now gives a warning (TeRanEX)
+
FIXED: bug 1083959, closed site still allowed posting comments (karma)
+
FIXED: bug 1083971, editing blog settings was not possible on PHP versions < 4.2.0 (floatval) (karma)
+
FIXED: In v3.15, deleting an item via the bookmarklet failed (karma)
+
ADDED: Support for <%blogsetting(short)%>, as suggested by caw (karma)
+
FIXED: Default skin used application/xml+rss instead of application/rss+xml, causing RSS autodiscovery to fail. (karma)
+
FIXED: Moved more hardcoded text into language files
+
FIXED: Made it so malicious users cannot trick a logged in site member/admin into visiting a specifically crafted URL that performs some admin area task. (karma).
+
FIXED: bug 976777, weblogs.com was not ping when posting draft (admun)
+
ADDED: bug 1008171, cookie-prefix (karma)
+
CHANGED: bug 1008175, move getTemplate into MANAGER class + some other performance tweaks (karma)
+
ADDED: add plugin dependency check (admun)
+
CHANGED: Sending out activation links rather than new passwords on new accounts, forgotten passwords, etc. (karma)
+
ADDED: Plugins can now make text- and textarea-optiontypes readonly (TeRanEX)
+
CHANGED: new plugin event FormExtra (for use with ValidateForm) (karma)
+
CHANGED: better error handling when commenting. Errors now displayed together with comment form. (karma)
+
CHANGED: actions (commenting, membermail, ...) can be done using any entry point, not just through action.php (karma)
+
CHANGED: Added $Id$ info in sourcefiles (karma)
+
CHANGED: PrePluginOptionsEdit-event now has an extra-field which can be used to add option-specific code to the page (TeRanEX)
+
ADDED: new event, PrePluginOptionsUpdate, can be used by plugins to verify/modify the new value for an option (TeRanEX)
+
ADDED: Plugins can now provide a documentation page, which is shown inside the admin area (TeRanEX)
+
ADDED: Plugins can now limit values for an option to be only numeric (datatype=numerical) (TeRanEX)
+
ADDED: OptionTop-methods, to let a plugin retreive an array of the x-highest (or lowest) values of an option (TeRanEX)
+
ADDED: Plugins can now make specific options for items. These options can be edited directly from the item add or edit page (TeRanEX)
+
+
+
+ Nucleus v3.15 (November 14, 2004)
+
+
FIXED: Some XSS issues, as reported by Alexander Antipov
+
FIXED: Validate data that is sent as HTTP headers (redirects etc) (karma)
+
FIXED: bug 1029057, parsed include doesn't accept empty files (karma)
+
FIXED: bug 1036849, 'relevance' listed in list of available skinvars, while it's a templatevar (karma)
+
FIXED: It was possible to spoof the username on comments, even when "protect member names" was turned on. Reported by bigmouth. (karma)
+
FIXED: bug 1025675, if(hasplugin) causes warnings in action log when plugin does not exist (karma)
+
FIXED: bug 1008700, taking away admin attribute from a member was disallowed when that member did not have logon rights (karma)
+
FIXED: bug 968925, member edit leak out repeat password box while it should be hidden (admun)
+
FIXED: bug 933580, URLs in comments followed with a comma should not have the comma in the generated hyperlink (karma)
+
FIXED: bug 1019584, separating search terms with a '+' character caused SQL errors (karma)
+
FIXED: bug 1016217, superadmin should be allowed to edit all items/comments (karma)
FIXED: Made sure no code relies on the PHP5 setting register_long_arrays to be On (karma)
+
FIXED: Call to undefined function when user specified a language in its profile (jef pober)
+
FIXED: Quickmenu didn't show up after login from index.php?action=showlogin (karma)
+
CHANGED: new plugin event ValidateForm (karma)
+
CHANGED: Extra whitespace to make skin exports easier to read in text editors (karma)
+
CHANGED: e-mail notifications are now sent as utf-8 rather than iso-8859-1 (karma)
+
ADDED: Admin members can click the version number in the admin area to check for a newer version (karma)
+
ADDED: <%if(admin)%> and <%if(admin,blogname)%> in skins (karma)
+
ADDED: In the admin area, a list of all comments for a blog is now available (karma)
+
ADDED: ITEM::getitem returns blogid, as suggested by leonbloy (karma)
+
+
+
+ Nucleus v3.1 (July 28, 2004)
+
+
FIXED: Nucleus v3.01 was missing a fix in backup.php, which could cause fulltext key info not to be backed up correctly
+
ADDED: support for patch levels, so plugin API enhancements can be distributed to power users earlier (suggested by TeRanEX)
+
FIXED: bug 974090, multiple identical SQL queries were executed when checking if a plugin is available (karma)
+
FIXED: Default language wasn't always respected (fushimi)
+
CHANGED: new bookmarklet style (TeRanEX / moraes)
+
FIXED: After a karma vote, redirection to referer URL failed if register_globals is turned off (karma)
+
FIXED: SQL Injection Vulnerability, reported by aCiDBiTS
+
FIXED: bug 689468, moved PostAddComment from action.php to COMMENTS.php(admun)
+
FIXED: bug 967580, Class variables were not explicitly defined in PHP classes (karma)
+
FIXED: IE6 unreadable Admin menu textarea (admun)
+
FIXED: Skin exports for skins containing CDATA sections (like the RSS feeds) caused the skinbackup.xml to contain invalid XML. (Import still worked, however) (karma)
+
FIXED: German language file wrong translation (admun)
+
CHANGED: replaced split by preg_split in the parser class. Should be faster according to PHP docs (karma)
FIXED: install.php - installCustomPlugs now correctly syncs plugin events (rADo2)
+
FIXED: Forcing focus on add/edit window after closing media library (nakahara21)
+
ADDED: class attributes on textareas that allow skins/templates to be edited (karma)
+
FIXED: Documentation and errors now tell to chmod config.php to 444 instead of 644 (hcgtv)
+
CHANGED: Admin area style power-up (Radek)
+
FIXED: Install script used $PHP_SELF, which is not available when register_globals is off (nakahara21)
+
FIXED; Skin import failed if there were CDATA sections (Nucleus Japan)
+
FIXED: undoMagic choked on array variables (Nucleus Japan)
+
FIXED: htmlspecialchars causes broken url like "&amp;" (Nucleus Japan)
+
FIXED: PostAddCategory event was never called (Nucleus Japan)
+
FIXED: PostAddCategory event was not called when creating a new weblog (Nucleus Japan)
+
FIXED: <%blogurl%> problem on category lists (nakahara21)
+
CHANGED: Took out the HTTP Authentication part for now (it has no real use yet, and caused problems when Nucleus is installed in a protected directory)
+
FIXED: When the 'Allow login edit' option was disabled, the e-mail address was not checked for validity when a user edited his/her settings. This would cause an e-mail with new password to be sent out to an invalid address. (Frankenstein)
+
FIXED: Some PHP files were missing the closing ?> tag (ikeizer)
+
FIXED: Plugins were inable to delete options (leonbloy)
+
FIXED: XML-RPC: metaWeblog.newPost fails when an empty array is passed as list of categories (caused problems with Ecto)
+
FIXED: Eliminated 2 SQL queries on most requests.
+
+
+
+ Nucleus v3.0 RC (April 27, 2004)
+
+
CHANGED: Labeled it v3.0, since users started believing "2.5 beta == 25 final"
+
FIXED: XML-RPC: metaWeblog.editPost assigned the default category again when no categories were passed along (karma).
+
FIXED: XML-RPC: mt.getPostCategories returned an invalid result (karma)
+
CHANGED: On clean install, RSS and Atom feeds contain full items rather than excerpts only (karma)
+
REMOVED: Clean installation does not include RSS 0.91 feed anymore. Only the RSS 2.0 and Atom 0.3 feeds are included (karma)
+
ADDED: When a skin provides a preview thumbnail, it is displayed in the skin overview (include prefix required, 100x75 preview.png, preview-large.png). Also, when a readme.html file is present in the skin include dir, a link to that file is added (karma)
+
CHANGED: Allowed skin names to have slashes (/) in them (karma)
+
FIXED: When adding media in non-IE browsers, all text was removed
+
FIXED: Wrong times displayed / 'no such item' errors when MySQL server and PHP server are in different timezones (karma)
+
ADDED: Made sure language files for v2.5beta can be used with v2.5final without strange strings (e.g. _SETTINGS_EXTAUTH) showing up in the admin area (karma)
+
FIXED: No CSS styles were applied on 'insert media' popup (karma)
+
FIXED: Some more possible problems with URL linking in comments (karma)
+
FIXED: In Opera, buttons on the extended area added text to the main body text instead (karma)
+
CHANGED: Admin pages are being sent as text/html instead of application/xhtml+xml again, since it caused too much javascript problems. When $CONF['debug'] is 1 however, the pages are still sent as application/xhtml+xml (karma)
+
FIXED: itemlink in templatevars didn't include itemid when used on item skins (mas)
+
FIXED: Errors when deleting plugins with options (Curtis)
+
FIXED: & not encoded in category names/descriptions in admin area (karma)
ADDED: HTTP Authentication (Frankenstein) (not in 3.0 final)
+
FIXED: When using the JavaScript buttons to add images/bold text/... to the extended text area, the text was added to the main text body instead if JavaScript toolbar style was set to 'simple' (karma)
+
FIXED: XML-RPC: Added postid in structs returned by metaWeblog.getPost and metaWeblog.getRecentPosts (karma)
+
FIXED: XML-RPC: metaWeblog.getRecentPosts expected a string instead of an int for the amountOfPosts parameter. (karma)
FIXED: On index and search skinparts, nextlink/prevlink could not be used before a blog or searchresults skinvar was called (karma)
+
FIXED: SQL errors when search query contained single quotes (') (karma)
+
FIXED: Backup did not store information about FULLTEXT keys. (karma)
+
ADDED: Extended the date templatevariables with pre-defined formats utc and iso8601 (needed for Atom syndication; karma)
+
FIXED: super-admins that were not on a blog team did not see the categories when trying to add an item to that blog (karma)
+
FIXED: nextresults and prevresults were listed as available skunvars, while they don't exist (karma)
+
FIXED: XML-RPC library wrote <?phpxml version="1.0"?> as XML header (jmuto)
+
FIXED: not longer showing comment form when comments disabled for blog (jmuto)
+
CHANGED: Plugin options are no longer limited to 128 characters (karma)
+
CHANGED: Exported skins are now saved as skinbackup.xml instead of skindata.xml to avoid confusion. (karma)
+
ADDED: New plugin events AdminPrePageHead, AdminPrePageFoot, PreSendContentType, QuickMenu, BookmarkletExtraHead (karma)
+
FIXED: Fix for bookmarklet, which failed in Opera (jmuto)
+
FIXED: nextitemtitle and previtemtitle skinvars did not htmlencode their output (karma)
+
CHANGED/ADDED: make all skinvars that insert links consistent. They can now all take a linktext parameter to insert a full link instead of a raw link. The nextlink/prevlink on search/index pages (introduced 2.5 beta) had to change for this. Skinvars that can take a linktext: todaylink, archivelink, prevlink, nextlink and itemlink (karma)
+
FIXED: XML-RPC: mt.setPostCategories asumed that isPrimary was always present (karma)
+
FIXED: Plugins that generate output when they are loaded can not longer break backups. (Xiffy)
+
FIXED: The test that auto-disabled fancy URLs was incorrect, and also applied to top-level domains that use 3 characters (like .com) (karma)
+
+
+
+ Nucleus v2.5 beta (October 11, 2003)
+
+
ADDED: if(previtem), if(nextitem) and if(skintype,typename) skinvars.
+
FIXED: RSS conditional GET wasn't working correctly (Visa Kopu)
+
ADDED: Templatevar relevance available when displaying search results (Xiffy)
+
CHANGED: nextlink and prevlink skinvar now also available on search and index skins. (Xiffy)
+
ADDED: Skinvars nextitemtitle and previtemtitle on item skins (Xiffy)
+
FIXED: Upload did not notice duplicates correctly
+
ADDED: XML-RPC: Support for metaWeblog.newMediaObject and metaWeblog.getRecentPosts methods
+
ADDED: XML-RPC: Support for the Movable Type API (except for mt.getTrackbackPings)
+
CHANGED: Fulltext search, prev/next links on search pages, ... (Xiffy)
+
FIXED/CHANGED: Action log size drops back to 250 when more than 500 entries.
FIXED: XHTML admin documents now have a proper xmlns attribute set; admin pages are now sent as application/xhtml+xml if the client browser accepts it. Removed again in 3.5final
+
ADDED: Plugins can now make specific options for blogs, categories and members. These options can be edited directly from the blogsettings or member settings page.
+
FIXED: It's no longer possible to select an item from an other weblog through ?itemid= when there is a different blogid= parameter set in the request (or set using selectBlog)
+
FIXED: Disallowed while trying to create a new category on item edit
+
FIXED: Date/Time variables in date footer were not parsed
+
FIXED: Adding an item while creating a new category prevented ping to be sent to weblogs.com
+
FIXED: Right-click bookmarklet for IE (re-install to get it working with IE6)
+
FIXED/CHANGED: hyperlink conversion in comments: ftp/http/mailto supported
+
FIXED: spaces in between multiple notify e-mail addresses caused ar error message saying the e-mail address is invalid.
+
FIXED: archivedate skinvar ignored the 'locale' parameter that was passed to it
+
FIXED: selectBlog did not protect for changes in ?archivelist
+
FIXED: selectCategory now takes a category id instead of a name (multiple categories can have the same name)
+
CHANGED: Fancy URLs are only generated when $CONF['Self'] does not end in .php (this avoids URLs like index.php/item/95/item/94/member/1 when turning fancy URLs on without further configuration)
+
CHANGED: Install script updates config.php automatically when it is writable
+
CHANGED: When the content type of a skin is application/xhtml+xml, only send this to browsers that specify this type in their HTTP_ACCEPT header (otherwise, send text/html instead)
+
CHANGED: More intelligent search keywords highlighting (multiple separate keywords etc), also available inside comment bodies now
+
ADDED: Possibility to filter on filename in media library
+
FIXED: include('config.php') caused problems when another config.php was in the PHP include path (nils bernhard)
+
ADDED: LiveJournal conversion (moraes)
+
FIXED: Karma Vote URLs used relative links to action.php
+
CHANGED: Support for PHP versions having short_open_tag = Off (Andrew Brampton/Terry Chay)
+
ADDED: Plugin options can now also use a textarea type. (max. size for data is still 128 bytes though)
+
FIXED: When unable to load a plugin, an error message is added to the actionlog
+
FIXED: Not all messages sent to the actionlog actually appeared there
+
ADDED: Made it possible to install more than one Nucleus installation in the same database (using a prefix to the tablenames)
+
ADDED: Nucleus does not longer allow access to the Admin Area when files like install.php, install.sql or the nucleus/upgrades directory are still on the server.
+
ADDED: <%member%> skinvar now also accepts id and yourid as parameter
+
FIXED: JavaScript toolbar works better in Gecko-based browsers (Mozilla Firebird/Netscape 7)
+
ADDED: supportsFeature method to plugin interface
+
FIXED: Destination URL parameter on membermailform skinvar didn't work
+
FIXED: Encoding of the window title of popup images (Osamu Higuchi)
+
FIXED: Link at end of install sequence was pointing to install.php
+
+
+
+ Nucleus v2.0 Final (April 3, 2003)
+
+
FIXED: renamed the xmlrpc_encode and xmlrpc_decode methods in xmlrpc.inc.php, avoiding naming conflicts on some PHP configurations that are compiled with XMLRPC support
+
FIXED: restore did not work on some PHP configurations, and did not correctly recognize application/x-gzip encoding type
+
ADDED: if(onteam[,blogname]) skinvar
+
ADDED: automatic warning when headers have already been sent, with filename and linenumber included
+
ADDED: About 40 extra plugin events
+
ADDED: Made <%member%> available on all skin parts, and added yourname, yoururl, ... parameters
+
FIXED: plugin loading is now a little more robust (non-fatal errors in the plugin PHP file used to cause a fatal error afterwards)
+
ADDED: extra variables inside popup code/image code/media code template-parts: width, height, link and text
+
ADDED: Extra optional parameter for image skinvar, indicating which information to insert on the page
+
CHANGED: Marked the imagetext skinvar as deprecated (use image(caption) instead)
+
CHANGED: Marked the ifcat skinvar as deprecated (use if(category) instead)
+
CHANGED: Marked the vars skinvar as deprecated (if anyone needs a hidden 'itemid' formfield [are there?], the itemid skinvar can be used instead)
+
ADDED: doTemplateCommentsVar(&$item, &$comment) method in plugin interface
+
CHANGED: comments are now also parsed using the same method as skins and items, allowing plugins, includes and more to be used there as well
+
FIXED: guests cannot longer place 'fake' comments (making it look as if a regsitered memeber made the comment)
+
FIXED: item contents is no longer trimmed
+
FIXED: Made install script look less messy
+
ADDED: selectItem($id) method
+
FIXED: Unable to disable comments through 'edit item'
+
ADDED: Plugins: EditItemFormExtras event gets itemid as separate parameter
+
FIXED: missing ; in presented new blog code
+
FIXED: PHP 4.0.6 didn't show item/member/... lists on admin area (PHP bug)
+
ADDED: Plugin Hook: BlogSettingsFormExtras
+
FIXED: <%if(blogsetting,bcomments,1)%> skinvars were not working
+
ADDED: <%if(loggedin)%> skinvars were not working
+
+
+
+ Nucleus v2.0 beta (January 18, 2003)
+
+
FIXED: Highlighted text no longer has <!--h--> in it
+
ADDED; Plugin hook: PostAuthentication
+
ADDED: Plugin hooks PreAddItemForm, AddItemFormExtras and EditItemFormExtras
+
CHANGED: Notifications emails (new comment, etc) are not sent to the person causing the notification (comment author)
+
ADDED: plugins can access global variables $currentTemplateName and $currentSkinName
+
CHANGED: Spaces after commas in <%image%>, <%popup%>, <%media%>
ADDED: 'Fancy' URLs option & support files. Allows for URLs like http://hostname/archive/1/2003-01-05 instead of http://hostname/index.php?blogid=1&archive=2003-01-05
+
ADDED: RSS 2.0 skin/template (Xiffy)
+
ADDED: skinvar <%skinname%>
+
ADDED: if/else in skins. parameters for 'if' are currently 'category' (=ifcat) or 'blogsetting/settingname' (settingname = columnname from database...)
+
ADDED: Etag/If-None-Match support for xml-rss.php (needs some more work)
+
FIXED: more friendly bookmarklet for Opera 6 users (all tabs are visible, editing through bookmarklet works)
+
ADDED: on edit item, the post time can be changed (only if 'allow post to past' is enabled)
+
ADDED: 'Allow Post to Past' option on weblog basis
+
ADDED: IncludeMode and IncludePrefix settings in nucleus_skin_desc + interface to change these settings + user IncludePrefix while parsing includes.
+
CHANGED: nucleusbutton skinvar now takes into account IncludeMode
+
CHANGED: btimeoffset column is now DECIMAL instead of INT
+
CHANGED: took away actionurl parameters from commentform and membermailform skinvars (it's a global setting now)
+
ADDED: <%set(property,value)%< skin/template-var to set global parser properties. Only one option defined so far: 'IncludeMode'. Can be 'skindir' or 'normal' and affects the include/parseinclude/phpinclude skin/templatevars
+
ADDED: <%skinfile(filename)%> skinvar (to be used on imported skins)
+
ADDED: $CONF['SkinsURL'] and $DIR_SKINS (config.php)
+
CHANGED: friendly names used on skin edit (instead of 'index', 'item' etc)
+
ADDED: action url to global settings (action.php location)
+
ADDED: $desturl and $actionurl parameters on membermailform skinvar
+
ADDED: skin import/export class
+
CHANGED: media library now works with multiple collections, of which one is private to the site member, and the rest is globally shared.
+
CHANGED: base skin can now be changed (it's now a config setting). This skin is ONLY used in two cased: when all else fails, and when the selected skin does not have contents for the needed skinpart
+
CHANGED: positive and negative karma votes are now kept separately, since that works better and is more flexible. The <%karma%> templatevar received an extra parameter to select which information to show
FIXED: when language settings are changed, the new language is used immediately (only for global settings, not for member settings)
+
CHANGED: archivelist query now uses the SUBSTRING MySQL function instead of the YEAR/DAYOFMONTH/MONTH functions (caused trouble for some people)
+
ADDED: maxlength attributes on forms
+
CHANGED: commentlists: placed time/author in same table cell
+
ADDED: extra convertor for Blogger blogs that use YACCS comments (exportable in CAIF format)
+
FIXED: some possible security issues (thanks to Morgan Tocker)
+
FIXED: shortening of strings does not corrupt HTML entities anymore (e.g. in RSS-feeds)
+
CHANGED: links in comments are now handled differently. Part of the URL is now displayed instead of just http://.../
+
ADDED: Opera version of bookmarklet
+
ADDED: selectLanguage() function to force the use of a certain language file
+
REMOVED: there was a plugin event AddItem which was actually not needed at all (wasn't included in the documentation too)
+
ADDED: archivelist skinvars now takes an extra limit-parameter
+
CHANGED: moved all forms which can be included through skinvar out of SKIN.php and into .template files in the nucleus/forms directory.
+
FIXED: 'clone skin' did not copy contenttype
+
FIXED: Errors in XML-RSS template (upgrading users might need to change this manually or by importing an updated skin)
+
+
+
+ Nucleus v1.55 (August 26, 2002)
+
+
ADDED: <%archivedaylist%> and <%otherarchivedaylist%> skinvars (to show archives by day instead of by month)
+
FIXED: PHP error on createAccount through action.php
+
ADDED: new parseFile-method available in index.php. Allows to parse non-blog pages with skinvars
+
FIXED: editing comments with hyperreffed links
+
ADDED: 'delete item' option on edit item, plus 'delete item' confirmation screens (also on bookmarklet)
+
CHANGED: on multi-blog systems, the admin now only gets to see the blogs for which (s)he is on the team. All other blogs are available through an 'show all blogs...' link
+
FIXED: link to recent items after weblogs.com ping was broken
+
CHANGED: plugin event call 'PreAddComment' moved to immediately before the item is added to the database
+
FIXED: tab-orders were not correct on multiple admin pages
+
ADDED: <%itemid%> and <%itemlink%> available on item pages
+
FIXED: install.php now works when the PHP option magic_quotes_runtime is enabled
+
CHANGED: install.php gives an error when PHP is compiled without MySQL installed
+
CHANGED: install.php automatically fills the 'mysql hostname' field when PHP option mysql.default_host is set.
+
FIXED: greymatter convert was not putting a reference to the weblog in the comments table.
+
CHANGED: added some linebreaks in the login screen of the admin area
+
ADDED: new plugin events: PreAddItem, PreUpdateItem, PrepareItemForEdit, PreUpdateComment, PrepareCommentForEdit
+
ADDED: JavaScript to hide empty fields when editing templates
+
CHANGED: Admin area CSS now uses relative fontsizes and fontsize-keywords (also added trick to make IE5 get it right)
+
FIXED: backup was broken :(
+
CHANGED: replaced an SQL query that caused problems (NATURAL JOIN replaced by implicit inner join)
+
ADDED: <%self%> available in categorylist templates
+
ADDED: <%itemtitle%> skinvar available on item-skins
+
FIXED: editing a comment you made in a blog that's not your own resulted in a 'disallowed action' error
+
FIXED: plugin was listed twice in the list of available skinvars
+
ADDED: <%archivedate%> skinvar on archive skins
+
FIXED: admininstrators could not edit details of other members
+
+
+
+ Nucleus v1.5 (August 13, 2002)
+
+
ADDED: Introducing plugins (define your own skinvars and templatevars, add event listeners, ...)
+
CHANGED: simpler and more accessible default templates/skins
+
FIXED: GreyMatter convert now works when the asp_tags option in PHP is enabled
+
ADDED: title and authorName fields in Blogger API getRecentItems call
+
ADDED: HTML label tags for radio buttons and checkboxes (this way you can click anywhere on the text instead of only on the radio button/checkbox itself)
+
FIXED: deleting a comment you made in a blog that's not your own resulted in a 'disallowed action' error (thanks moraes)
+
CHANGED: the place where comments are inserted can now be chosen from within the template. Just include <%comments%> in the ITEM templatepart whereever you want the comment count (or comments) to appear. In upgrading, the old ordening is imitated by adding '<%comments%>' to the end of the ITEM template part.
+
CHANGED: now trimming parameters that were passed to skinvars/templatevars
+
ADDED: <%referer%> skinvar, which inserts HTTP_REFERER
+
ADDED: '- New Category -' can now be chosen on add/edit item (only for blog admins). A new category is then created, and the chance is given to edit the category details.
+
ADDED: optional attributes for templatevars <%time(format)%>, <%date(format)%>, <%syndicate_title(maxLength)%>, <%syndicate_description(maxLength)%>
+
ADDED: new user registrations show up in action log
+
ADDED: new option to allow non-members to send messages (the membermailform)
+
FIXED: when an admin edits an item written by someone else, and uploads an image, the image is now saved under the original authors media directory
+
CHANGED: <%author(realname)%> in item templates now inserts the real name of the author
+
FIXED: install.php now works when magic_quotes_gpc is disabled
+
ADDED: New settings: PluginURL, MaxUploadSize, ProtectMemNames
+
ADDED: hotlinks to the defined skinparts from the skin overview (also gives a good view on which skinparts have been defined and which have not been defined)
+
ADDED: <%smartbody%> for item templates, which chooses between showing the body and extended part, based on the extended part being empty or not. Using this, the body text can be your full text, and the extended part could be seen as an 'introduction', which you want to show on the front page. (request from smarko)
+
ADDED: <%edit%>, <%editlink%> and <%editpopupcode%> can be used in item templates (and in items themselves) to insert a link to where the item can be edited/deleted. (default setting uses bookmarklet to do this). The edit links only get shown when the user is allowed to edit a certain item (blog admin or item author).
+
FIXED: bookmarklet now works correctly when magic_quotes_gpc and register_globals are turned off
+
ADDED: PHP and MySQL versions are listed during the installation proces, with warnings when those version numbers are lower than what Nucleus requires
+
CHANGED: item parsing method changed, so it's more easily extensible. plugin, parsedinclude, include and phpinclude are now also allowed in some templates. Inside items, there are also 3 allowed variables: 'image', 'media' and 'popup'
+
FIXED: image popups didn't work with register_globals disabled
CHANGED: 'remember me' checkbox is now checked when the information was remembered from before (this way, the cookie gets set again and does not expire)
+
FIXED: after a category got selected through skinvar parameters, skinvars applying to all categories also got applied only to the last category that was selected (thanks Xiffy!)
+
ADDED: table nucleus_comment got an extra cblog column (redundant) to allow to find the blog that goes with a comment more easily.
+
FIXED: email address checking routine (false email addresses like foo@@bar.com were allowed)
+
CHANGED: New installations now get a robots.txt file (disallows karma voting/commenting/... by bots)
+
CHANGED: JavaScript preview now shows image outlines and popup image links
+
CHANGED: searchform now available on ALL skintypes
+
FIXED: headers in globalfunctions/SKIN.php now sent _only_ when no other headers have been sent before. Should make including easier.
+
CHANGED: RSS-auto-discovery tag in default skin
+
CHANGED: formfields got labels (accessibility issue). Also access keys have been defined: L for login, 4 for Search (on windows, actions keys are used together with the ALT key)
+
ADDED: left and right box buttons on JS toolbar
+
FIXED: truncated entry when login is requested after adding (data didn't get passed on correctly)
+
ADDED: <%authorlink%> to template vars for item templates (this one can take catid into account)
+
ADDED: $CONF['Self'] => $CONF['ItemURL'], $CONF['IndexURL'], ... to optionally allow people to use different files for items/archives/...
+
CHANGED: Now using mysql_fetch_assoc instead of mysql_fetch_array (efficiency)
+
CHANGED: The <%searchresults%> and <%othersearchresults%> skintags got an extra parameter to limit the number of results (defaults to 50)
+
FIXED: doError did not take into account chosen skin
+
FIXED: Commentform not shown anymore for closed items (a message is shown instead)
+
CHANGED: Removed all unneccessary javascript: links (deprecated)
+
CHANGED: Media: Procentual width and height values are now allowed in image and inline constructs (e.g. <%image(bla.gif|50%|50%|lala)%>)
+
FIXED: Blogger API: getPost wasn't returning category name
FIXED: install-script now also accepts email addresses that contain uppercase characters
+
FIXED: imported items did not show up in the weblog
+
FIXED: blogger api <title> thingie didn't work
+
CHANGED: Made all uploaded files be chmodded to 644
+
FIXED: template cloning didn't clone all parts
+
FIXED: After new user registration, there was a redirect to the members url (use 'desturl' now to indicate destination url)
+
...and a lot of small changes
+
+
+
+ Nucleus v1.1 (April 30, 2002)
+
+
Started assuming that at least PHP 4.0.5 is available. (for older PHP versions, some small code-changes should do the trick)
+
Added bookmarklets for Mac/IE5 users and Mozilla. Also, made the title of the page also show up in the title field of the new item. Makes more sense. (thanks to Ricardo Lamego)
+
Made the predefined PHP variables available in scripts called through <%phpinclude(..)%> (thanks to Polskaya for noticing the problem)
+
Fixed: <%additemform%> and <%nucleusbutton%> didn't work when admin area was not in a dir named 'nucleus'
+
Added: <%sitevar(adminurl)%> and shortcut <%adminurl%> to include the URL of the admin area
+
Changed all references to nucleus.demuynck.org into references to nucleuscms.org
+
Extra settings: cookie domain, cookie path, secure cookie (for https)
+
Instead of stripping tags in comments, < and > are now replaced by their entities (< and >). This way, greater than and lower than signs can be used in comments (inspiration by Steven Verbruggen)
+
Added charset to language files, so international character sets can be used when needed (forum)
+
Added an extra content-type attribute to skins, so the output type can be set correctly by Nucleus
+
Removed the 'headlines' skin and templates. Don't want new users to get too confused.
+
Notification emails now also get the senders display name
+
All errors now handled by doError method in globalfunctions.php (makes it easier when you want to use your own error handler instead of the error skin)
+
Site-members can now override the default site-language setting for the pages they visit
+
Added skinvars <%otherarchive%> and <%othersearchresults%> for use on archive/search pages.
+
Skinvar <%searchform%> now takes an optional parameter: blogname (for which you want a search form)
+
Introducing categories! (new settings; new skinvars category, categorylist and ifcat; new template vars <%category%>, <%catid%> and <%categorylink%>; new optional category params for skinvars blog, otherblog, archive, otherarchive, archivelist, otherarchivelist)
+
Fixed: error skin didn't get copied on skin cloning
+
Even more new skinvars to make skinning easier: <%todaylink%>, <%archivelink%>, <%prevlink%> and <%nextlink%> (forum)
+
Fixed: The install script was giving warnings about uninitialized variables on some PHP configurations
+
Moved version history to separate file
+
Made upgrade scripts a little more robust and more verbose
Made it so Nucleus still works when using PHP >4.1.0 with register_globals turned off, which is the default setting for new installations (forum)
+
Media library: popup now requests login when needed
+
Media library: option to auto-prefix uploaded files with date (turned on by default)
+
Backup/Restore: backup file name now has date + nucleus.sql renamed to install.sql + extra "I'm sure"-checkbox on restore to avoid errors (forum)
+
Javascript toolbar: simpler version available that works in Mozilla
+
Fixed: Closed items don't show 'no comments' link anymore (forum)
+
Fixed: Drafts items don't result in 'January 1970' entries in archivelist
+
Fixed: Added <image> tag to xmlrss skin for new installs. It's required. (defaults to a nucleus logo, up to you to change it)
+
Fixed: Error with restore (content with semicolons in it would not get restored)
+
Added: Extra notification options
+
Archives can now also be accessed by day, and an extra daylink template var is available in date headers
+
Fixes in default skin
+
As always, lots of small fixes & code rewrites
+
+ Changes (additions to and deletions from) language file:
+
+
_SETTINGS_COOKIES_TITLE
+
_SETTINGS_COOKIEDOMAIN
+
_SETTINGS_COOKIEPATH
+
_SETTINGS_COOKIESECURE
+
_SKIN_UPDATED
+
_TEMPLATE_UPDATED
+
_CHARSET
+
_MEMBERS_DEFLANG
+
_MEMBERS_USESITELANG
+
_ADD_CATEGORY
+
_ADD_DRAFTNFUTURE
+
_ERROR_NOSUCHLANGUAGE
+
_ERROR_NOSUCHCATEGORY
+
_ERROR_DELETEDEFCATEGORY
+
_ERROR_DELETELASTCATEGORY
+
_ERROR_BADCATEGORYNAME
+
_ERROR_DUPCATEGORYNAME
+
_CONFIRMTXT_CATEGORY
+
_DELETED_CATEGORY
+
_LISTS_TYPE
+
_SKIN_TYPE
+
_YOURSITE
+
_LIST_COMMENT_HOST
+
_SETTINGS_MEDIA
+
_SETTINGS_MEDIAPREFIX
+
_SETTINGS_MEMBERS
+
_LOGIN_FORGOT
+
_TEMPLATE_CATEGORYLIST
+
_TEMPLATE_CATHEADER
+
_TEMPLATE_CATITEM
+
_TEMPLATE_CATFOOTER
+
_EBLOG_DEFCAT
+
_EBLOG_CAT_TITLE
+
_EBLOG_CAT_NAME
+
_EBLOG_CAT_DESC
+
_EBLOG_CAT_CREATE
+
_EBLOG_CAT_UPDATE
+
_EBLOG_CAT_UPDATE_BTN
+
_EBLOG_NOTIFY_ON
+
_EBLOG_NOTIFY_COMMENT
+
_EBLOG_NOTIFY_KARMA
+
_EBLOG_NOTIFY_ITEM
+
+
+
+
+
+
+ Nucleus v1.0 (March 6, 2002)
+
+
Fixed: width & height of <%image()%> construct
+
Changed: windows in popup windows don't have a white border anymore (see forum)
+
+
Fixed: bug with single quotes in image/popup constructs (see message)
+
Fixed: fatal error in 'send password' method (thanks to HANK!)
+
Fixed: removed some illegal characters from code documentation since they caused parse errors on some systems (thanks to Martin Belle-Isle and Rodrigo Moraes; see forum for extra details)
+
Refined: added a note about spaces to the install-script (see forum)
+
Added: donate-link on admin page (hey! it's free, I have the right to bug you with this sort of things ;-)
+
Changed: it's not possible anymore to create a draft future item. That didn't make sense. You can now choose whether you want to publish a draft item either immediately or in the future when editing the item
+
Changed: made it so that the 'disable comments' choice is not offered anymore on add/edit item form when commenting is disabled in the blogsettings
+
Fixed: where possible, redirection after commenting is now done to the correct file (instead of index.php)
+
Fixed: bug where only superadmins could change usernames/passwords, even if the corresponding option in the settings was set (thx slekke)
+
Added: allowed variables for a skinpart now shown when editing skin
+
Wrote new re-usable parser that does skin parsing in a way that is more flexible and less prone to errors.
+
Changed: passwords now stored in encrypted form
+
Optimizing: optimized some queries
+
Added: <%otherarchivelist(blogname,templatename)%> in skins
+
Added: Blogger Convert
+
Added: "shared computer" checkbox on login. Checking this box will make your cookie expire at the end of the session (instead of taking the global site setting) (see forum)
+
Added: "remember me" checkbox on comment forms for non-members
+
Most language related things are now moved to language files. Now you can roll your own :)
+
Added: optional parameters rows/cols in membermailform skinvar
+
Added: skinvars: <%phpinclude(file)%> and <%parsedinclude(file)%>. <%plugin%> is now deprecated (in favor of phpinclude). The plugins directory should also not be used anymore (it'll get another function in a later version)
+
Added: skinvar <%self%> which includes the filename of the currently executing script (index.php or whatever is sen in $CONF['Self'])
+
Automatich hyperlink detection in comments now also recognizes comma's
+
Added: selectSkin('name') and selectBlog('name') functions available for use in index.php
+
Added: Small restore-guide for the worst case scenario
+
Added: A toolbar with markup buttons on add/edit item, plus option to disable it in the settings. When Mozilla is used, Nucleus tries to disable it automatically (since it doesn't work there anyway)
+
Fixed: media were not expanded in extended text (thx raoul)
+
Changed javascript code of popup help so it works better in Mozilla (thanks to Paul Sowden)
+
UI improvements
+
New default skin (the old one was just plain ugly :-)
+
Small bug-fixes
+
+
+
+ Nucleus v0.96 (December 13, 2001)
+
+
Added: add-item-preview now also in admin area
+
Added: action log
+
Added: media library and file-upload
+
Added: karma votes
+
Added: Option to disable loginname/password changing by members
+
Added: simple popup windows for image viewing
+
Fixed: E-mail address validation check does not longer require addresses to be all lowercase
+
Fixed: magic_quotes are now explicitly disabled, solving escaping problems (thanks to Dennis Slagers)
+
Fixed: error handling when pinging weblogs.com
+
Added: now also storing IP with comments (next to hostname)
+
Added: IP banlist (to prevent nasty people from commenting/voting)
+
Changed: Notification mails now include the item's title
+
Changed: Weblogs can only be deleted by super-admins
Changed: Upgrade and conversion scripts now get packed separately
+
Fixed: For error skins, the default skin is used now instead of 'default' (thanks to Slekke)
+
Fixed: The code to insert the Nucleus button was not XHTML (strict) compliant, oh my!
+
GM Conversion: The conversion of {{popup}} now works correctly (and copies image files to the media dir)
+
Fixed: a minor bug in XML-RPC call blogger.getUsersBlogs
+
Fixed: a major bug in XML-RPC call blogger.getRecentPosts
+
Fixed: problem concerning template editing and the XML-RPC call blogger.setTemplate
+
+
+
+ Nucleus v0.95 (October 10, 2001)
+
+
Added: per-blog setting to enable/disable line break conversion
+
Added: per-blog setting to send a ping to Userland (weblogs.com) when you update your blog. This way, you'll be able to end up in the weblogs.com update-list
+
Switched to v1.01 of the XML-RPC for PHP libs (was v1.0)
+
Upgrade scripts are available (for upgrade from versions < 0.95 to v0.95)
+
Added: <%previtem%> and <%nextitem%> can be used in item-skins
+
Some changes in the default database dump
+
+
+
+ Nucleus v0.94 (September 27, 2001)
+
+
Changed: 'Add Item' in admin-area now redirects to blog url (if available)
+
Changed: headlines.php and xml-rss.php adapted to behave better in disabled-site situations
+
Changed: <%userlink%> got smarter in recognizing e-mail addresses
+
Added: tabindices in forms to make traversal with the TAB-button more natural
+
Fixed: bookmarklet login did not pass data correctly
+
Added: JavaScript to open links in new window (javascrip/opennew.js)
+
Added: <%year%> and <%month%> in templates for archivelist-items
+
CSS lightly changed because IE6 is a little bit more picky (which is actually a good thing)
+
Fixed: popup code (JavaScript) for help-windows (didn't work ok in IE6)
+
Added: Description or summary of what you are going to delete on the confirmation screens
+
Added: Workaround (for advanced users) to get your archives into search engines (on tips & suggestions page)
+
Fixed: A bug in the XML-RPC server
+
+
+
+ Nucleus v0.93 (September 19, 2001)
+
+
Added: friendly error message on error with nucleusdir definition in config.php
+
Changed: call_user_func instead of eval
+
Added: forms included by skin variables now have class="formfield" and class="formbutton" arguments, to allow more control on the layout
Fix: Search results didn't show the amount of comments. Now they do.
+
+
+
+ Nucleus v0.92 (September 18, 2001)
+
+
GM conversion: {{linkmo and {{emailmo conversion now also works with PHP versions < 4.0.4
+
GM conversion: Fixed occasional JavaScript errors with {{linkmo and {{emailmo
+
GM conversion: Fixed [read more] bug
+
GM conversion: Extra intelligence in choosing URL or e-mail to save as userid for comments
+
Added: ?archivelist can now be used without arguments to show the list of archives for the default weblog
+
Fixed: Editing comments now does not allow the use of HTML anymore. The same checks as when adding new comments are performed on update attempts.
+
Added: check to find out if update file is writable (on changing blogsettings and creating new weblog)
+
Changed: hard returns in add item now get converted to line breaks (<br />), Also, modified javascript code that handles preview to behave in the same way.
+
Changed: <%commentform%> does not show user and userid fields for logged in users. Instead, it shows the name of the user.
+
GM Conversion: {{popup command now also translated (will be converted into a link to the image, not into a popup window!)
+
Updated: default templates (?archivelist)
+
Changed: E-mail Address Validation Check
+
+
+
+ Nucleus v0.91 (September 15, 2001)
+
+
Improved conversion for GreyMatter blogs. Special markup commands are now recognized. (thanks to Raoul for pointing this out)
an install-script is now available, no more messing around in shells
+
created default skins/templates for a release version
+
option to store 'last visit' cookie and to use 'new' indication on items
+
?archivelist=.. request can now also be used with a blogid instead of a blog shortname
+
forgotten password reminder
+
Bookmarklet can be used without being logged in. A login prompt is shown in that case.
+
When not being logged in to the admin area, requested actions are now completed after passing login information. Before, you would always end up at the action overview after passing login information, and your requested action would have gone lost.
+
Super-admins now have access to all blogs, even if they are not on the team
+
Logtext passed to bookmarklet now gets <br /> added before each newline
+
Added little JavaScript to prevent submitting form data twice
+
Sample plugin: google referer check
+
Conversion script to import GreyMatter blogs included
+
Removed 'assign comment to member' feature
+
Added toolbar to popup help windows (because of the back/forward buttons)
This manual only contains information that is not already contained in the popup-help (help.html) available from the administration area. This document also contains instruction for the installation of Nucleus.
+Nucleus is a Content Management System (CMS): a powerful set of PHP scripts that allow you to maintain one or more weblogs or online journals. A short summary of the most important features is given below:
+
Some HTML and CSS knowledge, to edit skins and templates
+
+
+
+
+
+Nucleus is intended for the people that want full control and 'tweakability' over their sites. If you're just looking for a very simple way to put up a site, or don't know any HTML, you might want to use a 'simpler' service such as Blogger.
+
+
+
+
+
+
+
License
+
+
+Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
+
+Copyright (C) 2002-2007 The Nucleus Group
+
+
+
This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+
This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+
You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+Your possession of this software signifies that you agree to these terms. Please delete your copy of this software if you don't agree to these terms.
+
+
+
+
Installation
+
+
+Note: If you are upgrading, you should see the upgrade instructions on the Nucleus website.
+
+
+
+Installing Nucleus is done through some steps:
+
+
+
1. Unzip
+
+
+Unzip all files to a directory of your computer. Make sure the path names are used when unzipping. You should end up with the following directory structure (* stands for a number of files):
+
+
+
+/* (main files for site)
+/nucleus/* (main files for admin-area)
+/nucleus/javascript/* (javascript helper scripts)
+/nucleus/libs/* (Nucleus core libs)
+/nucleus/language/* (definitions of languages)
+/nucleus/plugins/* (plugin-dir)
+/nucleus/xmlrpc/* (XML-RPC interface)
+/nucleus/documentation/* (Documentation + admin-area help)
+/nucleus/styles/* (stylesheets for docs & admin-area)
+/nucleus/forms/* (skeletons for commentforms etc)
+/extra/* (extra goodies, e.g. needed files to enable fancy URLs)
+/skins/* (skins directory [imported skins will go here])
+/media/* (media library directory [emtpy])
+
+
+
+
2. Upload files
+
+
+Upload all files to your server, using your favorite FTP program. Make sure to upload .php files in ASCII mode! It might not work otherwise.
+
+
+
Optional:
+
+
+
+ To make your install process even easier, you can change the file permissions on config.php to 666. This way, the install script will be able to update it automatically instead of you having it to do manually. (Quick guide on how to change file permissions)
+
+
+ If you want to use file upload, you'll need to add write permissions to the /media/ directory. This is needed in order to allow PHP to write uploaded files into that directory. The directory should be chmodded to 777 (Quick guide on how to change file permissions). (If you have root access, you can instead chgrp the directory to the user that is running the httpd process (usually httpd or nobody, then chmod 775 the directory).
+
+
+ If you want to use the SkinFiles plugin to edit files, you'll need to change the permissions on all files and directories under the /skins/ directory. To be able to edit files, they should be chmodded to 666 (Quick guide on how to change file permissions). To be able to create new files or directories, the parent directory should be chmodded to 777.
+
+
+
+
+
3. Run install.php
+
+
+Open your web browser open the URL below, where you adapt the yoursite and yourpath parts.
+
+
+
+http://www.yoursite.com/yourpath/install.php
+
+
+
+This install-script will prompt you for some information, and perform most of the installation for you. When everything has succeeded, install.php will provide you with further instructions. (you'll still need to delete some files manually)
+
+
+
+Note: When you open install.php in your browser and you see the text "If you see this text in your browser...", or you are prompted to download 'install.php', then your web server does not support PHP, and you won't be able to run Nucleus there.
+
+
+
4. Done!
+
+
+You should now be able to visit your site at http://yoursite.com/weblog/ (or whatever URL maps to the location where you uploaded the Nucleus site main files)
+
+
+
+
+
+
+
+
+
Security Aspects
+
+
mySQL passwords
+
+
+Since Nucleus needs to connect to a mySQL database from a PHP-script, the password for that database must be stored inside a PHP-file. On multi-user systems, this might cause an unevitable security risk: On some systems, other users will be able to read your login information. You might want to contact your system operator to find out how secure it is to store sensible information inside PHP-scripts.
+
+
+
+The problem above is common to all PHP scripts that need to connect to a database. As a user, there's usually nothing you can do about it in order to make things 100% secure. We just want you to be aware of this potential danger.
+
+
+
Cookies
+
+
+Nucleus uses cookies to store user login information. This could cause a security risk when your cookies are stolen. Although your password is not derivable from the cookie (the values stored in the cookie are the username and a randomly generated string), there could be ways to 'fake' the cookie on another computer and thus to get logged in.
+
+
+
Media dir
+
+
+When you want to enable file upload, you'll need to set the permissions of the media dir to 777, which means that everyone on that server will be able to delete/add/... files. The reason why this is needed, is that PHP mostly runs as the httpd user, and that user needs to be able to access this dir and write to it. Here also, there's no way around this.
+
+
+
+
+
+
+
Performance Aspects
+
+
+Contradictory to some other weblog/online journal scripts, Nucleus does not generate a static version of all items. This means that every time a page is requested, the PHP parser is called and the database is accessed to dynamically create the requested page.
+
+
+
+For small web sites, this should not cause any problem. For web sites that get dozens of hits per second, the effect on the systems performance isn't really known. So far, no problems have been reported by Nucleus users (some are running pretty big sites on it, with 30 or more weblogs on a single installation).
+
+
+
+
+
+
+
+
+
What's allowed/disallowed in comments?
+
+
+Nucleus has some built-in rules concerning comments:
+
+
+
+
words longer than 90 characters are not allowed (why: layout might get messed up when people do that)
+
the actual comment should be at least 3 characters long
+
comments cannot be longer than 5000 characters
+
guests need to enter a username of at least 2 characters
+
guests cannot use quotes or newlines in username/email
+
each sequence of 3 newlines in the body gets replaced by a single newline (why: layout)
+
HTML tags are replaced by entities
+
the comment is trimmed (leading and trailing whitespace is left of)
+
URLs are 'hreffed'. To avoid layout mess-ups, the URLs are shortened.
+
+
+
+As for now, all of these rules and parameters are hardwired into the code.
+
+
+
+
+
+
+
+
XML-RPC Interface
+
+
+The URL for the Nucleus XML-RPC interface is:
+
+http://www.yourserver.com/yourpath/nucleus/xmlrpc/server.php
+
+
+
+XML-RPC is a format for remote calls using XML messages. Sounds complex, but implementing an XML-RPC interface into an application allows other services to communicate with it.
+
+The available calls to the interface are described in the development documentation, which can be separately downloaded, or viewed online.
+
+
+
+
+
Troubleshooting (FAQ)
+
+
Below, some of the most common problems with and questions about Nucleus are answered. Please read these first before you ask for help. In many cases, the solution can be found here.
+
+
+
+
I get an error: Cannot send headers. Headers already sent...
+
+This problem is usually caused by whitespace at the beginning or end of config.php. Check if it has spaces or newlines before the starting <? or after the ending ?>. If there are, remove them. The problem can also have to do with spaces in the language file or one of the installed plugins.
+
+
+
+
+
When I try to run install.php, I'm prompted if I want to download install.php
+
Your web server is not set up to support PHP scripts. You won't be able to install Nucleus on such a system.
+
+
+
+
When I try to visit my website, I get a 'Connection Error'. Why?
+
+The reason why this error is shown is that Nucleus cannot connect to your database server for one reason or another, or it cannot select the database. One possible reason is that your login information in config.php is incorrect. Another is that the mySQL server is down.
+
+
+
+
+
I can't get my update file to work!
+
+File permissions need to be set correctly in order for the update file to work. The update file also needs to exist prior to changing the blogsettings. (e.g. you can create an empty file and upload it). About the file permissions, make sure the update file is chmodded to 666 and the directories are chmodded to 755. (Quick guide on changing file permissions)
+
+
+
+
+
I don't want the XML-RPC interface to be available
+
You can simply delete the xmlrpc/ directory without causing trouble.
+
+
+
+
I don't want RSS syndication (headlines) to be available
+
You can safely delete the xml-rss.php (headlines.php) file and the 'xmlrss' (headlines) skin/template
+
+
+
+
Known Problems
+
+
Some known issues/bugs:
+
+
+
+
At the time of release, there are officially supported blog conversion tools available for Nucleus v3.3. We do have a set of code with which you can start, and are providing pointers to the import tools created by others. A good starting point is also the Nucleus Forum section Import Questions. Because all blog system have a different structure it isn't possible to convert each system in another without a possible loss of information. The script authors try to minimize troubles and loss of information.
+
Ctrl + Shift + A shortcut might conflict with ICQ/Trillian
+
When PHP is running in SAFE mode, it's very likely that there will be problems when using the media directory (Nucleus will not be able to automatically detect image sizes, or disallow uploading)
+
Entities can get messed up in the RSS channel (e.g. & becomes &amp;)
+
The notify-address option in blogsettings has a preset limit of 255 chars, which means you can't put too many e-mail addresses in there.
+
Live preview doesn't work correctly in Mozilla
+
Internet Explorer 6 seems to be occasionally closing itsself after adding an item. The item is added, though. (it's been a while since the last complaint about that, so it might have disappeared)
+
+
+
+
+
Credits & Thanks
+
+
No matter how hard we try, some people will be unintentionally overlooked in this section.