Sites Web : SPIP commits - by tech-nova

Publié le lundi 21 avril 2008

⇒ http://my.opera.com/tech-nova/blog/

Un site qui recense les astuces et évolutions des possibilités de SPIP.

Articles syndiqués tirés de ce site

Creating custom tags for SPIP
Mars 2009, par tech-nova
On its blog, Thomas Sutton describes how to create your own static SPIP tags. The SPIP template language has two constructions : loops (which determine the objects to be “output”) and tags (which actually output particular values). The reasonably simple syntax of tags — most look like (…)
height and width of embedded documents
Janvier 2009, par tech-nova
The doc model accepts two arguments, ’hauteur’ (height) and ’largeur’ (width). They will reduce the size of the visual. in your articles, use and for the templates #MODELEdoc,id_document,largeur=150
The latest filters and pipelines for programmers
Janvier 2009, par tech-nova
The SPIP team is really active and improve it regularly. Here is a list of new functions that can help you develop plugins : supprimer_objets_lies ( array($type, $id) ) : Type : pipeline Removes the objects of plugins linked to core objects (used when these core objects are deleted) // (…)
[13583] LOGO_GROUPE
Janvier 2009, par tech-nova
[13583] adds a logo to keyword groups
Top 20 most used SPIP plugins (and a few more)
Décembre 2008, par tech-nova
This is not a fresh news, but I’ve just read a mail that Pat sent on SPIP-ZONE. It give the complete records of the most used plugins, at the begining of October. It have been calculated with the websites declared on spip.net and some other sites. Thanks Pat for your job ! So, ladies and (…)
[13480] Search for a complete expression between quotes
Décembre 2008, par tech-nova
With this commit, SPIP can search an expression composed of a group of words. EX. : 2.0 SPIP will return anything that contains ’SPIP’ and ’2.0’ in any order « 2.0 SPIP » will return anything that contains exactly this expression
 ! SPIP2.0 (and SPIP1.92f) released
