From b7e5335177b8724f95d0f9b7e08550f4d9ec91b4 Mon Sep 17 00:00:00 2001 From: sakamocchi Date: Sun, 15 Jan 2012 14:33:55 +0900 Subject: [PATCH] =?utf8?q?=E6=9C=AC=E5=AE=B6Nucleus=20CMS=204.0=E3=81=AE?= =?utf8?q?=E3=83=AA=E3=83=93=E3=82=B8=E3=83=A7=E3=83=B31626=E3=82=92?= =?utf8?q?=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit http://nucleuscms.svn.sourceforge.net/viewvc/nucleuscms?view=revision&revision=1626 --- action.php | 36 + atom.php | 51 + benchmark.inc | 15 + build/build.xml | 211 + build/config.php | 42 + build/testcases/NP_Bug1058978_Testcase1.php | 75 + build/testcases/NP_HelpPageTestCase1.php | 42 + build/testcases/NP_ImageCreateThumbnail.php | 135 + build/testcases/NP_ImageLimitSize.php | 97 + build/testcases/NP_ItemOptionTestCase.php | 76 + build/testcases/NP_ItemOptionTestCase2.php | 76 + build/testcases/NP_ItemOptionTestCase3.php | 104 + build/testcases/NP_ItemOptionTestCase4.php | 83 + build/testcases/NP_OptionMeta_TestCase1.php | 94 + build/testcases/NP_OptionTest.php | 120 + .../NP_PrePluginOptionsUpdate_TestCase1.php | 96 + build/testcases/helppagetestcase1/help.php | 13 + build/testcases/plugindeptestcases/NP_DepA.php | 25 + build/testcases/plugindeptestcases/NP_DepB.php | 25 + build/testcases/plugindeptestcases/NP_DepC.php | 25 + build/testcases/plugindeptestcases/testcases.txt | 19 + build/testcases/urllinking.txt | 22 + build/testcases/xmlrpc-metaWeblog-editPost.php | 48 + .../testcases/xmlrpc-metaWeblog-getRecentPosts.php | 43 + .../testcases/xmlrpc-metaWeblog-newMediaObject.php | 55 + build/testcases/xmlrpc-metaWeblog-newPost.php | 48 + build/testcases/xmlrpc-mt-getPostCategories.php | 42 + build/testcases/xmlrpc-mt-getRecentPostTitles.php | 43 + build/testcases/xmlrpc-mt-getTrackbackPings.php | 40 + build/testcases/xmlrpc-mt-setPostCategories.php | 68 + config.php.sample | 42 + createaccount.html | 16 + createaccount.php | 152 + extra/fancyurls-2/.htaccess | 6 + extra/fancyurls/.htaccess | 21 + extra/fancyurls/archive | 20 + extra/fancyurls/archives | 19 + extra/fancyurls/blog | 19 + extra/fancyurls/category | 19 + extra/fancyurls/fancyurls.config.php | 60 + extra/fancyurls/item | 19 + extra/fancyurls/member | 19 + extra/fancyurls/special | 17 + extra/media/media.htaccess | 5 + extra/media/readme.txt | 10 + extra/skins/readme.txt | 10 + extra/skins/skins.htaccess | 4 + index.php | 13 + install.php | 1358 ++++ install.sql | 279 + install_lang_english.php | 157 + license.txt | 340 + media/.htaccess | 5 + media/readme.txt | 16 + nucleus/bookmarklet.php | 336 + nucleus/convert/PRAX.php | 289 + nucleus/convert/blogger.php | 279 + nucleus/convert/bloggercaif.php | 556 ++ nucleus/convert/functions.inc.php | 1009 +++ nucleus/convert/genericImport.php | 193 + nucleus/convert/greymatter.php | 544 ++ nucleus/convert/index.html | 36 + nucleus/convert/livejournal.php | 353 ++ nucleus/convert/weblog.php | 217 + nucleus/convert/wordpress.php | 258 + nucleus/documentation/devdocs/custominstall.html | 67 + nucleus/documentation/devdocs/index.html | 30 + nucleus/documentation/devdocs/plugins.html | 2512 ++++++++ nucleus/documentation/devdocs/sqltables.html | 1258 ++++ nucleus/documentation/devdocs/styles/manual.css | 141 + nucleus/documentation/devdocs/xmlrpc.html | 181 + nucleus/documentation/help.html | 4570 ++++++++++++++ nucleus/documentation/history.html | 1089 ++++ nucleus/documentation/icon-help.gif | Bin 0 -> 157 bytes nucleus/documentation/icon-up.gif | Bin 0 -> 159 bytes nucleus/documentation/index.html | 422 ++ nucleus/documentation/pics/chmod_menu.png | Bin 0 -> 8134 bytes nucleus/documentation/pics/chmod_window.png | Bin 0 -> 17795 bytes nucleus/documentation/pics/skinsandtemplates.png | Bin 0 -> 15424 bytes nucleus/documentation/skins.html | 539 ++ nucleus/documentation/styles/manual.css | 138 + nucleus/documentation/tips.html | 358 ++ nucleus/forgotpassword.html | 46 + nucleus/forms/additemform.template | 30 + nucleus/forms/commentform-closed.template | 1 + nucleus/forms/commentform-closedtopublic.template | 1 + nucleus/forms/commentform-loggedin.template | 18 + nucleus/forms/commentform-notloggedin.template | 28 + nucleus/forms/loginform-loggedin.template | 4 + nucleus/forms/loginform-notloggedin.template | 18 + nucleus/forms/membermailform-disallowed.template | 1 + nucleus/forms/membermailform-loggedin.template | 15 + nucleus/forms/membermailform-notloggedin.template | 18 + nucleus/forms/nucleusbutton.template | 3 + nucleus/forms/searchform.template | 8 + nucleus/images/button-aligncenter.gif | Bin 0 -> 85 bytes nucleus/images/button-alignleft.gif | Bin 0 -> 68 bytes nucleus/images/button-alignright.gif | Bin 0 -> 67 bytes nucleus/images/button-bold.gif | Bin 0 -> 73 bytes nucleus/images/button-copy.gif | Bin 0 -> 103 bytes nucleus/images/button-cut.gif | Bin 0 -> 89 bytes nucleus/images/button-italic.gif | Bin 0 -> 74 bytes nucleus/images/button-left.gif | Bin 0 -> 91 bytes nucleus/images/button-link.gif | Bin 0 -> 141 bytes nucleus/images/button-media.gif | Bin 0 -> 132 bytes nucleus/images/button-paste.gif | Bin 0 -> 127 bytes nucleus/images/button-preview.gif | Bin 0 -> 90 bytes nucleus/images/button-right.gif | Bin 0 -> 91 bytes nucleus/images/globe.gif | Bin 0 -> 124 bytes nucleus/index.php | 76 + nucleus/javascript/admin.js | 59 + nucleus/javascript/bookmarklet.js | 70 + nucleus/javascript/compatibility.js | 33 + nucleus/javascript/edit.js | 345 + nucleus/javascript/index.html | 11 + nucleus/javascript/numbercheck.js | 36 + nucleus/javascript/opennew.js | 62 + nucleus/javascript/templateEdit.js | 66 + nucleus/javascript/xmlhttprequest.js | 183 + nucleus/language/bg_Cyrl_BG.ISO-8859-5.php | 894 +++ nucleus/language/bg_Cyrl_BG.UTF-8.php | 894 +++ nucleus/language/ca_Latn_ES.ISO-8859-1.php | 956 +++ nucleus/language/ca_Latn_ES.UTF-8.php | 956 +++ nucleus/language/cs_Latn_CZ.UTF-8.php | 825 +++ nucleus/language/cs_Latn_CZ.WINDOWS-1250.php | 825 +++ nucleus/language/de_Latn_DE.ISO-8859-1.php | 1034 +++ nucleus/language/de_Latn_DE.UTF-8.php | 1034 +++ nucleus/language/en_Latn_US.ISO-8859-1.php | 1325 ++++ nucleus/language/en_Latn_US.UTF-8.php | 1325 ++++ nucleus/language/es_Latn_ES.ISO-8859-1.php | 953 +++ nucleus/language/es_Latn_ES.UTF-8.php | 953 +++ nucleus/language/fa_Arab_IR.UTF-8.php | 825 +++ nucleus/language/fi_Latn_FI.ISO-8859-1.php | 957 +++ nucleus/language/fi_Latn_FI.UTF-8.php | 957 +++ nucleus/language/fr_Latn_FR.ISO-8859-15.php | 951 +++ nucleus/language/fr_Latn_FR.UTF-8.php | 951 +++ nucleus/language/gl_Latn_ES.ISO-8859-1.php | 825 +++ nucleus/language/gl_Latn_ES.UTF-8.php | 825 +++ nucleus/language/hu_Latn_HU.ISO-8859-2.php | 944 +++ nucleus/language/hu_Latn_HU.UTF-8.php | 944 +++ nucleus/language/index.html | 11 + nucleus/language/it_Latn_IT.ISO-8859-1.php | 953 +++ nucleus/language/it_Latn_IT.UTF-8.php | 953 +++ nucleus/language/ja_Jpan_JP.EUC-JP.php | 1344 ++++ nucleus/language/ja_Jpan_JP.UTF-8.php | 1344 ++++ nucleus/language/ko_Kore_KR.EUC-KR.php | 914 +++ nucleus/language/ko_Kore_KR.UTF-8.php | 914 +++ nucleus/language/lv_Latn_LV.ISO-8859-13.php | 841 +++ nucleus/language/lv_Latn_LV.UTF-8.php | 841 +++ nucleus/language/nl_Latn_NL.ISO-8859-15.php | 962 +++ nucleus/language/nl_Latn_NL.UTF-8.php | 962 +++ nucleus/language/pt_Latn_BR.ISO-8859-1.php | 822 +++ nucleus/language/pt_Latn_BR.UTF-8.php | 822 +++ nucleus/language/ru_Cyrl_RU.UTF-8.php | 947 +++ nucleus/language/ru_Cyrl_RU.WINDOWS-1251.php | 947 +++ nucleus/language/sk_Latn_SK.ISO-8859-2.php | 825 +++ nucleus/language/sk_Latn_SK.UTF-8.php | 825 +++ nucleus/language/zh_Hans_CN.GB2312.php | 825 +++ nucleus/language/zh_Hans_CN.UTF-8.php | 825 +++ nucleus/language/zh_Hant_TW.BIG5.php | 825 +++ nucleus/language/zh_Hant_TW.UTF-8.php | 825 +++ nucleus/libs/.htaccess | 2 + nucleus/libs/ACTION.php | 550 ++ nucleus/libs/ACTIONLOG.php | 87 + nucleus/libs/ACTIONS.php | 1411 +++++ nucleus/libs/ADMIN.php | 6641 ++++++++++++++++++++ nucleus/libs/BAN.php | 106 + nucleus/libs/BLOG.php | 1418 +++++ nucleus/libs/BODYACTIONS.php | 439 ++ nucleus/libs/BaseActions.php | 329 + nucleus/libs/COMMENT.php | 203 + nucleus/libs/COMMENTACTIONS.php | 706 +++ nucleus/libs/COMMENTS.php | 431 ++ nucleus/libs/ENCAPSULATE.php | 258 + nucleus/libs/ITEM.php | 564 ++ nucleus/libs/ITEMACTIONS.php | 788 +++ nucleus/libs/KARMA.php | 117 + nucleus/libs/Link.php | 254 + nucleus/libs/MANAGER.php | 658 ++ nucleus/libs/MEDIA.php | 296 + nucleus/libs/MEMBER.php | 958 +++ nucleus/libs/NOTIFICATION.php | 66 + nucleus/libs/PAGEFACTORY.php | 584 ++ nucleus/libs/PARSER.php | 173 + nucleus/libs/PLUGIN.php | 898 +++ nucleus/libs/PLUGINADMIN.php | 138 + nucleus/libs/SEARCH.php | 221 + nucleus/libs/SKIN.php | 612 ++ nucleus/libs/TEMPLATE.php | 198 + nucleus/libs/backup.php | 545 ++ nucleus/libs/entity.php | 186 + nucleus/libs/globalfunctions.php | 2460 ++++++++ nucleus/libs/i18n.php | 756 +++ nucleus/libs/include/admin-add.template | 143 + nucleus/libs/include/admin-edit.template | 167 + nucleus/libs/include/bookmarklet-add.template | 172 + nucleus/libs/include/bookmarklet-edit.template | 171 + nucleus/libs/include/index.html | 13 + nucleus/libs/include/readme.txt | 7 + nucleus/libs/index.html | 11 + nucleus/libs/mysql.php | 222 + nucleus/libs/showlist.php | 683 ++ nucleus/libs/skinie.php | 716 +++ nucleus/libs/sql/mysql.php | 405 ++ nucleus/libs/sql/pdo.php | 659 ++ nucleus/libs/vars4.1.0.php | 214 + nucleus/libs/xmlrpc.inc.php | 3642 +++++++++++ nucleus/libs/xmlrpcs.inc.php | 1173 ++++ nucleus/media.php | 436 ++ nucleus/nucleus.gif | Bin 0 -> 1508 bytes nucleus/nucleus2.gif | Bin 0 -> 666 bytes nucleus/plugins/NP_Ping.php | 384 ++ nucleus/plugins/NP_SecurityEnforcer.php | 261 + nucleus/plugins/NP_SkinFiles.php | 103 + nucleus/plugins/NP_Text.php | 132 + nucleus/plugins/index.html | 11 + nucleus/plugins/ping/english.php | 19 + nucleus/plugins/ping/ping.php | 16 + nucleus/plugins/securityenforcer/english.php | 45 + nucleus/plugins/securityenforcer/index.php | 84 + nucleus/plugins/securityenforcer/japanese-euc.php | 45 + nucleus/plugins/securityenforcer/japanese-utf8.php | 45 + nucleus/plugins/skinfiles/dir.gif | Bin 0 -> 1019 bytes nucleus/plugins/skinfiles/english.php | 178 + nucleus/plugins/skinfiles/generic.gif | Bin 0 -> 598 bytes nucleus/plugins/skinfiles/home.gif | Bin 0 -> 1017 bytes nucleus/plugins/skinfiles/html.gif | Bin 0 -> 626 bytes nucleus/plugins/skinfiles/image.gif | Bin 0 -> 596 bytes nucleus/plugins/skinfiles/index.php | 1516 +++++ nucleus/plugins/skinfiles/japanese-euc.php | 178 + nucleus/plugins/skinfiles/japanese-utf8.php | 178 + nucleus/plugins/skinfiles/php.gif | Bin 0 -> 612 bytes nucleus/plugins/skinfiles/text.gif | Bin 0 -> 605 bytes nucleus/styles/addedit.css | 39 + nucleus/styles/admin_contemporary.css | 327 + nucleus/styles/admin_original.css | 318 + nucleus/styles/bookmarklet.css | 151 + nucleus/styles/contemporary/background.png | Bin 0 -> 310 bytes nucleus/styles/logo.gif | Bin 0 -> 4541 bytes nucleus/styles/manual.css | 151 + nucleus/styles/popups.css | 102 + nucleus/styles/quickb-hover.jpg | Bin 0 -> 493 bytes nucleus/styles/quickb.jpg | Bin 0 -> 325 bytes nucleus/upgrades/index.html | 27 + nucleus/upgrades/index.php | 270 + nucleus/upgrades/upgrade.functions.php | 480 ++ nucleus/upgrades/upgrade.php | 90 + nucleus/upgrades/upgrade0.95.php | 33 + nucleus/upgrades/upgrade0.96.php | 109 + nucleus/upgrades/upgrade1.0.php | 67 + nucleus/upgrades/upgrade1.1.php | 127 + nucleus/upgrades/upgrade1.5.php | 124 + nucleus/upgrades/upgrade2.0.php | 102 + nucleus/upgrades/upgrade2.5.php | 141 + nucleus/upgrades/upgrade3.0.php | 29 + nucleus/upgrades/upgrade3.1.php | 29 + nucleus/upgrades/upgrade3.2.php | 60 + nucleus/upgrades/upgrade3.3.php | 70 + nucleus/upgrades/upgrade3.4.php | 64 + nucleus/upgrades/upgrade3.5.php | 50 + nucleus/upgrades/upgrade3.6.php | 42 + nucleus/xmlrpc/api_blogger.inc.php | 452 ++ nucleus/xmlrpc/api_metaweblog.inc.php | 530 ++ nucleus/xmlrpc/api_mt.inc.php | 423 ++ nucleus/xmlrpc/api_nucleus.inc.php | 340 + nucleus/xmlrpc/index.html | 11 + nucleus/xmlrpc/server.php | 326 + readme.html | 18 + robots.txt | 2 + rsd.php | 8 + skins/.htaccess | 4 + skins/atom/skinbackup.xml | 59 + skins/default/default_left.css | 492 ++ skins/default/default_right.css | 492 ++ skins/default/favicon.ico | Bin 0 -> 1127 bytes skins/default/footer.inc | 17 + skins/default/head.inc | 38 + skins/default/header.inc | 20 + skins/default/images/arrow.gif | Bin 0 -> 55 bytes skins/default/images/bg.gif | Bin 0 -> 50 bytes skins/default/images/bgcategory.gif | Bin 0 -> 178 bytes skins/default/images/bgcomment.gif | Bin 0 -> 69 bytes skins/default/images/bgcontainer01.gif | Bin 0 -> 91 bytes skins/default/images/bgcontainer02.gif | Bin 0 -> 91 bytes skins/default/images/bgedit.gif | Bin 0 -> 67 bytes skins/default/images/bgpostedby.gif | Bin 0 -> 122 bytes skins/default/images/commentquote01.gif | Bin 0 -> 317 bytes skins/default/images/commentquote02.gif | Bin 0 -> 317 bytes skins/default/images/corner_br.gif | Bin 0 -> 100 bytes skins/default/images/corner_tr.gif | Bin 0 -> 99 bytes skins/default/images/dot.gif | Bin 0 -> 49 bytes skins/default/images/dotv.gif | Bin 0 -> 49 bytes skins/default/images/header.jpg | Bin 0 -> 8500 bytes skins/default/images/header_sm.jpg | Bin 0 -> 470 bytes skins/default/images/nucleus.gif | Bin 0 -> 1508 bytes skins/default/images/shadow.gif | Bin 0 -> 1651 bytes skins/default/images/sidetitlebg.gif | Bin 0 -> 51 bytes skins/default/navigation.inc | 56 + skins/default/nicetitle.css | 31 + skins/default/nicetitle.js | 448 ++ skins/default/preview-large.png | Bin 0 -> 46334 bytes skins/default/preview.png | Bin 0 -> 7788 bytes skins/default/readme.html | 53 + skins/default/show_benchmark.inc | 14 + skins/default/sidebar.inc | 120 + skins/default/skinbackup.xml | 377 ++ skins/grey/atom3.gif | Bin 0 -> 5621 bytes skins/grey/favicon.ico | Bin 0 -> 1127 bytes skins/grey/grey.css | 237 + skins/grey/nucleus.gif | Bin 0 -> 1508 bytes skins/grey/nucleus2.png | Bin 0 -> 1337 bytes skins/grey/nucleus3.png | Bin 0 -> 1522 bytes skins/grey/pagefoot.inc | 45 + skins/grey/pagehead.inc | 36 + skins/grey/preview-large.png | Bin 0 -> 23205 bytes skins/grey/preview.png | Bin 0 -> 2463 bytes skins/grey/readme.html | 12 + skins/grey/skinbackup.xml | 697 ++ skins/readme.txt | 8 + skins/rsd/skinbackup.xml | 30 + skins/rss2.0/skinbackup.xml | 60 + xml-rss2.php | 71 + 322 files changed, 103293 insertions(+) create mode 100644 action.php create mode 100644 atom.php create mode 100644 benchmark.inc create mode 100644 build/build.xml create mode 100644 build/config.php create mode 100644 build/testcases/NP_Bug1058978_Testcase1.php create mode 100644 build/testcases/NP_HelpPageTestCase1.php create mode 100644 build/testcases/NP_ImageCreateThumbnail.php create mode 100644 build/testcases/NP_ImageLimitSize.php create mode 100644 build/testcases/NP_ItemOptionTestCase.php create mode 100644 build/testcases/NP_ItemOptionTestCase2.php create mode 100644 build/testcases/NP_ItemOptionTestCase3.php create mode 100644 build/testcases/NP_ItemOptionTestCase4.php create mode 100644 build/testcases/NP_OptionMeta_TestCase1.php create mode 100644 build/testcases/NP_OptionTest.php create mode 100644 build/testcases/NP_PrePluginOptionsUpdate_TestCase1.php create mode 100644 build/testcases/helppagetestcase1/help.php create mode 100644 build/testcases/plugindeptestcases/NP_DepA.php create mode 100644 build/testcases/plugindeptestcases/NP_DepB.php create mode 100644 build/testcases/plugindeptestcases/NP_DepC.php create mode 100644 build/testcases/plugindeptestcases/testcases.txt create mode 100644 build/testcases/urllinking.txt create mode 100644 build/testcases/xmlrpc-metaWeblog-editPost.php create mode 100644 build/testcases/xmlrpc-metaWeblog-getRecentPosts.php create mode 100644 build/testcases/xmlrpc-metaWeblog-newMediaObject.php create mode 100644 build/testcases/xmlrpc-metaWeblog-newPost.php create mode 100644 build/testcases/xmlrpc-mt-getPostCategories.php create mode 100644 build/testcases/xmlrpc-mt-getRecentPostTitles.php create mode 100644 build/testcases/xmlrpc-mt-getTrackbackPings.php create mode 100644 build/testcases/xmlrpc-mt-setPostCategories.php create mode 100644 config.php.sample create mode 100644 createaccount.html create mode 100644 createaccount.php create mode 100644 extra/fancyurls-2/.htaccess create mode 100644 extra/fancyurls/.htaccess create mode 100644 extra/fancyurls/archive create mode 100644 extra/fancyurls/archives create mode 100644 extra/fancyurls/blog create mode 100644 extra/fancyurls/category create mode 100644 extra/fancyurls/fancyurls.config.php create mode 100644 extra/fancyurls/item create mode 100644 extra/fancyurls/member create mode 100644 extra/fancyurls/special create mode 100644 extra/media/media.htaccess create mode 100644 extra/media/readme.txt create mode 100644 extra/skins/readme.txt create mode 100644 extra/skins/skins.htaccess create mode 100644 index.php create mode 100644 install.php create mode 100644 install.sql create mode 100644 install_lang_english.php create mode 100644 license.txt create mode 100644 media/.htaccess create mode 100644 media/readme.txt create mode 100644 nucleus/bookmarklet.php create mode 100644 nucleus/convert/PRAX.php create mode 100644 nucleus/convert/blogger.php create mode 100644 nucleus/convert/bloggercaif.php create mode 100644 nucleus/convert/functions.inc.php create mode 100644 nucleus/convert/genericImport.php create mode 100644 nucleus/convert/greymatter.php create mode 100644 nucleus/convert/index.html create mode 100644 nucleus/convert/livejournal.php create mode 100644 nucleus/convert/weblog.php create mode 100644 nucleus/convert/wordpress.php create mode 100644 nucleus/documentation/devdocs/custominstall.html create mode 100644 nucleus/documentation/devdocs/index.html create mode 100644 nucleus/documentation/devdocs/plugins.html create mode 100644 nucleus/documentation/devdocs/sqltables.html create mode 100644 nucleus/documentation/devdocs/styles/manual.css create mode 100644 nucleus/documentation/devdocs/xmlrpc.html create mode 100644 nucleus/documentation/help.html create mode 100644 nucleus/documentation/history.html create mode 100644 nucleus/documentation/icon-help.gif create mode 100644 nucleus/documentation/icon-up.gif create mode 100644 nucleus/documentation/index.html create mode 100644 nucleus/documentation/pics/chmod_menu.png create mode 100644 nucleus/documentation/pics/chmod_window.png create mode 100644 nucleus/documentation/pics/skinsandtemplates.png create mode 100644 nucleus/documentation/skins.html create mode 100644 nucleus/documentation/styles/manual.css create mode 100644 nucleus/documentation/tips.html create mode 100644 nucleus/forgotpassword.html create mode 100644 nucleus/forms/additemform.template create mode 100644 nucleus/forms/commentform-closed.template create mode 100644 nucleus/forms/commentform-closedtopublic.template create mode 100644 nucleus/forms/commentform-loggedin.template create mode 100644 nucleus/forms/commentform-notloggedin.template create mode 100644 nucleus/forms/loginform-loggedin.template create mode 100644 nucleus/forms/loginform-notloggedin.template create mode 100644 nucleus/forms/membermailform-disallowed.template create mode 100644 nucleus/forms/membermailform-loggedin.template create mode 100644 nucleus/forms/membermailform-notloggedin.template create mode 100644 nucleus/forms/nucleusbutton.template create mode 100644 nucleus/forms/searchform.template create mode 100644 nucleus/images/button-aligncenter.gif create mode 100644 nucleus/images/button-alignleft.gif create mode 100644 nucleus/images/button-alignright.gif create mode 100644 nucleus/images/button-bold.gif create mode 100644 nucleus/images/button-copy.gif create mode 100644 nucleus/images/button-cut.gif create mode 100644 nucleus/images/button-italic.gif create mode 100644 nucleus/images/button-left.gif create mode 100644 nucleus/images/button-link.gif create mode 100644 nucleus/images/button-media.gif create mode 100644 nucleus/images/button-paste.gif create mode 100644 nucleus/images/button-preview.gif create mode 100644 nucleus/images/button-right.gif create mode 100644 nucleus/images/globe.gif create mode 100644 nucleus/index.php create mode 100644 nucleus/javascript/admin.js create mode 100644 nucleus/javascript/bookmarklet.js create mode 100644 nucleus/javascript/compatibility.js create mode 100644 nucleus/javascript/edit.js create mode 100644 nucleus/javascript/index.html create mode 100644 nucleus/javascript/numbercheck.js create mode 100644 nucleus/javascript/opennew.js create mode 100644 nucleus/javascript/templateEdit.js create mode 100644 nucleus/javascript/xmlhttprequest.js create mode 100644 nucleus/language/bg_Cyrl_BG.ISO-8859-5.php create mode 100644 nucleus/language/bg_Cyrl_BG.UTF-8.php create mode 100644 nucleus/language/ca_Latn_ES.ISO-8859-1.php create mode 100644 nucleus/language/ca_Latn_ES.UTF-8.php create mode 100644 nucleus/language/cs_Latn_CZ.UTF-8.php create mode 100644 nucleus/language/cs_Latn_CZ.WINDOWS-1250.php create mode 100644 nucleus/language/de_Latn_DE.ISO-8859-1.php create mode 100644 nucleus/language/de_Latn_DE.UTF-8.php create mode 100644 nucleus/language/en_Latn_US.ISO-8859-1.php create mode 100644 nucleus/language/en_Latn_US.UTF-8.php create mode 100644 nucleus/language/es_Latn_ES.ISO-8859-1.php create mode 100644 nucleus/language/es_Latn_ES.UTF-8.php create mode 100644 nucleus/language/fa_Arab_IR.UTF-8.php create mode 100644 nucleus/language/fi_Latn_FI.ISO-8859-1.php create mode 100644 nucleus/language/fi_Latn_FI.UTF-8.php create mode 100644 nucleus/language/fr_Latn_FR.ISO-8859-15.php create mode 100644 nucleus/language/fr_Latn_FR.UTF-8.php create mode 100644 nucleus/language/gl_Latn_ES.ISO-8859-1.php create mode 100644 nucleus/language/gl_Latn_ES.UTF-8.php create mode 100644 nucleus/language/hu_Latn_HU.ISO-8859-2.php create mode 100644 nucleus/language/hu_Latn_HU.UTF-8.php create mode 100644 nucleus/language/index.html create mode 100644 nucleus/language/it_Latn_IT.ISO-8859-1.php create mode 100644 nucleus/language/it_Latn_IT.UTF-8.php create mode 100644 nucleus/language/ja_Jpan_JP.EUC-JP.php create mode 100644 nucleus/language/ja_Jpan_JP.UTF-8.php create mode 100644 nucleus/language/ko_Kore_KR.EUC-KR.php create mode 100644 nucleus/language/ko_Kore_KR.UTF-8.php create mode 100644 nucleus/language/lv_Latn_LV.ISO-8859-13.php create mode 100644 nucleus/language/lv_Latn_LV.UTF-8.php create mode 100644 nucleus/language/nl_Latn_NL.ISO-8859-15.php create mode 100644 nucleus/language/nl_Latn_NL.UTF-8.php create mode 100644 nucleus/language/pt_Latn_BR.ISO-8859-1.php create mode 100644 nucleus/language/pt_Latn_BR.UTF-8.php create mode 100644 nucleus/language/ru_Cyrl_RU.UTF-8.php create mode 100644 nucleus/language/ru_Cyrl_RU.WINDOWS-1251.php create mode 100644 nucleus/language/sk_Latn_SK.ISO-8859-2.php create mode 100644 nucleus/language/sk_Latn_SK.UTF-8.php create mode 100644 nucleus/language/zh_Hans_CN.GB2312.php create mode 100644 nucleus/language/zh_Hans_CN.UTF-8.php create mode 100644 nucleus/language/zh_Hant_TW.BIG5.php create mode 100644 nucleus/language/zh_Hant_TW.UTF-8.php create mode 100644 nucleus/libs/.htaccess create mode 100644 nucleus/libs/ACTION.php create mode 100644 nucleus/libs/ACTIONLOG.php create mode 100644 nucleus/libs/ACTIONS.php create mode 100644 nucleus/libs/ADMIN.php create mode 100644 nucleus/libs/BAN.php create mode 100644 nucleus/libs/BLOG.php create mode 100644 nucleus/libs/BODYACTIONS.php create mode 100644 nucleus/libs/BaseActions.php create mode 100644 nucleus/libs/COMMENT.php create mode 100644 nucleus/libs/COMMENTACTIONS.php create mode 100644 nucleus/libs/COMMENTS.php create mode 100644 nucleus/libs/ENCAPSULATE.php create mode 100644 nucleus/libs/ITEM.php create mode 100644 nucleus/libs/ITEMACTIONS.php create mode 100644 nucleus/libs/KARMA.php create mode 100644 nucleus/libs/Link.php create mode 100644 nucleus/libs/MANAGER.php create mode 100644 nucleus/libs/MEDIA.php create mode 100644 nucleus/libs/MEMBER.php create mode 100644 nucleus/libs/NOTIFICATION.php create mode 100644 nucleus/libs/PAGEFACTORY.php create mode 100644 nucleus/libs/PARSER.php create mode 100644 nucleus/libs/PLUGIN.php create mode 100644 nucleus/libs/PLUGINADMIN.php create mode 100644 nucleus/libs/SEARCH.php create mode 100644 nucleus/libs/SKIN.php create mode 100644 nucleus/libs/TEMPLATE.php create mode 100644 nucleus/libs/backup.php create mode 100644 nucleus/libs/entity.php create mode 100644 nucleus/libs/globalfunctions.php create mode 100644 nucleus/libs/i18n.php create mode 100644 nucleus/libs/include/admin-add.template create mode 100644 nucleus/libs/include/admin-edit.template create mode 100644 nucleus/libs/include/bookmarklet-add.template create mode 100644 nucleus/libs/include/bookmarklet-edit.template create mode 100644 nucleus/libs/include/index.html create mode 100644 nucleus/libs/include/readme.txt create mode 100644 nucleus/libs/index.html create mode 100644 nucleus/libs/mysql.php create mode 100644 nucleus/libs/showlist.php create mode 100644 nucleus/libs/skinie.php create mode 100644 nucleus/libs/sql/mysql.php create mode 100644 nucleus/libs/sql/pdo.php create mode 100644 nucleus/libs/vars4.1.0.php create mode 100644 nucleus/libs/xmlrpc.inc.php create mode 100644 nucleus/libs/xmlrpcs.inc.php create mode 100644 nucleus/media.php create mode 100644 nucleus/nucleus.gif create mode 100644 nucleus/nucleus2.gif create mode 100644 nucleus/plugins/NP_Ping.php create mode 100644 nucleus/plugins/NP_SecurityEnforcer.php create mode 100644 nucleus/plugins/NP_SkinFiles.php create mode 100644 nucleus/plugins/NP_Text.php create mode 100644 nucleus/plugins/index.html create mode 100644 nucleus/plugins/ping/english.php create mode 100644 nucleus/plugins/ping/ping.php create mode 100644 nucleus/plugins/securityenforcer/english.php create mode 100644 nucleus/plugins/securityenforcer/index.php create mode 100644 nucleus/plugins/securityenforcer/japanese-euc.php create mode 100644 nucleus/plugins/securityenforcer/japanese-utf8.php create mode 100644 nucleus/plugins/skinfiles/dir.gif create mode 100644 nucleus/plugins/skinfiles/english.php create mode 100644 nucleus/plugins/skinfiles/generic.gif create mode 100644 nucleus/plugins/skinfiles/home.gif create mode 100644 nucleus/plugins/skinfiles/html.gif create mode 100644 nucleus/plugins/skinfiles/image.gif create mode 100644 nucleus/plugins/skinfiles/index.php create mode 100644 nucleus/plugins/skinfiles/japanese-euc.php create mode 100644 nucleus/plugins/skinfiles/japanese-utf8.php create mode 100644 nucleus/plugins/skinfiles/php.gif create mode 100644 nucleus/plugins/skinfiles/text.gif create mode 100644 nucleus/styles/addedit.css create mode 100644 nucleus/styles/admin_contemporary.css create mode 100644 nucleus/styles/admin_original.css create mode 100644 nucleus/styles/bookmarklet.css create mode 100644 nucleus/styles/contemporary/background.png create mode 100644 nucleus/styles/logo.gif create mode 100644 nucleus/styles/manual.css create mode 100644 nucleus/styles/popups.css create mode 100644 nucleus/styles/quickb-hover.jpg create mode 100644 nucleus/styles/quickb.jpg create mode 100644 nucleus/upgrades/index.html create mode 100644 nucleus/upgrades/index.php create mode 100644 nucleus/upgrades/upgrade.functions.php create mode 100644 nucleus/upgrades/upgrade.php create mode 100644 nucleus/upgrades/upgrade0.95.php create mode 100644 nucleus/upgrades/upgrade0.96.php create mode 100644 nucleus/upgrades/upgrade1.0.php create mode 100644 nucleus/upgrades/upgrade1.1.php create mode 100644 nucleus/upgrades/upgrade1.5.php create mode 100644 nucleus/upgrades/upgrade2.0.php create mode 100644 nucleus/upgrades/upgrade2.5.php create mode 100644 nucleus/upgrades/upgrade3.0.php create mode 100644 nucleus/upgrades/upgrade3.1.php create mode 100644 nucleus/upgrades/upgrade3.2.php create mode 100644 nucleus/upgrades/upgrade3.3.php create mode 100644 nucleus/upgrades/upgrade3.4.php create mode 100644 nucleus/upgrades/upgrade3.5.php create mode 100644 nucleus/upgrades/upgrade3.6.php create mode 100644 nucleus/xmlrpc/api_blogger.inc.php create mode 100644 nucleus/xmlrpc/api_metaweblog.inc.php create mode 100644 nucleus/xmlrpc/api_mt.inc.php create mode 100644 nucleus/xmlrpc/api_nucleus.inc.php create mode 100644 nucleus/xmlrpc/index.html create mode 100644 nucleus/xmlrpc/server.php create mode 100644 readme.html create mode 100644 robots.txt create mode 100644 rsd.php create mode 100644 skins/.htaccess create mode 100644 skins/atom/skinbackup.xml create mode 100644 skins/default/default_left.css create mode 100644 skins/default/default_right.css create mode 100644 skins/default/favicon.ico create mode 100644 skins/default/footer.inc create mode 100644 skins/default/head.inc create mode 100644 skins/default/header.inc create mode 100644 skins/default/images/arrow.gif create mode 100644 skins/default/images/bg.gif create mode 100644 skins/default/images/bgcategory.gif create mode 100644 skins/default/images/bgcomment.gif create mode 100644 skins/default/images/bgcontainer01.gif create mode 100644 skins/default/images/bgcontainer02.gif create mode 100644 skins/default/images/bgedit.gif create mode 100644 skins/default/images/bgpostedby.gif create mode 100644 skins/default/images/commentquote01.gif create mode 100644 skins/default/images/commentquote02.gif create mode 100644 skins/default/images/corner_br.gif create mode 100644 skins/default/images/corner_tr.gif create mode 100644 skins/default/images/dot.gif create mode 100644 skins/default/images/dotv.gif create mode 100644 skins/default/images/header.jpg create mode 100644 skins/default/images/header_sm.jpg create mode 100644 skins/default/images/nucleus.gif create mode 100644 skins/default/images/shadow.gif create mode 100644 skins/default/images/sidetitlebg.gif create mode 100644 skins/default/navigation.inc create mode 100644 skins/default/nicetitle.css create mode 100644 skins/default/nicetitle.js create mode 100644 skins/default/preview-large.png create mode 100644 skins/default/preview.png create mode 100644 skins/default/readme.html create mode 100644 skins/default/show_benchmark.inc create mode 100644 skins/default/sidebar.inc create mode 100644 skins/default/skinbackup.xml create mode 100644 skins/grey/atom3.gif create mode 100644 skins/grey/favicon.ico create mode 100644 skins/grey/grey.css create mode 100644 skins/grey/nucleus.gif create mode 100644 skins/grey/nucleus2.png create mode 100644 skins/grey/nucleus3.png create mode 100644 skins/grey/pagefoot.inc create mode 100644 skins/grey/pagehead.inc create mode 100644 skins/grey/preview-large.png create mode 100644 skins/grey/preview.png create mode 100644 skins/grey/readme.html create mode 100644 skins/grey/skinbackup.xml create mode 100644 skins/readme.txt create mode 100644 skins/rsd/skinbackup.xml create mode 100644 skins/rss2.0/skinbackup.xml create mode 100644 xml-rss2.php diff --git a/action.php b/action.php new file mode 100644 index 0000000..42f6d1c --- /dev/null +++ b/action.php @@ -0,0 +1,36 @@ +doAction($action); + +if ($errorInfo) { + doError($errorInfo['message'], new SKIN($errorInfo['skinid']) ); +} + +?> \ No newline at end of file diff --git a/atom.php b/atom.php new file mode 100644 index 0000000..0c8c5a9 --- /dev/null +++ b/atom.php @@ -0,0 +1,51 @@ + \ No newline at end of file diff --git a/benchmark.inc b/benchmark.inc new file mode 100644 index 0000000..99fe504 --- /dev/null +++ b/benchmark.inc @@ -0,0 +1,15 @@ + diff --git a/build/build.xml b/build/build.xml new file mode 100644 index 0000000..7dd000f --- /dev/null +++ b/build/build.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/config.php b/build/config.php new file mode 100644 index 0000000..89ec362 --- /dev/null +++ b/build/config.php @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/build/testcases/NP_Bug1058978_Testcase1.php b/build/testcases/NP_Bug1058978_Testcase1.php new file mode 100644 index 0000000..a0f108b --- /dev/null +++ b/build/testcases/NP_Bug1058978_Testcase1.php @@ -0,0 +1,75 @@ + diff --git a/build/testcases/NP_HelpPageTestCase1.php b/build/testcases/NP_HelpPageTestCase1.php new file mode 100644 index 0000000..0e5ffbe --- /dev/null +++ b/build/testcases/NP_HelpPageTestCase1.php @@ -0,0 +1,42 @@ + diff --git a/build/testcases/NP_ImageCreateThumbnail.php b/build/testcases/NP_ImageCreateThumbnail.php new file mode 100644 index 0000000..e7cf179 --- /dev/null +++ b/build/testcases/NP_ImageCreateThumbnail.php @@ -0,0 +1,135 @@ +createOption ('thumbsize', 'Maximal width (landscape format) or height (portrait format) for Thumbnails', 'text', '150'); + } + + function unInstall() { + } + + function getEventList() { + return array('PostMediaUpload'); + } + + + function event_PostMediaUpload(&$data) { + + $collection = $data['collection']; + $mediadir = $data['mediadir']; + $filename = $data['filename']; + $fullpath = $mediadir.$filename; + + // evaluate the filetype from the filename + $filetype = strtolower(substr($filename, strpos($filename, ".")+1)); + + // filetype is jpeg + if ($filetype=='jpg' || $filetype=='jpeg') { + + $size = getimagesize($fullpath); + + $ratio = $size[1]/$size[0]; // ratio = height / width + + if ($ratio < 1) { + $new_height = $this->getOption('thumbsize') * $size[1]/$size[0]; + $new_width = $this->getOption('thumbsize'); + } + else { + $new_height = $this->getOption('thumbsize'); + $new_width = $this->getOption('thumbsize') * $size[0]/$size[1]; + } + + $image_orig = imagecreatefromjpeg($fullpath); + $image_new = imagecreatetruecolor($new_width, $new_height); + + imagecopyresampled($image_new, $image_orig, 0, 0, 0, 0, $new_width, $new_height, $size[0], $size[1]); + + $thumbfilename = substr($fullpath, 0, strpos($fullpath, ".")).'_thumb.'.$filetype; + + imagejpeg ($image_new , $thumbfilename); + + // clear the memory + imagedestroy($image_orig); + imagedestroy($image_new); + } + + // filetype is png + if ($filetype=='png') { + + $size = getimagesize($fullpath); + + $ratio = $size[1]/$size[0]; // ratio = height / width + + if ($ratio < 1) { + $new_height = $this->getOption('thumbsize') * $size[1]/$size[0]; + $new_width = $this->getOption('thumbsize'); + } + else { + $new_height = $this->getOption('thumbsize'); + $new_width = $this->getOption('thumbsize') * $size[0]/$size[1]; + } + + $image_orig = imagecreatefrompng($fullpath); + $image_new = imagecreatetruecolor($new_width, $new_height); + + imagecopyresampled($image_new, $image_orig, 0, 0, 0, 0, $new_width, $new_height, $size[0], $size[1]); + + $thumbfilename = substr($fullpath, 0, strpos($fullpath, ".")).'_thumb.'.$filetype; + + imagepng ($image_new , $thumbfilename); + + // clear the memory + imagedestroy($image_orig); + imagedestroy($image_new); + } + } +} + +?> diff --git a/build/testcases/NP_ImageLimitSize.php b/build/testcases/NP_ImageLimitSize.php new file mode 100644 index 0000000..44793c6 --- /dev/null +++ b/build/testcases/NP_ImageLimitSize.php @@ -0,0 +1,97 @@ +createOption('maxwidth', 'Maximal width for images', 'text', '450'); + } + + function unInstall() { + } + + function getEventList() { + return array('PreMediaUpload'); + } + + function event_PreMediaUpload(&$data) { + + $collection = $data['collection']; + $uploadfile = $data['uploadfile']; + $filename = $data['filename']; + + // evaluate the filetype from the filename + $filetype = strtolower(substr($filename, strpos($filename, ".")+1)); + + // filetype is jpeg + if ($filetype=='jpg' || $filetype=='jpeg') { + + $size=getimagesize($data['uploadfile']); + + // size[0] is the image width + if ($size[0]>$this->getOption('maxwidth')) { + + $newheight = $this->getOption('maxwidth') * $size[1]/$size[0]; + $image_orig = imagecreatefromjpeg($uploadfile); + $image_new = imagecreatetruecolor($this->getOption('maxwidth'), $newheight); + + imagecopyresampled($image_new, $image_orig, 0, 0, 0, 0, $this->getOption('maxwidth'), $newheight, $size[0], $size[1]); + + imagejpeg ($image_new , $uploadfile); + + // clear the memory + imagedestroy($image_orig); + imagedestroy($image_new); + + } + } + + // filetype is png + if ($filetype=='png') { + + $size=getimagesize($data['uploadfile']); + + // size[0] is the image width + if ($size[0]>$this->getOption('maxwidth')) { + + $newheight = $this->getOption('maxwidth') * $size[1]/$size[0]; + $image_orig = imagecreatefrompng($uploadfile); + $image_new = imagecreatetruecolor($this->getOption('maxwidth'), $newheight); + + imagecopyresampled($image_new, $image_orig, 0, 0, 0, 0, $this->getOption('maxwidth'), $newheight, $size[0], $size[1]); + + imagepng ( $image_new , $uploadfile); + + // clear the memory + imagedestroy($image_orig); + imagedestroy($image_new); + + } + } + } +} + +?> diff --git a/build/testcases/NP_ItemOptionTestCase.php b/build/testcases/NP_ItemOptionTestCase.php new file mode 100644 index 0000000..32d8608 --- /dev/null +++ b/build/testcases/NP_ItemOptionTestCase.php @@ -0,0 +1,76 @@ +createItemOption('TestValue', 'TestOption', 'text', '0', 'datatype=numerical'); + $this->createItemOption('TestSelect', 'TestSelect', 'select', 'val1', 'de eerste optie|val1|de tweede optie|val2|de derde optie|val3'); + } + + +// --------- do...-Functions ------------------------------ + function doSkinVar($skinType, $counterType = 'visits', $counterMode = 'textual', $counterUpdate = 'count') { + //currently we do nothing :-) + } + +} +?> \ No newline at end of file diff --git a/build/testcases/NP_ItemOptionTestCase2.php b/build/testcases/NP_ItemOptionTestCase2.php new file mode 100644 index 0000000..b64a699 --- /dev/null +++ b/build/testcases/NP_ItemOptionTestCase2.php @@ -0,0 +1,76 @@ +createItemOption('TestCase', 'TestCaseOption', 'text', 'testing'); + } + + +// --------- do...-Functions ------------------------------ + function doTemplateVar(&$item) { + //currently we do nothing :-) + echo $this->getItemOption($item->itemid, 'TestCase'); + } + +} +?> \ No newline at end of file diff --git a/build/testcases/NP_ItemOptionTestCase3.php b/build/testcases/NP_ItemOptionTestCase3.php new file mode 100644 index 0000000..54125db --- /dev/null +++ b/build/testcases/NP_ItemOptionTestCase3.php @@ -0,0 +1,104 @@ +createItemOption('TestCase3', 'TestCaseOption:TextArea', 'textarea', 'This is the default value for my textareatest'); + } + + function event_PrePluginOptionsEdit($data){ + echo 'event: PrePluginOptionsEdit
'; + echo '$data: '.$data.'
'; + echo 'context: '.$data['context'].'
'; + echo 'contextid: '.$data['contextid'].'
'; + for ($i = 0; $i < count($data['options']); $i++) { + echo 'option-name: '.$data['options'][$i]['name'].' value: '.$data['options'][$i]['value'].'
'; + } + } + + function event_PostPluginOptionsUpdate($data){ + echo 'event: PostPluginOptionsEdit'; + echo '$data: '.$data.' | context: '.$data['context'].'
'; + echo 'itemid: '.$data['itemid'].'
'; + echo 'item title: '.$data['item']['title'].'
'; + } + +// --------- do...-Functions ------------------------------ + function doTemplateVar(&$item) { + //currently we do nothing :-) + echo $this->getItemOption($item->itemid, 'TestCase3'); + } + + function doSkinVar($skinType) { + global $blog; + $mostTest = $this->getItemOptionTop('TestCase3', 15, 'asc'); + for($i=0; $i < count($mostTest); $i++) { + echo '
item: '.$mostTest[$i]['id'].': '.$mostTest[$i]['value']; + } + } + +} +?> diff --git a/build/testcases/NP_ItemOptionTestCase4.php b/build/testcases/NP_ItemOptionTestCase4.php new file mode 100644 index 0000000..9096759 --- /dev/null +++ b/build/testcases/NP_ItemOptionTestCase4.php @@ -0,0 +1,83 @@ +createItemOption('TestCase4', 'TestCaseOption:select(numerical)', 'select', '0', '0|0|1|1|2|2|test|test;datatype=numerical'); + } + +// --------- do...-Functions ------------------------------ + function doTemplateVar(&$item) { + //currently we do nothing :-) + echo $this->getItemOption($item->itemid, 'TestCase4'); + } + + function doSkinVar($skinType) { + global $blog; + $mostTest = $this->getItemOptionTop('TestCase4', 15, 'asc'); + for($i=0; $i < count($mostTest); $i++) { + echo '
item: '.$mostTest[$i]['id'].': '.$mostTest[$i]['value']; + } + } + +} +?> diff --git a/build/testcases/NP_OptionMeta_TestCase1.php b/build/testcases/NP_OptionMeta_TestCase1.php new file mode 100644 index 0000000..0ee56d7 --- /dev/null +++ b/build/testcases/NP_OptionMeta_TestCase1.php @@ -0,0 +1,94 @@ +createOption('NumericTextOption1', 'Numeric text option', 'text', '', 'datatype=numerical'); + $this->createOption('ReadonlyTextOption1', 'Readonly text option', 'text', '', 'access=readonly'); + $this->createOption('ReadonlyNumericalTextOption1', 'Readonly, Numerical text option', 'text', '', 'access=readonly;datatype=numerical'); + $this->createOption('ReadonlyTextAreaOption1', 'Readonly textarea option', 'textarea', 'This textarea is readonly (at least it should be :-p)', 'access=readonly'); + $this->createOption('HiddenTextOption1', 'Hidden text option', 'text', 'hidden...', 'access=hidden'); + // itemoptoins + $this->createItemOption('NumericTextOption1', 'Numeric text option', 'text', '', 'datatype=numerical'); + $this->createItemOption('ReadonlyTextOption1', 'Readonly text option', 'text', '', 'access=readonly'); + $this->createItemOption('ReadonlyNumericalTextOption1', 'Readonly, Numerical text option', 'text', '', 'access=readonly;datatype=numerical'); + $this->createItemOption('ReadonlyTextAreaOption1', 'Readonly textarea option', 'textarea', 'This textarea is readonly (at least it should be :-p)', 'access=readonly'); + } +// }}} + +// -- events ------------------------------------ {{{ + function event_PrePluginOptionsUpdate(&$data) + { + /* + * this way of saving the date into the readonly option doesn't work anymore + * since readonly options aren't saved anymore automatically and thus this event is + * not triggered for a readonly option + */ + if (($this->getID() == $data['plugid']) && ($data['optionname'] == 'ReadonlyTextOption1')) { + $data['value'] = date('Y-m-d H:i:s'); + } + /* + * but we can do it by using it while this event is triggered for a non-readonly + * option (there are better events that are better suited for this task) + */ + if (($this->getID() == $data['plugid']) && ($data['optionname'] == 'NumericTextOption1')) { + $this->setOption('HiddenTextOption1', date('Y-m-d H:i:s')); + $this->setOption('ReadonlyTextOption1', date('Y-m-d H:i:s')); + } + } +// }}} +/* +jedit edit rules | http://jedit.org: powerful, open-source (gpl) texteditor +:mode=php:tabSize=4:indentSize=4:noTabs=false:encoding=UTF-8: +:folding=explicit:collapseFolds=1:wrap=none:maxLineLen=85: +*/ +} +?> diff --git a/build/testcases/NP_OptionTest.php b/build/testcases/NP_OptionTest.php new file mode 100644 index 0000000..4edbc84 --- /dev/null +++ b/build/testcases/NP_OptionTest.php @@ -0,0 +1,120 @@ +Creating some options'; + + if (!$this->createBlogOption('my option', 'my description', 'text', 'initial value', 'extra')) + array_push($aErrors, 'create blog option failed'); + + if (!$this->createBlogOption('my option2', 'my description2', 'yesno', 'no')) + array_push($aErrors, 'create blog option 2 failed'); + + if (!$this->createMemberOption('my option3', 'my description3', 'yesno', 'no')) + array_push($aErrors, 'create member option failed'); + + if (!$this->createCategoryOption('my option4', 'my description4', 'yesno', 'yes')) + array_push($aErrors, 'create catgeory option failed'); + + echo '

