This version was released three years after SPIP 3.0 and provides developers with:
- an update to the JavaScript libraries included in SPIP’s core as well as the supplied plugins mainly jQuery and jQuery UI;
- an update to the graphical interface of the public area. This theme integrates the CSS base Tiny Typo; cf Presentation of the dist (SPIP3.1)
- a mild update of the graphical interface of the private area;
- new features and many bug fixes.
SPIP 3.1: the novelties
For the authors and administrators:
- an additional button on the editing toolbars for editing the text in full screen, with its direct preview on the side;
- the HTML5 multimedia player http://mediaelementjs.com is included as standard to play videos and sounds directly;
- adding a video calculates its size and duration (partial integration of the plugin getid3 in the media plugin);
- discussion forums in the private area can be hooked to any editorial item via a configuration form;
- statistics can be displayed either graphically or in tabular form;
- the site map of the private area is improved and allows to move items by drag and drop;
- a new option in the web-masters personal preferences to display or not the "Development" menu;
- improvements to the ergonomics of multilingualism by sector.
SPIP 3.1: templates creating made easy
criteria
- the age criterion has been modified, the code has been simplified and bugs were fixed for certain periods;
- the criterion tri takes a third argument with a name starting with ’session’ and stating that the sort direction and the sorted element should be saved in the user’s session;
- the criterion branch takes a second argument to specify the section(s) to browse.
Tags
- the tag
#MODELE
takes theenv
parameter transmitting the entire environment; - the tag
#INCLURE
passes theconnect
parameter if present in the url in the same way that the<INCLURE...>
inclusion already does.
Filters
- the new filter |setenv
Logos and images
-
filtre_inactif
instead ofno_image_filtrer
; - the class
.spip_logo
on the documents instead of.spip_logos
(.spip_logos
still supported for a while) ; - Editing logos has been improved:
- height or maximum width of logos may be defined on their own;
- if a logo or an uploaded image exceeds the maximum size allowed and thumbnails are activated the logo or the image uploaded is reduced to match the maximum size allowed rather than returning an error;
- if a document exceeds the size allowed by the server, an error is displayed without any ajax problem.
Plugins
- improved ergonomics of the plugin management interface;
- new tags in paquet.xml;
-
script
to add a JavaScript in the public or private header; -
style
to add a CSS file; -
genie
to run a cron job easily; -
procure
to indicate that a plugin provides features.
-
SPIP 3.1: under the bonnet
Some minor changes to the core may be of interest for hosts or SPIP web-masters:
- SPIP anonymous sessions now use PHP sessions;
- the cache of thumbnail images is stored in 256 subdirectories (#3277), which can improve performance on NAS drives;
- when using a MySQL database, PHP functions
mysqli_*
are used instead ofmysql_*
. This requires that themysqli
functions are present on the server hosting the site (they are active by default in PHP since version 5.0); - MySQL tables now use MyISAM by default (recent versions of MySQL use the INNODB engine by default);
- caching has been improved by using the method filecache provided by the memoization plugin;
- revisions of editorial objects are no longer stored in compressed format to avoid problems when restoring database backups;
- the import / export CSV functions have been integrated from SPIP-Bonux plugin;
- the
objet_inserer()
API is more consistent with the second parameter$set
; - API roles on the links: the links between objects can be assigned roles.
SPIP 3.1: better source code
Much work on the presentation of the source code has been made:
- adoption of coding style PSR2 personalized;
- documentation of many functions in the phpDoc format [1] which automatically generate a technical documentation of the source code ;
- loads of PHP warnings fixed.
SPIP 3.1: web performance on the client side
As far as performance is concerned, the getScript
method of the jQuery library is overloaded to use the browser’s cache. In fact, by default, jQuery does not cache these elements. It is therefore advisable in a SPIP template using jQuery.getScript(...)
, to apply the timestamp filter to the requested file, so that a change in the source file induces a refresh of browser’s cache.
Example :
jQuery.getScript('[(#CHEMIN{prive/javascript/ui/widget.js}|timestamp)]', function(){
...
});
A header Link is sent in the HTTP headers to call the compressed CSS stylesheet causing it to be loaded faster by the browser.
jQL Library in the compressor plugin
It is also possible to activate via the constant _JS_ASYNC_LOAD
an asynchronous loading of the compressed JavaScript of public area through the built-in compressor JQL library. The "inline" scripts should be compatible.
Updating an existing site to SPIP 3.1
Check the plugins compatibility
Before starting the update by the usual methods (FTP, Spip loader, Subversion), it is advisable to update the plugins.
The following plugin also allows you to check if your site’s plugins are compatible with SPIP 3.1
http://contrib.spip.net/Verifier-ses-plugins-pour-le-passage-a-SPIP-3-1
Evolution of JavaScript libraries
The up-to-date JavaScript libraries integrated to SPIP 3.1 can sometimes require the updating of the templates or plugins when migrating from SPIP 3.0. Particularly for updated versions of jQuery and jQuery UI.
See the update advices of the respective libraries::
- jQuery updated from 1.7.2 à 1.11.3 . See jquery 1.8, jQuery 1.9, jquery 1.9upgrade guide, jQuery 1.10, jQuery 1.11 ;
- jQuery UI was upgraded from 1.8.21 to 1.11.4. See the upgrade guides. Also note that the location of JavaScript and CSS files in jQuery UI as in the SPIP jQuery UI plugin has changed. So the inclusion of those scripts in the templates should probably be rewritten.