website rev 906

Move libs to lib and starz new website all in PHP for 4.0
author Christophe Lincoln <pankso@slitaz.org>
date Thu Mar 08 02:41:51 2012 +0100 (2012-03-08)
parents fe3608d70cb1
children 0ea7bfa5f9c0
files da/index.php da/mailing-list.html de/mailing-list.html en/index.php en/mailing-list.html es/index.php es/mailing-list.html fr/index.php fr/mailing-list.html i18n.php index.php it/index.php it/mailing-list.html lib/archives.php lib/fb/index.php lib/get-feeds.php lib/get-feeds.sh lib/js/slideshow.js lib/random-image.php libs/archives.php libs/fb/index.php libs/get-feeds.php libs/get-feeds.sh libs/js/slideshow.js libs/random-image.php netmap.php pt/index.php pt/mailing-list.html webchat.php
line diff
     1.1 --- a/da/index.php	Wed Mar 07 01:54:42 2012 +0100
     1.2 +++ b/da/index.php	Thu Mar 08 02:41:51 2012 +0100
     1.3 @@ -222,7 +222,7 @@
     1.4  
     1.5  <h2>Projekt aktivitet</h2>
     1.6  <?php
     1.7 -	require_once("../libs/get-feeds.php");
     1.8 +	require_once("../lib/get-feeds.php");
     1.9  ?>
    1.10  
    1.11  <div class="activity">
     2.1 --- a/da/mailing-list.html	Wed Mar 07 01:54:42 2012 +0100
     2.2 +++ b/da/mailing-list.html	Thu Mar 08 02:41:51 2012 +0100
     2.3 @@ -191,7 +191,7 @@
     2.4  </p>
     2.5  
     2.6  <div>
     2.7 -<object type="text/html" width="100%" height="345" data="../libs/archives.php">
     2.8 +<object type="text/html" width="100%" height="345" data="../lib/archives.php">
     2.9  </object>
    2.10  </div>
    2.11  
     3.1 --- a/de/mailing-list.html	Wed Mar 07 01:54:42 2012 +0100
     3.2 +++ b/de/mailing-list.html	Thu Mar 08 02:41:51 2012 +0100
     3.3 @@ -181,7 +181,7 @@
     3.4  </p>
     3.5  
     3.6  <div>
     3.7 -<object type="text/html" width="100%" height="345" data="../libs/archives.php?lang=de">
     3.8 +<object type="text/html" width="100%" height="345" data="../lib/archives.php?lang=de">
     3.9  </object>
    3.10  </div>
    3.11  
     4.1 --- a/en/index.php	Wed Mar 07 01:54:42 2012 +0100
     4.2 +++ b/en/index.php	Thu Mar 08 02:41:51 2012 +0100
     4.3 @@ -269,7 +269,7 @@
     4.4  
     4.5  <h2>Project Activity</h2>
     4.6  <?php
     4.7 -	require_once("../libs/get-feeds.php");
     4.8 +	require_once("../lib/get-feeds.php");
     4.9  ?>
    4.10  
    4.11  <div class="activity">
     5.1 --- a/en/mailing-list.html	Wed Mar 07 01:54:42 2012 +0100
     5.2 +++ b/en/mailing-list.html	Thu Mar 08 02:41:51 2012 +0100
     5.3 @@ -186,7 +186,7 @@
     5.4  </p>
     5.5  
     5.6  <div>
     5.7 -<object type="text/html" width="100%" height="345" data="../libs/archives.php">
     5.8 +<object type="text/html" width="100%" height="345" data="../lib/archives.php">
     5.9  </object>
    5.10  </div>
    5.11  
     6.1 --- a/es/index.php	Wed Mar 07 01:54:42 2012 +0100
     6.2 +++ b/es/index.php	Thu Mar 08 02:41:51 2012 +0100
     6.3 @@ -208,7 +208,7 @@
     6.4  
     6.5  <h2>Actividad del proyecto</h2>
     6.6  <?php
     6.7 -	require_once("../libs/get-feeds.php");
     6.8 +	require_once("../lib/get-feeds.php");
     6.9  ?>
    6.10  
    6.11  <div class="activity">
     7.1 --- a/es/mailing-list.html	Wed Mar 07 01:54:42 2012 +0100
     7.2 +++ b/es/mailing-list.html	Thu Mar 08 02:41:51 2012 +0100
     7.3 @@ -181,7 +181,7 @@
     7.4  </p>
     7.5  
     7.6  <div>
     7.7 -<object type="text/html" width="100%" height="345" data="../libs/archives.php?lang=es">
     7.8 +<object type="text/html" width="100%" height="345" data="../lib/archives.php?lang=es">
     7.9  </object>
    7.10  </div>
    7.11  
     8.1 --- a/fr/index.php	Wed Mar 07 01:54:42 2012 +0100
     8.2 +++ b/fr/index.php	Thu Mar 08 02:41:51 2012 +0100
     8.3 @@ -407,7 +407,7 @@
     8.4  
     8.5  <h2>Activité du projet</h2>
     8.6  <?php
     8.7 -	require_once("../libs/get-feeds.php");
     8.8 +	require_once("../lib/get-feeds.php");
     8.9  ?>
    8.10  
    8.11  <div class="activity">
     9.1 --- a/fr/mailing-list.html	Wed Mar 07 01:54:42 2012 +0100
     9.2 +++ b/fr/mailing-list.html	Thu Mar 08 02:41:51 2012 +0100
     9.3 @@ -194,7 +194,7 @@
     9.4  </p>
     9.5  
     9.6  <div>
     9.7 -<object type="text/html" width="100%" height="345" data="../libs/archives.php?lang=fr">
     9.8 +<object type="text/html" width="100%" height="345" data="../lib/archives.php?lang=fr">
     9.9  </object>
    9.10  </div>
    9.11  
    10.1 --- a/i18n.php	Wed Mar 07 01:54:42 2012 +0100
    10.2 +++ b/i18n.php	Thu Mar 08 02:41:51 2012 +0100
    10.3 @@ -33,7 +33,7 @@
    10.4  <div id="block">
    10.5  	<!-- Navigation -->
    10.6  	<div id="block_nav" style="text-align: center; padding: 10px;">
    10.7 -		<?php include("libs/random-image.php"); ?>
    10.8 +		<?php include("lib/random-image.php"); ?>
    10.9  	</div>
   10.10  	<!-- Information/image -->
   10.11  	<div id="block_info">
    11.1 --- a/index.php	Wed Mar 07 01:54:42 2012 +0100
    11.2 +++ b/index.php	Thu Mar 08 02:41:51 2012 +0100
    11.3 @@ -48,7 +48,7 @@
    11.4  <div id="block">
    11.5  	<!-- Navigation -->
    11.6  	<div id="block_nav" style="text-align: center; padding: 10px;">
    11.7 -		<?php include("libs/random-image.php"); ?>
    11.8 +		<?php include("lib/random-image.php"); ?>
    11.9  	</div>
   11.10  	<!-- Information/image -->
   11.11  	<div id="block_info">
   11.12 @@ -117,7 +117,7 @@
   11.13  
   11.14  <h2>Project Activity</h2>
   11.15  <?php
   11.16 -	require_once("libs/get-feeds.php");
   11.17 +	require_once("lib/get-feeds.php");
   11.18  ?>
   11.19  
   11.20  <div class="activity">
    12.1 --- a/it/index.php	Wed Mar 07 01:54:42 2012 +0100
    12.2 +++ b/it/index.php	Thu Mar 08 02:41:51 2012 +0100
    12.3 @@ -176,7 +176,7 @@
    12.4  
    12.5  <h2>Attività del Progetto</h2>
    12.6  <?php
    12.7 -	require_once("../libs/get-feeds.php");
    12.8 +	require_once("../lib/get-feeds.php");
    12.9  ?>
   12.10  
   12.11  <div class="activity">
    13.1 --- a/it/mailing-list.html	Wed Mar 07 01:54:42 2012 +0100
    13.2 +++ b/it/mailing-list.html	Thu Mar 08 02:41:51 2012 +0100
    13.3 @@ -188,7 +188,7 @@
    13.4  </p>
    13.5  
    13.6  <div>
    13.7 -<object type="text/html" width="100%" height="345" data="../libs/archives.php">
    13.8 +<object type="text/html" width="100%" height="345" data="../lib/archives.php">
    13.9  </object>
   13.10  </div>
   13.11  
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/lib/archives.php	Thu Mar 08 02:41:51 2012 +0100
    14.3 @@ -0,0 +1,131 @@
    14.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    14.5 +<html xmlns="http://www.w3.org/1999/xhtml">
    14.6 +<head>
    14.7 +	<title>lists.tuxfamily.org/slitaz mailing list</title>
    14.8 +	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    14.9 +	<!-- link rel="stylesheet" type="text/css" href="/slitaz.css" / -->
   14.10 +	<style type="text/css">
   14.11 +body {
   14.12 +	background: #ffffff;
   14.13 +	color: black;
   14.14 +	font: 13px sans-serif, vernada, arial;
   14.15 +	margin: 0;
   14.16 +	#border-top: 34px solid #f1f1f1;
   14.17 +}
   14.18 +	table {
   14.19 +		border: 1px solid #000000;
   14.20 +		width: variable;
   14.21 +		border-collapse: collapse;
   14.22 +		margin: 2px 2px;
   14.23 +	}
   14.24 +	td {
   14.25 +		border: 1px dotted #6495ed;
   14.26 +		width: variable;
   14.27 +		padding: 2px;
   14.28 +	}
   14.29 +	.rowodd {
   14.30 +		background-color: #ffffff;
   14.31 +	}
   14.32 +	.roweven {
   14.33 +		background-color: #e1ffe1; /* the tower */
   14.34 +	}
   14.35 +	.odd {
   14.36 +		background-color: #ffffff;
   14.37 +	}
   14.38 +	.even {
   14.39 +		background-color: #e1ffe1; /* the tower */
   14.40 +	}
   14.41 +	th {
   14.42 +		border: 1px solid #000000;
   14.43 +		width: variable;
   14.44 +		padding: 4px;
   14.45 +	}
   14.46 +	.alignright {
   14.47 +		text-align: right;
   14.48 +	}
   14.49 +	</style>
   14.50 +</head>
   14.51 +<body>
   14.52 +<?php
   14.53 +
   14.54 +function translate($word)
   14.55 +{
   14.56 +	if (isset($_GET['lang'])) switch ($_GET['lang']) {
   14.57 +	case "de" :
   14.58 +		switch ($word) {
   14.59 +		case "Archives"  : return "Archiv";
   14.60 +		case "Archive"   : return "Archiv";
   14.61 +		case "View by"   : return "Ansicht von";
   14.62 +		case "Messages count":
   14.63 +		case "Number"    : return "Zahl";
   14.64 +		case "Total size": return "Gesamtgr\&ouml;\&szlig;e";
   14.65 +		case " or "      : return " oder ";
   14.66 +		case "Month/Year":
   14.67 +		case "Date"      : return "datum";
   14.68 +		}
   14.69 +		break;
   14.70 +	case "es" :
   14.71 +		switch ($word) {
   14.72 +		case "Archives"  : return "Archivos";
   14.73 +		case "Archive"   : return "Archivo";
   14.74 +		case "View by"   : return "Vista";
   14.75 +		case "Messages count":
   14.76 +		case "Number"    : return "n\&uacute;mero";
   14.77 +		case "Total size": return "Tama\&ntilde;o total";
   14.78 +		case "Thread"    : return "hilo";
   14.79 +		case " or "      : return " o ";
   14.80 +		case "Month/Year":
   14.81 +		case "Date"      : return "Fecha";
   14.82 +		}
   14.83 +		break;
   14.84 +	case "fr" :
   14.85 +		switch ($word) {
   14.86 +		case "View by"   : return "Tri\&eacute; par";
   14.87 +		case "Messages count":
   14.88 +		case "Number"    : return "Nombre";
   14.89 +		case "Total size": return "Volume";
   14.90 +		case "Thread"    : return "Sujet";
   14.91 +		case " or "      : return " ou ";
   14.92 +		case "Month/Year": return "Date";
   14.93 +		}
   14.94 +		break;
   14.95 +	case "pt" :
   14.96 +		switch ($word) {
   14.97 +		case "Archives"  : return "Arquivos";
   14.98 +		case "Archive"   : return "Arquivo";
   14.99 +		case "View by"   : return "Exibir por";
  14.100 +		case "Messages count":
  14.101 +		case "Number"    : return "n\&uacute;mero";
  14.102 +		case "Total size": return "O tamanho total";
  14.103 +		case "Thread"    : return "T\&oacute;pico";
  14.104 +		case " or "      : return " ou ";
  14.105 +		case "Month/Year":
  14.106 +		case "Date"      : return "Data";
  14.107 +		}
  14.108 +		break;
  14.109 +	default:
  14.110 +		switch ($word) {
  14.111 +		case "Messages count": return "Number";
  14.112 +		case "Month/Year": return "Date";
  14.113 +		}
  14.114 +		break;
  14.115 +	}
  14.116 +	return $word;
  14.117 +}
  14.118 +
  14.119 +echo '<h4>'.translate("Archives").' 2007-'.date('Y')."</h4>\n";
  14.120 +
  14.121 +$url = "http://listengine.tuxfamily.org/lists.tuxfamily.org/slitaz/";
  14.122 +
  14.123 +$script  = "-e '/<table/,/<\/table>/!d' ";
  14.124 +$script .= "-e 's|html\"|html\" target=\"_blank\"|g' ";
  14.125 +$script .= "-e 's|href=\"|href=\"$url|g' ";
  14.126 +foreach (array("Archive","View by","Number","Total size",
  14.127 +	       "Messages count", "Month/Year",
  14.128 +	       "Thread"," or ","Date") as $word) {
  14.129 +	$script .= "-e 's|".$word."|".translate($word)."|' ";
  14.130 +}
  14.131 +system("wget -q -O - $url | sed $script");
  14.132 +?>
  14.133 +</body>
  14.134 +</html>
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/lib/fb/index.php	Thu Mar 08 02:41:51 2012 +0100
    15.3 @@ -0,0 +1,99 @@
    15.4 +<?php
    15.5 +//
    15.6 +// SliTaz Social applications for Facebook. Just a tiny tool to help 
    15.7 +// spread and follow SliTaz activity.
    15.8 +//
    15.9 +// SliTaz FB page: http://facebook.com/slitaz
   15.10 +// SliTaz SO URL : http://apps.facebook.com/slitaz-so/
   15.11 +//
   15.12 +// NOTE: Any ideas for this app are welcome. We could have a comment box
   15.13 +// to let users post to the official SliTaz Facebook wall.
   15.14 +//
   15.15 +function get_feed($feed_url) {
   15.16 +	$content = file_get_contents($feed_url);
   15.17 +	$x = new SimpleXmlElement($content);
   15.18 +	echo "<ul>";
   15.19 +	foreach($x->channel->item as $entry) {
   15.20 +		echo "
   15.21 +		<li>
   15.22 +		  <strong><a href='$entry->link' target='_TOP'
   15.23 +			title='$entry->title'>" . $entry->title . "</a></strong>
   15.24 +		</li>";
   15.25 +		}
   15.26 +	echo "</ul>";
   15.27 +}
   15.28 +?>
   15.29 +<html>
   15.30 +<head>
   15.31 +	<title>SliTaz SO Canvas</title>
   15.32 +	<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
   15.33 +	<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
   15.34 +	<style type="text/css">
   15.35 +		body { font: 13px sans-serif, vernada, arial; }
   15.36 +		h1 { color: #444; font-size: 150%; }
   15.37 +		h2 { color: #b64b22; font-size: 130%; }
   15.38 +		ul { color: #666; }
   15.39 +	</style>
   15.40 +</head>
   15.41 +<body>
   15.42 +
   15.43 +<!-- Facebook settings -->
   15.44 +<div id="fb-root"></div>
   15.45 +<script>
   15.46 +	FB.init({ appId:'123696844365041', cookie:true, xfbml:true });
   15.47 +	FB.Canvas.setSize({ width: 700, height: 900 });
   15.48 +</script>
   15.49 +
   15.50 +<h1>SliTaz SO</h1>
   15.51 +<p>
   15.52 +	Welcome to the SliTaz Social application for Facebook.
   15.53 +</p>
   15.54 +
   15.55 +<h2>SliTaz on Facebook</h2>
   15.56 +<p>
   15.57 +	To let you show your appreciation for the SliTaz project, we have an official 
   15.58 +	<a href="http://facebook.com/slitaz" target="_TOP">Facebook page</a>
   15.59 +	where you can meet us and share stuff about SliTaz. Like the page to help
   15.60 +	spread the project!
   15.61 +</p>
   15.62 +<fb:like 
   15.63 +	href="http://www.facebook.com/slitaz"
   15.64 +	show_faces="true" width="700">
   15.65 +</fb:like>
   15.66 +
   15.67 +<h2>SliTaz on Twitter</h2>
   15.68 +<p>
   15.69 +	We have an official Twitter account providing small news about the
   15.70 +	project. Twitter posts are relayed on the official Facebook page to
   15.71 +	let you follow us from your favorite platform. Twitter news can also
   15.72 +	be read on the <a href="http://www.slitaz.org/" target="_TOP">SliTaz website</a>
   15.73 +	which is a central place for all SliTaz activity. You can use this 
   15.74 +	button to Tweet about the SliTaz website:
   15.75 +</p>
   15.76 +<!-- Twitter Button -->
   15.77 +<a href="http://twitter.com/share" class="twitter-share-button"
   15.78 +	data-url="http://www.slitaz.org/"
   15.79 +	data-text="SliTaz GNU/Linux" 
   15.80 +	data-count="horizontal"
   15.81 +	data-via="slitaz">Tweet</a>
   15.82 +
   15.83 +<h2>SliTaz Community Network</h2>
   15.84 +<p>
   15.85 +	The SliTaz Community Network aka 
   15.86 +	<a href="http://scn.slitaz.org/" target="_TOP">SCN</a> is the place
   15.87 +	where SliTaz users and contributors share things about the project. We
   15.88 +	provide a fully featured social platform with stuff such as Blogs, 
   15.89 +	Status updates and Artwork. Here are the latest posts on SCN:
   15.90 +</p>
   15.91 +<div>
   15.92 +	<?php
   15.93 +		echo "<div>\n";
   15.94 +		get_feed("http://scn.slitaz.org/rss.xml");
   15.95 +		echo "<p>Latest Status Updates</p>\n";
   15.96 +		get_feed("http://scn.slitaz.org/statuses/recent/feed");
   15.97 +		echo "</div>\n";
   15.98 +	?>
   15.99 +</div>
  15.100 +
  15.101 +</body>
  15.102 +</html>
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/lib/get-feeds.php	Thu Mar 08 02:41:51 2012 +0100
    16.3 @@ -0,0 +1,62 @@
    16.4 +<?php
    16.5 +
    16.6 +// Read RSS Feed
    16.7 +function get_feed($feed) {
    16.8 +	$cache = '/var/cache/slitaz/website';
    16.9 +	$entries = 4;
   16.10 +	// have the page displayed even if any xml file
   16.11 +	if ( ! file_exists("$cache/$feed")) {
   16.12 +		echo "</p>\n<div>\n";
   16.13 +		echo "Missing feed: $cache/$feed\n" . "</div>\n";
   16.14 +	}
   16.15 +	else {
   16.16 +		$content = file_get_contents("$cache/$feed");
   16.17 +		$x = new SimpleXmlElement($content);
   16.18 +		$count = 0;
   16.19 +		// We look for last item, channel may not have a PubDate*
   16.20 +		$up = ($x->channel->item->pubDate);
   16.21 +		echo "<span>- Updated: " . substr("$up", 5, 17) . "</span>\n";
   16.22 +		echo "</p>\n<div>\n<ul>\n";
   16.23 +		foreach($x->channel->item as $entry) {
   16.24 +			$count = $count + 1;
   16.25 +			echo "	<li><a href='$entry->link' title='$entry->title'>" . 
   16.26 +				$entry->title . "</a></li>\n";
   16.27 +			if ($count == $entries) {
   16.28 +				break;
   16.29 +			}
   16.30 +		}
   16.31 +		echo "</ul>\n";
   16.32 +	}
   16.33 +}
   16.34 +
   16.35 +// Read Blog RSS Feed
   16.36 +function get_feed_blog($feed) {
   16.37 +	$cache = '/var/cache/slitaz/website';
   16.38 +	$entries = 4;
   16.39 +	// have the page displayed even if any xml file
   16.40 +	if ( ! file_exists("$cache/$feed")) {
   16.41 +		echo "Missing feed: $cache/$feed\n" . "</div>\n";
   16.42 +	}
   16.43 +	else {
   16.44 +		$content = file_get_contents("$cache/$feed");
   16.45 +		$x = new SimpleXmlElement($content);
   16.46 +		$count = 0;
   16.47 +		// We look for last item, channel may not have a PubDate*
   16.48 +		$up = ($x->channel->item->pubDate);
   16.49 +		
   16.50 +		echo "<ul>\n";
   16.51 +		foreach($x->channel->item as $entry) {
   16.52 +			$count = $count + 1;
   16.53 +			echo "	<li><strong><a href='$entry->link' title='$entry->title'>" . 
   16.54 +				$entry->title . "</strong></a>\n";
   16.55 +			echo "<span>- " . substr("$entry->pubDate", 5, 17) . "</span>\n";
   16.56 +			echo "<p>$entry->description</p>\n</li>";
   16.57 +			if ($count == $entries) {
   16.58 +				break;
   16.59 +			}
   16.60 +		}
   16.61 +		echo "</ul>\n";
   16.62 +	}
   16.63 +}
   16.64 +
   16.65 +?>
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/lib/get-feeds.sh	Thu Mar 08 02:41:51 2012 +0100
    17.3 @@ -0,0 +1,27 @@
    17.4 +#!/bin/sh
    17.5 +# 
    17.6 +# Get latest commits and feeds to display on the website main page.
    17.7 +# On Tank, this script is executed by cron each hour.
    17.8 +#
    17.9 +
   17.10 +CACHE="/var/cache/slitaz/website"
   17.11 +
   17.12 +# Feeds URL http://scn.slitaz.org/activity/feed/
   17.13 +SCN_FEED='http://scn.slitaz.org/activity/feed/'
   17.14 +BLOG_FEED='http://scn.slitaz.org/category/news/feed/'
   17.15 +WOK_FEED='http://hg.slitaz.org/wok/rss-log'
   17.16 +FORUM_FEED='http://forum.slitaz.org/rss'
   17.17 +
   17.18 +# Clean cache
   17.19 +mkdir -p $CACHE && cd $CACHE
   17.20 +rm -f *.xml
   17.21 +
   17.22 +# Cache all feeds to save bandwidth (updated by cron)
   17.23 +echo -n "Getting latest rss feeds... "
   17.24 +wget -O scn.xml $SCN_FEED 2>/dev/null
   17.25 +wget -O wok.xml $WOK_FEED 2>/dev/null
   17.26 +wget -O blog.xml $BLOG_FEED 2>/dev/null
   17.27 +#wget -O forum.xml $FORUM_FEED 2>/dev/null
   17.28 +echo "Done"
   17.29 +
   17.30 +exit 0
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/lib/js/slideshow.js	Thu Mar 08 02:41:51 2012 +0100
    18.3 @@ -0,0 +1,57 @@
    18.4 +
    18.5 +window.addEventListener?window.addEventListener('load',so_init,false):window.attachEvent('onload',so_init);
    18.6 +
    18.7 +var d=document, imgs = new Array(), zInterval = null, current=0, pause=false;
    18.8 +
    18.9 +function so_init()
   18.10 +{
   18.11 +	if(!d.getElementById || !d.createElement)return;
   18.12 +
   18.13 +	imgs = d.getElementById('slideshow').getElementsByTagName('img');
   18.14 +	for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0;
   18.15 +	imgs[0].style.display = 'block';
   18.16 +	imgs[0].xOpacity = .99;
   18.17 +
   18.18 +	setTimeout(so_xfade,4000);
   18.19 +}
   18.20 +
   18.21 +function so_xfade()
   18.22 +{
   18.23 +	cOpacity = imgs[current].xOpacity;
   18.24 +	nIndex = imgs[current+1]?current+1:0;
   18.25 +	nOpacity = imgs[nIndex].xOpacity;
   18.26 +
   18.27 +	cOpacity-=.05;
   18.28 +	nOpacity+=.05;
   18.29 +
   18.30 +	imgs[nIndex].style.display = 'block';
   18.31 +	imgs[current].xOpacity = cOpacity;
   18.32 +	imgs[nIndex].xOpacity = nOpacity;
   18.33 +
   18.34 +	setOpacity(imgs[current]);
   18.35 +	setOpacity(imgs[nIndex]);
   18.36 +
   18.37 +	if(cOpacity<=0)
   18.38 +	{
   18.39 +		imgs[current].style.display = 'none';
   18.40 +		current = nIndex;
   18.41 +		setTimeout(so_xfade,4000);
   18.42 +	}
   18.43 +	else
   18.44 +	{
   18.45 +		setTimeout(so_xfade,60);
   18.46 +	}
   18.47 +
   18.48 +	function setOpacity(obj)
   18.49 +	{
   18.50 +		if(obj.xOpacity>.99)
   18.51 +		{
   18.52 +			obj.xOpacity = .99;
   18.53 +			return;
   18.54 +		}
   18.55 +
   18.56 +		obj.style.opacity = obj.xOpacity;
   18.57 +		obj.style.MozOpacity = obj.xOpacity;
   18.58 +		obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')';
   18.59 +	}
   18.60 +}
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/lib/random-image.php	Thu Mar 08 02:41:51 2012 +0100
    19.3 @@ -0,0 +1,11 @@
    19.4 +<?php
    19.5 +
    19.6 +$total  = "8";
    19.7 +$folder = "images/slideshow";
    19.8 +$start  = "1";
    19.9 +$random = mt_rand($start, $total);
   19.10 +$name   = $random . ".png";
   19.11 +
   19.12 +echo "<img src=\"$folder/$name\" alt=\"$name\" />";
   19.13 +
   19.14 +?>
    20.1 --- a/libs/archives.php	Wed Mar 07 01:54:42 2012 +0100
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,131 +0,0 @@
    20.4 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    20.5 -<html xmlns="http://www.w3.org/1999/xhtml">
    20.6 -<head>
    20.7 -	<title>lists.tuxfamily.org/slitaz mailing list</title>
    20.8 -	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    20.9 -	<!-- link rel="stylesheet" type="text/css" href="/slitaz.css" / -->
   20.10 -	<style type="text/css">
   20.11 -body {
   20.12 -	background: #ffffff;
   20.13 -	color: black;
   20.14 -	font: 13px sans-serif, vernada, arial;
   20.15 -	margin: 0;
   20.16 -	#border-top: 34px solid #f1f1f1;
   20.17 -}
   20.18 -	table {
   20.19 -		border: 1px solid #000000;
   20.20 -		width: variable;
   20.21 -		border-collapse: collapse;
   20.22 -		margin: 2px 2px;
   20.23 -	}
   20.24 -	td {
   20.25 -		border: 1px dotted #6495ed;
   20.26 -		width: variable;
   20.27 -		padding: 2px;
   20.28 -	}
   20.29 -	.rowodd {
   20.30 -		background-color: #ffffff;
   20.31 -	}
   20.32 -	.roweven {
   20.33 -		background-color: #e1ffe1; /* the tower */
   20.34 -	}
   20.35 -	.odd {
   20.36 -		background-color: #ffffff;
   20.37 -	}
   20.38 -	.even {
   20.39 -		background-color: #e1ffe1; /* the tower */
   20.40 -	}
   20.41 -	th {
   20.42 -		border: 1px solid #000000;
   20.43 -		width: variable;
   20.44 -		padding: 4px;
   20.45 -	}
   20.46 -	.alignright {
   20.47 -		text-align: right;
   20.48 -	}
   20.49 -	</style>
   20.50 -</head>
   20.51 -<body>
   20.52 -<?php
   20.53 -
   20.54 -function translate($word)
   20.55 -{
   20.56 -	if (isset($_GET['lang'])) switch ($_GET['lang']) {
   20.57 -	case "de" :
   20.58 -		switch ($word) {
   20.59 -		case "Archives"  : return "Archiv";
   20.60 -		case "Archive"   : return "Archiv";
   20.61 -		case "View by"   : return "Ansicht von";
   20.62 -		case "Messages count":
   20.63 -		case "Number"    : return "Zahl";
   20.64 -		case "Total size": return "Gesamtgr\&ouml;\&szlig;e";
   20.65 -		case " or "      : return " oder ";
   20.66 -		case "Month/Year":
   20.67 -		case "Date"      : return "datum";
   20.68 -		}
   20.69 -		break;
   20.70 -	case "es" :
   20.71 -		switch ($word) {
   20.72 -		case "Archives"  : return "Archivos";
   20.73 -		case "Archive"   : return "Archivo";
   20.74 -		case "View by"   : return "Vista";
   20.75 -		case "Messages count":
   20.76 -		case "Number"    : return "n\&uacute;mero";
   20.77 -		case "Total size": return "Tama\&ntilde;o total";
   20.78 -		case "Thread"    : return "hilo";
   20.79 -		case " or "      : return " o ";
   20.80 -		case "Month/Year":
   20.81 -		case "Date"      : return "Fecha";
   20.82 -		}
   20.83 -		break;
   20.84 -	case "fr" :
   20.85 -		switch ($word) {
   20.86 -		case "View by"   : return "Tri\&eacute; par";
   20.87 -		case "Messages count":
   20.88 -		case "Number"    : return "Nombre";
   20.89 -		case "Total size": return "Volume";
   20.90 -		case "Thread"    : return "Sujet";
   20.91 -		case " or "      : return " ou ";
   20.92 -		case "Month/Year": return "Date";
   20.93 -		}
   20.94 -		break;
   20.95 -	case "pt" :
   20.96 -		switch ($word) {
   20.97 -		case "Archives"  : return "Arquivos";
   20.98 -		case "Archive"   : return "Arquivo";
   20.99 -		case "View by"   : return "Exibir por";
  20.100 -		case "Messages count":
  20.101 -		case "Number"    : return "n\&uacute;mero";
  20.102 -		case "Total size": return "O tamanho total";
  20.103 -		case "Thread"    : return "T\&oacute;pico";
  20.104 -		case " or "      : return " ou ";
  20.105 -		case "Month/Year":
  20.106 -		case "Date"      : return "Data";
  20.107 -		}
  20.108 -		break;
  20.109 -	default:
  20.110 -		switch ($word) {
  20.111 -		case "Messages count": return "Number";
  20.112 -		case "Month/Year": return "Date";
  20.113 -		}
  20.114 -		break;
  20.115 -	}
  20.116 -	return $word;
  20.117 -}
  20.118 -
  20.119 -echo '<h4>'.translate("Archives").' 2007-'.date('Y')."</h4>\n";
  20.120 -
  20.121 -$url = "http://listengine.tuxfamily.org/lists.tuxfamily.org/slitaz/";
  20.122 -
  20.123 -$script  = "-e '/<table/,/<\/table>/!d' ";
  20.124 -$script .= "-e 's|html\"|html\" target=\"_blank\"|g' ";
  20.125 -$script .= "-e 's|href=\"|href=\"$url|g' ";
  20.126 -foreach (array("Archive","View by","Number","Total size",
  20.127 -	       "Messages count", "Month/Year",
  20.128 -	       "Thread"," or ","Date") as $word) {
  20.129 -	$script .= "-e 's|".$word."|".translate($word)."|' ";
  20.130 -}
  20.131 -system("wget -q -O - $url | sed $script");
  20.132 -?>
  20.133 -</body>
  20.134 -</html>
    21.1 --- a/libs/fb/index.php	Wed Mar 07 01:54:42 2012 +0100
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,99 +0,0 @@
    21.4 -<?php
    21.5 -//
    21.6 -// SliTaz Social applications for Facebook. Just a tiny tool to help 
    21.7 -// spread and follow SliTaz activity.
    21.8 -//
    21.9 -// SliTaz FB page: http://facebook.com/slitaz
   21.10 -// SliTaz SO URL : http://apps.facebook.com/slitaz-so/
   21.11 -//
   21.12 -// NOTE: Any ideas for this app are welcome. We could have a comment box
   21.13 -// to let users post to the official SliTaz Facebook wall.
   21.14 -//
   21.15 -function get_feed($feed_url) {
   21.16 -	$content = file_get_contents($feed_url);
   21.17 -	$x = new SimpleXmlElement($content);
   21.18 -	echo "<ul>";
   21.19 -	foreach($x->channel->item as $entry) {
   21.20 -		echo "
   21.21 -		<li>
   21.22 -		  <strong><a href='$entry->link' target='_TOP'
   21.23 -			title='$entry->title'>" . $entry->title . "</a></strong>
   21.24 -		</li>";
   21.25 -		}
   21.26 -	echo "</ul>";
   21.27 -}
   21.28 -?>
   21.29 -<html>
   21.30 -<head>
   21.31 -	<title>SliTaz SO Canvas</title>
   21.32 -	<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
   21.33 -	<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
   21.34 -	<style type="text/css">
   21.35 -		body { font: 13px sans-serif, vernada, arial; }
   21.36 -		h1 { color: #444; font-size: 150%; }
   21.37 -		h2 { color: #b64b22; font-size: 130%; }
   21.38 -		ul { color: #666; }
   21.39 -	</style>
   21.40 -</head>
   21.41 -<body>
   21.42 -
   21.43 -<!-- Facebook settings -->
   21.44 -<div id="fb-root"></div>
   21.45 -<script>
   21.46 -	FB.init({ appId:'123696844365041', cookie:true, xfbml:true });
   21.47 -	FB.Canvas.setSize({ width: 700, height: 900 });
   21.48 -</script>
   21.49 -
   21.50 -<h1>SliTaz SO</h1>
   21.51 -<p>
   21.52 -	Welcome to the SliTaz Social application for Facebook.
   21.53 -</p>
   21.54 -
   21.55 -<h2>SliTaz on Facebook</h2>
   21.56 -<p>
   21.57 -	To let you show your appreciation for the SliTaz project, we have an official 
   21.58 -	<a href="http://facebook.com/slitaz" target="_TOP">Facebook page</a>
   21.59 -	where you can meet us and share stuff about SliTaz. Like the page to help
   21.60 -	spread the project!
   21.61 -</p>
   21.62 -<fb:like 
   21.63 -	href="http://www.facebook.com/slitaz"
   21.64 -	show_faces="true" width="700">
   21.65 -</fb:like>
   21.66 -
   21.67 -<h2>SliTaz on Twitter</h2>
   21.68 -<p>
   21.69 -	We have an official Twitter account providing small news about the
   21.70 -	project. Twitter posts are relayed on the official Facebook page to
   21.71 -	let you follow us from your favorite platform. Twitter news can also
   21.72 -	be read on the <a href="http://www.slitaz.org/" target="_TOP">SliTaz website</a>
   21.73 -	which is a central place for all SliTaz activity. You can use this 
   21.74 -	button to Tweet about the SliTaz website:
   21.75 -</p>
   21.76 -<!-- Twitter Button -->
   21.77 -<a href="http://twitter.com/share" class="twitter-share-button"
   21.78 -	data-url="http://www.slitaz.org/"
   21.79 -	data-text="SliTaz GNU/Linux" 
   21.80 -	data-count="horizontal"
   21.81 -	data-via="slitaz">Tweet</a>
   21.82 -
   21.83 -<h2>SliTaz Community Network</h2>
   21.84 -<p>
   21.85 -	The SliTaz Community Network aka 
   21.86 -	<a href="http://scn.slitaz.org/" target="_TOP">SCN</a> is the place
   21.87 -	where SliTaz users and contributors share things about the project. We
   21.88 -	provide a fully featured social platform with stuff such as Blogs, 
   21.89 -	Status updates and Artwork. Here are the latest posts on SCN:
   21.90 -</p>
   21.91 -<div>
   21.92 -	<?php
   21.93 -		echo "<div>\n";
   21.94 -		get_feed("http://scn.slitaz.org/rss.xml");
   21.95 -		echo "<p>Latest Status Updates</p>\n";
   21.96 -		get_feed("http://scn.slitaz.org/statuses/recent/feed");
   21.97 -		echo "</div>\n";
   21.98 -	?>
   21.99 -</div>
  21.100 -
  21.101 -</body>
  21.102 -</html>
    22.1 --- a/libs/get-feeds.php	Wed Mar 07 01:54:42 2012 +0100
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,62 +0,0 @@
    22.4 -<?php
    22.5 -
    22.6 -// Read RSS Feed
    22.7 -function get_feed($feed) {
    22.8 -	$cache = '/var/cache/slitaz/website';
    22.9 -	$entries = 4;
   22.10 -	// have the page displayed even if any xml file
   22.11 -	if ( ! file_exists("$cache/$feed")) {
   22.12 -		echo "</p>\n<div>\n";
   22.13 -		echo "Missing feed: $cache/$feed\n" . "</div>\n";
   22.14 -	}
   22.15 -	else {
   22.16 -		$content = file_get_contents("$cache/$feed");
   22.17 -		$x = new SimpleXmlElement($content);
   22.18 -		$count = 0;
   22.19 -		// We look for last item, channel may not have a PubDate*
   22.20 -		$up = ($x->channel->item->pubDate);
   22.21 -		echo "<span>- Updated: " . substr("$up", 5, 17) . "</span>\n";
   22.22 -		echo "</p>\n<div>\n<ul>\n";
   22.23 -		foreach($x->channel->item as $entry) {
   22.24 -			$count = $count + 1;
   22.25 -			echo "	<li><a href='$entry->link' title='$entry->title'>" . 
   22.26 -				$entry->title . "</a></li>\n";
   22.27 -			if ($count == $entries) {
   22.28 -				break;
   22.29 -			}
   22.30 -		}
   22.31 -		echo "</ul>\n";
   22.32 -	}
   22.33 -}
   22.34 -
   22.35 -// Read Blog RSS Feed
   22.36 -function get_feed_blog($feed) {
   22.37 -	$cache = '/var/cache/slitaz/website';
   22.38 -	$entries = 4;
   22.39 -	// have the page displayed even if any xml file
   22.40 -	if ( ! file_exists("$cache/$feed")) {
   22.41 -		echo "Missing feed: $cache/$feed\n" . "</div>\n";
   22.42 -	}
   22.43 -	else {
   22.44 -		$content = file_get_contents("$cache/$feed");
   22.45 -		$x = new SimpleXmlElement($content);
   22.46 -		$count = 0;
   22.47 -		// We look for last item, channel may not have a PubDate*
   22.48 -		$up = ($x->channel->item->pubDate);
   22.49 -		
   22.50 -		echo "<ul>\n";
   22.51 -		foreach($x->channel->item as $entry) {
   22.52 -			$count = $count + 1;
   22.53 -			echo "	<li><strong><a href='$entry->link' title='$entry->title'>" . 
   22.54 -				$entry->title . "</strong></a>\n";
   22.55 -			echo "<span>- " . substr("$entry->pubDate", 5, 17) . "</span>\n";
   22.56 -			echo "<p>$entry->description</p>\n</li>";
   22.57 -			if ($count == $entries) {
   22.58 -				break;
   22.59 -			}
   22.60 -		}
   22.61 -		echo "</ul>\n";
   22.62 -	}
   22.63 -}
   22.64 -
   22.65 -?>
    23.1 --- a/libs/get-feeds.sh	Wed Mar 07 01:54:42 2012 +0100
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,27 +0,0 @@
    23.4 -#!/bin/sh
    23.5 -# 
    23.6 -# Get latest commits and feeds to display on the website main page.
    23.7 -# On Tank, this script is executed by cron each hour.
    23.8 -#
    23.9 -
   23.10 -CACHE="/var/cache/slitaz/website"
   23.11 -
   23.12 -# Feeds URL http://scn.slitaz.org/activity/feed/
   23.13 -SCN_FEED='http://scn.slitaz.org/activity/feed/'
   23.14 -BLOG_FEED='http://scn.slitaz.org/category/news/feed/'
   23.15 -WOK_FEED='http://hg.slitaz.org/wok/rss-log'
   23.16 -FORUM_FEED='http://forum.slitaz.org/rss'
   23.17 -
   23.18 -# Clean cache
   23.19 -mkdir -p $CACHE && cd $CACHE
   23.20 -rm -f *.xml
   23.21 -
   23.22 -# Cache all feeds to save bandwidth (updated by cron)
   23.23 -echo -n "Getting latest rss feeds... "
   23.24 -wget -O scn.xml $SCN_FEED 2>/dev/null
   23.25 -wget -O wok.xml $WOK_FEED 2>/dev/null
   23.26 -wget -O blog.xml $BLOG_FEED 2>/dev/null
   23.27 -#wget -O forum.xml $FORUM_FEED 2>/dev/null
   23.28 -echo "Done"
   23.29 -
   23.30 -exit 0
    24.1 --- a/libs/js/slideshow.js	Wed Mar 07 01:54:42 2012 +0100
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,57 +0,0 @@
    24.4 -
    24.5 -window.addEventListener?window.addEventListener('load',so_init,false):window.attachEvent('onload',so_init);
    24.6 -
    24.7 -var d=document, imgs = new Array(), zInterval = null, current=0, pause=false;
    24.8 -
    24.9 -function so_init()
   24.10 -{
   24.11 -	if(!d.getElementById || !d.createElement)return;
   24.12 -
   24.13 -	imgs = d.getElementById('slideshow').getElementsByTagName('img');
   24.14 -	for(i=1;i<imgs.length;i++) imgs[i].xOpacity = 0;
   24.15 -	imgs[0].style.display = 'block';
   24.16 -	imgs[0].xOpacity = .99;
   24.17 -
   24.18 -	setTimeout(so_xfade,4000);
   24.19 -}
   24.20 -
   24.21 -function so_xfade()
   24.22 -{
   24.23 -	cOpacity = imgs[current].xOpacity;
   24.24 -	nIndex = imgs[current+1]?current+1:0;
   24.25 -	nOpacity = imgs[nIndex].xOpacity;
   24.26 -
   24.27 -	cOpacity-=.05;
   24.28 -	nOpacity+=.05;
   24.29 -
   24.30 -	imgs[nIndex].style.display = 'block';
   24.31 -	imgs[current].xOpacity = cOpacity;
   24.32 -	imgs[nIndex].xOpacity = nOpacity;
   24.33 -
   24.34 -	setOpacity(imgs[current]);
   24.35 -	setOpacity(imgs[nIndex]);
   24.36 -
   24.37 -	if(cOpacity<=0)
   24.38 -	{
   24.39 -		imgs[current].style.display = 'none';
   24.40 -		current = nIndex;
   24.41 -		setTimeout(so_xfade,4000);
   24.42 -	}
   24.43 -	else
   24.44 -	{
   24.45 -		setTimeout(so_xfade,60);
   24.46 -	}
   24.47 -
   24.48 -	function setOpacity(obj)
   24.49 -	{
   24.50 -		if(obj.xOpacity>.99)
   24.51 -		{
   24.52 -			obj.xOpacity = .99;
   24.53 -			return;
   24.54 -		}
   24.55 -
   24.56 -		obj.style.opacity = obj.xOpacity;
   24.57 -		obj.style.MozOpacity = obj.xOpacity;
   24.58 -		obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')';
   24.59 -	}
   24.60 -}
    25.1 --- a/libs/random-image.php	Wed Mar 07 01:54:42 2012 +0100
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,11 +0,0 @@
    25.4 -<?php
    25.5 -
    25.6 -$total  = "8";
    25.7 -$folder = "images/slideshow";
    25.8 -$start  = "1";
    25.9 -$random = mt_rand($start, $total);
   25.10 -$name   = $random . ".png";
   25.11 -
   25.12 -echo "<img src=\"$folder/$name\" alt=\"$name\" />";
   25.13 -
   25.14 -?>
    26.1 --- a/netmap.php	Wed Mar 07 01:54:42 2012 +0100
    26.2 +++ b/netmap.php	Thu Mar 08 02:41:51 2012 +0100
    26.3 @@ -33,7 +33,7 @@
    26.4  <div id="block">
    26.5  	<!-- Navigation -->
    26.6  	<div id="block_nav" style="text-align: center; padding: 10px;">
    26.7 -		<?php include("libs/random-image.php"); ?>
    26.8 +		<?php include("lib/random-image.php"); ?>
    26.9  	</div>
   26.10  	<!-- Information/image -->
   26.11  	<div id="block_info">
    27.1 --- a/pt/index.php	Wed Mar 07 01:54:42 2012 +0100
    27.2 +++ b/pt/index.php	Thu Mar 08 02:41:51 2012 +0100
    27.3 @@ -230,7 +230,7 @@
    27.4  
    27.5  <h2>Atividades do projeto</h2>
    27.6  <?php
    27.7 -	require_once("../libs/get-feeds.php");
    27.8 +	require_once("../lib/get-feeds.php");
    27.9  ?>
   27.10  
   27.11  <div class="activity">
    28.1 --- a/pt/mailing-list.html	Wed Mar 07 01:54:42 2012 +0100
    28.2 +++ b/pt/mailing-list.html	Thu Mar 08 02:41:51 2012 +0100
    28.3 @@ -203,7 +203,7 @@
    28.4  </p>
    28.5  
    28.6  <div>
    28.7 -<object type="text/html" width="100%" height="345" data="../libs/archives.php?lang=pt">
    28.8 +<object type="text/html" width="100%" height="345" data="../lib/archives.php?lang=pt">
    28.9  </object>
   28.10  </div>
   28.11  
    29.1 --- a/webchat.php	Wed Mar 07 01:54:42 2012 +0100
    29.2 +++ b/webchat.php	Thu Mar 08 02:41:51 2012 +0100
    29.3 @@ -33,7 +33,7 @@
    29.4  <div id="block">
    29.5  	<!-- Navigation -->
    29.6  	<div id="block_nav" style="text-align: center; padding: 10px;">
    29.7 -		<?php include("libs/random-image.php"); ?>
    29.8 +		<?php include("lib/random-image.php"); ?>
    29.9  	</div>
   29.10  	<!-- Information/image -->
   29.11  	<div id="block_info">