Creating some more options

'; + // add some thingies with the same name + $this->createCategoryOption('idem', 'idemd', 'text', 'category'); + $this->createOption('idem', 'idemd', 'text', 'global'); + $this->createBlogOption('idem', 'idemd', 'text', 'blog'); + $this->createMemberOption('idem', 'idemd', 'text', 'member'); + + echo '

Checking options

'; + if ($this->getOption('idem') != 'global') + array_push($aErrors, 'get should return "global" ' . $this->getOption('idem')); + if ($this->getCategoryOption(1, 'idem') != 'category') + array_push($aErrors, 'get should return "category" ' . $this->getCategoryOption(1, 'idem')); + if ($this->getBlogOption(1, 'idem') != 'blog') + array_push($aErrors, 'get should return "blog" ' . $this->getBlogOption(1, 'idem')); + if ($this->getMemberOption(1, 'idem') != 'member') + array_push($aErrors, 'get should return "member" ' . $this->getMemberOption(1, 'idem')); + + echo '

Setting options

'; + if (!$this->setOption('idem','edit-global')) + array_push($aErrors, 'set option failed'); + if (!$this->setCategoryOption(1, 'idem', 'edit-category')) + array_push($aErrors, 'set catgeory option failed'); + if (!$this->setBlogOption(1, 'idem', 'edit-blog')) + array_push($aErrors, 'set blog option failed'); + if (!$this->setMemberOption(1, 'idem', 'edit-member')) + array_push($aErrors, 'set member option failed'); + + echo '

Checking options

'; + if ($this->getOption('idem') != 'edit-global') + array_push($aErrors, 'get should return "edit-global"'); + if ($this->getCategoryOption(1, 'idem') != 'edit-category') + array_push($aErrors, 'get should return "edit-category"'); + if ($this->getBlogOption(1, 'idem') != 'edit-blog') + array_push($aErrors, 'get should return "edit-blog"'); + if ($this->getMemberOption(1, 'idem') != 'edit-member') + array_push($aErrors, 'get should return "edit-member"'); + + if (count($aErrors) > 0); + echo ''; + + echo '
';
+		echo "All blog options:\n";
+		print_r($this->getAllBlogOptions('idem'));
+		
+		echo "\nAll category options:\n";
+		print_r($this->getAllCategoryOptions('idem'));
+
+		echo "\nAll member options:\n";
+		print_r($this->getAllMemberOptions('idem'));
+
+		echo '
'; + + } + +} +?> \ No newline at end of file diff --git a/build/testcases/NP_PrePluginOptionsUpdate_TestCase1.php b/build/testcases/NP_PrePluginOptionsUpdate_TestCase1.php new file mode 100644 index 0000000..b121068 --- /dev/null +++ b/build/testcases/NP_PrePluginOptionsUpdate_TestCase1.php @@ -0,0 +1,96 @@ +createItemOption('TestValue', 'TestOption', 'text', 'foobar', ''); + $this->createMemberOption('MemberTestOptions', 'TestOption', 'text', 'foobar-member', ''); + } + + //supported features + function supportsFeature($what) { + switch($what) { + case 'SqlTablePrefix': + return 1; + default: + return 0; + } + } + + function event_PrePluginOptionsUpdate(&$data) { + if ($this->getID() == $data['plugid']) { + //this belongs to us :-) + //echo "PrePluginOptionsUpdate: TestCase-plugin
"; + //echo "optionname: ".$data['optionname']."
"; + //echo "context: ".$data['context']."
"; + //echo "contextid: ".$data['contextid']."
"; + //echo "value: ".$data['value']."
"; + if ($data['value'] == '') { + $data['value'] = 'no-value'; + } else { + $data['value'] .= '-TEST'; + } + //echo "new value: ".$data['value']."

"; + } + + if ($data['optionname'] == 'TestValue') { + $data['value'] .= '|||'.requestVar('np_testcase_item'); + } + } + + + // function event_PrePluginOptionsEdit(&$data){ + // echo 'event: PrePluginOptionsEdit
'; + // echo '$data: '.$data.'
'; + // echo 'context: '.$data['context'].'
'; + // echo 'contextid: '.$data['contextid'].'
'; + // for ($i == 0; $i < count($data['options']); $i++) { + // echo 'option-name: '.$data['options'][$i]['name'].' value: '.$data['options'][$i]['value'].'
'; + // echo 'extra: '.$data['options'][$i]['extra'].'
'; + // // $data['options'][$i]['extra'] .= 'test'; + // // echo 'new extra: '.$data['options'][$i]['extra'].'
'; + // } + // } + + function event_PrePluginOptionsEdit(&$data) { + //echo 'PrePluginOptionsEdit '; + // if ($data['context'] == 'item') { + //foreach($data['options'] as $option) { + foreach (array_keys($data['options']) as $optionKey) { + $option = &$data['options'][$optionKey]; + // if (($option['pid'] == $this->getID)&&($option['name'] == 'TestValue')) { + if (($option['name'] == 'TestValue') && ($option['pid'] == $this->getID())) { + $option['extra'] .= ' '; + //echo 'Extra: '.$option['extra'].'
'; + } + // } + } + } +} +?> diff --git a/build/testcases/helppagetestcase1/help.php b/build/testcases/helppagetestcase1/help.php new file mode 100644 index 0000000..26e91ef --- /dev/null +++ b/build/testcases/helppagetestcase1/help.php @@ -0,0 +1,13 @@ +

Plugin overview

+

The only purpose of this plugin is to show how the plugin helppages work

+

Installation

+

If you can read this you correctly installed the plugin :-)

+

SkinVars

+

Because this plugin is only a testcase it doesn't has any skinvars/templatevars but suppose it would have: +

+

Support and Bug reports

+

For additional support and/or bug reports please use this forum thread: http://forum.nucleuscms.org/viewtopic.php?t=4137

+

Version History

+

diff --git a/build/testcases/plugindeptestcases/NP_DepA.php b/build/testcases/plugindeptestcases/NP_DepA.php new file mode 100644 index 0000000..da2afb7 --- /dev/null +++ b/build/testcases/plugindeptestcases/NP_DepA.php @@ -0,0 +1,25 @@ + diff --git a/build/testcases/plugindeptestcases/NP_DepB.php b/build/testcases/plugindeptestcases/NP_DepB.php new file mode 100644 index 0000000..401f349 --- /dev/null +++ b/build/testcases/plugindeptestcases/NP_DepB.php @@ -0,0 +1,25 @@ + diff --git a/build/testcases/plugindeptestcases/NP_DepC.php b/build/testcases/plugindeptestcases/NP_DepC.php new file mode 100644 index 0000000..7282773 --- /dev/null +++ b/build/testcases/plugindeptestcases/NP_DepC.php @@ -0,0 +1,25 @@ + diff --git a/build/testcases/plugindeptestcases/testcases.txt b/build/testcases/plugindeptestcases/testcases.txt new file mode 100644 index 0000000..6222034 --- /dev/null +++ b/build/testcases/plugindeptestcases/testcases.txt @@ -0,0 +1,19 @@ +Note for testcases: + +DepA depends on DepB +DepC depends on DepA and DepB + +Test sequences: + +install +1) DepA, DepB - failed +2) DepB, DepA - success +3) DepC - failed +4) DepB, DepC - failed +5) DepB, DepA, DepC - success + +uninstall +1) install DepB, DepA uninstall DepB - failed +2) install DepB, DepA, DepC uninstall DepC - failed +3) install DepB, DepA, DepC uninstall DepB - failed +4) install DepB, DepA, DepC uninstall DepA - failed diff --git a/build/testcases/urllinking.txt b/build/testcases/urllinking.txt new file mode 100644 index 0000000..264117b --- /dev/null +++ b/build/testcases/urllinking.txt @@ -0,0 +1,22 @@ +Testcases for auto-url linking in comments: + +http://www.nucleuscms.org/ should be linked +www.nucleuscms.org should be linked +Previous sentence.www.nucleuscms.org should be linked +Previous sentence.http://www.nucleuscms.org should be linked +awww... that hurts. Should not be linked +http://ftp.nucleuscms.org/ should NOT be an FTP link +ftp://www.nucleuscms.org/ should be linked as FTP +ftp.nucleuscms.org should be linked +Previous sentence.ftp.nucleuscms.org should be linked +Previous sentence.ftp://ftp.nucleuscms.org should be linked +naftp.ha should not be linked +mailto:someone@example.org -> Linked +someone@example.org -> not linked +http://www.example.org/?foo=x&bar=y => ampersand entity ok? +<<>> => < & > should not be included in link +&http://www.blaat.com&& => neither should & +https://www.bla.com/ +https://bla.com/ +blogger help => should become blogger help +https://www.bla.com/, => the comma should not be linked \ No newline at end of file diff --git a/build/testcases/xmlrpc-metaWeblog-editPost.php b/build/testcases/xmlrpc-metaWeblog-editPost.php new file mode 100644 index 0000000..e6ccad3 --- /dev/null +++ b/build/testcases/xmlrpc-metaWeblog-editPost.php @@ -0,0 +1,48 @@ + new xmlrpcval('Just a test','string'), + 'title' => new xmlrpcval('Edit Post Test', 'string') +/* 'categories' => new xmlrpcval(array(new xmlrpcval('General','string')), 'array')*/ + ),'struct'), + new xmlrpcval(1, 'boolean'), // publish + ) + ); + + $c=new xmlrpc_client($serverPath, $serverHost, $serverPort); + $c->setDebug(1); + $r=$c->send($f); + $v=$r->value(); + + + if (!$r->faultCode()) { + echo 'success!'; + } else { + print "Fault: "; + print "Code: " . $r->faultCode() . + " Reason '" .$r->faultString()."'
"; + } + + + +?> \ No newline at end of file diff --git a/build/testcases/xmlrpc-metaWeblog-getRecentPosts.php b/build/testcases/xmlrpc-metaWeblog-getRecentPosts.php new file mode 100644 index 0000000..806a488 --- /dev/null +++ b/build/testcases/xmlrpc-metaWeblog-getRecentPosts.php @@ -0,0 +1,43 @@ +setDebug(1); + $r=$c->send($f); + $v=$r->value(); + + + if (!$r->faultCode()) { + echo 'success!'; + } else { + print "Fault: "; + print "Code: " . $r->faultCode() . + " Reason '" .$r->faultString()."'
"; + } + + + +?> \ No newline at end of file diff --git a/build/testcases/xmlrpc-metaWeblog-newMediaObject.php b/build/testcases/xmlrpc-metaWeblog-newMediaObject.php new file mode 100644 index 0000000..467d14c --- /dev/null +++ b/build/testcases/xmlrpc-metaWeblog-newMediaObject.php @@ -0,0 +1,55 @@ + new xmlrpcval('myImage.gif', 'string'), + 'type' => new xmlrpcval('image/gif', 'string'), + 'bits' => new xmlrpcval($data, 'base64') + ), + 'struct' + ) + ) + ); + + + $c=new xmlrpc_client($serverPath, $serverHost, $serverPort); + $c->setDebug(1); + $r=$c->send($f); + $v=$r->value(); + + + if (!$r->faultCode()) { + echo 'succes!'; + } else { + print "Fault: "; + print "Code: " . $r->faultCode() . + " Reason '" .$r->faultString()."'
"; + } + + + +?> \ No newline at end of file diff --git a/build/testcases/xmlrpc-metaWeblog-newPost.php b/build/testcases/xmlrpc-metaWeblog-newPost.php new file mode 100644 index 0000000..219b025 --- /dev/null +++ b/build/testcases/xmlrpc-metaWeblog-newPost.php @@ -0,0 +1,48 @@ + new xmlrpcval('Just a test','string'), + 'title' => new xmlrpcval('Edit Post Test', 'string'), + 'categories' => new xmlrpcval(array(), 'array') + ),'struct'), + new xmlrpcval(1, 'boolean'), // publish + ) + ); + + $c=new xmlrpc_client($serverPath, $serverHost, $serverPort); + $c->setDebug(1); + $r=$c->send($f); + $v=$r->value(); + + + if (!$r->faultCode()) { + echo 'success!'; + } else { + print "Fault: "; + print "Code: " . $r->faultCode() . + " Reason '" .$r->faultString()."'
"; + } + + + +?> \ No newline at end of file diff --git a/build/testcases/xmlrpc-mt-getPostCategories.php b/build/testcases/xmlrpc-mt-getPostCategories.php new file mode 100644 index 0000000..17448a0 --- /dev/null +++ b/build/testcases/xmlrpc-mt-getPostCategories.php @@ -0,0 +1,42 @@ +setDebug(1); + $r=$c->send($f); + $v=$r->value(); + + + if (!$r->faultCode()) { + echo 'succes!'; + } else { + print "Fault: "; + print "Code: " . $r->faultCode() . + " Reason '" .$r->faultString()."'
"; + } + + + +?> \ No newline at end of file diff --git a/build/testcases/xmlrpc-mt-getRecentPostTitles.php b/build/testcases/xmlrpc-mt-getRecentPostTitles.php new file mode 100644 index 0000000..fb385a3 --- /dev/null +++ b/build/testcases/xmlrpc-mt-getRecentPostTitles.php @@ -0,0 +1,43 @@ +setDebug(1); + $r=$c->send($f); + $v=$r->value(); + + + if (!$r->faultCode()) { + echo 'succes!'; + } else { + print "Fault: "; + print "Code: " . $r->faultCode() . + " Reason '" .$r->faultString()."'
"; + } + + + +?> \ No newline at end of file diff --git a/build/testcases/xmlrpc-mt-getTrackbackPings.php b/build/testcases/xmlrpc-mt-getTrackbackPings.php new file mode 100644 index 0000000..de04d77 --- /dev/null +++ b/build/testcases/xmlrpc-mt-getTrackbackPings.php @@ -0,0 +1,40 @@ +setDebug(1); + $r=$c->send($f); + $v=$r->value(); + + + if (!$r->faultCode()) { + echo 'succes!'; + } else { + print "Fault: "; + print "Code: " . $r->faultCode() . + " Reason '" .$r->faultString()."'
"; + } + + + +?> \ No newline at end of file diff --git a/build/testcases/xmlrpc-mt-setPostCategories.php b/build/testcases/xmlrpc-mt-setPostCategories.php new file mode 100644 index 0000000..8119f19 --- /dev/null +++ b/build/testcases/xmlrpc-mt-setPostCategories.php @@ -0,0 +1,68 @@ + new xmlrpcval('Test','string') + ), + 'struct' + ) +/* , + new xmlrpcval( + array( +// 'isPrimary' => new xmlrpcval(1, 'boolean'), + 'categoryId' => new xmlrpcval('newcat1','string') + ), + 'struct' + ), + new xmlrpcval( + array( + 'categoryId' => new xmlrpcval('General','string') + ), + 'struct' + ) +*/ + ), + 'array' + ) + ) + ); + + echo 'ready'; + $c=new xmlrpc_client($serverPath, $serverHost, $serverPort); + $c->setDebug(1); + $r=$c->send($f); + $v=$r->value(); + + + if (!$r->faultCode()) { + echo 'succes!'; + } else { + print "Fault: "; + print "Code: " . $r->faultCode() . + " Reason '" .$r->faultString()."'
"; + } + + + +?> \ No newline at end of file diff --git a/config.php.sample b/config.php.sample new file mode 100644 index 0000000..36885fc --- /dev/null +++ b/config.php.sample @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/createaccount.html b/createaccount.html new file mode 100644 index 0000000..64ccf5c --- /dev/null +++ b/createaccount.html @@ -0,0 +1,16 @@ + + + + + Create Member Account + + + +

