#!/bin/sh

# Copyright 2001, 2002 (C) Metacosm development team

# An ugly script to produce static pages in reverse video mode.

# [Reverse video]
# dark.css/light.css
# logo for dark/light background
for i in `ls ./*.php3 releases/*.php3|grep -v "r_"`
{
  FILENAME=`basename $i`
  DIRECTORY=`echo "$i"|sed 's%/[^/]*$%%'`
  sed "s/\(<a href=\"\)\([a-z\.]*\.*php3\)/\1r_\2/g; \
       s/dark.css/light.css/; \
       s/header.inc/r_header.inc/; \
       s/header.fr.inc/r_header.fr.inc/" \
       ${DIRECTORY}/${FILENAME} > ${DIRECTORY}/r_${FILENAME}
}

for i in `ls *.inc|grep -v "r_"`
{
  sed "s%\(<img src=\"<?php echo \$basedir; ?>images/\)big_logo_dark.png\"%\1big_logo_light.png\"%; \
       s/r_index/TMP_index/;
       s%\(<a href=\"<?php echo \$basedir; ?>\)\(releases/\)*\([a-zA-Z\.]*\.*php3\)%\1\2r_\3%g; \
       s/TMP_index/index/g" \
       $i > r_$i
}
