On Jan 4, 2008 3:42 PM, Tereza Loparic <telopa@gmail.com> wrote:
Hi,
Could you please tell me what does it mean to "changing the
<INCLUDE>", or where can I find more about it? What I have at the
squelettes is:
<INCLUDE(global.php3){lang}>
This means that you must replace it by <INCLUDE{fond=global}{lang}>
Simple, no ?
the template global.html (probably the old one, sometimes global.php3)
must be accessible by Spip : so you can put here inside the directory
"squelettes" (or the root too)
Here is a script to automatically upgrade your templates
(I don't remember where I found it, so I copy it -- with a very poor
translation, sorry)
Hope it helps,
.Gilles
-------------------- BEGIN OF THE SCRIPT ------------
#!/bin/bash
# Objet : Automatic upgrade from SPIP 1.7 and 1.8 to SPIP 1.9
# Requirements : Bash > 3.0
# Author : pvincent@erasme.org - 2007 -
# Licence : GPL
# NOTE : YOU MUST DO A BACKUP FIRST
# This script must be executed from the root directory.
# Working directory
echo -en "\nName of the templates directory :"
read repertoire
if [ -d $repertoire ];
then
echo -en "\nBackup...\n\n"
else
echo -en "\nError : Directory not found.\n\n";
exit;
fi
# Backup
if [ -d "backup_$repertoire" ];
then
echo -en "Confirmation required : the backup directory already
exists. \nPress a key to continue and erase old datas\n" && read temp
else
mkdir "backup_ $repertoire";
fi
cp -aRf $repertoire/ backup_ $repertoire/
# Initialisation
# ---> INCLURE
rec[0]='< *INCLURE *(\(.\+\)[.]php3 *)>'
rep[0]='[(#INCLURE{fond=\1})]'
rec[1]='< *INCLURE *(\(.\+\)[.]php3 *) *\({.\+}\) *>'
rep[1]='[(#INCLURE{fond=\1}\2)]'
# Customisation : indicates bellow what is specific to your templates
rec[2]='&'
rep[2]='&'
rec[3]='&'
rep[3]='&'
#sq-sssc
#rec[2]='<link.\+DOSSIER_SQUELETTE.\+>'
#rep[2]='<link rel="stylesheet" href="#DOSSIER_SQUELETTE\/style.css"
type="text\/css">'
# basic elements
rec[4]='article.php3?id_article=#ID_ARTICLE'
rep[4]='#URL_ARTICLE'
rec[5]='rubrique.php3?id_rubrique=#ID_RUBRIQUE'
rep[5]='#URL_RUBRIQUE'
rec[6]='breve.php3?id_breve=#ID_BREVE'
rep[6]='#URL_BREVE'
rec[7]='auteur.php3?id_auteur=#ID_AUTEUR'
rep[7]='#URL_AUTEUR'
rec[8]='mot.php3?id_mot=#ID_MOT'
rep[8]='#URL_MOT'
# Standard url mode : remplace .php3 urls with spip.php?page=
rec[9]='\([0-9a-zA-Z_-]\+\).php3?'
rep[9]='spip.php?page=\1\&'
rec[10]='\([0-9a-zA-Z_-]\+\).php3'
rep[10]='spip.php?page=\1'
# Seach
rec[11]='\(<input.\+recherche\)'
rep[11]='<input name="page" value="recherche" type="hidden" \/>\1'
# XHTML - W3C
rec[12]='< *\([hb]r\) *>'
rep[12]='<\1 \/>'
rec[13]='\(<link.*\?[^-?\/]\)>'
rep[13]='\1 \/>'
rec[14]='\(<input.*\?[^-?\/]\)>'
rep[14]='\1 \/>'
rec[15]='\(<img.*\?[^-?\/]\)>'
rep[15]='\1 \/>'
rec[16]='\(<meta.*\?[^-?\/]\)>'
rep[16]='\1 \/>'
#rec[15]='\(<img \)\([^a][^l][^t]\).\+\(>\)'
#rep[15]='\1\2 alt=\"\" \3'
# Processing ...
for ((a=0 ; a<=${#rec[*]}-1 ; a++))
do
echo
echo "$a : remplace ${rec[a]} with ${rep[a]}";
echo
#echo "confirm"; read temp;
for i in `ls $repertoire/*.html`;
do
sed -e "s/${rec[a]}/${rep[a]}/gi" "$i" > "$i".new 2>/dev/null ;
mv "$i.new" "$i";
done
done
# cache
echo -en "\nDo you want to keep the existing cache value, when
specified in the templates ? [Y\N]\n" && read cache1
echo -en "\nDefault value in secondes (0 for no cache) ?\n" && read cache2
# CACHE
for i in `ls $repertoire/*.html`;
do
if grep "#CACHE" "$i";
then
if [ "$cache1" = "N" ] ;
then
sed -e s/"#CACHE{.*}"/"#CACHE{$cache2}"/gi "$i" > "$i".new 2>/dev/null ;
else
cat "$i" > "$i".new
fi
else
echo "#CACHE{$cache2}" > "$i".new
cat "$i" >> "$i".new
fi
mv "$i".new "$i";
done
echo "Replacements done"
------------------------ END OF THE SCRIPT -----------------------
best wishes
tereza
On Dec 29, 2007 4:56 PM, L'oiseau2nuit (ex- Zzz.)
<loiseau2nuit@no-log.org> wrote:
> Yep, the same.
>
> Indeed, to add some point to your success range, i'd first upgrade my 183
> to a 191, then to a 192.
>
> Because the changes between 18x and 19x were quite important, first, and
> because I don't know how the script which upgrades the DB works exactly.
> I'm not sure it is able to handle more than one version difference.
>
> Good luck and happy new year to all 
>
> Etienne.
>
>
>
> On Sat, December 29, 2007 3:32 pm, Gilles Vincent wrote:
> > Hi,
> >
> > The problem is may come from the fact that you overwrote. Maybe you
> > didn't remove the old files before. This can disturb Spip that
> > searches its functions dynamically..
> >
> > Here is what I always do for an upgrade :
> > - copy every templates to a separate directory
> > - update them (changing the <INCLUDE>, and adding #CACHE{} to
> > templates is generally sufficient)
> > - change the urls that link to custom templates
> > ("spip.php?page=myCustomTemplate")
> > - backup IMG
> > - remove everything
> > - install a clean version (from SPIP-Contrib)
> > - add write access to IMG, local, config, tmp
> > - install properly the new version (just go to http://…/ecrire/), and
> > choose the database that was used in the elder version : this will
> > later automatically upgrade the database content
> > - overwrite IMG with your backup
> > - create a directory /squelettes/ and move your templates
>
_______________________________________________
spip-en@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-en