Create Account

+ +

Sorry, the URL of the Create Account Form has changed.

+

If you are not redirected automatically please use this link: Create Member Account.

+

Thank you. :-)

+ + + diff --git a/createaccount.php b/createaccount.php new file mode 100644 index 0000000..1fa06d3 --- /dev/null +++ b/createaccount.php @@ -0,0 +1,152 @@ + + + + + Create Member Account + + + + +

Create Account

+ + + +
+ +
+ + + + Login Name (required): +
+ (only a-z, 0-9) +
+
+ Real Name (required): +
+ +
+
+ Email (required): +
+ (must be valid, because an activation link will be sent over there) +
+
+ URL: +
+ +
+ notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '
', 'prefield' => '', 'postfield' => '

')); + // add a Captcha challenge or something else + global $manager; + $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin')); + ?> +
+
+ +
+ +
+createAccount(); + + echo ''.$message.'

'; +?> + +
+ +
+ + + + Login Name (required): +
+ /> (only a-z, 0-9) +
+
+ Real Name (required): +
+ /> +
+
+ Email (required): +
+ /> (must be valid, because an activation link will be sent over there) +
+
+ URL: +
+ /> +
+ notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '
', 'prefield' => '', 'postfield' => '

')); + // add a Captcha challenge or something else + global $manager; + $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin')); + ?> +
+
+ +
+ +
+
'; + 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(); + +?> + + + + <?php echo _TITLE; ?> + + + + +
<?php echo _ALT_NUCLEUS_CMS_LOGO; ?>
+
+ +

+ + + +

+ + + +
    +
  • PHP:
  • +
  • MySQL: + + 0 ) + { + $row = sql_fetch_array($result); + $match = i18n::explode('.', $row['version']); + } + else + { + $result = @sql_query('SHOW VARIABLES LIKE \'version\'', $conn); + + if ( $result != FALSE && @sql_num_rows($result) > 0 ) + { + $row = sql_fetch_row($result); + $match = i18n::explode('.', $row[1]); + } + else + { + //$output = shell_exec('mysql -V'); + $output = ( function_exists('shell_exec') ) ? @shell_exec('mysql -V') : '0.0.0'; + preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version); + $match = i18n::explode('.', $version[0]); + + if ( $match[0] == '' ) + { + $match[0] = '0'; + $match[1] = '0'; + $match[2] = '0'; + } // end if + + } // end if + + } // end if + + @sql_disconnect($conn); + + //End and clean output buffer + ob_end_clean(); + + $mysqlVersion = implode($match, '.'); + $minVersion = '3.23'; + + if ( $mysqlVersion == '0.0.0' ) + { + echo _NOTIFICATION1; + } + else + { + echo $mysqlVersion; + } + + if ( $mysqlVersion < $minVersion ) + { + echo ' ', _TEXT2_WARN2 , $minVersion, ''; + } +?> + +
  • +
+ + + +

+ + + +

+ + + +
+ + + + + + + + + + + + + + + + + + +
()
+
+ +
+ + + + + + +
+ + + +
+ +

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
(used by imported skins) +
+
() +
+
() +
+
+ + + +

+ + + +
+ + + + + + + + + + + + + + + + + + + + + + +
()
()
+
+ +

+ + + +
+ + + + + + + + + + +
()
+
+ +

+ +
+ + + + + +
+
+ +

+ + + +

+ +
+ + + + 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) . "

"; + + if ( $query ) + { + + if ( $mysql_usePrefix == 1 ) + { + $query = str_replace($aTableNames, $aTableNamesPrefixed, $query); + } // end if + + sql_query($query, $MYSQL_CONN) or _doError(_ERROR30 . ' (' . i18n::hsc($query) . '): ' . sql_error($MYSQL_CONN) ); + } // end if + + } // end loop + + // 5a make first post + $newpost = "INSERT INTO ". tableName('nucleus_item') ." VALUES (1, '" . _1ST_POST_TITLE . "', '" . _1ST_POST . "', '" . _1ST_POST2 . "', 1, 1, '2005-08-15 11:04:26', 0, 0, 0, 1, 0, 1);"; + sql_query($newpost,$MYSQL_CONN) or _doError(_ERROR18 . ' (' . i18n::hsc($newpost) . '): ' . sql_error($MYSQL_CONN) ); + + // 6. update global settings + updateConfig('IndexURL', $config_indexurl); + updateConfig('AdminURL', $config_adminurl); + updateConfig('MediaURL', $config_mediaurl); + updateConfig('SkinsURL', $config_skinsurl); + updateConfig('PluginURL', $config_pluginurl); + updateConfig('ActionURL', $config_actionurl); + updateConfig('AdminEmail', $config_adminemail); + updateConfig('SiteName', $config_sitename); + + // 7. update GOD member + $query = 'UPDATE ' . tableName('nucleus_member') + . " SET mname='" . addslashes($user_name) . "'," + . " mrealname='" . addslashes($user_realname) . "'," + . " mpassword='" . md5(addslashes($user_password) ) . "'," + . " murl='" . addslashes($config_indexurl) . "'," + . " memail='" . addslashes($user_email) . "'," + . " madmin=1, mcanlogin=1" + . " WHERE mnumber=1"; + + sql_query($query,$MYSQL_CONN) or _doError(_ERROR19 . ': ' . sql_error($MYSQL_CONN) ); + + // 8. update weblog settings + $query = 'UPDATE ' . tableName('nucleus_blog') + . " SET bname='" . addslashes($blog_name) . "'," + . " bshortname='" . addslashes($blog_shortname) . "'," + . " burl='" . addslashes($config_indexurl) . "'" + . " WHERE bnumber=1"; + + sql_query($query, $MYSQL_CONN) or _doError(_ERROR20 . ': ' . sql_error($MYSQL_CONN) ); + + // 9. update item date + $query = 'UPDATE ' . tableName('nucleus_item') + . " SET itime='" . date('Y-m-d H:i:s', time() ) ."'" + . " WHERE inumber=1"; + + sql_query($query,$MYSQL_CONN) or _doError(_ERROR21 . ': ' . sql_error($MYSQL_CONN) ); + + global $aConfPlugsToInstall, $aConfSkinsToImport; + $aSkinErrors = array(); + $aPlugErrors = array(); + + if ( (count($aConfPlugsToInstall) > 0) || (count($aConfSkinsToImport) > 0) ) + { + // 10. set global variables + global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_PREFIX; + + $MYSQL_HOST = $mysql_host; + $MYSQL_USER = $mysql_user; + $MYSQL_PASSWORD = $mysql_password; + $MYSQL_DATABASE = $mysql_database; + $MYSQL_PREFIX = ( $mysql_usePrefix == 1 ) ? $mysql_prefix : ''; + + global $DIR_NUCLEUS, $DIR_MEDIA, $DIR_SKINS, $DIR_PLUGINS, $DIR_LANG, $DIR_LIBS; + + $DIR_NUCLEUS = $config_adminpath; + $DIR_MEDIA = $config_mediapath; + $DIR_SKINS = $config_skinspath; + $DIR_PLUGINS = $DIR_NUCLEUS . 'plugins/'; + $DIR_LANG = $DIR_NUCLEUS . 'language/'; + $DIR_LIBS = $DIR_NUCLEUS . 'libs/'; + + // close database connection (needs to be closed if we want to include globalfunctions.php) + sql_close($MYSQL_CONN); + + $manager = ''; + include_once($DIR_LIBS . 'globalfunctions.php'); + + // 11. install custom skins + $aSkinErrors = installCustomSkins($manager); + $defskinQue = 'SELECT `sdnumber` as result FROM ' . sql_table('skin_desc') . ' WHERE `sdname` = "default"'; + $defSkinID = quickQuery($defskinQue); + $updateQuery = 'UPDATE ' . sql_table('blog') . ' SET `bdefskin` = ' . intval($defSkinID) . ' WHERE `bnumber` = 1'; + sql_query($updateQuery); + $updateQuery = 'UPDATE ' . sql_table('config') . ' SET `value` = ' . intval($defSkinID). ' WHERE `name` = "BaseSkin"'; + sql_query($updateQuery); + + // 12. install NP_Ping, if decided + if ( $weblog_ping == 1 ) + { + global $aConfPlugsToInstall; + array_push($aConfPlugsToInstall, 'NP_Ping'); + } + + // 13. install custom plugins + $aPlugErrors = installCustomPlugs($manager); + } + + // 14. Write config file ourselves (if possible) + $bConfigWritten = 0; + + if ( @file_exists('config.php') && is_writable('config.php') && $fp = @fopen('config.php', 'w') ) + { + $config_data = '<' . '?php' . "\n\n"; + //$config_data .= "\n"; (extraneous, just added extra \n to previous line + $config_data .= " // mySQL connection information\n"; + $config_data .= " \$MYSQL_HOST = '" . $mysql_host . "';\n"; + $config_data .= " \$MYSQL_USER = '" . $mysql_user . "';\n"; + $config_data .= " \$MYSQL_PASSWORD = '" . $mysql_password . "';\n"; + $config_data .= " \$MYSQL_DATABASE = '" . $mysql_database . "';\n"; + $config_data .= " \$MYSQL_PREFIX = '" . (($mysql_usePrefix == 1)?$mysql_prefix:'') . "';\n"; + $config_data .= " // new in 3.50. first element is db handler, the second is the db driver used by the handler\n"; + $config_data .= " // default is \$MYSQL_HANDLER = array('mysql','mysql');\n"; + $config_data .= " //\$MYSQL_HANDLER = array('mysql','mysql');\n"; + $config_data .= " //\$MYSQL_HANDLER = array('pdo','mysql');\n"; + $config_data .= " \$MYSQL_HANDLER = array('".$MYSQL_HANDLER[0]."','".$MYSQL_HANDLER[1]."');\n"; + $config_data .= "\n"; + $config_data .= " // main nucleus directory\n"; + $config_data .= " \$DIR_NUCLEUS = '" . $config_adminpath . "';\n"; + $config_data .= "\n"; + $config_data .= " // path to media dir\n"; + $config_data .= " \$DIR_MEDIA = '" . $config_mediapath . "';\n"; + $config_data .= "\n"; + $config_data .= " // extra skin files for imported skins\n"; + $config_data .= " \$DIR_SKINS = '" . $config_skinspath . "';\n"; + $config_data .= "\n"; + $config_data .= " // these dirs are normally sub dirs of the nucleus dir, but \n"; + $config_data .= " // you can redefine them if you wish\n"; + $config_data .= " \$DIR_PLUGINS = \$DIR_NUCLEUS . 'plugins/';\n"; + $config_data .= " \$DIR_LANG = \$DIR_NUCLEUS . 'language/';\n"; + $config_data .= " \$DIR_LIBS = \$DIR_NUCLEUS . 'libs/';\n"; + $config_data .= "\n"; + $config_data .= " // include libs\n"; + $config_data .= " include(\$DIR_LIBS.'globalfunctions.php');\n"; + $config_data .= "?" . ">"; + + $result = @fputs($fp, $config_data, i18n::strlen($config_data) ); + fclose($fp); + + if ( $result ) + { + $bConfigWritten = 1; + } // end if + + } // end if +?> + + + + <?php echo _TITLE; ?> + + + +

+ + 0 ) + { + echo '

' . _TITLE2 . '

'; + echo '
  • ' . implode('
  • ', $aAllErrors) . '
'; + } + + // 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) + { +?> + + + + <?php echo _TITLE; ?> + + + +
+

+ +

: ""

+

+ + + + + + + + <?php echo _TITLE; ?> + + + +
+

+ +

:

+ +
    + +', $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 <![CDATA[<%title%>]]>\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.

'); + +define('_HEADER4', 'MySQL Login Data'); +define('_TEXT4', '

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.

'); +define('_TEXT4_TAB_HEAD', 'General Database Settings'); +define('_TEXT4_TAB_FIELD1', 'Hostname'); +define('_TEXT4_TAB_FIELD2', 'Username'); +define('_TEXT4_TAB_FIELD3', 'Password'); +define('_TEXT4_TAB_FIELD4', 'Database'); +define('_TEXT4_TAB_FIELD4_ADD', 'needs to be created'); + +define('_TEXT4_TAB2_HEAD', 'Advanced Database Settings'); +define('_TEXT4_TAB2_FIELD', 'Use table prefix'); +define('_TEXT4_TAB2_ADD', '

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.

'); + +define('_HEADER6', 'Administrator User'); +define('_TEXT6', '

Below, you need to enter some information to create the first user of your site.

'); +define('_TEXT6_TAB_HEAD', 'Administrator User'); +define('_TEXT6_TAB_FIELD1', 'Display Name'); +define('_TEXT6_TAB_FIELD1_2', 'allowed characters: a-z and 0-9, spaces allowed inside'); +define('_TEXT6_TAB_FIELD2', 'Real Name'); +define('_TEXT6_TAB_FIELD3', 'Password'); +define('_TEXT6_TAB_FIELD4', 'Password Again'); +define('_TEXT6_TAB_FIELD5', 'E-mail Address'); +define('_TEXT6_TAB_FIELD5_2', 'needs to be a valid e-mail address'); + +define('_HEADER7', 'Weblog Data'); +define('_TEXT7', '

Below, you need to enter some information to create a default weblog. The name of this weblog will also be used as name for your site

'); +define('_TEXT7_TAB_HEAD', 'Weblog Data'); +define('_TEXT7_TAB_FIELD1', 'Blog Name'); +define('_TEXT7_TAB_FIELD2', 'Blog Short Name'); +define('_TEXT7_TAB_FIELD2_2', 'allowed characters: a-z and 0-9, no spaces allowed'); + +define('_HEADER8', 'Weblog Ping'); +define('_TEXT8_TAB_HEADER', 'Weblog Ping'); +define('_TEXT8_TAB_FIELD1', 'Install NP_Ping weblog pinging plugin'); + +define('_HEADER9', 'Submit'); +define('_TEXT9', '

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.

Don\'t forget to change the permissions on config.php back to 444 for security (Quick guide on how to change file permissions).

'); +define('_TEXT14', '

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', '

Files you should delete from your web server:

'); +define('_TEXT15_L1', 'install.sql: file containing table structures'); +define('_TEXT15_L2', 'install.php: this file'); + +define('_TEXT16', '

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 \"help 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!

Vote for Nucleus CMS
Like Nucleus CMS? Vote for us at HotScripts and opensourceCMS.

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 + + + +

+ +
+

+ + + + + + : +
+
: +
+

+
+

+
+

+ + + isTeamMember($blogid) ) { + bm_doError(_ERROR_NOTONTEAM); + } + + $logje = ''; + + if ($log_text) { + $logje .= '
"' . i18n::hsc($log_text) . '"
' . "\n"; + } + + if (!$log_linktitle) { + $log_linktitle = $log_link; + } + + if ($log_link) { + $logje .= '' . i18n::hsc($log_linktitle) . ''; + } + + $item['body'] = $logje; + $item['title'] = i18n::hsc($log_linktitle); + + $factory = new PAGEFACTORY($blogid); + $factory->createAddForm('bookmarklet', $item); +} + +function bm_doEditForm() { + global $member, $manager; + + $itemid = intRequestVar('itemid'); + + if (!$manager->existsItem($itemid, 0, 0) ) { + bm_doError(_ERROR_NOSUCHITEM); + } + + if (!$member->canAlterItem($itemid) ) { + bm_doError(_ERROR_DISALLOWED); + } + + $item =& $manager->getItem($itemid, 1, 1); + $blog =& $manager->getBlog(getBlogIDFromItemID($itemid) ); + + $manager->notify('PrepareItemForEdit', array('item' => &$item) ); + + if ($blog->convertBreaks() ) { + $item['body'] = removeBreaks($item['body']); + $item['more'] = removeBreaks($item['more']); + } + + $formfactory = new PAGEFACTORY($blog->getID() ); + $formfactory->createEditForm('bookmarklet', $item); +} + +function bm_doError($msg) { + bm_message(_ERROR, _ERRORMSG, $msg); + die; +} + +function bm_message($title, $head, $msg, $extrahead = '') { + ?> + + + + <?php echo $title ?> + + + + +

+

+

+ + + + '; + 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.
+ +
    +
  1. + Log into Blogger and go to the blog you want to export. +
  2. +
  3. + Change the template of your blog to the following: + +
    <?xml version="1.0"?>
    +
    +<blog xmlns="http://nucleuscms.org/ns/import1.0" version="1.0">
    +
    + <Blogger>
    +
    +  <item id="<$BlogItemNumber$>">
    +   <title><BlogItemTitle><$BlogItemTitle$></BlogItemTitle></title>
    +   <body><![CDATA[<$BlogItemBody$>]]></body>
    +   <timestamp type="blogger"><$BlogItemDateTime$></timestamp>
    +   <author><$BlogItemAuthor$></author>
    +  </item>
    +
    + </Blogger>
    +
    +</blog>
    + Don't forget to save changes! +
  4. +
  5. + Go to the settings and change the following options: +
      +
    • + Blog filename: +
    • +
    • + Show 900 day'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 +
    • +
    +
  6. +
  7. + Save the settings and publish your blog. You'll end up with a file on your server containing all of your blog items. +
  8. +
  9. + If you're running blogspot, you'll need to edit this file and take out the advertising banner code. +
  10. +
+ +

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

+ +
+ + getHtmlCode('ConvertSelectBlog'); + ?> + +

+ + + (Could take quite a while. Press the button only once) +

+ +
+ + +
+ +

Step 3: Assign members and Categories

+ + 1)); + $oImport->importXmlFile($xmlFile); + + echo $oImport->getHtmlCode('ConvertSelectMembers'); +// echo $oImport->getHtmlCode('ConvertSelectCategories'); + ?> + +

+ + + (Could take quite a while. Press the button only once) +

+ +
+ 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 '
'; + $bOk = $oImport->importXmlFile($xmlFile); + echo '
'; + + // 2. import data... + if (!$bOk) { + echo '

Error on import: ' . $oImport->getLastError() . '

'; + exit; + } + + echo '

Successfully imported items

'; + + echo '

Mappings

'; + + echo '

The mapping below maps blogger post ids to nucleus ids.

'; + + echo '
';
+	print_r($oImport->aMapIdToNucleusId);
+	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.
+ +
    +
  1. + Log into Blogger and go to the blog you want to export. +
  2. +
  3. + Change the template of your blog to the following: + +
    +<?xml version="1.0"?>
    +
    +<bloggerblog>
    +
    + <Blogger>
    +
    +  <blogentry>
    +   <bloggerid><$BlogItemNumber$></bloggerid>
    +   <body><![CDATA[<$BlogItemBody$>]]></body>
    +   <date><$BlogItemDateTime$></date>
    +   <author><$BlogItemAuthor$></author>
    +  </blogentry>
    +
    + </Blogger>
    +
    +</bloggerblog>
    +				
    + Don't forget to save changes! +
  4. +
  5. + Go to the settings and change the following options: +
      +
    • + Blog filename: blogger.xml +
    • +
    • + Show 900 day'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 +
    • +
    +
  6. +
  7. + 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. +
  8. +
  9. + If you're running blogspot, you'll need to edit this file and take out the advertising banner code. +
  10. +
+ +

Exporting comments to CAIF (Instructions for YACCS)

+ +
    +
  1. Log into YACCS
  2. +
  3. Export using the CAIF format. This will result in an XML file, which you should save as caif.xml on your computer.
  4. +
+ +

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 2: 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. +

+ + + + + + + + + + openfile('blogger.xml'); + $blog->record_delim = 'blogentry'; + $blog->parse(); + + + $authors = array(); + + + while ( $entry = $blog->readRecord() ) { + $row = $entry->getRow(); + + // handle one item + if (!in_array($row['author'],$authors)) + array_push($authors,$row['author']); + + } + + $blog->close(); // close the file + $idx = 0; + +while ($a_name = array_pop($authors)) { + ?> + + + + + +
Blogger AuthorNucleus MemberBlog Admin?
+ + + + + + +
+ + +

Choose Destination Weblog

+ +

+ There are two options: you can either choose an existing blog to add the blogger entries into, or you can choose to create a new weblog. +

+ +
+ + + +
+
+ +
    +
  • New blog name:
  • +
  • Blog owner: + +
  • +
+
+ +

Do the conversion!

+

+ + + +

+ +
+ Note: Clicking the button once is enough, even if it takes a while to complete. +
+ +
+ +

Step 3: Converting...

+ +

+ Please be patient. Don't hit reload! The conversion progress should be showing below. +

+ "; + + echo "Authors:
"; + for ($i=0;$i<$authorcount;$i++) { + echo "\tAuthor=" . $author[$i]; + echo " ID=" . $memberid[$author[$i]]; + echo " ADMIN=" . $isadmin[$author[$i]]; + echo "
"; + } + echo "Create New Weblog = $createnew (name='$newblogname', owner=$newowner, dest=$nucleus_blogid)
"; + + echo ""; + + // create blog + if ($createnew == 1) { + // choose unique name + $shortname = 'blogger'; + if (BLOG::exists($shortname)) { + $idx = 1; + while (BLOG::exists($shortname . $idx)) + $idx++; + $shortname = $shortname . $idx; + } + + $nucleus_blogid = convert_addToBlog($newblogname, $shortname, $newowner); + echo "
New blog created
"; + } + + // add authors to blog team + $b = new BLOG($nucleus_blogid); + global $catid; + $catid = $b->getDefaultCategory(); + + for ($i=0;$i<$authorcount;$i++) + $b->addTeamMember($memberid[$author[$i]],$isadmin[$author[$i]]); + + + global $mapping; + $mapping = array(); + + // 3. go through blogger.xml file + + $blog = new RAX(); + $blog->openfile('blogger.xml'); + $blog->record_delim = 'blogentry'; + $blog->parse(); + + while ( $entry = $blog->readRecord() ) { + $row = $entry->getRow(); + + bc_convertOneItem($row, $memberid, $nucleus_blogid); + } + + $blog->close(); // close the file + + // 4. convert comments + bc_convertComments($mapping); + + echo "
All done!
"; + + convert_foot(); + +} + +function bc_convertOneItem($row, $memberid, $nucleus_blogid) { + global $catid, $comments; + + $nucl_id = $memberid[$row['author']]; + $bloggerid = $row['bloggerid']; + + $timestamp = date("Y-m-d H:i:s",bc_transformDate($row['date'])); + + echo "
    "; + echo "
  • Blogger ID: $bloggerid
  • "; + echo "
  • Body:" . i18n::hsc(substr($row['body'],0,20)) . "...(time: " . $timestamp . ")
  • "; + echo "
  • author: " . $row['author'] ; + echo " (nucleus-id: " . $nucl_id . ")
  • "; + + $nucleus_itemid = convert_addToItem($row['title'], $row['body'], '', $nucleus_blogid, $nucl_id, $timestamp, 0, $catid, 0, 0); + + echo "
  • New itemid= $nucleus_itemid
  • "; + + // 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. +

+ + + + + + + + + + getAuthorNames(); + + // get HTML code for selection list + $optionsHtml = $this->getHtmlCode('NucleusMemberOptions'); + $idx = 0; + while ($a_name = array_pop($authors)) { + ?> + + + + + + + + + + + +
AuthorNucleus MemberBlog Admin?
+ + + + + + +
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. +

+ + + + + + + + + getCategoryNames(); + + // get HTML code for selection list + $optionsHtml = $this->getHtmlCode('NucleusCategoryOptions'); + $idx = 0; + while ($a_name = array_pop($catnames)) { + ?> + + + + +
CategoryNucleus Category
+ + + + +
+ + +

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(); + ?> +

Please Log in First

+

Enter your data below:

+ +
+ +
    +
  • Name:
  • +
  • Password
  • +
+ +

+ + +

+ +
+ + + + + Nucleus Convert + + + + + + + +

Error!

+ +

Message was:

+ +
+ +
+ +

Go Back

+ \ 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: +

+ +
    +
  • Blogger (not implemented yet)
  • +
  • pMachine (not implemented yet)
  • +
  • (to be worked out)
  • +
+ +

Import from generic XML

+ +

+ 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) + +

+ + +
+

+ + +
+ + +

Step 2: 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. +

+ + + + + + + + + + +
Tool AuthorNucleus MemberBlog Admin?
+ +

Choose Destination Weblog

+ +

+ There are two options: you can either choose an existing blog to add the imported entries into, or you can choose to create a new weblog. +

+ +
+ + + +
+
+ +
    +
  • New blog name:
  • +
  • Blog owner: + +
  • +
+
+ +

Do the conversion!

+

+ + + +

+ +
+ Note: Clicking the button once is enough, even if it takes a while to complete. +
+ +
+ \ 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

+ +
+ +

+ Please enter the path in which the GreyMatter script is installed below. The current value is a guess by Nucleus. The GreyMatter data path will be extracted from the GM config in the next step. +
+ Note: The path should end with a slash! +

+ +
    +
  • GreyMatter path:
  • +
+ +

+ + +

+ +
+ +
+ + +

Assign Members to Authors

+ +

+ Below is a list of all the GreyMatter authors that Nucleus could discover. Please assign a Nucleus Member to all of these authors. +

+ + + + + + + + + + + + + + + + + + + + +
GreyMatter AuthorNucleus MemberBlog Admin?
+ + + + + + + /> +
+ (users not listed in gm-authors.cgi) + + + + + +
+ + +

Choose Destination Weblog

+ +

+ There are two options: you can either choose an existing blog to add the greymatter entries into, or you can choose to create a new weblog. +

+ +
+ : + + +
+
+ +
    +
  • New blog name:
  • +
  • Blog owner: + +
  • +
+
+ +

Do the conversion!

+

+ + + + + + +

+ +
+ +

Converting...

+ +

+ Please be patient. Don't hit reload! The conversion progress should be showing below. +

