CMSimple_XH 1.6

A place for general not CMSimple related discussions
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

CMSimple_XH 1.6

Post by cmb » Fri Jan 03, 2014 7:22 pm

Hello Community,

we have just released CMSimple_XH 1.6. Note that upgrading from XH 1.5.9 is not necessary, as the 1.5.x branch will still be supported with security patches and bug fixes until June, 30th, 2014.

Thanks to everybody who contributed to this new version with ideas, comments, suggestions and code.

The most notable changes for Users
  • the folder layout has been changed; the images/, downloads/ and media/ folders have to be subfolders of userfiles/ now (actually you can configure all these folders); the content/ folder of second languages has been moved to the toplevel content folder (e.g. fr/content/ -> content/fr/)
  • the menu item Settings->Website has been removed, as the cmsimple/languages/LANGconfig.php files have been removed; the respective settings have been moved to the configuration resp. the language files as appropriate. The variables $txc['template']['textX'], which may be used in templates, do still exist, but they are deprecated; use $tx['template']['textX'] instead.
  • the subsites feature has been removed, as the implementation in CMSimple_XH 1.5 was too much of a hack (see the documentation about Subsites and alternative solutions)
  • content.htm and pagedata.php have been joined to a single content.htm, so it's finally possible to edit the content as in classic CMSimple (offline or online)
  • all plugin stylesheets are dynamically joined to a single sytelesheet (css/plugins.css) to reduce the number of requests for a page.
  • the default template (mini1) was extended to contain some useful CSS classes, which can be selected in the editors; their use is shown in the default content
  • viewing resp. downloading of files in the filebrowser has been added. Furthermore it is possible to replace already linked images with newly uploaded files.
  • the plugin UpdateCheck has been added to the distribution
  • tinymce has been updated to contain the most recent TinyMCE of the 3.x branch (3.5.10). TinyMCE 4.x is still behind 3.x wrt. functionality, so we'll keep it out of the base distribution for now. manu has set up a project on SF, where you can download the tinymce4 plugin.
  • the format select list of tinymce has been improved; you can customize it to some degree in the respective init file (see the comment above theme_advanced_blockformats)
  • jQuery4CMSimple has been updated to contain the most recent jQuery(UI)
  • the Pagemanager has be updated to version 2.0 (same functionality as before, but optimized, especially for "large" sites)
  • the config option Plugins->Disabled has been added, what may serve as a quick alternative to uninstalling a plugin (note, that this might not have the same effect in some cases).
  • customization of the plugin names in the admin menu is possible by adding $plugin_tx['NAME_OF_THE_PLUGIN']['menu_plugin']="desired name"; to config.php of the respective plugin
  • the delimiter of the config options Urichar->Old and ->New has been changed to the pipe character (|) to allow to replace commas (it is actually defined in cmsimple/cms.php as XH_URICHAR_SEPARATOR)
  • the plugin call notation has been simplified; it is not necessary anymore to write "PLUGIN:", so you can write {{{plugin_function(...);}}}; actually "PLUGIN" can be replaced with an arbitrary comment (which must not contain colons)
  • integration of the built-in mailform on a page is possible: {{{XH_mailform();}}}, what allows for additional text above or below the mailform
  • Security->Type "javascript" has been removed
  • several improvements regarding the security of CMSimple_XH have been made
  • a Password forgotten feature has been added to the login form; this requires the config option Security->Email (not Mailform->Email) to be set appropriately; so it is not necessary anymore to reset the password directly in config.php
  • a button to delete the content has been added, which might be useful to get rid of the default content with a single click (the current content will be stored as a backup)
  • the built-in mailform accepts IDN (if supported by your PHP version)
  • an (empty) file .2lang (note the leading dot) is required to mark a folder as second language folder; thus it is possible to have folder names consisting of 2 characters that are not second language folders
  • the configuration forms allow for different types of config options (checkboxes, text inputs, textareas etc.); plugins can also use this feature
  • config options can be hidden by using the typed config; this may be useful to hide options that should not be changed by the end-user of a site
  • the page data tabs can be saved without saving modifications of the page content first
  • to cater for servers where the timezone is not correctly configured, the config option site_timezone has been added; consult the system check, whether you need to set it, and see the resp. help tooltip regarding the details.
  • to unify the handling of locales, the language setting Locale->All has been introduced; this is not used by the core, but rather offers an opportunity for plugins to avoid individual setting of locales; unfortunately, it is not possible to preset this setting, as it differs for various operating systems (and usually not all locales are available on a particular server); consult the system check, if the configured locale is working
  • content backups (stored on the server in the content folder) can be restored in the back-end. Furthermore you can make additional backups.
  • under Settings -> Page Data you can clean up the page data
  • page scheduling has been added (thanks to Jerry), so it is possible to specify a publishing interval for individual pages in the "Page" tab
  • individual page templates are inherited to all sub pages unless explicitely overridden
  • the Meta->Description is shown in the search results
  • the log file is displayed within the template, and more importantly, it may contain more information than just about log ins (such as failed contact form mails), so have a look at it from time to time
  • the link checker (Settings -> Validate) has been slightly improved
  • links in print views are converted on the fly to point to the resp. print view
  • internationalization of the config keys has been added (still experimental)