Décembre 2008, par tech-nova
For more details : http://www.spip.net/fr_article3784.html A little changelog for SPIP2.0 : - Translation in asturiano, Burmese, Khmer (Kampuchean), Indonesian, Swedish - Unified private interface using AJAX - Programming interface for SQL Server (MySQL, Postgres, SQLite) - New forms for use on (…)
Howto avoid the automatic compression of your scripts ?
Décembre 2008, par tech-nova
SPIP is fantastic because it can automatically merge and compress the css and javascript files. But sometimes it can crash our scripts (especially if some parameters are stored inside). To solve it, just change, in your template, the type of your script. Instead of « text/javascript » use « (…)
[13008] Creation of an API for footnotes
Octobre 2008, par tech-nova
Until now, all the treatment of footnotes was included in inc/texte.php. This commit creates a separate file, inc/note.php, dedicaced to them. Consequence : it’s possible for a plugin to customize the code generated for footnotes
[13014] Howto make an action executable inside the public area ?
Octobre 2008, par tech-nova
Until now, it was impossible if the arguments where passed in the url. [12798], however, made it possible with a POST : The 4th arg of generer_url_action forces the production of an URL executable in the public area, even if it should use a POST (it’s also the case for redirige_par_entete). (…)
What does SPIP do (with or without plugins) ?
Octobre 2008, par tech-nova
Drag the map to navigate inside the functionnalities. This mind map will be translated soon. The original version on MindMeister is available here : http://www.mindmeister.com/maps/show_public/11093093 Here is a printable version in PDF (A3 format) : (…)
A small list of code tips for SPIP
Septembre 2008, par tech-nova
Howto detect if a plugin is activated : 1. PHP : if (defined(’_DIR_PLUGIN_XXX’)) /* My action for this plugin */ 2. SPIP1.9.2 : [(#EVALDIR_PLUGIN_PREFIX| ?’ ’,”) My action for this plugin ] 3. SPIP2.0 : [(#PLUGINXXX) My action for this plugin ] Howto do not display the admin toolbar in the (…)
[12429] Use whatever url you like !
Septembre 2008, par tech-nova
Don’t use generer_url_article, auteur, breve, mot, rubique, site : these functions are obsolete, and should be replaced by the unique function generer_url_entite($id=’’, $entity=’’, $args=’’, $anchor=’’, private=’’, $type=’’) For example, generer_url_entite($id, ’article’, $arg, $anchor) (…)
[12416] Parameters in the multilingual chains
Septembre 2008, par tech-nova
A chain can use arguments like this : <:chaineargument1=texte,argument2=#BALISE:> The more complex operation is <:module:chaineargument1=texte,argument2=#BALISE|filtre1texte,#BALISE|filtre2:> I don’t know what to do with that ;)
[12640] New filter image_format
Septembre 2008, par tech-nova
« New » filter |image_format : it saves the image in the chosen format, and keeps its transparency ; in fact it’s a shortcut for the « transparency » option that has just added ARNO* ([12638]) to the filter |image_aplatir Example : in inc-head.html, |image_formatico for the favicon Note : (…)
 ! SPIP1.9.2e is coming out !
Septembre 2008, par tech-nova
Hi ! The changeset [12624] introduces the release 1.9.2e You can download it here : http://www.spip.net/spip-dev/DISTRIB/SPIP-v1-9-2e.zip This version includes some minor corrections since the latest release (*) : Regular expressions are now compatible with PHP5.2.6 (This is THE main (…)
[12400] favicons inside !
Septembre 2008, par tech-nova
SPIP 2.0 supports favicons (.ico extension) : it integrates a part of phpThumb, by James Heinrich (available at http://phpthumb.sourceforge.net ). Application : the favicon can be dynamically calculated and is compatible with IE6 and other modern browsers like Firefox The filter to use : (…)
[Howto] Control of the uploaded picture size
Juillet 2008, par tech-nova
You can limit the size of the uploaded pictures with the constants (in mes_options.php) : define('_IMG_MAX_SIZE', 0); # size in Kb define('_IMG_MAX_WIDTH', 0); # width in pixels define('_IMG_MAX_HEIGHT', 0); # height in pixels For documents it’s : define('_DOC_MAX_SIZE', 0); # size in Kb If (…)
[11922] Customize the keyword box in the private area
Juillet 2008, par tech-nova
With this commit, some keyword groups can be displayed/hidden in specific sections. The customization can be done with autoriser_xxx_editermots($action,$what,$id,$who,$opts. $opts contains the id of the concerned keyword group, and also the fields of this group that can be displayed. By default, (…)
No, I don't like like SPIP (or try to hide it ;)
Juillet 2008, par tech-nova
config/mes_options.php <?php @define('_SPIP_SCRIPT', 'joomla.php'); @define('_HEADER_COMPOSED_BY', "Composed-By: JOOMLA"); $GLOBALS['spip_header_silencieux'] = 1; $GLOBALS['cookie_prefix'] = "joomla"; ?> joomla.php : <?php @define('_DIR_RESTREINT_ABS', 'private/'); (…)
How does the login form really works ?
Juillet 2008, par tech-nova
The login process seems to be quite mysterious, but thanks to the developper toolbar and Firebug you can see it completly naked 🙂 The screencast is here : http://screencast.com/t/eiiGjNt7 So it works like this : - The action is the same url (and the form can display errors). - The form (…)
The parameter « var_mode » detailled
Juin 2008, par tech-nova
4 values can be used :  ?var_mode=preview : enables to display an article without publishing it.  ?var_mode=calcul : refreshes the cache  ?var_mode=recalcul : regenerates the templates and refreshes the cache  ?var_mode=debug : shows informations relating to the page calculation (…)
Plugins : My list
Mai 2008, par tech-nova
Nagigate throught this concept map : A full screen version of the interactive map is available here : http://tech-nova.fr/blog/carte-flash-plugins.html You can download a screenshot here : (jpeg, 1.8Mb)
[11355] Overwrite a criteria for a specific loop only
Avril 2008, par tech-nova
For exemple, the function critere_AUTEURS_recherche_dist() overwrites the criteria recherche for the loop AUTEURS only. The priority order is : critere_TABLE_nomcrit() critere_TABLE_nomcrit_dist() critere_nomcrit() critere_nomcrit_dist()
[11440] SQL views in the API
Avril 2008, par tech-nova
3 new functions enable to create and delete views for PG, SQlite and MySQL : sql_get_select() : same arguments as sql_select() but returns the query without evaluating it sql_create_view($view_name, $select_request) : creates the view $view_name for the select request $select_request. (…)
[11435] MySQL views can be used in SPIP loops
Avril 2008, par tech-nova
SQL views are known to be used like tables. They enable to : - mask the schema complexity ( -> simplification of queries) - give access to a limited number of fields ( -> security) - manipulate calculated fields (sum(), max(), avg(), ..) Now you can avoid writing complexe loops by using (…)
[11415] 3 new filters for boolean operators
Avril 2008, par tech-nova
These filters are ’et’, ’ou’, and ’xou’ (for ’and’, ’not’, and ’xor’). They work like | ?’ ’, : each filter returns a space char if the condition is verified, elsewhere it returns an empty string For example this PHP codeif ($a=='testA' OR ($b=='testB' AND $c=='testC')) echo "OK"; Can be (…)
[11400] A more secure import from old SPIP versions
Avril 2008, par tech-nova
This commit introduces a lot of things that make the import really secure : Create a set of tables with the old structure and a prefix not used Import data inside Update copy data to the actual site Of course it’s a beginning, a lot of things should be done : Make this (…)
 ! INCLURE and doublons
Avril 2008, par tech-nova
doublons arrays can be transmitted to included templates. #ENV can also transmit them. These sentences are corrects : [(#INCLUREfond=totodoublons)] spip.php?page=article&id_article=3&doublons[articles]=1,2,89,12&doublons[documents]=15,12 Note that the doublons are transmitted (…)
What is a SPIP pipeline ? It's a hook
Avril 2008, par tech-nova
During the normal execution of several commands, call-outs are made to optional scripts that allow a developer to add functionality or checking. Typically, the hooks allow for a command to change the values of function arguments before any other call, and allow for a post-processing treatment (…)
Howto use an array in a template ?
Mars 2008, par tech-nova
Arrays are really usefull when you have to manipulate the same elements several times. A new tag has been introduced with the version 1.92 : #ARRAYkey1,value1,key2,value2… allows the creation of a variable length table (useful for constructing a table for a #SET and/or for use with a dynamic « (…)
[11355] overwrite a criterion for a specific loop only
Mars 2008, par tech-nova
For exemple critere_AUTEURS_recherche_dist() will overwrite the criterion recherche for the loops over AUTEURS. The priority order is : critere_TABLE_nomcrit critere_TABLE_nomcrit_dist critere_nomcrit critere_nomcrit_dist
Easter egg on the private area
Mars 2008, par tech-nova
"You can even create a specific template in the private area. For exemple, this template /squelette/prive/editer/article-23.html is used to edit articles which are in the section number 23 (and it’s subsections) (works also to display them)" from (…)
 ! Custom fields are directly interpreted
Mars 2008, par tech-nova
With the revision [11350], any custom field can directly be used in templates with the tags #FOO and #EDITfoo (with the plugin « crayons » [fr]) You don’t have to change inc/modifier or specify the structure of the table : the core directly manages them. However the private interface actually (…)
[11350] any table field creates its specific tag
Mars 2008, par tech-nova
The value of any field ’foo’ can be displayed in your templates with #FOO — Even if this is a field of the ’official’ tables. Much more, this value can be edited in the public area with an inline content editor (actually it’s still not possible in the private area) : sql_showtable() is used to (…)
[11341] The form name in #ACTION_FORMULAIREpage, formulaire
Mars 2008, par tech-nova
A template formulaire/foo.html can contain another template with #INCLUDE - which can refer to it with #ACTION_FORMULAIRE#SELF, foo
[11289] Ajax without coding in SPIP
Mars 2008, par tech-nova
includes the template and ajaxifies all it’s links. By default, the javascript variable « ajaxbloc_selecteur » is used. It transforms into ajax call each link that corresponds to the jquery selector ’.pagination a,a.ajax’. An ajax call refreshes the template’s result by restauring it’s #ENV, (…)
Optimizing your SPIP server
Février 2008, par tech-nova
It’s in fact usefull for every website. Here is what I do : - Expires header and Etag : I add this to http.conf : # cache ExpiresActive On ExpiresDefault A300 ExpiresByType image/x-icon A2592000 ExpiresByType application/x-javascript A2592000 ExpiresByType text/css A2592000 (…)
#URL_ECRIRE just discovered
Février 2008, par tech-nova
I barely know what #URL_PAGE is. But not #URL_ECRIRE,.. until today ;) This helper, like #URL_ACTION_AUTEUR, enables us to link your website to the private area. #URL_ECRIREnaviguer returns ecrire/ ?exec=naviguer #URL_ECRIREnaviguer, args returns ecrire/ ?exec=naviguer&args (it’s like (…)
[11156] : new filter to exclude elements by keyword
Janvier 2008, par tech-nova
Nothing new in fact, just a simplification :  !id_mot=2 now returns all the elements that are not linked to id_mot=2 (including elements without any keyword)
FAQ : I want to update the url value after having changed the title of my article
Janvier 2008, par tech-nova
Long title for a frequent problem ;) . when a title of an article is changed, the url isn’t automatically recalculated. It’s interresting if you don’t want to lost backlinks, but it can be disturbing because the url may not correspond to the content of the linked page. Here is the trick : (…)
Howto detect if a plugin is activated ?
Janvier 2008, par tech-nova
in PHP : Each plugin defines a constant corresponding to it’s execution path if (defined('_DIR_PLUGIN_XXX')) ... inside a template : #PLUGIN and conditionnal evaluation does your job ! [(#PLUGINXXX) doSomething ]
A lot of arguments for a tag
Janvier 2008, par tech-nova
They can sometimes be concatenated into a unique argument list : [(#MODELEembautostart=truethis=1that=anything)] #MODELEembautostart=true,this=1,that=anything [(#INCLUREsomethingid_xx=0envtruc=toto)] All these sentences are corrects. But you can’t write : (…)
Revenir en haut