+ "; + + echo "Authors:
"; + for ($i=0;$i<$authorcount;$i++) { + echo "\tAuthor=" . $author[$i]; + echo " ID=" . $memberid[$author[$i]]; + echo " ADMIN=" . $isadmin[$author[$i]]; + echo "
"; + } + echo "Create New Weblog = $createnew (name='$newblogname', owner=$newowner, dest=$nucleus_blogid)
"; + + echo ""; + + // create blog + if ($createnew == 1) { + // choose unique name + $shortname = 'greymatter'; + if (BLOG::exists($shortname)) { + $idx = 1; + while (BLOG::exists($shortname . $idx)) + $idx++; + $shortname = $shortname . $idx; + } + + $nucleus_blogid = convert_addToBlog($newblogname, $shortname, $newowner); + echo "
New blog created
"; + } + + // add authors to blog team + $blog = new BLOG($nucleus_blogid); + global $catid; + $catid = $blog->getDefaultCategory(); + for ($i=0;$i<$authorcount;$i++) + $blog->addTeamMember($memberid[$author[$i]],$isadmin[$author[$i]]); + + // go through all files + $dirhandle = opendir($grey_datapath); + while ($filename = readdir($dirhandle)) { + if (ereg("\.cgi$",$filename)) { + gmc_convertOneFile($grey_datapath . $filename, $nucleus_blogid, $memberid); + } + } + closedir($dirhandle); + + echo "
All done!
"; + + convert_foot(); + +} + +/** + * Converts one GreyMatter entry into a Nucleus Item + */ +function gmc_convertOneFile($filename, $nucleus_blogid, $memberid) { + global $catid; + + echo "
";
+
+	$filehandle = fopen($filename,'r');
+
+	$entry_info = fgets($filehandle,4096);	// entry info
+	$entry_karma = fgets($filehandle,4096); // ips of karma voters (ignore)
+	$entry_body = fgets($filehandle,4096);  // body
+	$entry_more = fgets($filehandle,4096);  // extended
+
+	// decode information
+	$entry_info = str_replace("|*|","\n",$entry_info);
+	$entry_body = str_replace("|*|","\n",$entry_body);
+	$entry_more = str_replace("|*|","\n",$entry_more);
+
+	list ($e_number, $e_author, $e_title, $e_wday, $e_mon, $e_mday, $e_year, $e_hour, $e_min, $e_sec, $e_ampm, $e_karmapos, $e_karmaneg, $e_commentcount, $e_allowkarma, $e_allowcomments, $e_openclosed) = explode ("|", $entry_info);
+
+	if (($e_ampm == "PM") && ($e_hour != 12 ))
+		$e_hour = $e_hour + 12;
+
+	if ($e_allowcomments == "yes")
+		$e_closed = 0;
+	else
+		$e_closed = 1;
+
+	$e_timestamp = mktime($e_hour, $e_min, $e_sec, $e_mon, $e_mday, $e_year);
+	$e_timestamp = date("Y-m-d H:i:s",$e_timestamp);
+
+
+
+	$nucl_id = $memberid[$e_author];
+	if (intval($nucl_id) == 0)
+		$nucl_id = $memberid['_other_'];
+
+	// handle {{link, {{linkmo, {{email and {{emailmo
+	$e_title = gm_parsecommands($e_title,$nucl_id);
+	$entry_body = gm_parsecommands($entry_body,$nucl_id);
+	$entry_more = gm_parsecommands(trim($entry_more),$nucl_id);
+
+	echo "Title: $e_title
"; + echo "\tGreyMatter Author = $e_author
"; + echo "\tNucleus Memberid = $nucl_id
"; + echo "\tKarma: $e_karmapos+/$e_karmaneg-
"; + + + // add to nucleus_item table + $nucleus_itemid = convert_addToItem($e_title, $entry_body, $entry_more, $nucleus_blogid, $nucl_id, $e_timestamp, $e_closed, $catid, $e_karmapos, $e_karmaneg); + + + echo "\tComments:
"; + + while ($comment = fgets($filehandle,4096)) { + // echo "\t\tConverting comment: $comment
"; + + // decode + $comment = str_replace("|*|","\n",$comment); + list ($c_author, $c_ip, $c_email, $c_url, $c_wday, $c_mon, $c_mday, $c_year, $c_hour, $c_min, $c_sec, $c_ampm, $c_body) = explode("|",$comment); + + echo "\t\tConverting comment by $c_author
"; + + // make hrefs out of links + $c_body = eregi_replace("(http://([a-zA-Z0-9]|\.|/|~|%|&|\?|\@|\=|_|\+|\:|;|-)*)","http://.../",$c_body); + + // special markup commands + $c_body = gm_parsecommands($c_body,0); + + if ($c_ampm == "PM") + $c_hour = $c_hour + 12; + $c_timestamp = mktime($c_hour, $c_min, $c_sec, $c_mon, $c_mday, $c_year); + $c_timestamp = date("Y-m-d H:i:s",$c_timestamp); + + // choose url or email to pass as userid + if (stristr($c_url,'http://') != false) + $c_userid = $c_url; + else + $c_userid = $c_email; + + // add to comments + convert_addToComments($c_author, $c_userid, $c_body, $nucleus_blogid, $nucleus_itemid, 0, $c_timestamp, $c_ip); + + } + + + fclose($filehandle); + + echo "
"; +} + +// 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 2: Assign Members to Authors

+ +

+ Please assign a Nucleus Member to these entries. +

+ + + + + + + + + + openfile('ljent.xml'); + $blog->record_delim = 'entry'; + $blog->parse(); + + + $blog->close(); // close the file + $idx = 0; + +{ + ?> + + + + + +
Blogger AuthorNucleus MemberBlog Admin?
+ default + + + + + +
+ + +

Choose Destination Weblog

+ +

+ There are two options: you can either choose an existing blog to add the Live Journal entries into, or you can choose to create a new weblog. +

+ +
+ + + +
+
+ +
    +
  • New blog name:
  • +
  • Blog owner: + +
  • +
+
+ +

Do the conversion!

+

+ + + +

+ +
+ Note: Clicking the button once is enough, even if it takes a while to complete. +
+ +
+ +

Step 3: Converting...

+ +

+ Please be patient. Don't hit reload! The conversion progress should be showing below. +

+ "; + + echo "Authors:
"; + for ($i=0;$i<$authorcount;$i++) { + echo "\tAuthor=" . $author[$i]; + echo " ID=" . $memberid[$author[$i]]; + echo " ADMIN=" . $isadmin[$author[$i]]; + echo "
"; + } + echo "Create New Weblog = $createnew (name='$newblogname', owner=$newowner, dest=$nucleus_blogid)
"; + + echo ""; + + // create blog + if ($createnew == 1) { + // choose unique name + $shortname = 'blogger'; + if (BLOG::exists($shortname)) { + $idx = 1; + while (BLOG::exists($shortname . $idx)) + $idx++; + $shortname = $shortname . $idx; + } + + $nucleus_blogid = convert_addToBlog($newblogname, $shortname, $newowner); + echo "
New blog created
"; + } + + // add authors to blog team + $b = new BLOG($nucleus_blogid); + global $catid; + $catid = $b->getDefaultCategory(); + + for ($i=0;$i<$authorcount;$i++) + $b->addTeamMember($memberid[$author[$i]],$isadmin[$author[$i]]); + + + // 3. go through ljent.xml file + + $blog = new RAX(); + $blog->openfile('ljent.xml'); + $blog->record_delim = 'entry'; + $blog->parse(); + + while ( $entry = $blog->readRecord() ) { + $row = $entry->getRow(); + + bc_convertOneItem($row, $memberid, $nucleus_blogid); + } + + $blog->close(); // close the file + + echo "
All done!
"; + + convert_foot(); + +} + +function bc_convertOneItem($row, $memberid, $nucleus_blogid) { + global $catid; + + $nucl_id = $memberid[$row['author']]; + + $timestamp = date("Y-m-d H:i:s",bc_transformDate($row['eventtime'])); + + echo "
";
+	echo "entry:" .  i18n::hsc(substr($row['event'],0,20)) . "...(time: " . $timestamp . ") \n";
+	echo "author: " . $row['author'] ;
+	echo " (nucleus-id: " . $nucl_id . ")";
+	echo "
"; + + $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.
+ +
    +
  1. + Change the template of your blog to the following: + +
    <!-- Your weblog template -->
    +<html>
    +<head>
    +<title>GaGa WebCam Log</title>
    +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    +
    +<!-- ********************************************************************************** -->
    +<!-- DO NOT REMOVE OR CHANGE ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING -->
    +<!-- ********************************************************************************** -->
    +<!--
    +<weblog>
    +  translate          {:-)}                {<img src="/weblog/image/emoticon/smiley.gif">}
    +
    +  translate_template {[#edit]}           {[IF $edit_link][<a href="[$edit_link]">edit</a>][ENDIF]}
    +  translate_template {[#date_header]}    {[IF $date_header]<p class="commentdateheader">[$post_day]/[$post_month]/[$post_year]</p>[ENDIF]}
    +  translate_template {[#comments_page]}  {[IF $generation]}
    +  translate_template {[/#comments_page]} {[ENDIF]}
    +  translate_template {[#main_page]}      {[IF $generation][ELSE]}
    +  translate_template {[/#main_page]}     {[ENDIF]}
    +  translate_template {[#messages]}       {[LOOP $messages]}
    +  translate_template {[/#messages]}      {[ENDLOOP]}
    +  translate_template {[#archives]}       {[LOOP $archives]}
    +  translate_template {[/#archives]}      {[ENDLOOP]}
    +  translate_template {[#hidden_message]}
    +  {
    +	[IF $message_status_hide]
    +	  [IF $is_owner]
    +		<p class="commenttitle" id="[$message_id]"><font color="#FF0000" face="tahoma">::HIDDEN::</font>
    +		[IF $comment_link]<a class="navigate" href="[$comment_link]">[ENDIF][$message_title][IF $comment_link]</a>[ENDIF]
    +		[IF $edit_link][<a class="navigate" href="[$edit_link]">edit</a>][ENDIF]</p>
    +	  [ENDIF]
    +	[ENDIF]
    +  }
    +  translate_template {[#visible_message]}  {[IF $message_status_hide][ELSE]}
    +  translate_template {[/#visible_message]} {[ENDIF]}
    +  translate_template {[#post]} {[IF $add_comment_link]<br><p class="addcomment">[ <a class="navigate" href="[$add_comment_link]">[IF $generation]add a comment[ELSE]post a message[ENDIF]</a> ]</p>[ENDIF]}
    +  translate_template {[#comment]}
    +  {
    +	[IF $comment_link]
    +	<a class="navigate" href="[$comment_link]"><nobr>[$num_comments] comments</nobr></a>
    +	[ENDIF]
    +  }
    +  translate_template {[#post_datetime]} {[$post_month]/[$post_day]/[$post_year] [$post_hour]:[$post_minute] PM}
    +  translate_template {[#mod_datetime]} {[$mod_month_abbrev] [$mod_day], [$mod_year] at [$mod_hour]:[$mod_minute]}
    +
    +  share	       { template; }
    +  generation.0 { comments: yes; show_depth: 1; max_comments: 1000; max_days: 365; sort_comments: new_to_old; sort_days: new_to_old; permissions: owner; }
    +  generation.1 { comments: yes; show_depth: 1; max_comments: 1000; max_days: 365; sort_comments: new_to_old; sort_days: new_to_old; permissions: all; }
    +  generation.2 { comments: no; }
    +  generation.open { comments: yes; show_depth: 16; max_comments: 1000; }
    +  timezone { +2 }
    +</weblog>
    +-->
    +<!-- ********************************************************************************** -->
    +<!-- DO NOT REMOVE OR CHANGE ANYTHING ABOVE THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING -->
    +<!-- ********************************************************************************** -->
    +
    +</head>
    +
    +<body>
    +<style type = "text/css">
    +	<!--
    +	  .pagetitle  { font-family: Comic Sans MS; font-size: 10pt; font-weight: bold; color: #000000; margin-top: 0px; margin-bottom: 0px;  margin-left: 0px; margin-right: 0px }
    +	  .pagebody   { font-family: Comic Sans MS; font-size: 9pt; color: #000000; margin-top: 0px; margin-bottom: 0px;  margin-left: 0px; margin-right: 0px }
    +	  .pagebyline	{ font-family: Comic Sans MS; font-size: 8pt; color: #666666; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px }
    +
    +	  .addcomment { font-family: Comic Sans MS; font-size: 8pt; font-weight: bold; color: #000000; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px }
    +
    +	  .commenttitle  { font-family: Comic Sans MS; font-size: 10pt; font-weight: bold; color: #000000;  margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px }
    +	  .commentbody   { font-family: Comic Sans MS; font-size: 9pt; color: #000000; margin-top: 0px;  margin-bottom: 0px;   margin-left: 0px; margin-right: 0px }
    +	  .commentbyline { font-family: Comic Sans MS; font-size: 8pt; color: #666666; margin-top: 0px;  margin-bottom: 10px;  margin-left: 0px; margin-right: 0px }
    +	  .commentdateheader { font-family: Comic Sans MS; font-size: 8pt; color: #000000; margin-top: 0px; margin-bottom: 0px;   margin-left: 0px; margin-right: 0px }
    +
    +	  .navigate { font-family: Comic Sans MS; font-size: 8pt; font-weight: bold; color: #000000 }
    +
    +	  .responseto { font-family: Comic Sans MS; font-size: 8pt; color: #666666; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right:0px }
    +
    +	  a.navigate:link     { color: rgb(0,102,153); text-decoration : underline; }
    +	  a.navigate:visited  { color: rgb(0,153,102); text-decoration : underline; }
    +	  a.navigate:hover    { color: rgb(0,102,102); text-decoration : underline; }
    +	-->
    +  </style>
    +<!-- the contents of the weblog -->
    +
    +<!-- main weblog page -->
    +
    +
    +
    +
    +
    +<?xml version="1.0"?>
    +[#main_page]
    +<bloggerblog>
    +
    +
    +[#messages][#visible_message]
    +  <blogentry>
    +   <body><![CDATA[[$message_body]]]></body>
    +   <title>[$message_title]</title>
    +   <date>[$post_month]/[$post_day]/[$post_year] [$post_hour_dd]:[$post_minute]:[$post_second] [$post_time_ap]m</date>
    +   <author>[$author_nickname]</author>
    +  </blogentry>
    +
    + [/#visible_message]
    +[/#messages]
    +</bloggerblog>
    +[/#main_page]
    +
    +</body>
    +</html>
    + Don't forget to save changes! +
  2. +
  3. Save the generated page as blogger.xml
  4. +
  5. Edit blogger.xml and remove the header and footer of the file (the file should start with <bloggerblog> and end with </bloggerblog>)
  6. +
+ +

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('!()!', "$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('!

\s*(]*>)!', "$1", $text); + $text = preg_replace('!(]*>)\s*

|"!', "$1", $text); + if ($br) $text = preg_replace('|(?)\s*\n|', "
\n", $text); // optionally make line breaks + $text = preg_replace('!(]*>)\s*
!', "$1", $text); + $text = preg_replace('!
(\s*)!', '$1', $text); + // some cleanup + $text = str_replace('


','

',$text); + $text = str_replace("
\n

",'

',$text); + return $text; + } + + function encoding($s){ + global $input; + if (is_callable("iconv")) + return iconv($input,'utf-8',$s); + else + return $s; + } + +?> + + + + +WordPress to Nucleus CMS convertor + + + + + + +
+

WordPress »» Nucleus CMS »» convertor

+ + +

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.

+Please correct these errors first!


"; + } else { + /* */ + /* transfer data ! */ + /* */ + $prefixwp=$_POST['wpprefix']; + + /* *********************************************** */ + echo "

Getting encoding...

"; + $query="select option_value from ".$prefixwp."options where option_name='blog_charset'"; + $querywp=mysql_query($query,$linkwp) or die($query); + if ($row=mysql_fetch_object($querywp)) + $input=$row->option_value; + else + $input="utf-8"; + echo "

Encoding: $input

"; + + /* *********************************************** */ + echo "

Transfering categories...

"; + mysql_query("delete from ". sql_table('category') . " where cdesc='@wordpress'",$linkblogcms); + $q = mysql_query("SELECT count(*) as result FROM " . sql_table('category')); + $total_row = mysql_fetch_object($q); + $total_num = $total_row->result; + $catdd = $total_num; + $total_num++; + + $query="SELECT * FROM `".$prefixwp."term_taxonomy` , `".$prefixwp."terms` WHERE ".$prefixwp."term_taxonomy.term_taxonomy_id = ".$prefixwp."terms.term_id AND ".$prefixwp."term_taxonomy.taxonomy='category'"; + $querywp=mysql_query($query,$linkwp) or die($query); + echo "

rows to transfer: ".mysql_num_rows($querywp)."

"; + echo "

"; + $cate_map = array(); + while ($row=mysql_fetch_object($querywp)) { + echo $total_num.", "; + $cate_map[$row->term_id] = $total_num; + $query= + "insert into " . sql_table('category') . + " (catid,cblog,cname,cdesc) values (". + intval($total_num).",1,'".encoding($row->name)."','@wordpress')"; + $result = mysql_query($query,$linkblogcms) or die($query); + $total_num++; + } + echo "

"; + + /* *********************************************** */ + echo "

Transfering posts and comments...

"; + 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 "

"; + + // done + echo "

Done! Enjoy your stay in Nucleus

"; + die; + } + + } +?> +
+ +

WordPress (v3.1.x) Database Info

+
WP info +
+
+
+
+ +
+ +

New Nucleus:CMS Database Info

+
Nucleus:CMS info +
+
+
+
+
+ +

Submit

+
+ +
+ +
+
+ diff --git a/nucleus/documentation/devdocs/custominstall.html b/nucleus/documentation/devdocs/custominstall.html new file mode 100644 index 0000000..e060239 --- /dev/null +++ b/nucleus/documentation/devdocs/custominstall.html @@ -0,0 +1,67 @@ + + + + + Nucleus - Custom Install Scripts + + + + +
+Customized Install Scripts +
+ +

Note: this functionality is only available in versions > v2.2.

+ +

Introduction

+ +

+Back to the developer docs index +

+ +

+This document contains information on how to customize the Nucleus install script. It can be customized in two ways: +

+ +
    +
  1. Automatically install skins
  2. +
  3. Automatically install plugins
  4. +
+ +

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. +

+ +

Table of Contents

+ + + + + \ 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. +
  • +
+
+ +

Introduction

+ +

+Back to the developer docs index +

+ +

+This document contains information on how you can write your own Nucleus plugins +

+ +

Table Of Contents

+ + + +

Introduction back to top

+ +

+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 back to top

+ +

+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;
+		}
+	}
+
+}
+?>
+ +
    +
  1. + 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. +
  2. +
  3. Open the Nucleus Administration area and go into Nucleus Management/Manage Plugins
  4. +
  5. 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.
  6. +
  7. + 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! +
  8. +
  9. Now visit a page that uses the skin you edited: notice the "Hello World" at the location where you've added the plugin-skinvar.
  10. +
+ +

+So, that wasn't so hard after all. Read on to find out more. +

+ + + + + + + +

The class NucleusPlugin back to top

+ +

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 SignatureExplanation
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)
Method SignatureExplanation
+ createOption(...) +
createBlogOption(...)(v2.2) +
createCategoryOption(...)(v2.2) +
createMemberOption(...)(v2.2) +
createItemOption(...)(v3.2) +
Creates a new option
+ deleteOption(...) +
deleteBlogOption(...)(v2.2) +
deleteCategoryOption(...)(v2.2) +
deleteMemberOption(...)(v2.2) +
deleteItemOption(...)(v3.2) +
Deletes an option
+ setOption(...) +
setBlogOption(...)(v2.2) +
setCategoryOption(...)(v2.2) +
setMemberOption(...)(v2.2) +
setItemOption(...)(v3.2) +
Sets the value of an option
+ getOption(...) +
getBlogOption(...)(v2.2) +
getCategoryOption(...)(v2.2) +
getMemberOption(...)(v2.2) +
getItemOption(...)(v3.2) +
Retrieves the value of an option
+ getAllBlogOptions(...)(v2.2) +
getAllCategoryOptions(...)(v2.2) +
getAllMemberOptions(...)(v2.2) +
getAllItemOptions(...)(v3.2) +
For a given option, returns an associative of all values (one value per context)
+ getBlogOptionTop(...)(v3.2) +
getMemberOptionTop(...)(v3.2) +
getCategoryOptionTop(...)(v3.2) +
getItemOptionTop(...)(v3.2) +
For a given option, returns the top of all values
getID()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 back to top

+ +

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: +

+ +
function doSkinVar($skinType)
+function doSkinVar($skinType, $param1, $param2)
+function doSkinVar($skinType, $skinVar, $param1, $param2)
+function doSkinVar($skinType, $skinVar, $param1 = 'default value')
+ +
    +
  • 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 back to top

+ +

Description

+ +

+Template plugin variables work in the same way as skin plugin vars. There are two differences:

+ +
    +
  1. They are called from within templates instead of from within skins
  2. +
  3. 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! +
  4. +
+ +

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. +

+ +
function doTemplateVar(&$item)
+function doTemplateVar(&$item, $param1, $param2)
+function doTemplateVar(&$item, $type, $param1, $param2)
+function doTemplateVar(&$item, $type, $param1 = 'default value')
+function doTemplateCommentsVar(&$item, &$comment)
+function doTemplateCommentsVar(&$item, &$comment, $param1, $param2)
+function doTemplateCommentsVar(&$item, &$comment, $type, $param1, $param2)
+function doTemplateCommentsVar(&$item, &$comment, $type, $param1 = 'default value')
+ +

Notes

+ +
    +
  • (v2.0b) You can find the name of the template that's currently being used inside the global variable $currentTemplateName
  • +
+ + + + +

Actions back to top

+ +

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 back to top

+ +

+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. +

+ +
class NP_Acronyms extends NucleusPlugin {
+  ...
+  function getEventList() { return array('PreAddComment'); }
+  ...
+  function event_PreAddComment(&$data) {
+	// replace acronym HTML
+	$data['comment']['body'] =
+		strreplace('HTML',
+				   '<acronym title="HyperText Markup Language">HTML</acronym>',
+				   $data['comment']['body']);
+  }
+}
+
+ +

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:

+ +
    +
  1. Add the event name to the array returned by the getEventList-method
  2. +
  3. Create a method with signature event_EventName($data), in which the handling of the event is done
  4. +
+ +

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
NameWhenParameters
InitSkinParseJust 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')
+
PreSkinParseImmediately 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
+
PostSkinParseImmediately 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')
+
PreItemBefore an item is parsed, but after the item header has been placed
+
blog
+
BLOG object
+
item
+
object containing item data
+
PostItemAfter an item has been parsed, but before the item footer has been parsed
+
blog
+
BLOG object
+
item
+
object containing item data
+
PreCommentBefore a comment is shown
+
comment
+
associative array containing comment data
+
PostCommentAfter a comment has been shown
+
comment
+
associative array containing comment data
+
PreDateHeadBefore a date header is shown
+
blog
+
BLOG object
+
timestamp
+
Timestamp for date header
+
PostDateHeadAfter a date header has been parsed
+
blog
+
BLOG object
+
timestamp
+
Timestamp for date header
+
PreDateFootBefore a date footer is parsed
+
blog
+
BLOG object
+
timestamp
+
Timestamp for day that is closed
+
PostDateFootAfter a date footer has been parsed
+
blog
+
BLOG object
+
timestamp
+
Timestamp for day that is closed
+
LoginSuccessAfter a successful login
+
member
+
MEMBER object
+
username
+
login name that was used in the login attempt
+
LoginFailedAfter a failed login
+
username
+
login name that was used in the login attempt
+
LogoutAfter logout
+
username
+
name of the user that logged out
+
PreBlogContentBefore 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')
+
PostBlogContentAfter 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')
+
PreAddCommentBefore adding a comment to the database
+
comment
+
comment data (associative array)
+
spamcheck
+
the resulting datastructure of the previously called SpamCheck event (associative array)
+
PostAddCommentAfter 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)
+
PostRegisterAfter a new user has registered
+
member
+
New MEMBER object
+
PostAddItemAfter an item has been added to the database
+
itemid
+
new itemid in database
+
PostUpdateItemImmediately after an item gets updates in the database
+
itemid
+
item ID
+
PreAddItemImmediately 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
+
PreUpdateItemImmediately 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
+
PrepareItemForEditCalled after getting an item from the database, and before presenting it to the user to be edited.
+
item
+
associative array containing item data
+
PreUpdateCommentImmediately before a comment is updated and saved into the database
+
body
+
Comment body
+
PrepareCommentForEditAfter 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: +
<h4>plugin name</h4>
+<form method="post" action="..."><p>
+your stuff
+</p></form>
+ 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 clearedNone
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: +
<h4>plugin name</h4>
+<form method="post" action="..."><p>
+your stuff
+</p></form>
+ 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: +
<h4>plugin name</h4>
+<form method="post" action="..."><p>
+your stuff
+</p></form>
+ 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 back to top

+ +

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:

+ +
    +
  1. Global options: Editable on the admin area from the plugins section.
  2. +
  3. Blog options: Editable from the blogsettings pages.
  4. +
  5. Category options: Editable from the blogsettings pages (on the 'edit category' page).
  6. +
  7. Member options: Editable on the 'edit member' pages
  8. +
  9. Item options: Editable on the 'add item' or 'edit item' pages
  10. +
+ +

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.

+ + + + + + + + + + +
keyexplanation
datatypeUsing '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')
accessIf 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

+ +
    +
  1. The name of an option can contain a maximum of 20 characters
  2. +
  3. The description of an option can contain a maximum of 255 characters
  4. +
  5. The value for an option has no limit (Prior to v2.5 the limit was 128 characters)
  6. +
  7. The characters '=', '|' and ';' can not be used inside a select list (for a select-option), or in option-metadata
  8. +
+ +

The methods

+ +

createOption($name, $desc, $type, $defValue = '', $typeExtras = '')

+ +

Creates a new option in the global context

+ + + + + + + + + + + + + + + + + + + +
parametervalue
$nameOption name
$descTextual description, to be shown on the page where options can be edited
$typeOption type (see above)
$defValueInitial value
$typeExtrasExtra info on option type (see above)
+ +

[v2.2] createBlogOption($name, $desc, $type, $defValue = '', $typeExtras = '')

+ +

Creates an option in the blog context (see createOption)

+ +

[v2.2] createCategoryOption($name, $desc, $type, $defValue = '', $typeExtras = '')

+ +

Creates an option in the category context (see createOption)

+ +

[v2.2] createMemberOption($name, $desc, $type, $defValue = '', $typeExtras = '')

+ +

Creates an option in the member context (see createOption)

+ +

[v3.2] createItemOption($name, $desc, $type, $defValue = '', $typeExtras = '')

+ +

Creates an option in the item context (see createOption)

+ +

setOption($name, $value)

+ +

changes the value of an option that was already in the database

+ + + + + + + + + + +
parametervalue
$nameOption name
$valueNew value for option
+ +

[v2.2] setBlogOption($blogid, $name, $value)

+ +

Changes the value for a blog option. The blogid attribute indicates for which blog the option is valid. (other options: see setOption)

+ +

[v2.2] setCategoryOption($catid, $name, $value)

+ +

Changes the value for a category option. The catid attribute indicates for which category the option is valid. (other options: see setOption)

+ +

[v2.2] setMemberOption($memberid, $name, $value)

+ +

Changes the value for a member option. The memberid attribute indicates for which member the option is valid. (other options: see setOption)

+ +

[v3.2] setItemOption($itemid, $name, $value)

+ +

Changes the value for an item option. The itemid attribute indicates for which item the option is valid. (other options: see setOption)

+ +

getOption($name)

+ +

Returns the value for an option in the database

+ + + + + + + +
parametervalue
$nameOption name
+ +

[v2.2] getBlogOption($blogid, $name)

+ +

Returns the value for a blog option. blogid indicates for which blog a value is requested (other parameters: see getOption)

+ +

[v2.2] getCategoryOption($catid, $name)

+ +

Returns the value for a category option. catid indicates for which category a value is requested (other parameters: see getOption)

+ +

[v2.2] getMemberOption($memberid, $name)

+ +

Returns the value for a member option. memberid indicates for which member a value is requested (other parameters: see getOption)

+ +

[v3.2] getItemOption($itemid, $name)

+ +

Returns the value for an item option. itemid indicates for which item a value is requested (other parameters: see getOption)

+ +

deleteOption($name)

+ +

Deletes an option from the database

+ + + + + + + +
parametervalue
$nameOption name
+ +

[v2.2] deleteBlogOption($name)

+ +

Deletes a blog option (see deleteOption)

+ +

[v2.2] deleteCategoryOption($name)

+ +

Deletes a category option (see deleteOption)

+ +

[v2.2] deleteMemberOption($name)

+ +

Deletes a member option (see deleteOption)

+ +

[v3.2] deleteItemOption($name)

+ +

Deletes an item option (see deleteOption)

+ +

[v2.2] getAllBlogOptions($name)

+ +

Returns all values for a given blog option. The result is an associative array with a value for each existing blogid

+ +

[v2.2] getAllCategoryOptions($name)

+ +

Returns all values for a given category option. The result is an associative array with a value for each existing catid

+ +

[v2.2] getAllMemberOptions($name)

+ +

Returns all values for a given member option. The result is an associative array with a value for each existing memberid

+ +

[v3.2] getAllItemOptions($name)

+ +

Returns all values for a given item option. The result is an associative array with a value for each existing itemid

+ +

[v3.2] getBlogOptionTop($name, $amount = 10, $sort = 'desc')

+ +

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 blogid ('id')

+ + + + + + + + + + + + + +
parametervalue
$nameOption name
$amountThe amount of options you want
$sortSort ascending ('asc') or descending ('desc')
+ +

[v3.2] getMemberOptionTop($name, $amount = 10, $sort = 'desc')

+ +

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)

+ +

[v3.2] getCategoryOptionTop($name, $amount = 10, $sort = 'desc')

+ +

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)

+ +

[v3.2] getItemOptionTop($name, $amount = 10, $sort = 'desc')

+ +

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 back to top

+ +

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';)

+ +
    +
  1. Instead of using a fixed tablename like nucleus_item, use the global function sql_table('item') to generate the prefixed tablename
  2. +
  3. 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)
  4. +
  5. 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)
  6. +
+ +

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 back to top

+ +

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:

+ +
    +
  1. Create a subdirectory of the plugins directory, and name it pluginname if your plugin is NP_PluginName. Note that the name should be lowercase!
  2. +
  3. + 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();
    +
    +?>
    +
  4. +
  5. + Subscribe to the QuickMenu event and add this code in your plugin: +
    function event_QuickMenu(&$data) {
    +		array_push(
    +			$data['options'],
    +			array(
    +				'title' => 'Plugin Name',
    +				'url' => $this->getAdminURL(),
    +				'tooltip' => 'Tooltip text'
    +			)
    +		);
    +	}
    +
  6. +
  7. + Implement this method in your plugin: +
    function hasAdminArea()
    +{
    +	return 1;
    +}
    +
  8. +
  9. 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'));
    +}
    +
  10. +
+ +

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 back to top

+ +

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:

+
    +
  1. 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.
  2. +
  3. 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>
    +
  4. +
  5. Return a value larger than 0 for supportsFeature('HelpPage'): +
    function supportsFeature($what) {
    +	switch($what) {
    +	case 'HelpPage':
    +		return 1;
    +	  default:
    +		return 0;
    +	}
    +  }
    +
  6. +
+ +

Plugin Dependency Check back to top

+ +

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 back to top

+ +

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.

+ +
    +
  1. 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.
  2. +
  3. Create plugin directory + +If your plugin name is NP_AbcDef, the plugin directory name is abcdef (always lower case).
  4. +
  5. 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).
  6. +
  7. 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).
  8. +
  9. Replace static strings + +Replace static strings in your plugin with the defined names so they will change according to the language file.
  10. +
  11. 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');
    +   }
    +
  12. +This logic is same as Nucleus’ language file setting. +
  13. Add language files + +As English is the default language, it is recommended to have at least the English version.
  14. +
+ + + +

Formatting your SkinVar output back to top

+ +

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
NameWhatParametersDescription
$CONF['AdminURL']Global variableNoneFull URL to the Nucleus Admin Area
$CONF['PluginURL']Global variableNoneFull URL to the Nucleus plugins directory. Use it to link to a plugin's admin page, like this $CONF['PluginURL'].'pluginname/'
$CONF['ActionURL']Global variableNoneFull URL to the Nucleus action.php file
$CONF['MediaURL']Global variableNoneFull URL to the Nucleus media folder
$CONF['SkinsURL']Global variableNoneFull URL to the Nucleus skins folder
$CONF['IndexURL']Global variableNoneFull URL to the main Nucleus directory.
$DIR_NUCLEUSGlobal variableNoneFull system path to the Nucleus Admin folder
$DIR_SKINSGlobal variableNoneFull system path to the Nucleus skins folder
$DIR_MEDIAGlobal variableNoneFull system path to the Nucleus media folder
$DIR_PLUGINSGlobal variableNoneFull system path to the Nucleus plugins folder
$DIR_LANGGlobal variableNoneFull system path to the Nucleus language folder
$DIR_LIBSGlobal variableNoneFull system path to the Nucleus libs folder
getAdminURL()method, PLUGIN classNoneReturns 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 classNoneReturns 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%>.

+ +
    +
  1. 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: +
    $mytemplate = $this->getOption('my_template');
    +$couples = array(
    +			array(
    +				'foo'=>'Ricky',
    +				'bar'=>'Lucy'),
    +			array(
    +				'foo'=>'Sid',
    +				'bar'=>'Nancy'),
    +			array(
    +				'foo'=>'Mickey',
    +				'bar'=>'Minnie')
    +			);
    +foreach ($couples as $values) {
    +	echo TEMPLATE::fill($mytemplate,$values);
    +}
    + Now the skinvar for our plugin <%TemplateTest%> will output three lines like this: +
    <li>Ricky loves Lucy</li>
    +<li>Sid loves Nancy</li>
    +<li>Mickey loves Minnie</li>
    +
  2. + +
  3. 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. +
    function doSkinVar($skinType,$template = '') {
    +	global $blog, $CONF, $manager,$member;
    +
    +	$template =& $manager->getTemplate($template);
    +	if (trim($template['templatetest_body']) == '')
    +		$template['templatetest_body'] = $this->getOption('my_template');
    +		
    +	$couples = array(
    +			array(
    +				'foo'=>'Ricky',
    +				'bar'=>'Lucy'),
    +			array(
    +				'foo'=>'Sid',
    +				'bar'=>'Nancy'),
    +			array(
    +				'foo'=>'Mickey',
    +				'bar'=>'Minnie')
    +			);
    +	foreach ($couples as $values) {
    +		echo TEMPLATE::fill($template['templatetest_body'],$values);
    +	}	
    +}
    + 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: +
    <li>Ricky loves Lucy!!!</li>
    +<li>Sid loves Nancy!!!</li>
    +<li>Mickey loves Minnie!!!</li>
    +
  4. + +
  5. 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 +
    function doSkinVar($skinType,$item1 = 0,$item2 = 0,$item3 = 0,$item4 = 0) {
    +	global $blog;
    +	$highlight = '';
    +	$template = 'default/index';
    +	$item_array = array($item1,$item2,$item3,$item4);
    +	$blog->readLogFromList($item_array, $template);
    +}
    + +
  6. +
+ + +

Additional Reading back to top

+ +

As this document is intended to get you started, there are other resources available that offer additional insight.

+ + + + + + diff --git a/nucleus/documentation/devdocs/sqltables.html b/nucleus/documentation/devdocs/sqltables.html new file mode 100644 index 0000000..cf95f07 --- /dev/null +++ b/nucleus/documentation/devdocs/sqltables.html @@ -0,0 +1,1258 @@ + + + + + Nucleus - SQL Table Structure + + + + + + + +
+SQL Table Reference +November 1, 2010 +
+ +

Introduction

+ +

+Back to the developer docs index +

+ +

+This document contains information on the fields inside the Nucleus database tables. +

+ +

The structure as presented here is for Nucleus v3.6.

+ +

Table Of Contents

+ + + + +

Color codesback to top

+ +

This document uses some visual styles to indicate the type of columns. An overview is listed below:

+ + + + + + + + + + + + + +
primaryPrimary keys
foreignForeign keys (click to go to the references value in other columns). Please note that MySQL does not enforce foreign key restrictions.
toremoveTables/columns that will probably be removed in upcoming Nucleus version, in favor of plugins that provide the same functionality.
fulltextThere is a fulltext index on the column (used for searches).
+ + + +

Table nucleus_blogback to top

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
bnumberint(11)Blog ID
bnamevarchar(60)''Blog Name
bshortnamevarchar(15)''Short Blog Name (as used in skinvars <%blog%> etc.)
bdescvarchar(200)NULLBlog Description
bcommentstinyint(2)'1'Enable comments (1=true, 0=false)
bmaxcommentsint(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.
btimeoffsetdecimal(3,1)'0.0'Time offset to use. The items will be stored in the database using the correct time (server time+offset).
bnotifyvarchar(128)NULLNotify 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.
burlvarchar(100)NULLBlog URL
bupdatevarchar(60)NULLUpdate 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.
bdefskinint(11)'1'Default skin to use when displaying this weblog
bpublictinyint(2)'1'Allow comments by non-registered members? (1=true/0=false)
bconvertbreakstinyint(2)'1'Convert line breaks to <br />? (1=true/0=false)
bdefcatint(11)NULLDefault category. This category will be selected by default when no other category is selected.
bnotifytypeint(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) +
ballowpasttinyint(2)'0'Allow backdating of items and editing the timestamp of an item (1=true/0=false)
bincludesearchtinyint(2)'0'Always include in search queries, even if the query is on another blog (1=true/0=false)
breqemailtinyint(2)'0'Require non-members to supply an email address when adding comments (1=true/0=false)
bfutureposttinyint(2)'0'Whether blog has future posts awaiting publishing (1=true/0=false)
+ + + +

Table nucleus_categoryback to top

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
catidint(11)Category ID
cblogint(11)'0'Blog to which the category belongs
cnamevarchar(40)NULLCategory Name
cdescvarchar(200)NULLCategory Description
+ + + +

Table nucleus_itemback to top

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
inumberint(11)Item ID
ititlevarchar(160)NULLTitle
ibodytextBody text
imoretextExtended text
iblogint(11)'0'Blog to which the item belongs to
iauthorint(11)'0'Member that is the author of the item
itimedatetime'0000-00-00 00:00:00'Item time (this is the corrected time, with offset already applies)
iclosedtinyint(2)'0'Is item closed? (1=true/0=false). When an item is closed, it's no longer possible to add new comments or cast 'karma votes'
idrafttinyint(2)'0'Is the item a draft version? Draft versions only show up in the admin area.
ikarmaposint(11)'0'Total amount of positive karma votes casted
ikarmanegint(11)'0'Total amount of negative karma votes casted
icatint(11)NULLCategory to which the item belongs
ipostedtinyint(2)'1'Is the item posted? 0 means it is awaiting publication on a future date.
+ + + +

Table nucleus_commentback to top

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
cnumberint(11)Comment ID
cbodytextComment text
cuservarchar(40)NULLAnonymous user name (only used when comment was placed by a non-member. For members, see cmember)
cmailvarchar(100)NULLURL or, pre-3.3, E-mail address (only used when comment was placed by a non-member. For members, see cmember)
cemailvarchar(100)NULLE-mail address (only used when comment was placed by a non-member. For members, see cmember)
cmemberint(11)NULLID of site member that placed the commend (0 for comments by non-members)
citemint(11)'0'Item ID to which the comment is attached
ctimedatetime'0000-00-00 00:00:00'Time of comment
chostvarchar(60)NULLHostname from where the comment was placed
cipvarchar(15)''IP address from where the comment was placed
cblogint(11)'0'Blog to which the comment belongs (this is redundant information)
+ + + + +

Table nucleus_memberback to top

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
mnumberint(11)Member ID
mnamevarchar(32)''Display name (the one used to login)
mrealnamevarchar(60)NULLFull name
mpasswordvarchar(40)''password (md5 hash)
memailvarchar(60)NULLE-mail address. This should always be a valid address.
murlvarchar(100)NULLURL of members site
mnotesvarchar(100)NULLExtra notes (members can fill these out themselves)
madmintinyint(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)
mcanlogintinyint(2)'1'Can logon to admin area? (1=true/0=false)
mcookiekeyvarchar(40)NULLA 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).
deflangvarchar(20)''Language file to use for this member. When empty, uses the default site language.
+ + + + + +

Table nucleus_teamback to top

+ +

For each team member of a blog, there is a row in this table.

+ + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
tmemberint(11)'0'Member ID
tblogint(11)'0'Blog of which member is on team
tadmintinyint(2)'0'Is blog admin? (0=false/1=true; each blog must have at least one admin)
+ + + +

Table nucleus_pluginback to top

+ + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
pidint(11)Plugin ID
pfilevarchar(40)''Filename (e.g. NP_CommentControl) of plugin. This must be a file in the plugins directory (.php extension).
porderint(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_eventback to top

+ +

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

+ + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
pidint(11)'0'Plugin ID
eventvarchar(40)NULLName of event
+ + +

Table nucleus_plugin_optionback to top

+ +

Values for the plugin options. See the nucleus_plugin_option_desc table for the definition of the options itself.

+ + + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
oidint(11)Identification of the option (See the nucleus_plugin_option_desc table)
ovalueTEXT''Value of the option
ocontextidint(11)'0' + Semantics depend on the option context type, + +
+ + + +

Table nucleus_plugin_option_descback to top

+ +

For each option created by a plugin, a row is present in this table.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
oidint(11)Option ID. Used from nucleus_plugin_option
opidint(11)'0'Plugin to which the option belongs
onamevarchar(20)''Name of the option
ocontextvarchar(20)''Context of the option (global, blog, category, member)
odescvarchar(255)NULLOption description
otypevarchar(20)NULLoption type. See plugin documentation.
odeftextDefault value for options
oextratextExtra data needed for some option types (e.g. select option type)
+ + +

Table nucleus_skinback to top

+ + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
sdescint(11)'0'Reference to the skin description
stypevarchar(20)'' + Skinpart type +
    +
  • index
  • +
  • item
  • +
  • archive
  • +
  • archivelist
  • +
  • search
  • +
  • error
  • +
  • member
  • +
  • imagepopup
  • +
+
scontenttextContents of the skinpart
+ + +

Table nucleus_skin_descback to top

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
sdnumberint(11)Skin ID
sdnamevarchar(20)''Name of skin
sddescvarchar(200)NULLSkin description
sdtypevarchar(40)'text/html'mimetype of skin
sdincmodevarchar(10)'normal' + Include mode +
    +
  • normal
  • +
  • skindir
  • +
+
sdincprefvarchar(50)''Prefix to use when including files
+ + +

Table nucleus_templateback to top

+ + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
tdescint(11)'0'Reference to template description info
tpartnamevarchar(64)'' + Name of template part +
    +
  • ARCHIVELIST_FOOTER
  • +
  • ARCHIVELIST_HEADER
  • +
  • ARCHIVELIST_LISTITEM
  • +
  • BLOGLIST_FOOTER
  • +
  • BLOGLIST_HEADER
  • +
  • BLOGLIST_LISTITEM
  • +
  • CATLIST_FOOTER
  • +
  • CATLIST_HEADER
  • +
  • CATLIST_LISTITEM
  • +
  • COMMENTS_AUTH
  • +
  • COMMENTS_BODY
  • +
  • COMMENTS_CONTINUED
  • +
  • COMMENTS_FOOTER
  • +
  • COMMENTS_HEADER
  • +
  • COMMENTS_MANY
  • +
  • COMMENTS_NONE
  • +
  • COMMENTS_ONE
  • +
  • COMMENTS_TOOMUCH
  • +
  • DATE_FOOTER
  • +
  • DATE_HEADER
  • +
  • EDITLINK
  • +
  • FORMAT_DATE
  • +
  • FORMAT_TIME
  • +
  • IMAGE_CODE
  • +
  • ITEM_FOOTER
  • +
  • ITEM_HEADER
  • +
  • ITEM
  • +
  • LOCALE
  • +
  • MEDIA_CODE
  • +
  • MORELINK
  • +
  • NEW
  • +
  • POPUP_CODE
  • +
  • SEARCH_HIGHLIGHT
  • +
  • SEARCH_NOTHINGFOUND
  • +
  • other template fields as added by plugins using TemplateExtraFields event
  • +
+
tcontenttextContents of templatepart
+ + + +

Table nucleus_template_descback to top

+ + + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
tdnumberint(11)Template ID
tdnamevarchar(64)''Name of template
tddescvarchar(200)NULLTemplate description
+ + +

Table nucleus_actionlogback to top

+ +

[[general purpose description]]

+ + + + + + + + + + + + + + + + + +
Column NameTypeDescription
timestampdatetime'0000-00-00 00:00:00'Time of action
messagevarchar(255)''Action message
+ + + + +

Table nucleus_configback to top

+ +

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 NameTypeDefaultDescription
namevarchar(20)''Option name
valuevarchar(128)NULLOption 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)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefault ValueDescription
DefaultBlog1Default weblog. This is the blog that will be used when no other blog has been specified in the request.
AdminEmailE-mail address of site administrator
IndexURLURL of website. Should end with a slash.
LanguageenglishLanguage file to use by default. A file languagename.php must exist in the languages directory.
SessionCookie0Use session cookie instead of cookies with a lifetime of one month?
AllowMemberCreate0Allow visitors to create their own account?
AllowMemberMail1Allow members to send messages to each other through the member mail forms (e-mail addresses remain hidden)
SiteNameName of the website
AdminURLURL of admin area. Should end with a slash.
NewMemberCanLogon1Can newly registered members login right away? If not, the administrator will have to change their 'can login' option first
DisableSite0Is the website disabled? If so, only the administrator can access it. All other visitors are redirected to DisableSiteURL.
DisableSiteURLAn URL to redirect to when the site is disabled.
LastVisit0Save 'Last Visit' cookies
MediaURLURL of media folder. Should end with a slash.
AllowedTypesjpg, jpeg, gif, mpg, mpeg, avi, mov, mp3, swf, pngFiletypes that can be uploaded
AllowLoginEdit0Allow members to edit their login name and password?
AllowUpload1Allow file uploads?
DisableJsTools2 + Style of the javascript toolbar: +
    +
  • 0: full featured (IE)
  • +
  • 1: toolbar disabled
  • +
  • 2: simpler (Gecko)
  • +
+
CookiePath/Path to set cookie on
CookiePrefixString 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.
CookieDomainDomain to set cookie on
CookieSecure0Secure cookie (https)
MediaPrefix1If true, the uploaded files get the current date in their filename.
MaxUploadSize1048576Max. size of uploaded files (in bytes)
NonmemberMail0Allow non-members to send e-mail messages to site members?
PluginURLURL of plugin folder. Should end with a slash.
ProtectMemNames1When 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.
BaseSkin1The 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.
SkinsURLURL of skins folder. Should end with a slash.
ActionURLURL of action.php script.
URLModenormaleither normal or pathinfo
DatabaseVersion250Last Nucleus version for which the database structure has been updated (introduced in Nucleus v2.5)
DebugVars0Whether unresolved variables should be displayed in skins (introduced in Nucleus v3.4)
DefaultListSize10Set the size of lists in the admin area (introduced in Nucleus v3.4)
+

Table nucleus_ticketsback to top

+ +

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 NameTypeDefaultDescription
ticketvarchar(40)Unique ticket, valid for one particular member. A typical ticket looks like this: 65303a785423b4d53c7b3e6579766f26
memberint(11)Member for which this ticket is valid.
ctimedatetimeTime of ticket creation. A ticket is valid no longer than one hour.
+ + + +

Table nucleus_activationback to top

+ +

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 NameTypeDefaultDescription
vkeyvarchar(40)Activation key. This key needs to be passed to the member activation code. A typical key looks like this: 41cf637d4fbeeff954b4ca70b8bde9dd
vmemberint(11)Member which needs to be activated.
vtimedatetimeTime at which activation key was generated. Each activation key is valid no longer than 2 days.
vtypevarchar(15)Type of activation. +
    +
  • forgot: member forgot his password.
  • +
  • register: new member registration.
  • +
  • addresschange: member changed his e-mail address.
  • +
+
vextravarchar(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_karmaback to top

+ +

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.

+ + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
itemidint(11)'0'Item ID
ipchar(15)''IP address of voter
+ + +

Table nucleus_banback to top

+ +

This table will most likely be removed in future Nucleus version, in favor of plugins with the same functionality.

+ +

IP bans. These people cannot comment or cast karma votes.

+ + + + + + + + + + + + + + + + + + + + + + +
Column NameTypeDefaultDescription
iprangevarchar(15)''IP 'range'. This can either be a full IP address or part of an IP address (starting from the left) to ban ranges
reasonvarchar(255)''A message with the reason why someone was banned. This message will be shown when they try to add a comment/cast a vote.
blogidint(11)'0'Blog for which the ban is active
+ + + + diff --git a/nucleus/documentation/devdocs/styles/manual.css b/nucleus/documentation/devdocs/styles/manual.css new file mode 100644 index 0000000..e0b89db --- /dev/null +++ b/nucleus/documentation/devdocs/styles/manual.css @@ -0,0 +1,141 @@ +body { + background-color: #fff; + color: #000; + font-family: verdana, arial; + font-size: small; +} + +@media screen { + body { + margin-left: 10%; + margin-right: 10%; + } +} + +@media print { + pre, .note, td, th { + border: 1px dashed gray; + } +} + +img { + border: none; +} + +a:link, a:visited { + color: #1D3565; + font-weight: bold; + text-decoration: none; +} +a: hover { + text-decoration: underline; +} + +.heading { + text-align: center; + font-size: xx-large; + font-weight: bold; + color: gray; +} + +.heading i { + position: absolute; + top: 5px; + right: 5px; + font-size: small; + font-style: normal; + font-weight: normal; +} + +p:first-letter { + font-size: large; +} + +p { + text-indent: 20px; +} + +h1 { + border-bottom: 1px dotted gray; + font-size: x-large; + color: #596d9d; +} + +h2 { + color: gray; + font-size: large; + margin-left: 20px; + text-indent: 10px; + border-bottom: 1px solid #ddd; +} + +pre, .note, .faq .answer { + background-color: #ddd; + padding: 10px; + font-size: small; +} + +.screenshot { + text-align: center; + background-color: #ddd; + padding: 10px; +} + +.faq .question { + font-weight: bold; + margin-bottom: 0px; +} + +.faq .answer { + +} + +.faq { + margin-bottom: 20px; +} + +table { + border: none; +} + +th { + background-color: linen; + font-size: medium; +} + +th, td { + padding: 5px; +} + +td { + background-color: #dddddd; + font-size: small; + vertical-align: top; + text-align: left; +} + +input, select, option, textarea { + background-color: transparent; +} + +.deprecated { + border: 3px solid red; + padding: 5px; + font-size: medium; +} + +tt, code, samp { + font-size: small; +} + +.warning { + color: red; +} +.ok { + color: green; +} + +acronym, abbr { + border-bottom: 1px dotted gray; + cursor: help; +} diff --git a/nucleus/documentation/devdocs/xmlrpc.html b/nucleus/documentation/devdocs/xmlrpc.html new file mode 100644 index 0000000..2e9c6d9 --- /dev/null +++ b/nucleus/documentation/devdocs/xmlrpc.html @@ -0,0 +1,181 @@ + + + + + Nucleus - XML-RPC Interface + + + + +
+XML-RPC Interface +
+ +

Introduction

+ +

+Back to the developer docs index +

+ +

+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 CodeError Message
801Login Error (probably bad username/password combination)
802No Such Blog
803Not a Team Member
804Cannot add Empty Items
805Amount parameter must be in range 1..20 (getRecentItems)
806No Such Item
807Not Allowed to Alter Item
808Invalid media type
809File is too large (max. upload filesize)
810Other error on newMediaObject (message will contain more info about what happened)
other codes < 100Errors encountered by the Useful Inc. XML-RPC implementation
other codes > 100Errors 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: +

+
+<?
+	include('./config.php');
+	selectBlog('myshortblogname');
+	selector();
+?>
+
+
+ +
+

Default Skin

+

+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. +

+
+ +
+

New Member: can login ?

+

+When you allow creation of member accounts by your visitors, this setting defines whether or not accounts created in that way will have the ability to login to the administration area. +

+
+ + +
+

Message Service

+ +

+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.

+ +

Variables

+ +

Within these template, a series of so called template variables can be used to insert item data.

+ +

Example

+

An example

+ +
+ +
+

Templates: Items

+

+An example for the item body template: +

+ +
<h1><%title%></h1>
+
+<p><%body%></p>
+
+<div class="metadata">
+ <a href="<%itemlink%>">link</a> -
+ <%date%> <%time%> -
+ <a href="<%authorlink%>"><%author%></a> -
+ <%comments%>
+</div>
+ +

The result would become something like this:

+ +
+

This is an item

+

This is the text for the item

+
+ link - + August 8th 2002 18:51 - + karma - + no comments +
+
+ +
+ + +
+

Templates: comments

+ +

There are three possible structures for a comments block.

+ +
    +
  1. + When comments are displayed (like on detail pages, or on the main page when there are less than the maximum allowed amount of comments) +
    comments header
    +  comments body (repeated)
    +comments footer
    +
  2. +
  3. + When there are no comments at all +
    +no comments
    +
    +
  4. +
  5. + When there are comments, but there are more than the maximum allowed number. (only applies when not on a detailed item page) +
    +too much comments
    +
    +
  6. +
+ +

Inside these template-parts, some comments-related variables are available

+ +
+ +
+ + +

Templates: Comment headers/footers

+ +

Description

+ +

While the comments-body is repeated for each comment, the header and footer are only displayed once. A typicall structure would look like this:

+
comments header
+  comments body 1
+  comments body 2
+  comments body 3
+comments footer
+

In these template-parts, comments-related templatevars are available

+ +

Examples

+ +

Header:

+
<ul>
+

Body:

+
<li><%user%>: <%body%></li>
+

Footer

+
</ul>
+

Result

+ +
    +
  • karma: nice!
  • +
  • xiffy: yes indeed!
  • +
+ +
+ +
+

Templates: Link to extended entry

+

+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) +

+ + + + + + + + + + + + + + + + + + + +
NameDescription
blogidID of the weblog
archivelinklink to the archive, which you can embed in a <a href=".."> tag.
monthNumber of the month (2 digits: 01-12)
yearYear (4 digits)
dayDay 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.

+ +
+ + + + +
+

Templates: Category Lists

+ +

The category lists are formatted as listed below:

+ +
categorylist header
+  categorylist listitem (repeated)
+categorylist footer
+ +

Available variables: (in the header and footer, only blogid, blogurl, self, catiscurrent, and currentcat are allowed)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
blogidID of the weblog
blogurlURL of the blog (as defined in blogsettings)
selfCurrent page, without parameters (e.g. index.php)
catlinka link to the most recent items for a category, which you can embed in a <a href=".."> tag.
catidCategory ID
catnameCategory name
catdescCategory description
catiscurrentyes if category is currently selected, no if it is not. Useful to style current category.
currentcatSynonym of catiscurrent
+ +

View an example

+ +
+ +
+

Templates: Category Lists Example

+

+(go back) +

+ +

Header

+
<ul>
+  <li><a href="<blogurl%>">All</a></li>
+ +

List Item

+
<li><a href="<%catlink%>"><%catname%></a></li>
+ +

Footer

+
</ul>
+ +

Results in:

+ + + +
+ +
+

Templates: Blog Lists

+ +

The blog lists are formatted as listed below:

+ +
bloglist header
+  bloglist listitem (repeated)
+bloglist footer
+ +

Available variables in list item field:

+ + + + + + + + + + + + + + + + +
NameDescription
bloglinkURL of the blog (as generated by createBlogIdLink() function)
blogurlURL of the blog (as defined in blogsettings)
blogdescDescription of the blog
blognameName of the blog (either full or short, depending on skinvar parameter).
+ +

Available variables in header and footer fields:

+ + + + + + + + + + +
NameDescription
siteurlURL of the site (as defined in global settings)
sitenameName of the site (as defined in global settings).
+ +

View an example

+ +
+ +
+

Templates: Blog Lists Example

+

+(go back) +

+ +

Header

+
<ul>
+  <li><a href="<siteurl%>"><sitename%></a></li>
+ +

List Item

+
<li><a href="<%bloglink%>"><%blogname%></a></li>
+ +

Footer

+
</ul>
+ +

Results in:

+ + + +
+ + + + + + + +
+

Templates: 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 +

+ +
    +
  • en: English
  • +
  • dutch: Dutch
  • +
  • ...
  • +
+ +

+More info in the Open Group Specification for strftime. (opens a new window) +

+ +

+The locale is used for the date and time format, for the dateheaders, and for the archivelist items +

+ +
+ +
+

Templates: Date and Time formats

+

+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

+ +
+<div class="day">
+<h1>%d %B</h1>
+<a href="<%%daylink%%>">(archive)</a>
+
+ +
+ +
+

Templates: Highlight

+

+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:

+ + + + + + + + + + +
NameDescription
blogidID of the weblog
querythe 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>
+ +

Result:

+ +
+

Comment by karma:

+

Nice!

+
(from host.example.org on 2003-03-02 at 13:30)
+
+ +
+ +
+

Templates: Media & Popups

+

+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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
popuplinkan <a href... link ready to use
rawpopuplinkonly the url inside href="..."
popupcodejavascript code to open window
textthe alternate text (link text)
widthimage width
heightimage width
popuptext(=same as text)
linkdirect link to the image (URL)
mediaa non-popup A-tag to the image, ready to use.
+ + +

Inline Image Code

+ + + + + + + + + + + + + + + + + + + + + + +
NameDescription
imagean IMG-tag, ready to use
linkdirect link to the image (URL)
textthe alternate text (link text)
widthimage width
heightimage width
mediaan A-tag to the image, ready to use.
+ +

Media Object Link Code

+ + + + + + + + + + + + + +
NameDescription
mediaan A-tag, ready to use
linkdirect link to the file (URL)
textthe 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 +

+ +

Inside this template-part, some comments-related variables are available.

+ +
+ +
+

Templates: Comments Read More

+

+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. +

+
+ + + +
+

Templates: Edit Link

+

+This template defines how the edit-templatevar will be marked up. You can use any of the template variables here. +

+ +

Example:

+ +
<a href="<%editlink%>"
+   onclick="<%editpopupcode%>">edit</a>
+ +
+ + + + +
+

Skins: Main Index

+

+This skinpart is used to show the most recent entries of your weblog. It's usually the home page of your site. +

+ +

+Very basic buildup for a main index: +

+ +
+<html>
+  <head>
+    <title>My Weblog</title>
+  </head>
+  <body>
+
+    <h1>My Weblog</h1>
+    <%blog(mytemplate,20)%>
+
+  </body>
+</html>
+
+ +

+ This will show the 20 most recent items of the default weblog (unless overridden), using the 'mytemplate' template. +

+
+ + +
+

Skins: Detail Pages

+

+These pages are used to show the full items, all comments that were made and a form to add comments. +

+ +

+Very basic buildup for a detailed item page: +

+ +
+<html>
+  <head>
+    <title>My Weblog :: Item</title>
+  </head>
+  <body>
+
+    <h1>Item</h1>
+    <%item(detailed)%>
+
+    <h1>Comments</h1>
+    <%comments(detailed)%>
+
+    <h1>Add Comment</h1>
+    <%commentform%>
+
+  </body>
+</html>
+
+ +

+ This will show the item and comments using the 'detailed' template, and add a standard commentform. +

+ + +
+ +
+

Skins: Archive List

+

+An overview of all the months for which archives are available, and links to those archives +

+ +

+Very basic buildup for an archive list: +

+ +
+<html>
+  <head>
+    <title>My Weblog :: Archives</title>
+  </head>
+  <body>
+
+    <h1>Archives</h1>
+    <%archivelist(default)%>
+
+  </body>
+</html>
+
+ +

+ This will show the list of all available archive files, using the 'default' template +

+ +
+ +
+

Skins: Archive

+

+An archive for one month. Behaves like a main index, but shows all the items from a certain month. +

+ +

+Very basic buildup for an archive page: +

+ +
+<html>
+  <head>
+    <title>My Weblog :: Archive</title>
+  </head>
+  <body>
+
+    <h1>Archive</h1>
+    <%archive(default)%>
+
+  </body>
+</html>
+
+ +

+ This will show the requested archive using the 'default' template +

+ + +
+ + +
+

Skins: Search

+

+Used to show search results. +

+ +

+Very basic buildup for a searchresults page: +

+ +
+<html>
+  <head>
+    <title>My Weblog :: Search</title>
+  </head>
+  <body>
+
+    <h1>Search</h1>
+    <%searchform%>
+
+    <h1>Searchresults</h1>
+    <%searchresults(default)%>
+
+  </body>
+</html>
+
+ +

+ This will show search results using the 'default' template. +

+ +
+ +
+

Skins: Errors

+

+Used when there is an error +

+ +
+<html>
+  <head>
+    <title>My Weblog :: Error</title>
+  </head>
+  <body>
+
+    <h1>Error!</h1>
+    <%errormessage%>
+
+    <br /><br />
+
+    <a href="javascript:history.back();">Back</a>
+
+  </body>
+</html>
+
+ +

+ This will show the error message, plus a link to go back. +

+ +
+ +
+

Skins: Member

+

+Used to show member details. +

+ +

+Very basic buildup for a member-detail page: +

+ +
+<html>
+  <head>
+    <title>My Weblog :: Member details</title>
+  </head>
+  <body>
+
+    <h1>Info about <%member(name)%></h1>
+    Website:
+    <a href="<%member(url)%>"><%member(url)%></a>
+
+    <h1>Send Message</h1>
+    <%membermailform%>
+
+  </body>
+</html>
+
+ +

+ This will show the members name, website address and a mailform. +

+ +
+ + +
+

Skins: Image Popup

+

+Used when a media file (image) needs to be shown in a popup window. This skin defines the layout that will be used in that case. +

+ +

+Very basic buildup for an imagepopup page: +

+ +
+<html>
+<head>
+  <title><%imagetext%></title>
+  <style type="text/css">
+   img { border: none; }
+  </style>
+</head>
+<body>
+  <a href="javascript:window.close();"><%image%></a>
+</body>
+</html>
+
+ +
+ + +
+

Skins: Main Index

+

+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): +

+http://www.yoursite.tld/index.php?special=fred + +

Further discussion of the use of this feature can be found on the support forum: +Nucleus 3.31 and Static Pages +

+ +

+Very basic buildup for a special skin part: +

+ +
+<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

+

Arguments

+
    +
  • Optional + + + + + + + + + +
    NameValue
    LocaleLocale in which the date must be formatted
    FormatDate format (strftime variables)
    +
  • +
+

Skintypes

+

archive

+

Examples

+
+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
  • +
  • category: name of the category to show
  • +
+

+ +

Skintypes

+ +

+index, item, archive, archivelist, search +

+ +

Examples

+ +
+<%blog(default,15)%>
+<%blog(default,5(15))%>
+<%blog(mytemplate)%>
+<%blog(mytemplate,5,mycategory)%>
+
+ +
+ +
+ +

Skinvar: bloglist

+ +

+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. +
+

+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%bloglist(default/index)%>
+<%bloglist(default/index,name)%> 
+<%bloglist(default/index,shortname)%>
+<%bloglist(default/index,name,name,asc)%> 
+
+ +
+ + + +
+ +

Skinvar: otherblog

+ +

+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
  • +
  • category: name of the category to show
  • +
+

+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%otherblog(myblog,default,15)%>
+<%otherblog(yourblog,mytemplate)%>
+<%otherblog(yourblog,mytemplate,15,mycategory)%>
+<%otherblog(yourblog,mytemplate,5(15),mycategory)%>
+
+ +
+ + + + + + + + + +
+ +

Skinvar: item

+ +

+Shows the currently selected item (without comments) using a given template +

+ +

Arguments

+
    +
  • template: name of the template to use
  • +
+ +

Skintypes

+ +

+item +

+ +

Examples

+ +
+<%item(mytemplate)%>
+
+ +
+ + + + + + + + + +
+ +

Skinvar: comments

+ +

+Shows the comments for the currently selected item using a given template. +

+ +

Arguments

+
    +
  • template: name of the template to use
  • +
+ +

Skintypes

+ +

+item +

+ +

Examples

+ +
+<%comments(mytemplate)%>
+
+ +
+ + + + + + + +
+ +

Skinvar: archive

+ +

+Shows the archive for the selected month and the selected blog (usually the default one), using a given template +

+ +

Arguments

+

+ Required +

    +
  • template: name of the template to use
  • +
+ Optional +
    +
  • category: name of the category to show
  • +
+

+ +

Skintypes

+ +

+archive +

+ +

Examples

+ +
+<%archive(mytemplate)%>
+<%archive(mytemplate,mycategory)%>
+
+ +
+ + + + +
+ +

Skinvar: otherarchive

+ +

+Shows the archive for the selected month, using the given blog and template +

+ +

Arguments

+

+ Required +

    +
  • blogname: name of the blog to use
  • +
  • template: name of the template to use
  • +
+ Optional +
    +
  • category: name of the category to show
  • +
+

+ +

Skintypes

+ +

+archive +

+ +

Examples

+ +
+<%otherarchive(myblog,mytemplate)%>
+<%otherarchive(myblog,mytemplate,mycategory)%>
+
+ +
+ + + + + + + +
+ +

Skinvar: archivelist

+ +

+Shows the list of available archives for the currently selected blog (usually the default one), using a given template +

+ +

Arguments

+

+ Required +

    +
  • template: name of the template to use
  • +
+ Optional +
    +
  • category: name of the category to show
  • +
  • limit: limits the amount of links shown (e.g. if you only want to show links to the past 3 months)
  • +
+

+ +

Skintypes

+ +

+index, archive, archivelist, search, item +

+
+ +
+ +

Skinvar: archivedaylist

+ +

+The same as the archivelist skinvar, but shows an entry for each day instead of for each month +

+ +

Arguments

+

+ Required +

    +
  • template: name of the template to use
  • +
+ Optional +
    +
  • category name of the category to show
  • +
  • limit: limits the amount of links shown (e.g. if you only want to show links to the past 3 months)
  • +
+

+ +

Skintypes

+ +

+index, archive, archivelist, search, item +

+ + +

Examples

+ +
+<%archivedaylist(mytemplate)%>
+<%archivedaylist(mytemplate,mycategory)%>
+
+ +
+ + +
+ +

Skinvar: otherarchivedaylist

+ +

+The same as the otherarchivelist skinvar, but shows an entry for each day instead of for each month + +

+ +

Arguments

+

+ Required +

    +
  • blogname: name of the blog
  • +
  • template: name of the template to use
  • +
+ Optional +
    +
  • category: name of the category to show
  • +
+

+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%otherarchivedaylist(yourblog,mytemplate)%>
+<%otherarchivedaylist(yourblog,mytemplate,mycategory)%>
+
+ +
+ +
+ +

Skinvar: archiveyearlist

+ +

+The same as the archivelist skinvar, but shows an entry for each year instead of for each month +

+ +

Arguments

+

+ Required +

    +
  • template: name of the template to use
  • +
+ Optional +
    +
  • category name of the category to show
  • +
  • limit: limits the amount of links shown (e.g. if you only want to show links to the past 3 years)
  • +
+

+ +

Skintypes

+ +

+index, archive, archivelist, search, item +

+ + +

Examples

+ +
+<%archiveyearlist(mytemplate)%>
+<%archiveyearlist(mytemplate,mycategory)%>
+
+ +
+ + +
+ +

Skinvar: otherarchiveyearlist

+ +

+The same as the otherarchivelist skinvar, but shows an entry for each year instead of for each month + +

+ +

Arguments

+

+ Required +

    +
  • blogname: name of the blog
  • +
  • template: name of the template to use
  • +
+ Optional +
    +
  • category: name of the category to show
  • +
+

+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%otherarchiveyearlist(yourblog,mytemplate)%>
+<%otherarchiveyearlist(yourblog,mytemplate,mycategory)%>
+
+ +
+ + + +
+ +

Skinvar: otherarchivelist

+ +

+Shows the list of available archives for a given blog, using a given template +

+ +

Arguments

+

+ Required +

    +
  • blogname: name of the blog
  • +
  • template: name of the template to use
  • +
+ Optional +
    +
  • category: name of the category to show
  • +
+

+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%otherarchivelist(yourblog,mytemplate)%>
+<%otherarchivelist(yourblog,mytemplate,mycategory)%>
+
+ +
+ + + +
+ +

Skinvar: categorylist

+ +

+Inserts a list of categories for a blog (defaults to the currently selected blog), using a given template +

+ +

Arguments

+

+ Required +

    +
  • template: name of the template to use
  • +
+ Optional +
    +
  • blogname: short name of the blog to use
  • +
+

+ +

Skintypes

+ +

+index, archive, archivelist, search, item, [error, member, special if blogname parameter specified] +

+ +

Examples

+ +
+<%categorylist(mytemplate)%>
+<%categorylist(mytemplate,myweblog)%>
+
+ +
+ + + +
+ +

Skinvar: category

+ +

+Inserts some information about the currently selected category. When no category is selected, does nothing. +

+ +

Arguments

+

+ Optional +

    +
  • type: What information to include. Can be name (default), desc or id
  • +
+

+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%category%>
+<%category(id)%>
+<%category(desc)%>
+<%category(name)%>
+
+ +
+ + +
+ +

Skinvar: ifcat

+ +

Deprecated as of Nucleus v2.0. Use <%if(category)%> instead.

+ +

Arguments

+

+ None +

    +
  • text: Text to show
  • +
+

+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%ifcat(Current Category: )%><%category%>
+
+ +
+ + + + +
+ +

Skinvar: searchresults

+ +

+Shows the searchresult for the current query +

+ +

Arguments

+

+ Required: +

    +
  • template: name of the template to use
  • +
+ Optional: +
    +
  • maxresults: maximum amount of results to show
  • +
+

+ +

Skintypes

+ +

+search +

+ +

Examples

+ +
+<%searchresults(mytemplate)%>
+
+ +
+ + + + +
+ +

Skinvar: othersearchresults

+ +

+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.
  • +
+

+ + +

Skintypes

+ +

+item, archive, search, index +

+ +

Examples

+ +
+<%nextlink%>
+<%nextlink(Next Page,10)%>
+<%nextlink(,10)%>
+<%nextlink(,10,yes)%>
+
+ +
+ + + + + + + + +
+ +

Skinvar: prevlink

+ +

+Inserts a link to the previous item (on item pages) or to the previous archive (on archive pages). For search and index 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
  • +
+

+ +

Skintypes

+ +

+item, archive, search, index +

+ +

Examples

+ +
+<%prevlink%>
+
+ +
+ + + + + + + + +
+ +

Skinvar: errormessage

+ +

+Inserts the message corresponding to the error that occurred +

+ +

Arguments

+

None

+ +

Skintypes

+ +

+error +

+ +

Examples

+ +
+<%errormessage%>
+
+ +
+ + + + + + + + +
+ +

Skinvar: imagetext

+ +

This skinvar is deprecated since Nucleus v2.0. You should use <%image(caption)%> instead

+ +

+Inserts the caption text for a popup image +

+ +

Arguments

+

None

+ +

Skintypes

+ +

+imagepopup +

+ +

Examples

+ +
+<%imagetext%>
+
+ +
+ + + +
+ +

Skinvar: image

+ +

+Inserts the selected image (for popup images) +

+ +

Arguments

+ +

Optional

+
    +
  • + type + + + + + + + + + + + + + + + +
    imgtag (default)Full XHTML <img ... /> tag
    urlImage file URL
    widthimage width
    heightimage height
    captionimage caption (text to go with image)
    +
  • +
+ +

Skintypes

+ +

+imagepopup +

+ +

Examples

+ +
+<%image%>
+
+ +
+ + +
+ +

Skinvar: vars

+ +

This skinvar is deprecated since Nucleus v2.0. It's a small pain to insert this HTML yourself using the itemid skinvar

+ +

+Inserts a hidden form-input field with the itemid. +

+ +<input type="hidden" name="itemid" value="1234" /> + +

Arguments

+

None

+ +

Skintypes

+ +

+item +

+ + +
+ + + + + + +
+ +

Skinvar: sitevar

+ +

+Includes a site variable +

+ +

Arguments

+
    +
  • type: name of the variable to show: +
      +
    • url: URL of the site
    • +
    • name: Name of the site
    • +
    • admin: E-mail address of the administrator
    • +
    +
  • +
+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%sitevar(name)%>
+<%sitevar(url)%>
+<a href="mailto:<%sitevar(email)%>">Admin</a>
+
+ +
+ + + + + + +
+ +

Skinvar: blogsetting

+ +

+Inserts a setting specific to the currently selected blog (usually the default one) +

+ +

Arguments

+
    +
  • type: which setting to add +
      +
    • id: ID of the blog
    • +
    • url: URL of the blog
    • +
    • name: Name of the blog (long name)
    • +
    • desc: Description of the blog
    • +
    • short: Short name of the blog
    • +
    +
  • +
+ +

Skintypes

+ +

+index, archive, archivelist, search, item, member +

+ +

Examples

+ +
+<%blogsetting(name)%>
+<%blogsetting(id)%>
+<%blogsetting(desc)%>
+<a href="<%blogsetting(url)%>">...</a>
+
+ +
+ + + + + + +
+ +

Skinvar: member

+ +

+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.
  • +
+ +

Notes

+ + +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%include(filename.txt)%>
+<%include(/home/user/myself/filename.txt)%>
+<%include(http://mydomain.com/filename.html)%>
+
+ +
+ + + + + + + +
+ +

Skin/Templatevar: phpinclude

+ +

+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)
  • +
+ +

Notes

+
    +
  • This tag is affected by the parser settings IncludeMode and IncludePrefix
  • +
  • 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.
  • +
+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
<%phpinclude(filename.php)%>
+<%phpinclude(/home/user/myself/filename.php)%>
+ +
+ + + +
+ +

Skin/Templatevar: phpinclude : vars

+ +

+The following global variables are accessible from within files included by the phpinclude skin/templatevar: +

+ +

+$GATEWAY_INTERFACE, $SERVER_NAME, $SERVER_SOFTWARE +
$SERVER_PROTOCOL, $REQUEST_METHOD, $QUERY_STRING +
$DOCUMENT_ROOT, $HTTP_ACCEPT, $HTTP_ACCEPT_CHARSET +
$HTTP_ACCEPT_ENCODING, $HTTP_ACCEPT_LANGUAGE +
$HTTP_CONNECTION, $HTTP_HOST, $HTTP_REFERER +
$HTTP_USER_AGENT, $REMOTE_ADDR, $REMOTE_PORT +
$SCRIPT_FILENAME, $SERVER_ADMIN, $SERVER_PORT +
$SERVER_SIGNATURE, $PATH_TRANSLATED, $SCRIPT_NAME +
$REQUEST_URI, $argv, $argc, $PHP_SELF +
$HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS +
$HTTP_POST_FILES, $HTTP_ENV_VARS, $HTTP_SERVER_VARS +
$HTTP_SESSION_VARS, $PATH_INFO, $HTTPS +
$HTTP_RAW_POST_DATA, $HTTP_X_FORWARDED_FOR +

+ +

+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)
  • +
+ +

Notes

+ + + +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%parsedinclude(filename.txt)%>
+<%parsedinclude(/home/user/myself/filename.txt)%>
+
+ +
+ + + + + + +
+ +

Skin/Templatevar: plugin

+ +

+Calls a plugin +

+ +

Arguments

+
    +
  • +

    Required

    + + + + + + +
    NameContents
    PlugNameName of the plugin that should be called. This name is case sensitive!
    +
  • +
  • Extra parameters can be added, depending on the plugin

  • +
+ +

Notes

+
    +
  • When a plugin name does not conflict with existing variables, it can be called directly using <%PluginName(parameters)%>
  • +
+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%plugin(Calendar)%>
+<%plugin(LastComments,myweblog)%>
+<%LastComments(myweblog)%>
+
+ +
+ + + + +
+ +

Skinvar: loginform

+ +

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)
  • +
+

+ +

Skintypes

+ +

+item +

+ +

Examples

+ +
+<%commentform%>
+<%commentform(http://host/thanks.html)%>
+
+ +
+ + + +
+ +

Skin/Templatevar: set

+ +

+Sets a parser property. +

+ +

Arguments

+

+

    +
  • property: name of the property
  • +
  • value: value of the property
  • +
+

+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%set(IncludeMode,skindir)%>
+<%set(IncludePrefix,somedir/)%>
+
+ +
+ + +
+ +

Skin/Templatevar: skinfile

+ +

Used by imported skins to put a link relative to the skins-URL. Use it in conjunction with the IncludePrefix parser 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)
    • +
    +
  • + +
+ +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%if(loggedin)%>
+Welcome back!
+<%else%>
+Welcom guest!
+<%endif%>
+
+ +
+<%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:

+ +
+<%ifnot(skintype,error)%>
+<%blogsetting(name)%>
+<%endif%>
+
+ +
+ + + + + + +
+ +

Skinvar: membermailform

+ +

+Shows a form through which a logged-in member can send a message to the member which details are being shown (on member detail pages) +

+ +

Arguments

+

+ Optional: +

    +
  • rows: Amount of rows in the box (default = 10)
  • +
  • cols: Amount of columns in the box (default = 40)
  • +
  • destination url: URL to where Nucleus needs to redirection after sending the message
  • +
+

+ +

Skintypes

+ +

+member +

+ +

Examples

+ +
+<%membermailform%>
+
+ +
+ + + + + + +
+ +

Skinvar: searchform

+ +

+Shows a search form for the current blog. +

+ +

Arguments

+

+ Optional: +

    +
  • blogname: The name of the blog for which you want a search form (short blog name)
  • +
+

+ +

Skintypes

+ +

+index, archive, archivelist, search, item +

+ +

Examples

+ +
+<%searchform%>
+<%searchform(otherweblog)%>
+
+ +
+ + + + + + +
+ +

Skinvar: nucleusbutton

+ +

Inserts a nucleus button, with link to the Nucleus website.

+ +

Arguments

+

+ Optional: +

    +
  • imgurl: URL of the image (if you don't want the default)
  • +
  • imgwidth: width of the image (in pixels)
  • +
  • imgheight: height of the image (in pixels)
  • +
+

+ +

Notes

+ + +

Skintypes

+ +

+all +

+ +

Examples

+ +
+<%nucleusbutton%>
+<%nucleusbutton(nucleus/nucleus.gif,46,43)%>
+
+ +
+ + + + +
+ +

Skinvar: self

+ +

+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:

+ + + + +
+ + + +
+ +

Template variables: Basic variables

+ +

All these variables concern the item that's currently being parsed.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
titleitem title
bodybody text
moreextended text
categoryname of the category
categorylinkraw link to the category
karmakarma score
authorlinkraw link to the author
itemlinkraw permanent link for the item
authorname of the author
smartbodyeither the body text or the extended text
morelink'read more'-link
dateFormatted date
timeFormatted time
daylinkraw link to the daily archive
commentscomments block or commentcount
itemidID of the item
blogurlURL of the blog
+ +

Template variables overview...

+ + +
+ + + +
+ +

Template variables: Advanced variables

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
authoridID of the current items author
blogidID of the blog
catidID of the category for the current item
querysearch query (if there is one)
syndicate_titleSyndicated title
syndicate_descriptionSyndicated body text
karmaposlinkraw vote link
karmaneglinkraw vote link
new'New Item!'-text
includeincludes a file, whithout parsing
parsedincludeincludes a file, parsing it
phpincludeincludes a file, parsing by PHP
if-ifnot-else-elseif-elseifnot-endifperforms condition statements in templates (3.60)
pluginexecutes a plugin
editinserts an 'edit this item' link
editlinkraw 'edit item' link (links to bookmarklet)
editpopupcodejavascript code to open a popup window for editlink
skinfileincludes the correct URL for a file belonging to an imported skin
setsets a parser property
imageinline image from media library
popuppopup image from media dir
mediaother media object from media dir
relevanceIncludes the 'search hit relevance' in templates that display search results
+ +

Template variables overview...

+ +
+ + + + +
+ +

Template variables: Comments

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
bodycomment body
useruser name
useridusers URL or e-mail address
userlinka 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)
userlinkrawsame as above, but without the <a href.., empty when no valid URL or e-mail available
useremailthe e-mail address of the user, empty if the e-mail address was not provided by the user
userwebsitethe URL of the users website, empty if the URL was not provided by the user
userwebsitelinka 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)
memberidID of the member (0 for non-members)
commentcounttotal amount of comments for the item
commentword1 'comment', 2 'comments'
datedate on which comment was added
timetime at which comment was added
hosthost from where comment was added
ipIP-address from where comment was added
commentidID of the current comment
itemidID of the current item
itemlinklink to the detailed item page
itemtitleTitle of the current item
blogidID of the weblog
blogurlURL of the weblog
authtextthe extra text for members, empty for non members
shorta cut off version of the body, which truncates after the first line break. A link is added at the end according to the template
excerptthe body of the comment, cut at 60 characters and appended with '...'
timestamptime at which comment was added
if-ifnot-else-elseif-elseifnot-endifperforms condition statements in templates (3.60)
includeincludes a file, whithout parsing
parsedincludeincludes a file, parsing it
phpincludeincludes a file, parsing by PHP
pluginexecutes a plugin
skinfileincludes the correct URL for a file belonging to an imported skin
setsets a parser property
+ + + +

Template variables overview...

+ +
+ + + +
+ +

Templatevar: karma

+ +

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.

+ +

Arguments

+ + + +
+ + + + + + +
+ +

Templatevar: author

+ +

Inserts the name of the author

+ +

Arguments

+
    Optional: +
      +
    • what: Choose a type of information to be displayed: +
        +
      • name: display name (default)
      • +
      • realname: the real name of the author instead of the display name
      • +
      • id: Nucleus membet ID
      • +
      • url: URL of members website
      • +
      • email: email address of member (use of this one should be avoided)
      • +
      +
    • +
    +
+ +

Examples

+ +
<%author%>
+<%author(realname)%>
+<a href="<%author(url)%>"><%author%></a>
+ +
+ + + + +
+ +

Templatevar: smartbody

+ +

+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.

+ + + + + + + + + +
PartEmpty?
BodyNoNo
ExtendedYesNo
smartbody=body partextended 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.

+
+ + +
+ +

Templatevar: date

+ +

+Inserts a date using the date format specified in the template. Optionally, a custom date format can be given as a parameter. +

+ +

Arguments

+
    Optional +
      +
    • format: format to be used to format the date
    • +
    +
+ +

Specials

+ +

Four special parameters are possible:

+
    +
  1. rfc822: RFC822 date in local time
  2. +
  3. rfc822GMT: RFC date in GMT time
  4. +
  5. iso8601: ISO-8601 date (W3C Date and Time Format profile). Example: 2002-10-02T10:00:00-05:00
  6. +
  7. utc: Same as iso8601, but the date is expressed in UTC, using a "Z" for the timezone indicator.
  8. +
+ +

Examples

+
+<%date%>
+<%date(%x)%>
+<%date(rfc822)%>
+<%date(rfc822GMT)%>
+
+ + +
+ +
+ +

Templatevar: time

+ +

+Inserts a time using the time format specified in the template. Optionally, a custom time format can be given as a parameter. +

+ +

Arguments

+
    Optional +
      +
    • format: format to be used to format the time
    • +
    +
+ +

Examples

+
+<%time%>
+<%time(%X)%>
+
+ +
+ + +
+ +

Templatevar: comments

+ +

+Inserts a comments 'block'. More information about the structure of this block. +

+ +

Arguments

+

    Optional:

    + + + + + + +
    NameContents
    MaxToShowAmount of comments to show (when set, this overrides the max. comments blogsetting)
    +
+ +

Examples

+ +
+<%comments%>
+<%comments(5)%>
+
+ +
+ + +
+ +

Templatevar: syndicate_title

+ +

+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:

    + + + + + + +
    NameContents
    MaxCharsMaximum 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:

    + + + + + + +
    NameContents
    MaxCharsMaximum amount of characters to keep (defaults to 250)
    +
  • +
+ +

Examples

+ +
+<%syndicate_description%>
+<%syndicate_description(25)%>
+
+ +
+ + +
+ +

Templatevar: image

+ +

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:

    + + + + + + + + + + + + + + + +
    NameContents
    filenameName of the image file (file gets)
    widthWidth of the image (pixels or percentage)
    heightHeight of the image
    textalt-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:

    + + + + + + + + + + + + + + + +
    NameContents
    filenameName of the image file (file gets)
    widthWidth of the image (pixels or percentage)
    heightHeight of the image
    textalt-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:

    + + + + + + + + + +
    NameContents
    filenameName of the image file (file gets)
    textdescriptive 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.

+ +

Example

+

An example for the item body template

+
<h1><%title%></h1>
+<p><%body%> <%morelink%></p>
+<div class="metadata">
+	<%edit%> <%comments%>
+</div>
+ +

Results in

+ +
+

Title

+

This is an item

+ +
+ +
+ + +
+ +

Templatevar: editlink

+ +

+Insert a link to the 'edit item' bookmarklet. This can be used in the editlink template for simplicity. +

+ +

Example

+ +

The 'edit link'-template could look like this:

+
+<a href="<%editlink%>"
+   onclick="<%editpopupcode%>">edit</a> -
+
+ +
+ + +
+ +

Templatevar: editpopupcode

+ +

+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. +

+ +

Example

+

See the example for the editlink templatevar

+
+ + + +
+ +

Plugins

+

+Nucleus allows you to install custom plugins, adding extra functionality. Plugins can do different things: +

+
    +
  1. Act as a skin variable
  2. +
  3. Act as a template variable
  4. +
  5. 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.
  6. +
  7. Act as actors when called through action.php
  8. +
+

+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 NameValues
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 affects the following skinvars: include, phpinclude, parsedinclude, nucleusbutton

+
IncludePrefix +

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/

+

This property affects the following skinvars: include, phpinclude, parsedinclude, nucleusbutton

+
+ +

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.

+ +
+ + + diff --git a/nucleus/documentation/history.html b/nucleus/documentation/history.html new file mode 100644 index 0000000..22443ee --- /dev/null +++ b/nucleus/documentation/history.html @@ -0,0 +1,1089 @@ + + + + + + + + + + Nucleus - History + + + + + +

Version History

+ +

+ Back to manual +

+ +
    +
  • + Nucleus v4.00 (SVN) +
      +
    • CHANGE: allow - and _ characters in skin and template names. And enforce name validation during skin/template import.(ftruscot)
    • +
    • FIX: close ul tag in bookmarklet.php. Thanks WillyP. (ftruscot)
    • +
    • FIX: caching of global plugin options. Thanks slightlysome. (ftruscot)
    • +
    • CHANGE: Some enhancements to pdo.php for sqlite handler suggested by kotorisen. (ftruscot).
    • +
    • CHANGE: install.sql now creates tables using ENGINE= to define table engine instead of TYPE=. (ftruscot).
    • +
    • CHANGE: SKIN::update() to add events PreUpdateSkinPart, PreAddSkinPart, PreDeleteSkinPart, PostUpdateSkinPart, PostAddSkinPart, PostDeleteSkinPart. Thanks slightlysome. (ftruscot).
    • +
    • 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)
    • +
    • ADDED: Add delete permission check (katsumi/admun)
    • +
    • ADDED: Add ATOM1.0 autodiscovery for default skin. (shizuki)
    • +
    • FIXED: Fix short open tag on skins/default/show_benchmark.inc. (shizuki)
    • +
    • FIXED: Fix broken XML for Skins. (shizuki)
    • +
    • ADDED: Japanese forum:Special skin parts are used as a skin part. (Andy/shizuki)
    • +
    • ADDED: The number of comments is indicated on the item list screen. Japanese forum(The confirmation and the elimination which are a comment every item.) (shizuki)
    • +
    • ADDED: Automatic re loading after an item renewal. Bibou-Nikki/Automatic re loading after an item renewal. (shizuki)
    • +
    • ADDED: Prevention of comment double contribution. Bibou-Nikki/Prevention of comment double contribution. (shizuki)
    • +
    • ADDED: Addition of an item The hack which checks a radio button of "of the date and time, designation" automatically if the item of the date is changed at the time of edit. Japanese forum(Check box of "later, addition" and "of a time stamp, renewal") (shizuki)
    • +
    • FIXED: (#110(JP)): When an item is added by "new category", a SendPing event doesn't occur. (shizuki)
    • +
    • FIXED: (#58(JP)): When database backup, table name and a column name are bound up with back quotat. (shizuki)
    • +
    • CHANGED: Eliminate few hardcoded language (shizuki)
    • +
    • FIXED: (#94(JP)): A plugin option isn't generated. (kimitake/shizuki)
    • +
    • FIXED: (#79(JP)): Permission setting of upload isn't effective. (shizuki/yu)
    • +
    • FIXED: (#77(JP)): [XHTML] When the attribute of the option is hidden,<tr> isn't output. (shizuki)
    • +
    • FIXED: (#76(JP)): [XHTML] Validate admin-area. (shizuki)
    • +
    • FIXED: (#67(JP)): Change isn't reflected on ValidateForm event. (shizuki)
    • +
    • FIXED: (#107(JP)): When editing an item, time generation will be an error. (kotorisan/yu/shizuki)
    • +
    • FIXED: (#108(JP)): Pop-up, for if a character string is empty, nothing is indicated. (sato-na/shizuki)
    • +
    • FIXED: Fix history. (shizuki)
    • +
    • FIXED: "history.html" is XHTML 1.0 Strict. (shizuki)
    • +
    • FIXED: (#142): Plugin API: Incorrect operation order. (shizuki/Andrew Black)
    • +
    • ADDED: Add tool tip for "MEDIA" button (shizuki/kyasya)
    • +
    • FIXED: (#82(JP)): fix <%itemtitle%> on COMMENT_HEADER COMMENT_BODY COMMENT_FOOTER (shizuki)
    • +
    • CHANGED: (#83(JP)): Change bookmarklet height. Add 50pix. (kmorimatsu)
    • +
    • 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)
    • +
    • FIXED: fix redirect function in globalfunctions so that it does not strip out the permitted "*" character. See forum(Trying to get a create an account link) (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) +
        +
      • ADDED(JP): (#68(JP)): Encrypted cookie key. (Katsumi)
      • +
      • FIXED(JP): (#60(JP)): Item link in notification email is wrong. (shizuki)
      • +
      • FIXED(JP): (#62(JP)): email address is not referred in <%usermail%>. (shizuki)
      • +
      • FIXED(JP): (#66(JP)): Even if calling PostPluginOptionsUpdate, getOption does not returns correct value. (Katsumi)
      • +
      • FIXED(JP): (#49(JP)): PLUGIN::getAllItemOptions does not work correctly. (NKJG)
      • +
      • FIXED(JP): (#57(JP)): SQL error happens when updating plugin option. (Katsumi)
      • +
      • FIXED(JP): (#56(JP)): When creating db backup, the key length drops (Katsumi)
      • +
      • FIXED(JP): (#41(JP)): fixed dropped info during backing up (Katsumi)
      • +
      • FIXED(JP): (#40(JP)): fixed PostAddCategory event (Kimitake)
      • +
      • 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)
    • +
    • FIXED: allow + in email address, see forum(Minor bug fix in globalfunctions.php) (wgroleau)
    • +
    • FIXED: XHTML compliance in default skin (admun)
    • +
    • FIXED (#80): Atom 1.0 support (rakaz)
    • +
    • FIXED (#129): Plugin API: SpamCheck event called from core. (rakaz)
    • +
    • FIXED (#128): Don't show DISALLOWED(XXXX) errors (karma)
    • +
    • FIXED (#127): parse_commentform: double-escaped URLs (karma)
    • +
    • FIXED (#121): backup fails when $plugin->getTableList() doesn't return an array (karma)
    • +
    • FIXED (#118): Errors in default skin (legolas)
    • +
    • ADDED (#119): Added optional includeMode/includePrefix parameters to parseFile() (karma)
    • +
    • FIXED (#115): Redundant database queries on member table (karma)
    • +
    • FIXED (#114): Magic quotes not correctly undone when magic_quotes_sybase enabled (karma)
    • +
    • FIXED (#104): Return to blogsettings - link missing on edit category
    • +
    • FIXED (#107): Better path detection in install.php (dekarma)
    • +
    • FIXED (#106): Make 'Log Out' link under Comment box work with Fancy URLs (Wendy Smoak)
    • +
    • FIXED (#99): Use workaround when the only installed MySQL PHP extension is mysqli (dekarma)
    • +
    • FIXED (#98): More "Fatal error: Only variables can be passed by reference" occurrences on some installations (pete)
    • +
    • ADDED (#23): adding email/url + email field display in blog comment list (admun)
    • +
    • FIXED (#12): item id and timestamp were not sent along with GenerateURL event when itemlink called from commentvars (karma)
    • +
    • CHANGED: Now using XML-RPC for PHP (phpxmlrpc) v1.2.1
    • +
    • FIXED: (#97): file uploads didn't check $_FILES['file']['error'] codes. (dekarma)
    • +
    • CHANGED: Update user instruction for Blogger conversion tool
    • +
    • ADDED: When an e-mail is provided in the comment-form it is validated. (TeRanEX)
    • +
    • ADDED (#23): Splitted the URL & E-mail field in comments. (gRegor, ketsugi, Red Dalek, TeRanEX)
    • +
    • ADDED: (bug 817364): delete member enhancement (admun)
    • +
    • ADDED: Auto save draft (Legolas)
    • +
    • ADDED: Custom skin parts (tutorio)
    • +
    +
  • +
  • + Nucleus v3.24 (November 11, 2006) +
      +
    • FIXED: XSS issue (reported by JPCERT/CC).
    • +
    +
  • +
  • + Nucleus v3.23 (May 23, 2006) +
      +
    • FIXED: Remote code execution vulnerability (reported by rgod).
    • +
    +
  • +
  • + Nucleus v3.22 (August 21, 2005) +
      +
    • FIXED: Major security vulnerability in the phpxmlrpc library.
    • +
    • FIXED: New NP_SkinFiles version, fixing a minor security issue. (rakaz)
    • +
    • CHANGED (#17): An errormessage is now displayed when logon through loginform failed. (karma)
    • +
    • FIXED (#91): Initialize variables in MEMBER class (andrew)
    • +
    • FIXED (#90): there was no plugin callback on member edits when the email address changed (andrew)
    • +
    • FIXED (#90): when editing members other than yourself, you shouldn't be logged out (andrew)
    • +
    • FIXED (#85): If both itemid and catid are specified in the URL, ignore catid if it doesn't match itemid (karma)
    • +
    • FIXED (#49): 'name clashes' warning on skin import no longer displayed when no clashes detected (karma)
    • +
    • FIXED (#67): Add resilency to upgrade scripts (Frankenstein)
    • +
    • FIXED (#88): PHP5.1: "Fatal error: Only variables can be passed by reference" (karma)
    • +
    • FIXED (#87): Translate & -> &amp; when links added via toolbar (karma)
    • +
    • FIXED (#42): formatDate didn't always use the correct timezone (karma)
    • +
    • FIXED (#43): Only load user language file when logged in (karma).
    • +
    • FIXED (#76): Disabling site blocked admin menu access (karma).
    • +
    • FIXED (#57): PostRegister event not fired from inside admin area.
    • +
    • FIXED (#58): images and popups were not in feeds. (karma)
    • +
    • FIXED (#33): add item form invalid ticket error (admun)
    • +
    • FIXED: Most buttons of the toolbar reset the scroll position of the textarea to the top in Firefox (leonbloy)
    • +
    • ADDED (#64): Applications that use the metaweblogAPI, such as Ecto can now also access and edit the extended body (rakaz)
    • +
    • FIXED (#63): _getArrayVal() always returned first element of array (rakaz)
    • +
    • ADDED: add InitSkinParse event (rakaz)
    • +
    • ADDED (#38): added alternative output for <%title%>, <%itemtitle%>, <%previtemtitle%> and <%nextitemtitle%> (rakaz)
    • +
    • FIXED (#51): removed hardcoded charset declaration from the RSS 2 skin (rakaz)
    • +
    • ADDED (#55): add <%skinvar%> variable that corresponds with _CHARSET (rakaz)
    • +
    • ADDED (#24): add PostUpdateItem event (admun)
    • +
    • FIXED (#48): <%if(nextitem)%> and <%nextlink%> didn't use the timezone offset. (Basic)
    • +
    • FIXED: "ADMIN.php line 5270" fatal error when plugin filename and plugin classname mismatch (Frankenstein)
    • +
    • CHANGED (#16): Event PreSkinItem can now modify the skin contents; PreComment now knows the ItemID. (suggested by Andy)
    • +
    +
  • +
  • + Nucleus v3.21 (June 30, 2005) + +
  • +
  • + Nucleus v3.2 (March 7, 2005) +
      +
    • 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: bug 1019191, <%if(blogsetting,..)%> / <%if(category,...)%> broken on error pages (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: documentation typo (admun)
    • +
    • FIXED: PHP5: Install script failed to discover install path automatically (karma)
    • +
    • FIXED: Skin parser no longer parses skinvars when they are inside a non-displayed if-section (karma)
    • +
    • FIXED: bug 817361, prefix http:// to member's URL if missing (admun)
    • +
    +
  • +
  • + Nucleus v3.01 (July 13, 2004) +
      +
    • FIXED: PHP5: Links to plugin admin area broken (radekradek)
    • +
    • FIXED: bug 966011, skins created with v2.0 could not be imported (karma)
    • +
    • FIXED: Security issue spotted by rADo2
    • +
    +
  • +
  • + Nucleus v3.0 (May 30, 2004) +
      +
    • FIXED: When adding a weblog, select globally defined default skin by default (TeRanEX)
    • +
    • FIXED: CSS conflict in default skin (moraes)
    • +
    • FIXED: ADMIN.php no-cache after doctype added to support dynamic content for plugins in admin area (rADo2)
    • +
    • FIXED: vars4.1.0.php fixed a strange bug for some PHP installs having empty $_REQUEST[] (rADo2)
    • +
    • FIXED: globalfunctions.php - added a flag preventing include of vars...php twice for custom install (rADo2)
    • +
    • FIXED: install.php - added a flag preventing include of vars...php twice for custom install (rADo2)
    • +
    • FIXED: install.php - installCustomSkins skinbackup.xml renamed (rADo2)
    • +
    • 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;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: hasplugin option on if skinvars (Kazuhiko)
    • +
    • ADDED: External Authentication (plugin contains authentication code) (Frankenstein) (not in 3.0 final)
    • +
    • 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: convert linebreaks broke \r\n linebreaks (jmuto)
    • +
    • 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: No more restrictions on category names
    • +
    • ADDED: possibility to create custom installs
    • +
    • 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%>
    • +
    • FIXED: HTML to Text conversion didn't always work
    • +
    • ADDED: <%date%> templatevars extras (rfc822 & rfc822GMT) (Xiffy)
    • +
    • ADDED: ranges for <%blog(...)%> and <%otherblog(...)%> skinvars
    • +
    • ADDED: templatevars <%author(email)%>, <%author(url)%> and <%author(id)%<
    • +
    • CHANGED: Added info on new weblog creation (split up creation process into two steps)
    • +
    • FIXED: Login screen after email address change did not work correctly
    • +
    • ADDED: Plugin Hook: PrePluginOptionsEdit
    • +
    • ADDED: Added a getMinNucleusVersion method to the plugin interface
    • +
    • ADDED: PostPluginOptionsUpdate plugin event
    • +
    • ADDED: Javascript toolbar: align left/center/right buttons (Irmo)
    • +
    • ADDED: RSD skin/template
    • +
    • 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
    • +
    • ADDED: skinvars archivenext/archiveprev/archivetype
    • +
    • CHANGED: skinvars nextlink/prevlink now also work on archive skins
    • +
    • CHANGED: move item now also allows to choose a category
    • +
    • CHANGED: new items can be added to other blogs also now
    • +
    • FIXED: archivedate skinvar displaying wrong date
    • +
    • FIXED: serverVar function was not working when using vars4.0.6.php
    • +
    • ADDED: now also listing category in itemlist
    • +
    • CHANGED: Admin Area now uses the Site Name instead of Nucleus
    • +
    • CHANGED: admin.css and admin area: corrected h1, h2, h3 depth levels
    • +
    • ADDED: batch operations
    • +
    • 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: renamed method: getBlogidFromName -> getBlogIDFromName (consistency)
    • +
    • ADDED: method selectCategory($name)
    • +
    • FIXED: Nucleus now handles data correctly when magic_quotes_gpc is disabled (solves some problems with template editing)
    • +
    • CHANGED: categories in selection box are now sorted by name (tip from katatonik)
    • +
    • FIXED: Not all tables got exported on backup :( (thanks Xiffy!)
    • +
    • FIXED: add item form didn't handle keyboard shortcuts correctly (thanks Hop!)
    • +
    • 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: Blogger API: getRecentPosts wasn't converting linebreaks
    • +
    • FIXED: surpressed warning on mysql_close
    • +
    • 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 (&lt; and &gt;). 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
    • +
    • XML-RPC: metaWeblog API support
    • +
    • XML-RPC: <title> and <category> tags can now be used with the Blogger API (similar to b2)
    • +
    • Fixed problem with create account (forum)
    • +
    • 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: XML-RPC for PHP v1.02
    • +
    • Added: Small guide to changing/setting filepermission in docs
    • +
    • 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
    • +
    • Created a 'Tips & Suggestions' page next to this manual
    • +
    • XML-RPC API: added nucleus.addDatedItem method
    • +
    • XML-RPC API: added nucleus.editItem method
    • +
    • XML-RPC API: added nucleus.getRecentItems method
    • +
    • XML-RPC API: added nucleus.getItem method
    • +
    • Added documentation for XML-RPC nucleus.* methods
    • +
    • 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)
    • +
    +
  • +
  • + Nucleus v0.90 [beta 2 release] (September 14, 2001) +
      +
    • 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)
    • +
    • Added <%blogurl%> variable for item templates
    • +
    • bug-fixes
    • +
    • small esthetic changes
    • +
    • ...
    • +
    +
  • +
  • + Nucleus v0.80 [beta 1 release] (September 2, 2001) +
      +
    • XML-RPC Interface implementing the blogger methods
    • +
    • fixes and code-reorganisation
    • +
    • popup-help on item pages
    • +
    • bookmarklets/right click blogging
    • +
    • the start of something that looks like documentation
    • +
    +
  • +
  • + Nucleus v0.70 [not released] (August 20, 2001) +
      +
    • mySQL instead of XML
    • +
    • extensive admin area
    • +
    • 'member' concept, including blog teams/admins/...
    • +
    • rewrote most of the code
    • +
    • skin format slightly changed
    • +
    • almost ready for public release :)
    • +
    • adding items with instant preview (when viewing the weblog)
    • +
    • LOCALE used for time/date notations.
    • +
    +
  • +
  • + Nucleus v0.60 and earlier (since February 2001) +
    + no history (XML versions with limited functions) +
  • +
+ + + + diff --git a/nucleus/documentation/icon-help.gif b/nucleus/documentation/icon-help.gif new file mode 100644 index 0000000000000000000000000000000000000000..12cabfd2a33832106e4282ac4756de9ee085d494 GIT binary patch literal 157 zcmV;O0Al|~Nk%w1VGjTg0J8u9T5FtRbER{8t$U2Mgp{?IpuwQ6#U>p&fd<> z-qzmd-skV{@Av=z|3LphA^8LW000jFEC2ui01p5U000C^@X1LlZO9a(tXu;iiUm_G z!l)9>)P$lVkHv(jqay~3WZ<#UK~ezfMg|}5D3mCcs(^_IY`S0oX0p;K1V({F%dtHs literal 0 HcmV?d00001 diff --git a/nucleus/documentation/icon-up.gif b/nucleus/documentation/icon-up.gif new file mode 100644 index 0000000000000000000000000000000000000000..4e47be1e4f16ca59dfea3d3b116f29ac5b64b342 GIT binary patch literal 159 zcmV;Q0AT+|Nk%w1VGjTg0J8u9T5FtRbER{8t$U2Mgp{?IpuwQ6#U>p&fd<> z-qzmd-skV{@Av=z{{a60A^8LW000jFEC2ui01p5U000C`@X1LlZO9a(tXu;iiUm_G z!l)9>)P$p>789a6_!umb5z9HzK~fL}0YO6#DZ9yr4~1$92$+b}5mfTZDl3gbKzC?) N7KlUQ>S<3R06Y4NMGgP} literal 0 HcmV?d00001 diff --git a/nucleus/documentation/index.html b/nucleus/documentation/index.html new file mode 100644 index 0000000..13f6b02 --- /dev/null +++ b/nucleus/documentation/index.html @@ -0,0 +1,422 @@ + + + + + Nucleus CMS - Manual + + + + +
+Nucleus CMS Manual +(v3.3) +
+ +
+Notes: +
    +
  • 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.
  • +
  • If you're a developer, extra developer documentation is available.
  • +
+
+ +

Table Of Contents

+ + + +

About Nucleus back to top

+ +

+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: +

+ +
    +
  • Runs on your own server
  • +
  • One or more weblogs, even on the same page
  • +
  • Plugin-interface to add extra functionality
  • +
  • Comments
  • +
  • Archives
  • +
  • Categories
  • +
  • Search
  • +
  • Multiple authors
  • +
  • Future items
  • +
  • Drafts
  • +
  • Extensive administration area
  • +
  • Media library and file upload
  • +
  • Fully customizable skins and templates
  • +
  • Skin import/export
  • +
  • Banlist against commenting system abuse
  • +
  • RSS syndication
  • +
  • Easy installation
  • +
  • Easy backups
  • +
  • XML-RPC interface (implementing the Blogger API and metaWeblog API)
  • +
  • XHTML-ready
  • +
  • Tools to import Blogger and GreyMatter blogs
  • +
  • ...
  • +
+ +

+Requirements in order to run Nucleus: (If you don't know if you fit the requirements, ask your system administrator) +

+ +
    +
  • PHP (version 5.0.0 or higher, may still work on version 4.0.6 or higher)
  • +
  • Access to a MySQL database (version 4 or higher)
  • +
  • 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 back to top

+ +

+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 back to top

+ +
+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:

+ +
    +
  1. + 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) +
  2. +
  3. + 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). +
  4. +
  5. + 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. +
  6. +
+ + +

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 back to top

+ +

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 back to top

+ +

+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? back to top

+ +

+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 back to top

+ +
+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. +

+ +

+Currently, there are three APIs supported: the Blogger API, the metaWeblog API, and the Movable Type API. If you want an examples of a client that uses these interfaces, try w.Bloggar (Windows) or Ecto (MacOS). +

+ +

+The available calls to the interface are described in the development documentation, which can be separately downloaded, or viewed online. +

+ + + +

Troubleshooting (FAQ) back to top

+ +

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 back to top

+ +

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. &amp; becomes &amp;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 back to top

+ +

No matter how hard we try, some people will be unintentionally overlooked in this section.

+ +

Founder

+ +
    +
  • Wouter Demuynck
  • +
+ +

Code submissions

+ +
    +
  • Andy Matsubara
  • +
  • Armon Toubman
  • +
  • Edmond Hui
  • +
  • gRegor alias gregorlove
  • +
  • Kai Greve alias kg
  • +
  • Joel Pan alias ketsugi
  • +
  • Kimitake
  • +
  • Legolas
  • +
  • Niels Leenheer alias rakaz
  • +
  • Rodrigo Moraes
  • +
  • Jeroen Budts
  • +
  • Appie Verschoor alias xiffy (Fulltext search)
  • +
  • Many others... (check the history)
  • +
+ +

Libraries etc

+ +
    +
  • Jeff MacMichael (NP_SkinFiles plugin)
  • +
  • Ivan Fong, Roel, Moraes, Hcgtv (Nucleus 3.2 default skin)
  • +
  • Plugins are written by their respective authors.
  • +
  • Thanks should go out to the people that wrote language-files for Nucleus. You can download extra language files on the Nucleus website.
  • +
  • The logo (the one with the yellow rays) was created by Rodrigo Moraes
  • +
  • The RSS 2.0 skin was created by Xiffy
  • +
  • The XML-RPC interface uses the 'XML-RPC for PHP' implementation from Useful Inc..
  • +
  • The backup/restore code is largely inspired on the code used in phpBB.
  • +
  • The JavaScript code used for the instant preview was originally inspired on the code used by Mijn Kop Thee (dutch) and milov.nl.
  • +
  • The globe bullet next to links in the admin screen, comes from QBullets
  • +
+ +

Thanks!

+ +

+Many thanks should also go to all people who have helped Nucleus to become what it is today.

+ + + + + + + \ No newline at end of file diff --git a/nucleus/documentation/pics/chmod_menu.png b/nucleus/documentation/pics/chmod_menu.png new file mode 100644 index 0000000000000000000000000000000000000000..7ffc0796e537f7d96e8f28424b61435843849871 GIT binary patch literal 8134 zcmXwecTm&M^L|8WB1KSo5ov;SX#wdVy$Fc(sscu&M7jZi(B7aFDT1L(Clm!Kp-PjM zP($xxqLhF{f`st;^7+mDcINhWcJKC{*?sQ*xg<+-1IDY|S3w{UqmiMW6$o?*c405l zUB1w;VUOsGiT0I|nLh0l9V7iM8Mlt|-3u4Jzo9)81Y%(Q-?%ij5_xvvyyB&8rVRo$ zrZSwlQ-eTMLzbpC`Tzi2ga`y&JDS*u1_rUfAexlY3^b#G-0E)x!YToWB@nP>Wr)qq z#kN@9Qa5oO9XU80P9l*AB!EC5Adv_F3jqKGfcBjFat|P7LLi<1Kmu?P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aOp}@;B@G+f|s{os6AS+KYHa{&I zaKOP^BGm>gxGm^mJ>L`R9wnCb{7Ix(XInD(pB zx|Q8WTzt(^=t`oRMV2O*nUCZQhpDwC_87Eu)l9~Qv_6s&|S%e52|#m^Y}6p>6A zJPT@y<)q6zZ&*f_2@|1F&JpEnjnpbYf9`UN4LlnrkOgK;<~Z{w6xb$Zw1AfdSg2eb z%E@x5-dHaX&LV3TEVFNT;bdJwYxqp(th!k90r-Y1vZjX3S7e<7E3(dkIgvFnWymGn zKJzg=zxGgWh3p(Ctm1>Tu~$MixAJ`Fgj9e+PYRxCR4YjOe?%Y?Y8TfJVI!7V(W< zx3}K!{#Kei zVM5L7t`EA0eK3WC6xa!Tsmo``*V7elodJ zTJ=pX3O;%7>+fE|Bt_NWlTSYW*FRTeO@-_Mg-Ie=uT(8!atVN0g_9p6S#f;l1a1Si zS2%^+w|@j=y_)XbzyIg|C656|i;siHlQ#bQ*T3t#dOlaaPGo)j(fhxC`{1#Id*fl% zoXken-go};{=fhBixWk7birip{r06F-2a1qeDlWf8#iV@=jTq=!{d#+U-|ZHuf6ux z(dMWK+wsoP(XE5wr#GLKtbcs>g%^MSE4>{@HyYPAuQfIr8#g*tb5e?jk0)(>|En*( z^vat+RHxm!x!s5x?fAxX8`o~G?KV4W8`m1`?U^rp4;%PbfAhkNKm6#I`rhWXjm_td zIyW~qJMl)tZ_1<2?#4#vW~bA>)rfC&cE7N*aclFrP1v=uKjUThAMLxx z@SSh`?A_<@9o>uex9=V8+}V$gZpBq|G9y_>`*-iY{pQj3_Rj6yM|W=R-@5Z~cjwXm z_U_TGJNvskxA$i)*rUe>NY?d(eKd{x4~N)aY#fwtJc8etZ|+?DMR#@&c95)ZU3Ylp q + + + + Nucleus - Skins and Templates + + + + +
+Skins & Templates +
+ +

Introduction

+ +

+Back to the manual +

+ +

So, you've installed Nucleus... You've got several options now concerning the look of your site:

+
    +
  1. Go with the default skin/templates that comes with Nucleus
  2. +
  3. Start from the default skin/templates, and modify it to your needs (colors, etc...)
  4. +
  5. Start your own skin/templates, and define your own CSS stylesheets
  6. +
  7. Download one of the dozens of free skins available on the Nucleus Skins site.
  8. +
+

This document tries to help you with doing this.

+ +

Table Of Contents

+ + + +

HTML and CSS back to top

+ +

+When editing skins and templates, you'll need at least some basic knowledge about HTML and CSS. This section provides some pointers to online tutorials and references: +

+ + + + + + + + + +

The default skin back to top

+ +

This section briefly explains which files are used by the default skin, and how you can edit them.

+ +

The default skin uses three files:

+
    +
  1. default.css: CSS stylesheet that defines the page style. Colors, layout etc. are defined in this file
  2. +
  3. atom.gif: The logo that appears in the upper left corner of the screen
  4. +
  5. nucleus2.gif: Nucleus logo
  6. +
+ +

The CSS file default.css contains extra information about how pages are built up by the default skins and templates. Basically, it comes down to three div-containers: .contents, .logo and .menu

+ +

To edit the default.css file, you'll need a simple texteditor that does not add extra data, like Notepad (comes with windows),emacs or TextPad. Do not use WordPad, Word, OpenOffice Writer, ... since those add extra markup data.

+ + + + + + +

Templates vs. Skins back to top

+ +

+In Nucleus, both templates and skins are used to determine the way your blog looks. So, what is the difference between these two? +

+ +
    +
  1. + Skins define how your sites look. Each skin consists of several types: one for the main index, one for the detailed item pages, one for the archive, ... + The skins also contain instructions of where to include a weblog, and which template should be used to do so. +
  2. +
  3. + Ha! This means templates are used to define the way the weblog block in your page looks like. The reason why templates aren't included in the skins themselves, is that several skins can use the same template to display a blog. +
  4. +
+ +

An example is given in the image below. The whole page is defined by a skin, while the parts in the red rectangles (category list and blog contents) are formatted according to the templates. It's the skin that defines where the red rectangles will appear.

+ +
+Skins and Templates example +
+ + + + + + + + + +

How skins are chosen back to top

+ +

+This section tries to explain how Nucleus chooses the skin to use when you request a page. +

+ +

Skin Types

+ +

+First of all, there are several skin types between which Nucleus makes a choice according to the request URL: see the list below. This should be very obvious. +

+ + + + + + + + + + + +
Query String FormatWhich skin type?Which weblog is shown?
?itemid=..itemDeducted from itemid
?archive=..archiveDefault weblog, or blogid attribute
?archivelist=...archivelistarchivelist-attribute
?archivelistarchivelistDefault weblog
?query=...searchDefault weblog, or blogid attribute
?memberid=..memberNone
?imagepopup=..imagepopupNone (popup window with image)
(other or empty)indexDefault weblog, or blogid attribute
+ +

+Next to these 7 types, there is an error type, which is used when errors occur. +

+ +

The Skin Cascade

+ +

+The table above also indicates how the blog to be displayed is chosen. The skin that will be used, is the default skin for that weblog, as selected in the settings for that weblog. +

+ +

+Not every skin needs to have definitions for all skin parts. When a part is missing, the skin called 'default' will be used instead (see below). This allows you for example to only create one error page and one member page. +

+ +

The 'default' Skin

+ +

+Nucleus requires that at all times there exists a skin called 'default'. This is the skin to which is backed up when a skinpart is missing. If the same skinpart is also missing from the 'default' skin, the error message 'no appropriate skin found' will be shown. +

+ +

+Another reason why the 'default' skin is required, is to be able to display error messages when no blog is selected (e.g. the 'no such blog' error) +

+ + + + + + + + +

Howto: An 'add item' form on your website back to top

+ +

+Nucleus provides facilities to add an 'add item' form to your weblog. It adds an 'add item' link that shows and hides the 'add item' form right above the current contents of your weblog. Entering text in this form results into an instant preview, so you can immediately see how the actual weblog item will look like. +

+ +

+All modifications below apply to the skin for the main index page. You don't need to alter any templates. +

+ +

1. JavaScript code

+

+First of all, you need to include the edit.js Javascript code by putting the following line somewhere in between the <head> and </head> tags. This file contains the functions that are needed to make the preview work and to hide/show the 'add item' form. +

+ +
+<script type="text/javascript"
+        src="nucleus/javascript/edit.js"></script>
+
+ +

2. Indicate where the form will show up

+ +

+The, you add a logical container somewhere on your page, where you want to have the 'add item' form. The "display:none;" makes sure it is hidden. +

+ +
+<div id="edit" style="display:none;">
+...
+</div>
+
+ +

3. Code that inserts the form and preview

+ +

+Now, you can add your custom HTML into this container, and use <%additemform%> and <%preview(templatename)%> to insert the 'add item' form and the preview code respectively. An example is given below +

+ +
+<h2>Add Item</h2>
+<%additemform%>
+
+<h2>Preview</h2>
+<%preview(mytemplate)%>
+
+ +

4. The 'add item'-link

+

+And the finishing touch: a link or button to trigger the visibility of the form. Two examples are given. The first one is a simple link: +

+ +
+<a href="javascript:showedit();">add item</a>
+
+ +

+The second example is a hidden button in the topleft corner +

+ +
+<div style="position: absolute; left: 0px;
+            top: 0px; width: 10px; height: 10px"
+     onclick="javascript:showedit();">
+</div>
+
+ + + + + + +

Howto: CSS to define the look of forms back to top

+ +

+Through variables such as <%searchform%> and <%commentform%>, forms can easily be included into your skin. To allow styles to be applied on those forms, CSS classes have been assigned to the input fields and buttons, and to a surrounding DIV-container. +

+ +

+Below is a list of which CSS class corresponds to which form. These are the classes assigned to the surrounding DIV-container. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Form TypeSkin VariableCSS Class Name
Add Item to Blog<%additemform%>.blogform
Add Comment<%commentform%>.commentform
Login Form<%loginform%>.loginform
Search Form<%searchform%>.searchform
Member to Member Mail<%membermailform%>.mailform
+ +

+Below is an overview of the CSS classes assigned to buttons and input fields. +

+ + + + + + + + + + + + + + +
TypeCSS Class Name
Input fields (text and textarea).formfield
Buttons.formbutton
+ +

+An example of how to use these classes in you stylesheets is given below: +

+ +
+/* applies to all input fields */
+.formfield {
+  background-color: gray;
+}
+
+/* only applies to buttons for comment forms */
+.commentform .formbutton {
+  border: 1px solid #000;
+  background-color: #ddd;
+  color: #000;
+  font-size: xx-large;
+}
+
+ +

In the example above, all formfields that nucleus generates are given a gray background, and the submit button on the comment form has large text, a black 1px border, black text and a light-gray background.

+ + +

Howto: Enabling karma votes back to top

+ +

The default skins and templates have karma votes disabled (better: left out). Here's how to add them to your template.

+ +

1. Open the template for the main index

+ +

Start editing the template named 'default' (when starting from the default skins/templates that come with Nucleus)

+ +

2. Edit the 'Item body' template-part

+ +

Edit the bottom part of the item body templatepart to be as follows:

+ +
+<div class="iteminfo">
+  <%time%> -
+  <a href="<%authorlink%>"><%author%></a> -
+  karma: <%karma%>
+    [<a href="<%karmaposlink%>">+</a>/<a href="<%karmaneglink%>">-</a>] -
+  <%edit%>
+  <%comments%>
+</div>
+
+ +

On the main page, the iteminfo line for the items will now look like:

+ +
9:00:39 PM - God - karma: 5 [+/-] - edit
+ +

3. Template for the detailed pages

+ +

At this time, the karma score is only listed on the main page. To make it appear on the detailed page also, the same change needs to be applied to the template with name 'detailed'

+ + + + + + +

Howto: 'edit item' links back to top

+ +

The default Nucleus skin includes 'edit item'-links that are only visible to the author of a item and to the people having the right to alter the item. This section explains which template-parts are needed for this feature to work.

+ +

'editlink'-template

+ +

The 'Edit Link'-templatepart defines how an 'edit item'-link is formatted. By default, the contents is:

+
<a href="<%editlink%>" onclick="<%editpopupcode%>">edit</a>
+ +

If you would rather edit the item in the admin area, instead of in the popup bookmarklet, use the following code instead:

+ +
<a href="nucleus/index.php?action=itemedit&amp;itemid=<%itemid%>">edit</a>
+
+ +

Positioning the edit-link

+ +

Next to the 'editlink' template, there's the <%edit%>-templatevar that, when placed somewhere in the 'item body'-templatepart, inserts the editlink.

+ +

See the example from the karma votes howto to see an example.

+ + + + +

Writing skins with Export/Import in mind back to top

+ +

Nucleus v2.0 introduced the ability to import and export skins and templates. This section describes the creation of a simple skin, highlighting the features involved.

+ +

Creating a new skin

+ +
    +
  1. +

    First, we're going to create a new skin from the admin area. Browse to Nucleus Management > Edit Skins and scroll to the bottom of the page. Let's call this skin 'vista'

    +
  2. +
  3. +

    Now look up the 'vista' skin in the skin list and go to the Edit screen. The content type is set to text/html. That's what we want, so no need to change that

    +

    The Include Mode and Include Prefix setting reuire more attention. To export a skin, we like to have all files (images, stylesheets, etc...) under one single directory. Remember the $DIR_SKINS setting in config.php and the Skins URL in the general site settings? Suppose these were as follows:

    +
    /home/user/example/htdocs/skins/
    +http://example.org/skins/
    +

    Then we would like to put our files in

    +
    /home/user/example/htdocs/skins/vista/
    +http://example.org/skins/vista/
    +

    And this is what the Include Mode is for. Setting it to Use skin dir will do this.

    +

    The Include Prefix also plays a role. This is the vista/ part

    +

    An overview of the correct settings:

    +
      +
    • Name: vista
    • +
    • Content Type: text/html
    • +
    • Include Mode: Use skin dir
    • +
    • Include Prefix: vista/
    • +
    +
  4. +
+ +

Edit the skin

+ +

The IncludeMode and IncludePrefix settings will cause the include, phpinclude and parsedinclude skinvars to get their files from the skindir. Next to that, there's the skinfile skinvar, which translates its argument to an URL relative to the skinsdir.

+ +

In our case:

+ +
<%skinfile(myFile.jpg)%>
+ +

Will get expanded to:

+ +
http://example.org/skins/vista/myFile.jpg
+ +

Lets go easy on ourselves and define the global layout in two files called pagefoot.inc and pagehead.inc, which we place in our vista/ directory:

+ +

pagehead.inc

+ +
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>My Site</title>
+	<link rel="stylesheet" type="text/css" href="<%skinfile(layout.css)%>" />
+</head>
+<body>
+
+<div id="contents">
+ +

pagefoot.inc

+ +
</div><!-- contents div end -->
+
+<div id="stuffbar">
+	<h2>Navigation</h2>
+
+	<ul>
+		<li><a href="<%todaylink%>">Today</a></li>
+		<li><a href="<%archivelink%>">Archives</a></li>
+	</ul>
+
+	<h2>About</h2>
+
+	<ul>
+		<li><a href="http://www.nucleuscms.org/">Nucleus</a> Power!</li>
+	</ul>
+</div><!-- stuffbar end -->
+
+</body>
+</html>
+ +

The contents of the skinparts then becomes kind of trivial: (I'm not defining them all, you'll get the point by seeing the most important ones)

+ +

Main Index

+
<%parsedinclude(pagehead.inc)%>
+
+<h1>My Blog</h1>
+
+<%blog(vista/main,10)%>
+
+<%parsedinclude(pagefoot.inc)%>
+ +

Item Pages

+ +
<%parsedinclude(pagehead.inc)%>
+
+<h1>My Blog</h1>
+
+<h2>Item</h2>
+<%item(vista/detailed)%>
+
+<h2>Comments</h2>
+<%comments(vista/detailed)%>
+
+<h2>Add Comment</h2>
+<%commentform%>
+
+<%parsedinclude(pagefoot.inc)%>
+ +

Note that I named my templates vista/main and vista/detailed. Makes it easier to see things together six months later. Both templates are actually clones that I made of the default and detailed templates that come with Nucleus.

+ +

Archive List

+ +
<%parsedinclude(pagehead.inc)%>
+
+<h1>My Blog</h1>
+
+<%archivelist(vista/main)%>
+
+<%parsedinclude(pagefoot.inc)%>
+ +

Archive

+ +
<%parsedinclude(pagehead.inc)%>
+
+<h1>My Blog</h1>
+
+<%archive(vista/main)%>
+
+<%parsedinclude(pagefoot.inc)%>
+ +

Export the skin

+ +

When all is done, you can export the skin from the Skin Import/Export page in the admin area. Here's what to do:

+ +
    +
  1. Select vista, vista/detailed and vista/main from the skins and template list
  2. +
  3. Add some textual description and hit the Export selected skins/templates button. It will generate a skinbackup.xml for you.
  4. +
  5. Save this skinbackup.xml file together with the other files in the vista/ directory.
  6. +
  7. Package all files from the vista directory inside a zipfile
  8. +
  9. All done! Your skin can now be shared with others
  10. +
+ +

Importing a skin

+ +

Importing is the reverse process:

+ +
    +
  1. Unzip the zip file under your skins directory, so you end up with a vista/ dir (there will be one directory per skin)
  2. +
  3. From the Skin Import/Export page in the admin area, select vista from the dropdown, and click the Import button.
  4. +
  5. Follow the instructions
  6. +
  7. The skin is now installed. It can be selected from the blogsettings.
  8. +
+ + + \ No newline at end of file diff --git a/nucleus/documentation/styles/manual.css b/nucleus/documentation/styles/manual.css new file mode 100644 index 0000000..317e6ea --- /dev/null +++ b/nucleus/documentation/styles/manual.css @@ -0,0 +1,138 @@ +body { + background-color: #fff; + color: #000; + font-family: verdana, arial; + font-size: small; +} + +@media screen { + body { + margin-left: 10%; + margin-right: 10%; + } +} + +@media print { + pre, .note, td, th { + border: 1px dashed gray; + } +} + +img { + border: none; +} + +a:link, a:visited { + color: #1D3565; + font-weight: bold; + text-decoration: none; +} +a: hover { + text-decoration: underline; +} + +.heading { + text-align: center; + font-size: xx-large; + font-weight: bold; + color: gray; +} + +.heading i { + position: absolute; + top: 5px; + right: 5px; + font-size: small; + font-style: normal; + font-weight: normal; +} + + +p { + text-indent: 20px; +} + +h1 { + border-bottom: 1px dotted gray; + font-size: x-large; + color: #596d9d; +} + +h2 { + color: gray; + font-size: large; + margin-left: 20px; + text-indent: 10px; + border-bottom: 1px solid #ddd; +} + +pre, .note, .faq .answer { + background-color: #ddd; + padding: 10px; + font-size: small; +} + +.screenshot { + text-align: center; + background-color: #ddd; + padding: 10px; +} + +.faq .question { + font-weight: bold; + margin-bottom: 0px; +} + +.faq .answer { + +} + +.faq { + margin-bottom: 20px; +} + +table { + border: none; +} + +th { + background-color: linen; + font-size: medium; +} + +th, td { + padding: 5px; +} + +td { + background-color: #dddddd; + font-size: small; + vertical-align: top; + text-align: left; +} + +.deprecated { + border: 3px solid red; + padding: 5px; + font-size: medium; +} + +tt, code, samp { + font-size: small; +} + +.warning { + color: red; +} +.ok { + color: green; +} + +acronym, abbr { + border-bottom: 1px dotted gray; + cursor: help; +} + +label { + cursor: hand; +} \ No newline at end of file diff --git a/nucleus/documentation/tips.html b/nucleus/documentation/tips.html new file mode 100644 index 0000000..fc1b9ae --- /dev/null +++ b/nucleus/documentation/tips.html @@ -0,0 +1,358 @@ + + + + + Nucleus - Tips and suggestions + + + + + + +

Introduction

+ +

+Back to the manual +

+ +

+This file contains tips and suggestions that might prove useful. +

+ +

Table Of Contents

+ + + + + + + + + + + + +

Getting your archives into search engines like Google back to top

+ +
+Note: The solutions described here might not work on your system. +
+ +

+Nucleus creates archives dynamically on users requests. The URL is then of the form index.php?archive=2001-09&blogid=1. Unfortunately, Google and other search engines don't like to index pages with a question mark in it, or with too much arguments. This is because their spiders might get trapped going too deep. +

+ +

Two solutions are listed below. They're not guaranteed to work, however (wether they work or not depends on the webserver configuration)

+ +
    +
  1. Fancy URLs
  2. +
  3. mod_rewrite
  4. +
  5. Fancy URLs 2
  6. +
+ + +

Fancy URLs

+ +

Nucleus v2.0 has a new option in the global settings 'URL mode'. Setting it to 'Fancy URL' mode, and performing the steps below, will make your URLs look like http://example.org/item/1234 instead of http://example.org/index.php?itemid=1234. Search engines like these URLs better.

+ +

Installation steps:

+ +
    +
  1. Copy all files from the /extra/fancyurls directory (except for index.html) to your main nucleus dir (that's where your index.php and action.php file are)
  2. +
  3. If you have an already existing .htaccess file (most ftp-programs don't show hidden files by default, so don't start uploading it without checking your server). If you do, download that old one first, and copy the contents of the new .htaccess file (from the fancyurls folder) in your old one, and upload that...
  4. +
  5. Edit the fancyurls.config.php file so that $CONF['Self'] points to your main directory.
    NOTE: this time, and only this time, the URL should NOT end in a slash
  6. +
  7. Also edit the $CONF['Self'] variable in your index.php, if you don't want to end up with index.php/item/1234 urls when people come via that way
  8. +
  9. Enable 'Fancy URLs' in the Nucleus admin area (nucleus management / edit settings)
  10. +
  11. Off you go!
  12. +
+ +

When it doesn't work (e.g. you receive an Internal Server Error): bad luck... Remove the files again (don't forget the hidden file .htaccess) and reset the Fancy URLs setting in the admin area.

+ + + +

mod_rewrite

+ +

+This second possible solution will only work on servers running Apache, and when you have the right to do so. What we will do is 'disguise' the archives as regular HTML pages +

+ +

+Create a file called .htaccess (leading dot!) with the following contents: +

+ +
+RewriteEngine On
+RewriteRule ^archive-([0-9]+)-([0-9]+)-([0-9]+).html+ index.php?archive=$2-$3&blogid=$1
+RewriteRule ^item-([0-9]+).html+ index.php?itemid=$1
+RewriteRule ^archivelist-([a-z]+).html+ index.php?archivelist=$1
+
+ +

+Now upload this file to the directory that contains index.php and config.php. Open your browser and try to open archive-1-2001-09.html. If it works, continue to read. If you get a 500 error (internal server error), it does not work on your server, so delete the .htaccess file. +

+ +

+Now all you have to do is to update the link to your blog archives into archivelist-shortblogname.html and make the following changes to your archivelist item template: +

+ +
+<a href="archive-<%blogid%>-<%year%>-<%month%>.html">...</a>
+
+ +

+And now, wait until Google comes spidering again... +

+ + +

Fancy URLs 2

+ +

Nucleus CMS version 3.3 offers an easier way to enable the basic Fancy URLs. There are only three steps necessary to install this solution:

+ +
  1. Copy or move the .htaccess file from extra/fancyurl-2 to the root directory of your Nucleus CMS installation.
  2. +
  3. Edit the index.php file which you can find in your root directory. Change value of the CONF['Self'] from the default value ('index.php') to the URL that points to your root directory, for example:
    +
    CONF['Self'] = 'http://yourdomain.com/yourNucleusDirectory';
    +Don't use a slash at the end.
  4. +
  5. Enable the 'Fancy URLs' in the Nucleus admin area, you can find this setting under Management > Configuration.
+ +

Everything done.

+ +

If you want to use rewritten URLs like item/this-is-a-title you can find plugin solutions for it in the Nucleus Plugin Wiki, for example NP_FancierURL2.

+ +

How to set file/dir permissions back to top

+ +

+To enable some features of Nucleus, changing file permissions is required. A small guide on how to do this using an FTP client is given below. +

+ +

+First of all, you'll need an FTP client that supports file permission changing. In this example, we'll use CuteFTP. You can download a free trial version if you don't have it. +

+ +

+To change the permissions of a file or directory, create an FTP connection to your website and search for that file or directory in the hierarchy. Select the file by clicking on it. +

+ +

+Open the menu Commands > File Actions > CHMOD... for a file, or Commands > Directory > CHMOD... for a directory. +

+ +
+ menu +
+ +

+A window will pop up: +

+ +
+ The window that pops up +
+ +

+On the bottom, you can enter the code that's given in the documentation (e.g. 755 or 444). Click the OK button and the changes will be applied. You're finished now. +

+ +

How to restore backups back to top

+ +

+Nucleus has a backup/restore option that super-admins can use to create a backup of the database. It's strongly encouraged to take a backup regularly (weekly or so). The backup-files that are returned are files containing standard SQL-queries, that reconstruct the state of the database as it was when the backup was created. +

+ +

+While backing up is easy, and restoring should also be easy, problems might pop up when your database is fucked up beyond repair. In that case, the repair function might become unaccessible. Below are some ways you can restore your database in that case: +

+ +
+If you're backup was gzipped, unzip if first (it contains an sql file) +
+ + +

Possibility 1: Web-based

+ +

+If you have a web-based interface through which you can manage your database (e.g. PHPMyAdmin), there's most likely an option where you can import a file into the database. Use this function to restore your database. +

+ +

Possibility 2: Shell-access

+ +

+If you have a shell account, restoring a backup can be done by running the mysql program with the following arguments: +

+ +
+mysql -u username -p -h hostname databasename < backupfile.sql
+
+ + +

How to create a new weblog back to top

+ +

1. Creating the weblog

+ +

As a superadmin, you can create new weblogs from the 'Nucleus Management' screen. They will then show up on the admin area.

+ +

2. Accessing your new weblog

+ +

There are several ways in which you can make your new weblog accessible.

+ +
    +
  1. Using a blogid attribute in the URL: +
    http://yourhost.com/index.php?blogid=2
    + (You can find the blogid in the admin area, when hovering over the blog name in the blog list) +
  2. +
  3. + By creating a copy of the index.php file (in this example, our file is named copy.php), and editing the contents of the file to look like this: +
    $CONF['Self'] = 'copy.php';
    +include('./config.php');
    +selectBlog('shortblogname');
    +selector();
    +
    +?>
    + (You can find the short blog name in the admin area, when hovering over the blog name in the blog list) +
  4. +
+ +

Extra methods to use in copy.php

+ +

The selectBlog is only one of the methods which you can use in copies of index.php files. Here's a list of the available calls:

+ + + + + + + + + + + + + + + + + + + + + + +
MethodDescription
selectBlog('shortblogname');Makes sure a certain blog gets selected
selectSkin('skinname');Makes sure a certain skin gets selected
selectCategory(1234);Makes sure a certain category gets selected. Takes a category id as argument. Also accepts a category name (keep in mind that this can cause problems if multiple categories have the same name)
selectItem(1234);Makes sure a certain item gets selected
selectLanguage('french');Makes sure a certain language gets used (note: might produce PHP warnings)
selectSpecialSkinType('construction');Makes sure a certain special skin type gets used (note: if used by itself, it will only show that special skin type). Try this to show the special page only to non-members:
if (!$member->isLoggedIn()) {
+	selectSpecialSkinType('login');
+}
or this to show the special skin type only for the main page:
if (empty($blogid) && empty($catid) && empty($itemid)&& empty($archive) && empty($archivelist) && empty($special)) {
+	selectSpecialSkinType('welcome');
+}
+ +

+Make sure that these methods are called after the include('./config.php') statement, and before the selector(); statement! +

+ +

Creating a blog in a subdirectory

+ +

The process for creating a blog in a subdirectory (http://yourhost.com/sub/ where the main weblog is in http://yourhost.com/) is similar, with the only change that you'll need to replace include('./config.php'); by include('../config.php');

+ + + + + + + + + + + + + + + +

XHTML Support back to top

+ +

+If you see tags like <br /> in the source code of your webpage, it's because the output of Nucleus (except the things defined by templates and skins, of course) is compliant to the XHTML 1.0 standard from the W3C, which is the successor of HTML 4. This way, Nucleus is ready for the future of the web. As far as I know, this XHTML support does not cause any trouble with older browsers and is correctly interpreted. +

+ +

+What this means, is that you can perfectly create an XHTML-compliant site by using correct skins and templates. The default Nucleus skin is XHTML-compliant, but uses the "HTML 4 Loose" doctype. This way, users not knowing XHTML can not create documents with a false XHTML doctype. +

+ + + + + + + + + + + +

How to create a Special skin part back to top

+ +

1. Enter the Nucleus admin area and go to Skins management page (Layout>Skins). Find your skin and click the Edit link in the right column.

+ +

2. Under the list of skin parts there is a sections called Special skin parts. In the field type the name of your special skin part and then click the Create button. (I'm using the name 'About' for my example). You then get a Edit skin part form, just like for any other skin part, that you can add content, skin variables or anything else. If you want to make it look like the rest of your site, you can copy the contents of the Main Index skinpart here and replace the <%body(...)%> skin variable with the contents of the static page.
+
+For example, using the default skin, the contents of the About skin part would look something like this:

+
<%parsedinclude(head.inc)%>
+
+<!-- page header -->
+<%parsedinclude(header.inc)%>
+
+<!-- page content -->
+<div id="container">
+<div class="content">
+This site is run by a group of friends who all enjoy hiking. Together we have
+hiked a total of over 4000 miles though out the US, Canada and Europe. Here we
+share our experiences and our experience. Though we are serious hikers, we
+believe hiking should first be fun for everybody.
+<br /><br />
+To join our community, please register here: (...link to registration page...)
+<br /><br />
+... insert links to images of hiking fun...
+</div>
+</div>
+
+<!-- page menu -->
+<h2 class="hidden">Sidebar</h2>
+<div id="sidebarcontainer">
+<%parsedinclude(sidebar.inc)%>
+</div>
+
+<!-- page footer -->
+<%parsedinclude(footer.inc)%>
+ +

3. Now to access this page, you would point your browser (or put a link in your skin somewhere) to

+ +
www.yourdomain.tld/index.php?special=About
+ + +

4. You can edit this skin part just as you would any other skin part and most skin variables and plugins will probably work.

+ +

Note: You may want to keep your static content in a file called About.html in the skins/default/ directory (if using the default skin) and instead of typing the content of the page in the skin part, just put <%include(About.html)%>. There's almost no restriction on what these pages can contain.

+ +

(Tip from ftruscot)

+ + + \ No newline at end of file diff --git a/nucleus/forgotpassword.html b/nucleus/forgotpassword.html new file mode 100644 index 0000000..b10d854 --- /dev/null +++ b/nucleus/forgotpassword.html @@ -0,0 +1,46 @@ + + + + + Nucleus - Forgotten Password + + + +
+

Nucleus CMS

+
+ +
+ +

Forgot your password?

+ +

Enter your username and email address below, and you'll be sent an e-mail with a link where you can choose a new password.

+ +
+

+
+
+ +
+
+
+ + + +

+
+ +

If you don't remember your exact username, contact the site administrator.

+ + + +
+ + + diff --git a/nucleus/forms/additemform.template b/nucleus/forms/additemform.template new file mode 100644 index 0000000..47d65f4 --- /dev/null +++ b/nucleus/forms/additemform.template @@ -0,0 +1,30 @@ + + +
+
+ <%ticket%> + + + + + +
+ +
+ +
+ [ctrl+shift+A] = Link, [ctrl+shift+B] = Bold, [ctrl+shift+I] = Italic, [ctrl+shift+M] = Insert Media. + <%callback(FormExtra,additemform)%> +
+
diff --git a/nucleus/forms/commentform-closed.template b/nucleus/forms/commentform-closed.template new file mode 100644 index 0000000..b9393ec --- /dev/null +++ b/nucleus/forms/commentform-closed.template @@ -0,0 +1 @@ +
<%text(_ERROR_ITEMCLOSED)%>
diff --git a/nucleus/forms/commentform-closedtopublic.template b/nucleus/forms/commentform-closedtopublic.template new file mode 100644 index 0000000..a4600ed --- /dev/null +++ b/nucleus/forms/commentform-closedtopublic.template @@ -0,0 +1 @@ +
<%text(_ERROR_COMMENTS_NONPUBLIC)%>
diff --git a/nucleus/forms/commentform-loggedin.template b/nucleus/forms/commentform-loggedin.template new file mode 100644 index 0000000..79b88b2 --- /dev/null +++ b/nucleus/forms/commentform-loggedin.template @@ -0,0 +1,18 @@ +  +
+
+ + + + <%errordiv%> + + + + <%text(_COMMENTFORM_YOUARE)%> <%formdata(membername)%> + (<%text(_LOGOUT)%>) + + + + <%callback(FormExtra,commentform-loggedin)%> +
+
diff --git a/nucleus/forms/commentform-notloggedin.template b/nucleus/forms/commentform-notloggedin.template new file mode 100644 index 0000000..6b1125c --- /dev/null +++ b/nucleus/forms/commentform-notloggedin.template @@ -0,0 +1,28 @@ +  +
+
+ + + + <%errordiv%> + + + + + + + + + + + + + + <%callback(FormExtra,commentform-notloggedin)%> + + /> + + + +
+
diff --git a/nucleus/forms/loginform-loggedin.template b/nucleus/forms/loginform-loggedin.template new file mode 100644 index 0000000..c949df1 --- /dev/null +++ b/nucleus/forms/loginform-loggedin.template @@ -0,0 +1,4 @@ +  +
+ <%text(_LOGINFORM_YOUARE)%> <%formdata(membername)%> ! (<%text(_LOGOUT)%>) +
diff --git a/nucleus/forms/loginform-notloggedin.template b/nucleus/forms/loginform-notloggedin.template new file mode 100644 index 0000000..0dc0827 --- /dev/null +++ b/nucleus/forms/loginform-notloggedin.template @@ -0,0 +1,18 @@ +  +
+
+ + <%errordiv%> + + + + + + + + + + + +
+
diff --git a/nucleus/forms/membermailform-disallowed.template b/nucleus/forms/membermailform-disallowed.template new file mode 100644 index 0000000..01e37b6 --- /dev/null +++ b/nucleus/forms/membermailform-disallowed.template @@ -0,0 +1 @@ +
<%text(_ERROR_LOGINNEEDED)%>
\ No newline at end of file diff --git a/nucleus/forms/membermailform-loggedin.template b/nucleus/forms/membermailform-loggedin.template new file mode 100644 index 0000000..ecb9663 --- /dev/null +++ b/nucleus/forms/membermailform-loggedin.template @@ -0,0 +1,15 @@ +  +
+
+ + + + <%errordiv%> + + + + <%callback(FormExtra,membermailform-loggedin)%> + + +
+
diff --git a/nucleus/forms/membermailform-notloggedin.template b/nucleus/forms/membermailform-notloggedin.template new file mode 100644 index 0000000..48de0d0 --- /dev/null +++ b/nucleus/forms/membermailform-notloggedin.template @@ -0,0 +1,18 @@ +  +
+
+ + + + <%errordiv%> + + + + + + + <%callback(FormExtra,membermailform-notloggedin)%> + + +
+
diff --git a/nucleus/forms/nucleusbutton.template b/nucleus/forms/nucleusbutton.template new file mode 100644 index 0000000..64f545f --- /dev/null +++ b/nucleus/forms/nucleusbutton.template @@ -0,0 +1,3 @@ +
+ Powered by Nucleus CMS +
diff --git a/nucleus/forms/searchform.template b/nucleus/forms/searchform.template new file mode 100644 index 0000000..0122457 --- /dev/null +++ b/nucleus/forms/searchform.template @@ -0,0 +1,8 @@ +
+
+ + + + +
+
diff --git a/nucleus/images/button-aligncenter.gif b/nucleus/images/button-aligncenter.gif new file mode 100644 index 0000000000000000000000000000000000000000..2ce38e76d65815bd9e795cecad09690badeda8f1 GIT binary patch literal 85 zcmZ?wbhEHb6krfwn8*ME|3TmxkfHdK1uUQgB0=&DOlm!?D~~bqCv&e_CT2WmdC{EO cX{=d6##N~u%T^_CnybA=%6b3&a0Uiz0Q;93i2wiq literal 0 HcmV?d00001 diff --git a/nucleus/images/button-alignleft.gif b/nucleus/images/button-alignleft.gif new file mode 100644 index 0000000000000000000000000000000000000000..53522cbb970864cb9efc9e5bc793feb2250ebaee GIT binary patch literal 68 zcmZ?wbhEHb6krfwXkY+=|NoyU{$v3&bwDIYhJi`Cr$6(++cilwBB!LY4%=j3_YFN! OtI#<^?35HMgEas{@)LCc literal 0 HcmV?d00001 diff --git a/nucleus/images/button-alignright.gif b/nucleus/images/button-alignright.gif new file mode 100644 index 0000000000000000000000000000000000000000..a27a9444cad00fed83c06f285e216e3bbe5f6dcf GIT binary patch literal 67 zcmZ?wbhEHb6krfwXkY+=|NoyU{$v3&bwDIYhJi_{r@!;S+ck@-L{9Bqbu`ePk1fig Nk~ebJi!2caYXCJc6C?lt literal 0 HcmV?d00001 diff --git a/nucleus/images/button-bold.gif b/nucleus/images/button-bold.gif new file mode 100644 index 0000000000000000000000000000000000000000..207c859956fc8626d6faefee8b06c23d956a0b5e GIT binary patch literal 73 zcmZ?wbhEHb6krfwXkcUjg8%=YDgI;uG8q|kKzxu41Cv5e|H{*A8I*G_UMYP)+fn^x XZA?YV9kvK{rb*|xkADheV6X-Nxfm8i literal 0 HcmV?d00001 diff --git a/nucleus/images/button-copy.gif b/nucleus/images/button-copy.gif new file mode 100644 index 0000000000000000000000000000000000000000..4cb12cf4c18122be283c5694d5332dd99649d5db GIT binary patch literal 103 zcmZ?wbhEHb6krfwn8?h)z%cXw|NlVh|Nm!-KUo+V7?>G!fLx%g00RS)#hm`kLu)mf zc;2k_T-n>x#P1ZrkZ}K?>C+IV>7K3&W*fcscwFer*K0Lthse_TZwieS(~Y}7&(vUG Gum%8|Ya|Z< literal 0 HcmV?d00001 diff --git a/nucleus/images/button-cut.gif b/nucleus/images/button-cut.gif new file mode 100644 index 0000000000000000000000000000000000000000..d00c0e638271ed8021593eadf52c052cfe4fba92 GIT binary patch literal 89 zcmZ?wbhEHb6krfwn8?V$z%cXw|7So72o!&^00kHsbU+-CJOh(fPyfoIH7}fMHeEb+ nWXVsbw~h}PISxq7IZ(BBRiW0$*>=Uf>g7_mZC`0JFjxZsPJlZBCifr&u}$Og&^0NK)0`d6NQ%ec^3 az=!e4TJv`8g30V%z9NmUPBpPISOWm1aTI0% literal 0 HcmV?d00001 diff --git a/nucleus/images/button-left.gif b/nucleus/images/button-left.gif new file mode 100644 index 0000000000000000000000000000000000000000..915841403bec91d21cc193c36cb7beda3fe90c66 GIT binary patch literal 91 zcmZ?wbhEHb6krfwn8?8JYOfsw1H=FS&w!-jPZl7_z@P&nK=KSsI#c>H59;zBW)|@% qb=s=GDKb{V!}H$q*2kM>s-Ik&d9!ju$4&KpX}@oK|M6pGum%8mZXTxq literal 0 HcmV?d00001 diff --git a/nucleus/images/button-link.gif b/nucleus/images/button-link.gif new file mode 100644 index 0000000000000000000000000000000000000000..c1a41e2d7db846fb0b37d4d09c86e3f0cd34a3d7 GIT binary patch literal 141 zcmZ?wbhEHb6krfwSj5V3;J|@~h6aWP1_p*7K>YvzGav~Bia%Kx85md@bU+-CS_bBz z2&p^2CU7cn)-b+M*tH?hAj8?R#L*;Z`Guy_2P&U)iZ6Oo`gHDe>*?pOJUXezBAhrg p<=!kQUPZ2ou({`6C3|uBER9>+)ScRO{L1<-K?U1pcCj#60{|x{Gk*X8 literal 0 HcmV?d00001 diff --git a/nucleus/images/button-media.gif b/nucleus/images/button-media.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce65641056c6a3ad1a6a302b2a51aa95be793328 GIT binary patch literal 132 zcmZ?wbhEHb6krfwSj52a|Npc9|AFNHGiT0BoH&sI1{8m?FoM`RAOfV8f!UK|*PSSX zQ=DD`=8t8)p2{!^Hl;U)J9gY%p1LX`?7iBm+{Smy*skvMJ;Nk;$xAyl(cl7W@@kdf ZbSbr^zQG|SqQ2Ub3ywI(sW32D0|2W7Em{Bo literal 0 HcmV?d00001 diff --git a/nucleus/images/button-paste.gif b/nucleus/images/button-paste.gif new file mode 100644 index 0000000000000000000000000000000000000000..ef0d0eb88c685faf5d246294b1dbc494d1b91ae0 GIT binary patch literal 127 zcmZ?wbhEHb6krfwSj57>z%a9;tM2E|pFr0C|IdIV1StMwVPs%nVbB3_L24P8T|9Q( zu`93;T__NG=>YpTX7P-N8Z6>blVaIQXKS2Z!*jkn`-b!0Ut$*Ua+;&i{^U#B X{$k6kg~1vCKNKq^ literal 0 HcmV?d00001 diff --git a/nucleus/images/button-preview.gif b/nucleus/images/button-preview.gif new file mode 100644 index 0000000000000000000000000000000000000000..71d2d923d5f1a4af42808c9fc39ff6c371c46cc8 GIT binary patch literal 90 zcmZ?wbhEHb6krfwn8?Jyz|is^1fBs|ia%Kx85o!tbbxH2tN@U$J*9uJ51xJ9^z`$|>Dn~95?4_Vy|{^P;QU=0ALIv;-k literal 0 HcmV?d00001 diff --git a/nucleus/images/globe.gif b/nucleus/images/globe.gif new file mode 100644 index 0000000000000000000000000000000000000000..03f2a470fe0911a7f3146cec927a65456638f63e GIT binary patch literal 124 zcmZ?wbhEHb`rj}u!t#?R@@kLTH cr;!ztj+(Ygqag#Ukn##O9x<0B4+aKn0L-l>EC2ui literal 0 HcmV?d00001 diff --git a/nucleus/index.php b/nucleus/index.php new file mode 100644 index 0000000..77f8ddf --- /dev/null +++ b/nucleus/index.php @@ -0,0 +1,76 @@ + _ERRORS_INSTALLSQL, + '../install.php' => _ERRORS_INSTALLPHP, + 'upgrades' => _ERRORS_UPGRADESDIR, + 'convert' => _ERRORS_CONVERTDIR + ); + $aFound = array(); + foreach($aFiles as $fileName => $fileDesc) + { + if (@file_exists($fileName)) + array_push($aFound, $fileDesc); + } + if (@is_writable('../config.php')) { + array_push($aFound, _ERRORS_CONFIGPHP); + } + if (sizeof($aFound) > 0) + { + startUpError( + _ERRORS_STARTUPERROR1. implode($aFound, '
  • ')._ERRORS_STARTUPERROR2, + _ERRORS_STARTUPERROR3 + ); + } + } + + $bNeedsLogin = false; + $bIsActivation = in_array($action, array('activate', 'activatesetpwd')); + + if ($action == 'logout') + $bNeedsLogin = true; + + if (!$member->isLoggedIn() && !$bIsActivation) + $bNeedsLogin = true; + + // show error if member cannot login to admin + if ($member->isLoggedIn() && !$member->canLogin() && !$bIsActivation) { + $error = _ERROR_LOGINDISALLOWED; + $bNeedsLogin = true; + } + + if ($bNeedsLogin) + { + setOldAction($action); // see ADMIN::login() (sets old action in POST vars) + $action = 'showlogin'; + } + + sendContentType('text/html', 'admin-' . $action); + + $admin = new ADMIN(); + $admin->action($action); +?> \ No newline at end of file diff --git a/nucleus/javascript/admin.js b/nucleus/javascript/admin.js new file mode 100644 index 0000000..da583b1 --- /dev/null +++ b/nucleus/javascript/admin.js @@ -0,0 +1,59 @@ +/** + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) + * Copyright (C) 2002-2009 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. + * (see nucleus/documentation/index.html#license for more info) + * + * Some JavaScript code for the admin area + * + * $Id: admin.js 1388 2009-07-18 06:31:28Z shizuki $ + */ + +function help(url) { + popup = window.open(url,'helpwindow','status=no,toolbar=yes,scrollbars=yes,resizable=yes,width=500,height=500,top=0,left=0'); + if (popup.focus) popup.focus(); + if (popup.GetAttention) popup.GetAttention(); + return false; +} + +var oldCellColor = "#000"; +function focusRow(row) { + var cells = row.cells; + if (!cells) return; + oldCellColor = cells[0].style.backgroundColor; + for (var i=0;i
  • "; + } else { + $types[$i] = '
  • ' . helpHtml('skinpartspecial') . ' ' . i18n::hsc($friendlyNames[$type]) . "
  • "; + } + } + echo '

    ',_LIST_SKINS_DEFINED,'
      ',implode($types,'') ,'
    '; + } + echo ""; + echo ""._LISTS_EDIT.""; + + $url = $manager->addTicketToUrl('index.php?action=skinclone&skinid=' . intval($current->sdnumber)); + echo ""._LISTS_CLONE.""; + echo ""._LISTS_DELETE.""; + + break; + } +} + +function listplug_table_draftlist($template, $type) { + switch($type) { + case 'HEAD': + echo ""._LISTS_BLOG.""._LISTS_TITLE.""._LISTS_ACTIONS.""; + break; + case 'BODY': + $current = $template['current']; + + echo '', i18n::hsc($current->bshortname) , ''; + echo '', i18n::hsc(strip_tags($current->ititle)) , ''; + echo ""._LISTS_EDIT.""; + echo ""._LISTS_DELETE.""; + + break; + } +} + +function listplug_table_otherdraftlist($template, $type) { + switch($type) { + case 'HEAD': + echo ""._LISTS_BLOG.""._LISTS_TITLE.""._LISTS_AUTHOR.""._LISTS_ACTIONS.""; + break; + case 'BODY': + $current = $template['current']; + + echo '', i18n::hsc($current->bshortname) , ''; + echo '', i18n::hsc(strip_tags($current->ititle)) , ''; + echo '', i18n::hsc($current->mname) , ''; + echo ""._LISTS_EDIT.""; + echo ""._LISTS_DELETE.""; + + break; + } +} + +function listplug_table_actionlist($template, $type) { + switch($type) { + case 'HEAD': + echo ''._LISTS_TIME.''._LIST_ACTION_MSG.''; + break; + case 'BODY': + $current = $template['current']; + + echo '' , i18n::hsc($current->timestamp), ''; + echo '' , i18n::hsc($current->message), ''; + + break; + } +} + +function listplug_table_banlist($template, $type) { + switch($type) { + case 'HEAD': + echo ''._LIST_BAN_IPRANGE.''. _LIST_BAN_REASON.''._LISTS_ACTIONS.''; + break; + case 'BODY': + $current = $template['current']; + + echo '' , i18n::hsc($current->iprange) , ''; + echo '' , i18n::hsc($current->reason) , ''; + echo "",_LISTS_DELETE,""; + break; + } +} + +?> diff --git a/nucleus/libs/skinie.php b/nucleus/libs/skinie.php new file mode 100644 index 0000000..656983a --- /dev/null +++ b/nucleus/libs/skinie.php @@ -0,0 +1,716 @@ +debug = 0; + + $this->reset(); + } + + function reset() + { + if ( $this->parser ) + { + xml_parser_free($this->parser); + } + + // XML file pointer + $this->fp = 0; + + // which data has been read? + $this->metaDataRead = 0; + $this->allRead = 0; + + // to maintain track of where we are inside the XML file + $this->inXml = 0; + $this->inData = 0; + $this->inMeta = 0; + $this->inSkin = 0; + $this->inTemplate = 0; + $this->currentName = ''; + $this->currentPartName = ''; + + // character data pile + $this->cdata = ''; + + // list of skinnames and templatenames (will be array of array) + $this->skins = array(); + $this->templates = array(); + + // extra info included in the XML files (e.g. installation notes) + $this->info = ''; + + // 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); + } + + /** + * Reads an XML file into memory + * + * @param $filename + * Which file to read + * @param $metaOnly + * Set to 1 when only the metadata needs to be read (optional, default 0) + */ + function readFile($filename, $metaOnly = 0) + { + // open file + $this->fp = @fopen($filename, 'r'); + if ( !$this->fp ) + { + return _SKINIE_ERROR_FAILEDOPEN_FILEURL; + } + + // here we go! + $this->inXml = 1; + + $tempbuffer = null; + + while ( !feof($this->fp) ) + { + $tempbuffer .= fread($this->fp, 4096); + } + fclose($this->fp); + +/* + [2004-08-04] dekarma - Took this out since it messes up good XML if it has skins/templates + with CDATA sections. need to investigate consequences. + see bug [ 999914 ] Import fails (multiple skins in XML/one of them with CDATA) + + // backwards compatibility with the non-wellformed skinbackup.xml files + // generated by v2/v3 (when CDATA sections were present in skins) + // split up those CDATA sections into multiple ones + $tempbuffer = preg_replace_callback( + "/(metaDataRead)) ) + { + $err = xml_parse( $this->parser, $buffer, feof($temp) ); + if ( !$err && $this->debug ) + { + echo 'ERROR: ', xml_error_string(xml_get_error_code($this->parser)), '
    '; + } + } + + // all done + $this->inXml = 0; + fclose($temp); + } + + /** + * Returns the list of skin names + */ + function getSkinNames() + { + return array_keys($this->skins); + } + + /** + * Returns the list of template names + */ + function getTemplateNames() + { + return array_keys($this->templates); + } + + /** + * Returns the extra information included in the XML file + */ + function getInfo() + { + return $this->info; + } + + /** + * Writes the skins and templates to the database + * + * @param $allowOverwrite + * set to 1 when allowed to overwrite existing skins with the same name + * (default = 0) + */ + function writeToDatabase($allowOverwrite = 0) + { + $existingSkins = $this->checkSkinNameClashes(); + $existingTemplates = $this->checkTemplateNameClashes(); + $invalidSkinNames = $this->checkSkinNamesValid(); + $invalidTemplateNames = $this->checkTemplateNamesValid(); + + // if there are invalid skin or template names, stop executioin and return and error + if ( (sizeof($invalidSkinNames) > 0) || (sizeof($invalidTemplateNames) > 0) ) + { + $inames_error = "

    "._SKINIE_INVALID_NAMES_DETECTED."

    \n"; + $inames_error .= "
      "; + foreach( $invalidSkinNames as $sName ) + { + $inames_error .= "
    • ".i18n::hsc($sName)."
    • "; + } + foreach( $invalidTemplateNames as $sName ) + { + $inames_error .= "
    • ".i18n::hsc($sName)."
    • "; + } + $inames_error .= "
    "; + return $inames_error; + } + + // if not allowed to overwrite, check if any nameclashes exists + if ( !$allowOverwrite ) + { + if ( (sizeof($existingSkins) > 0) || (sizeof($existingTemplates) > 0) ) + { + return _SKINIE_NAME_CLASHES_DETECTED; + } + } + + foreach ( $this->skins as $skinName => $data ) + { + // 1. if exists: delete all part data, update desc data + // if not exists: create desc + if ( in_array($skinName, $existingSkins) ) + { + $skinObj = SKIN::createFromName($skinName); + + // delete all parts of the skin + $skinObj->deleteAllParts(); + + // update general info + $skinObj->updateGeneralInfo( + $skinName, + $data['description'], + $data['type'], + $data['includeMode'], + $data['includePrefix'] + ); + } + else + { + $skinid = SKIN::createNew( + $skinName, + $data['description'], + $data['type'], + $data['includeMode'], + $data['includePrefix'] + ); + $skinObj = new SKIN($skinid); + } + + // 2. add parts + foreach ( $data['parts'] as $partName => $partContent ) + { + $skinObj->update($partName, $partContent); + } + } + + foreach ( $this->templates as $templateName => $data ) + { + // 1. if exists: delete all part data, update desc data + // if not exists: create desc + if ( in_array($templateName, $existingTemplates) ) + { + $templateObj = TEMPLATE::createFromName($templateName); + + // delete all parts of the template + $templateObj->deleteAllParts(); + + // update general info + $templateObj->updateGeneralInfo($templateName, $data['description']); + } + else + { + $templateid = TEMPLATE::createNew($templateName, $data['description']); + $templateObj = new TEMPLATE($templateid); + } + + // 2. add parts + foreach ( $data['parts'] as $partName => $partContent ) + { + $templateObj->update($partName, $partContent); + } + } + } + + /** + * returns an array of all the skin nameclashes (empty array when no name clashes) + */ + function checkSkinNameClashes() + { + $clashes = array(); + + foreach ( $this->skins as $skinName => $data ) + { + if ( SKIN::exists($skinName) ) + { + array_push($clashes, $skinName); + } + } + return $clashes; + } + + /** + * returns an array of all the template nameclashes + * (empty array when no name clashes) + */ + function checkTemplateNameClashes() + { + $clashes = array(); + + foreach ( $this->templates as $templateName => $data ) + { + if ( TEMPLATE::exists($templateName) ) + { + array_push($clashes, $templateName); + } + } + return $clashes; + } + + /** + * returns an array of all the invalid skin names (empty array when no invalid names ) + */ + function checkSkinNamesValid() + { + $notValid = array(); + + foreach ( $this->skins as $skinName => $data ) + { + if ( !isValidSkinName($skinName) ) + { + array_push($notValid, $skinName); + } + } + return $notValid; + } + + /** + * returns an array of all the invalid template names (empty array when no invalid names ) + */ + function checkTemplateNamesValid() + { + $notValid = array(); + + foreach ( $this->templates as $templateName => $data ) + { + if ( !isValidTemplateName($templateName) ) + { + array_push($notValid, $templateName); + } + } + return $notValid; + } + + /** + * Called by XML parser for each new start element encountered + */ + function startElement($parser, $name, $attrs) + { + foreach( $attrs as $key=>$value ) + { + $attrs[$key] = i18n::hsc($value); + } + + if ( $this->debug ) + { + echo 'START: ', i18n::hsc($name), '
    '; + } + + switch ( $name ) + { + case 'nucleusskin': + $this->inData = 1; + break; + case 'meta': + $this->inMeta = 1; + break; + case 'info': + // no action needed + break; + case 'skin': + if ( !$this->inMeta ) + { + $this->inSkin = 1; + $this->currentName = $attrs['name']; + $this->skins[$this->currentName]['type'] = $attrs['type']; + $this->skins[$this->currentName]['includeMode'] = $attrs['includeMode']; + $this->skins[$this->currentName]['includePrefix'] = $attrs['includePrefix']; + $this->skins[$this->currentName]['parts'] = array(); + } + else + { + $this->skins[$attrs['name']] = array(); + $this->skins[$attrs['name']]['parts'] = array(); + } + break; + case 'template': + if ( !$this->inMeta ) + { + $this->inTemplate = 1; + $this->currentName = $attrs['name']; + $this->templates[$this->currentName]['parts'] = array(); + } + else + { + $this->templates[$attrs['name']] = array(); + $this->templates[$attrs['name']]['parts'] = array(); + } + break; + case 'description': + // no action needed + break; + case 'part': + $this->currentPartName = $attrs['name']; + break; + default: + echo _SKINIE_SEELEMENT_UNEXPECTEDTAG . i18n::hsc($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->debug ) + { + echo 'END: ' . i18n::hsc($name) . '
    '; + } + + switch ( $name ) + { + case 'nucleusskin': + $this->inData = 0; + $this->allRead = 1; + break; + case 'meta': + $this->inMeta = 0; + $this->metaDataRead = 1; + break; + case 'info': + $this->info = $this->getCharacterData(); + case 'skin': + if ( !$this->inMeta ) + { + $this->inSkin = 0; + } + break; + case 'template': + if ( !$this->inMeta ) + { + $this->inTemplate = 0; + } + break; + case 'description': + if ( $this->inSkin ) + { + $this->skins[$this->currentName]['description'] = $this->getCharacterData(); + } + else + { + $this->templates[$this->currentName]['description'] = $this->getCharacterData(); + } + break; + case 'part': + if ( $this->inSkin ) + { + $this->skins[$this->currentName]['parts'][$this->currentPartName] = $this->getCharacterData(); + } + else + { + $this->templates[$this->currentName]['parts'][$this->currentPartName] = $this->getCharacterData(); + } + break; + default: + echo _SKINIE_SEELEMENT_UNEXPECTEDTAG . i18n::hsc($name) . '
    '; + break; + } + $this->clearCharacterData(); + } + + /** + * Called by XML parser for data inside elements + */ + function characterData ($parser, $data) + { + if ( $this->debug ) + { + 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 = ''; + } + + /** + * Static method that looks for importable XML files in subdirs of the given dir + */ + function searchForCandidates($dir) + { + $candidates = array(); + + $dirhandle = opendir($dir); + while ( $filename = readdir($dirhandle) ) + { + if ( @is_dir($dir . $filename) && ($filename != '.') && ($filename != '..') ) + { + $xml_file = $dir . $filename . '/skinbackup.xml'; + if ( file_exists($xml_file) && is_readable($xml_file) ) + { + //$xml_file; + $candidates[$filename] = $filename; + } + + // backwards compatibility + $xml_file = $dir . $filename . '/skindata.xml'; + if ( file_exists($xml_file) && is_readable($xml_file) ) + { + //$xml_file; + $candidates[$filename] = $filename; + } + } + } + closedir($dirhandle); + return $candidates; + } +} + +class SKINEXPORT { + var $templates; + var $skins; + var $info; + + /** + * Constructor initializes data structures + */ + function SKINEXPORT() + { + // list of templateIDs to export + $this->templates = array(); + + // list of skinIDs to export + $this->skins = array(); + + // extra info to be in XML file + $this->info = ''; + } + + /** + * Adds a template to be exported + * + * @param id + * template ID + * @result false when no such ID exists + */ + function addTemplate($id) + { + if ( !TEMPLATE::existsID($id) ) + { + return 0; + } + + $this->templates[$id] = TEMPLATE::getNameFromId($id); + return 1; + } + + /** + * Adds a skin to be exported + * + * @param id + * skin ID + * @result false when no such ID exists + */ + function addSkin($id) + { + if ( !SKIN::existsID($id) ) + { + return 0; + } + + $this->skins[$id] = SKIN::getNameFromId($id); + return 1; + } + + /** + * Sets the extra info to be included in the exported file + */ + function setInfo($info) + { + $this->info = $info; + } + + /** + * Outputs the XML contents of the export file + * + * @param $setHeaders + * set to 0 if you don't want to send out headers + * (optional, default 1) + */ + function export($setHeaders = 1) + { + if ( $setHeaders ) + { + // make sure the mimetype is correct, and that the data does not show up + // in the browser, but gets saved into and XML file (popup download window) + header('Content-Type: text/xml'); + header('Content-Disposition: attachment; filename="skinbackup.xml"'); + header('Expires: 0'); + header('Pragma: no-cache'); + } + + echo "\n"; + + // meta + echo "\t\n"; + // skins + foreach ( $this->skins as $skinId => $skinName ) + { + echo "\t\t" . '' . "\n"; + } + // templates + foreach ( $this->templates as $templateId => $templateName ) + { + echo "\t\t" . '