The most notable changes for Template Designers
  • there's a new function (aka. "template tag") for more flexibility regarding the print links: XH_printUrl()
  • function legallink() was deprecated; this function is a leftover from CMSimple's AGL license, and it's not necessary anymore for GPL; you may consider to remove it from your template(s), as the function definition might be removed in a future version
  • the current page is wrapped in <span> in menus (TOC, sitemap, submenu) to allow for a more "symmetrical" styling
  • as the LANGconfig.php files have been removed, you might have to replace $txc with $tx ($txc['template'] does still work, but it has been deprecated)
The most notable changes for Plugin Developers
  • as content.htm and pagedata.php have been joined to a single file, plugins can't read pagedata.php directly anymore and directly reading content.htm might give unexpected results; therefore XH_readContents() was introduced
  • config options can now be typed (see e.g. plugins/pagemanager/config/metaconfig.php on how to use this for your plugins)
  • there are no more subsites, so strlen($sl) === 2 is guaranteed again, and usually $sl should contain a valid ISO-639-1 language code
  • plugins can use GET forms on a page by adding <input name="selected" value="$su">
  • for easier handling of the content the class XH_Pages has been introduced (somewhat experimental API)
  • to register a function that will be called after all plugins have been loaded, XH_afterPluginLoading() has been introduced
  • the configuration and localization of all plugins are loaded in advance (so there's no need to include them explicitely for special cases)
  • to display messages XH_message() has been introduced
  • to log messages in CMSimple_XH's log.txt, XH_logMessage() has been introduced
  • to unregister page data fields, PageDataRouter::removeInterest() has been introduced
  • to ease internationalization of number dependent language strings (e.g. "1 entry has been deleted" vs. "3 entries have been deleted"), XH_numberSuffix() has been introduced (see a related discussion)
  • identical plugin calls on same page are possible and will be evaluated independently
  • the following functions have been deprecated: chkdl(), rf()
  • the query parameter logout=no_backup has been introduced; this might be used by a plugin to offer the ability to log out without creating a content backup
  • the IDs of pagedata tabs have been changed to guarantee valid HTML
  • $cf['editmenu']['external'] has been introduced; this allows a plugin/addon to offer a modified admin menu
  • $plugin_tx[$plugin]['menu_plugin'] has been introduced to allow to localize/customize the name of the plugin in the built-in admin menu; you may consider to add this to your language files
  • CMSIMPLE_URL has been introduced; this constant holds the fully qualified absolute URL to the requested index.php
  • the page data tab views will be submitted via AJAX; this does not make sense for some plugins (e.g. EditorSwitch), so it's possible to revert to a normal submit by adding onsubmit="return true" to the page data form
  • you can rely now on an appropritate configured timezone, so you don't need any workarounds wrt. this issue anymore
  • to unify the handling of locale specific settings, $tx['locale']['all'] has been introduced; it's probably best to avoid any locale specific functionality at all, but if you need it, rely on $tx['locale']['all'] which will call setlocale(...) instead of calling it yourself
  • CSRF-Protection has been added, which you can and should use for your plugins
  • some of the config options and language settings that have been removed are now hardcoded in cms.php, so you still can use them: $cf['security']['type']="page", $cf['scripting']['regexp']='#CMSimple (.*?)#', $tx['meta']['codepage']='UTF-8' (however, their use is deprecated)
  • the quick workaround to disable the OPcache extension was removed; you have to cater for this extension yourself, if you're allowing editing of included PHP files in the back-end
  • several new API functions have been introduced; it's not clear yet, which one should be regarded as public (i.e. usable from plugins); your feedback on this issue is appreciated
  • to avoid session fixation attacks the session ID is regenerated on each change of the priviledge level (i.e. admin login/logout), so you can't rely on an unchanging session ID anymore (some plugins currently do this)
  • XH_renameFile() was introduced, which provides a fallback for the buggy rename() implementation in PHP < 5.3 on Windows
  • on logout, $f is set to 'xh_loggedout', which might be useful for plugins to detect the logout action
  • developer documentation is available
The most notable changes for Translators
  • internationalization of the config keys has been added (still experimental); see cmsimple/languages/metade.php for how it works; feedback is appreciated on how to finally handle this
The most notable changes for Supporters
  • all installed plugins are listed in the HTML source code in a comment
  • the loading of plugins happens in alphabetical order, so it is easier to reproduce issues that might be related to the loading order
The most notable changes for Core Developers
  • the code files have been restructured; the pluginloader has been merged with the core, all global code is now solely in cms.php, and all classes are now in cmsimple/classes/
  • coding standards for PHP and JavaScript have been adopted
  • PHPDoc and JSDoc have been adopted (see the developer documentation)
  • PHPUnit tests have been added (see tests/ in the sources)
  • Phing has been adopted as build tool (see build.xml in the sources)
  • PHP_CompatInfo has been adopted to ensure conformance to the CMSimple_XH requirements
  • Usage of the @ operator has been deprecated
Upgrading from an earlier UTF-8 encoded CMSimple_XH version
  1. make a full backup of the current installation
  2. install CMSimple_XH 1.6 in a test environment (on your local machine or in a subfolder of your webspace)
  3. copy the content/ folder to the test environment
  4. copy the second language folders to the test environment, and move their subfolder content/ inside the toplevel content/ folder and rename it to the language code (e.g. fr/content/ -> content/fr/); add an empty file .2lang to all language folders (e.g. fr/.2lang)
  5. copy the folder templates/ (or just individual template folders) to the test environment
  6. copy additional plugins to the test environment (note, that some plugins may be incompatible, such as Pagemanager_XH 1.x and Menumanager)
  7. copy all images, downloads and media files to the new environment; note that the images, downloads and media folders have to be subfolders of the userfiles folder, so usually you have to copy images/ to userfiles/images/. Obviously this will break existing links to these files; you can work around this by establishing redirects from the old folders to the new one. E.g. for Apache servers you can put the following .htaccess to the domain root (change "xh16" to the folder name of your test installation):

    Code: Select all

    Redirect /xh16/images /xh16/userfiles/images
    Redirect /xh16/downloads /xh16/userfiles/downloads
    Redirect /xh16/media /xh16/userfiles/media
    Note that svasti has written an update script, that will adjust image and download URLs in the content permanently. You can download it from SourceForge (usage instructions are contained in readme_update.txt).
  8. set write permissions (0755 resp. 0777) for the folder css/
  9. manually reconfigure Settings->CMS and Settings->Language
  10. after throrough testing replace the old installation with the new one (don't forget to adjust the redirects for the user files)
Unfortunately, there's still plenty of documentation on the new features and changes missing yet. So if you have questions regarding certain items, feel free to ask, so we can set priority on writing the most missing documentation first.

Download: CMSimple_XH 1.6

Happy new year!
Last edited by cmb on Thu Jun 19, 2014 11:49 am, edited 5 times in total.
Reason: fixed copy&paste relict; updated info regarding update script: updated regarding tinymce4; added info about writability of css/; fixed link to developer documentation
Christoph M. Becker – Plugins for CMSimple_XH

twc
Posts: 233
Joined: Fri Jun 18, 2010 12:25 am
Location: Netherlands

Re: CMSimple_XH 1.6 RC

Post by twc » Sat Jan 04, 2014 11:16 am

after new upload........

cant change admin password ?

and this tweak dont work any more :roll:

Code: Select all

<p>Latest updated page:(Click below)<br> <?php echo latestUpdatedPageLink();?></p>



cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.6 RC

Post by cmb » Sat Jan 04, 2014 11:25 am

twc wrote:after new upload........
Of CMSimple_XH 1.6 or 1.6rc1?
twc wrote:cant change admin password ?
What happens exactly? Doesn't the form to change passwords show up? Doesn't clicking okay work? Note, that you have still to save the configuration after changing the password in the dialog.
twc wrote:and this tweak dont work any more
I've tried to search for "latestUpdatedPageLink", but the forum search doesn't help. Do you know where this funktion was defined?
Christoph M. Becker – Plugins for CMSimple_XH

twc
Posts: 233
Joined: Fri Jun 18, 2010 12:25 am
Location: Netherlands

Re: CMSimple_XH 1.6 RC

Post by twc » Sat Jan 04, 2014 11:31 am

oky forgett everthing :D

everthing works. forget file to upload....tweak

svasti
Posts: 1651
Joined: Wed Dec 17, 2008 5:08 pm

Re: CMSimple_XH 1.6

Post by svasti » Sat Jan 04, 2014 8:08 pm

update.php
You find it on sourceforge in the CMSimple_XH 1.6 folder: update_content_to_1-6.zip

The update.php makes it easier to migrate XH from 1.5 to 1.6:

After you installed a new XH 1.6 with all your plugins, images, templates, etc. from your old XH 1.5,
copy the old content.htm and pagedata.php into the new content folder, deleting the new
content.htm!


Copy the script into your base folder an call it with
[base URL]/update.php

The script adjusts the links to images and downloads and integrates the pagedata into the content.htm and deletes the pagedata.php.
For secondary languages the script needs to be called with the language code:
[base URL]/update.php?lang=[language code]

Delete the script after usage.

Many thanks to Christoph who spotted a few bugs in the script and to Holger, who had the idea for it.
svasti

mrleejohn
Posts: 33
Joined: Mon Dec 26, 2011 1:54 pm

Re: CMSimple_XH 1.6

Post by mrleejohn » Sun Jan 05, 2014 11:36 am

Too much is going wrong. My old template does not work. It worked fine with XH1.5.9. After using update.php all works fine with mini1. Changing to my old template made lots of things not work.
The menu is showing, but no content. Again, with the template mini1 this was fine. Also the bottom part of the template was cut off. I think I am not ready to switch to XH1.6 yet.


EDIT: I found the problem. The plugin minicounter completely broke my template. Once I got it out of the the template-file, things were fine!
EDIT2: My website mrleejohn.nl is now running XH1.6 :ugeek:

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.6

Post by cmb » Sun Jan 05, 2014 12:06 pm

mrleejohn wrote: I found the problem. The plugin minicounter completely broke my template. Once I got it out of the the template-file, things were fine!
I have to admit that I have not checked Minicounter_XH with XH 1.6 yet. The plugin is somewhat problematic regarding the "EU cookie laws", anyway, because the cookies it uses might be regarded as tracking.

Anyway, the behavior you have described might have been caused by the plugin not being (properly) installed in XH 1.6. If the plugin is called from the template, but the function minicounter() has not been defined, script execution would terminate, what would supress all further HTML output.
mrleejohn wrote:My website mrleejohn.nl is now running XH1.6 :ugeek:
Cool. :)
Christoph M. Becker – Plugins for CMSimple_XH

mrleejohn
Posts: 33
Joined: Mon Dec 26, 2011 1:54 pm

Re: CMSimple_XH 1.6

Post by mrleejohn » Sun Jan 05, 2014 12:43 pm

Maybe Minicounter can work fine with XH1.6. I did not gave it much thought and deleted the code in template.htm. When I have the time I'll check it sometime.

svasti
Posts: 1651
Joined: Wed Dec 17, 2008 5:08 pm

Re: CMSimple_XH 1.6

Post by svasti » Mon Jan 06, 2014 4:14 pm

svasti wrote:update.php
... The update.php makes it easier to migrate XH from 1.5 to 1.6 ...
The update.php-script has been improved: the script now finds the secondary languages automatically and will give out messages, if writing permissions have not been set.

Download from Sourceforge: update_content_to_1-6_v2.zip

tanavots
Posts: 72
Joined: Sat Feb 25, 2012 4:18 pm

Re: CMSimple_XH 1.6

Post by tanavots » Wed Jan 08, 2014 12:55 pm

I noticed that urichar not working in 1.6. Special characters not replaced as given in Settings --> Language --> Urichar. Or am I the only one?

Post Reply