# HG changeset patch # User Christophe Lincoln # Date 1295820100 -3600 # Node ID 6fa4ffc7415d06dba6839305ae4e53a314f5e2e5 # Parent f5c1b6da6403f8cea1388654c1bf5ffba718b617 mainpage: Add a feed grid (feeds are cached by a script and cron) diff -r f5c1b6da6403 -r 6fa4ffc7415d index.php --- a/index.php Sun Jan 23 11:21:24 2011 +0100 +++ b/index.php Sun Jan 23 23:01:40 2011 +0100 @@ -3,7 +3,7 @@ SliTaz GNU/Linux - + @@ -18,13 +18,13 @@ - + @@ -123,6 +123,9 @@ title="Chinese" alt="cn" /> + + +

Latest Tweet

@@ -158,27 +161,35 @@
+

Feed Grid

+ +
+
+

.pngCommunity Network

+ +
+
+

.pngSupport Forum

+ +
+
+
+
+

.pngDocumentation

+ +
+
+

.pngBug Tracker

+ +
+
+ -

Community Network Feed

-
-
- -
-
-

- Join the community -

-
-
- - - -

Spread SliTaz

One way to help the project is to make SliTaz even more popular. diff -r f5c1b6da6403 -r 6fa4ffc7415d libs/get-feed.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libs/get-feed.php Sun Jan 23 23:01:40 2011 +0100 @@ -0,0 +1,43 @@ +channel->item->pubDate); + echo "Updated: " . substr("$up", 5, 12) . "\n"; + echo "

\n"; +} + +// Read Forum RSS Feed +function get_forum_rss_feed($feed_url) { + $content = file_get_contents($feed_url); + $x = new SimpleXmlElement($content); + $up = ($x->channel->pubDate); + echo "Updated: " . substr("$up", 5, 6) . (date( ' Y ')) . "\n"; + echo "\n"; +} + +// Read Atom Feed +function get_atom_feed($feed_url) { + $content = file_get_contents($feed_url); + $x = new SimpleXmlElement($content); + $up = ($x->updated); + echo "Updated: " . substr("$up", 0, 10) . "\n"; + echo "\n"; +} + +?> diff -r f5c1b6da6403 -r 6fa4ffc7415d libs/get-latest.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libs/get-latest.sh Sun Jan 23 23:01:40 2011 +0100 @@ -0,0 +1,54 @@ +#!/bin/sh +# +# Get latest commits and packages to display on the website main page. +# On Tank, this script is executed by cron each hour. +# + +REPO="/home/slitaz/repos/wok" +URL="http://hg.slitaz.org/wok" +PKGS="/home/slitaz/cooking/packages" +CACHE="/var/cache/slitaz/website" +OUTPUT="$CACHE/latest.html" + +# Feed URL's +SCN_FEED='http://scn.slitaz.org/rss.xml' +DOC_FEED='http://doc.slitaz.org/feed.php' +FORUM_FEED='http://forum.slitaz.org/discussions/feed.rss' +BUGS_FEED='http://labs.slitaz.org/issues.atom?query_id=' + +# Clean cache +mkdir -p $CACHE && cd $CACHE +rm *.xml + +# Cache all feeds to save bandwitch (update by cron) +wget -O scn.xml $SCN_FEED +wget -O doc.xml $DOC_FEED +wget -O forum.xml $FORUM_FEED +wget -O bugs.xml $BUGS_FEED + +# Latest Hg commits +echo -n "Getting latest commits... " +echo '
' > $OUTPUT +echo '

.pngLatest commits

' >> $OUTPUT +echo '
    ' >> $OUTPUT +hg log --repository $REPO --limit 5 --no-merges \ + --template "
  • {date|shortdate} \ +- {desc}
  • \n" >> $OUTPUT 2> /dev/null +echo '
' >> $OUTPUT +echo '
' >> $OUTPUT +echo "Done" + +# Latest cooked packages by the build bot. +echo -n "Getting latest cooked packages... " +echo '
' >> $OUTPUT +echo '

.pngLatest cooked packages

' >> $OUTPUT +echo '
    ' >> $OUTPUT +cd $PKGS && ls -1t *.tazpkg | head -5 | \ +while read file +do + echo -n '
  • '$(stat -c '%y' $PKGS/$file | \ + cut -d ' ' -f 1); echo " - $file
  • " +done >> $OUTPUT +echo '
' >> $OUTPUT +echo '
' >> $OUTPUT +echo "Done" diff -r f5c1b6da6403 -r 6fa4ffc7415d libs/js/slideshow.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libs/js/slideshow.js Sun Jan 23 23:01:40 2011 +0100 @@ -0,0 +1,57 @@ + +window.addEventListener?window.addEventListener('load',so_init,false):window.attachEvent('onload',so_init); + +var d=document, imgs = new Array(), zInterval = null, current=0, pause=false; + +function so_init() +{ + if(!d.getElementById || !d.createElement)return; + + imgs = d.getElementById('slideshow').getElementsByTagName('img'); + for(i=1;i.99) + { + obj.xOpacity = .99; + return; + } + + obj.style.opacity = obj.xOpacity; + obj.style.MozOpacity = obj.xOpacity; + obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')'; + } +} diff -r f5c1b6da6403 -r 6fa4ffc7415d scripts/get-latest.sh --- a/scripts/get-latest.sh Sun Jan 23 11:21:24 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Get latest commits and packages to display on the website main page. -# On Tank, this script is executed by cron each hour. -# - -REPO="/home/slitaz/repos/wok" -URL="http://hg.slitaz.org/wok" -PKGS="/home/slitaz/cooking/packages" -OUTPUT="/var/cache/slitaz/website/latest.html" - -mkdir -p /var/cache/slitaz/website - -# Latest Hg commits -echo -n "Getting latest commits... " -echo '

Latest commits

' > $OUTPUT -echo "" >> $OUTPUT -echo "Done" - -# Latest cooked packages by the build bot. -echo -n "Getting latest cooked packages... " -echo '

Latest cooked packages

' >> $OUTPUT -echo "" >> $OUTPUT -echo "Done" diff -r f5c1b6da6403 -r 6fa4ffc7415d scripts/get_feed.php --- a/scripts/get_feed.php Sun Jan 23 11:21:24 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -"; - foreach($x->channel->item as $entry) { - echo " -
  • - " . $entry->title . " -

    $entry->description

    -
  • "; - } - echo ""; -} - -?> diff -r f5c1b6da6403 -r 6fa4ffc7415d scripts/slideshow.js --- a/scripts/slideshow.js Sun Jan 23 11:21:24 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ - -window.addEventListener?window.addEventListener('load',so_init,false):window.attachEvent('onload',so_init); - -var d=document, imgs = new Array(), zInterval = null, current=0, pause=false; - -function so_init() -{ - if(!d.getElementById || !d.createElement)return; - - imgs = d.getElementById('slideshow').getElementsByTagName('img'); - for(i=1;i.99) - { - obj.xOpacity = .99; - return; - } - - obj.style.opacity = obj.xOpacity; - obj.style.MozOpacity = obj.xOpacity; - obj.style.filter = 'alpha(opacity=' + (obj.xOpacity*100) + ')'; - } -} diff -r f5c1b6da6403 -r 6fa4ffc7415d slitaz.css --- a/slitaz.css Sun Jan 23 11:21:24 2011 +0100 +++ b/slitaz.css Sun Jan 23 23:01:40 2011 +0100 @@ -288,7 +288,7 @@ -ms-transform: rotate(-45deg) skew(15deg, 15deg); transform: rotate(-45deg) skew(15deg, 15deg); } -#twitter, .feedbox { +#twitter { margin-top: 20px; -moz-border-radius: 8px; -webkit-border-radius: 8px; @@ -297,16 +297,10 @@ -webkit-box-shadow: 0 1px 3px #666; box-shadow: 0 1px 3px #666; } -.feedbox { - background-color: #f9f9f9; - padding: 10px 20px; - margin: 20px 100px; -} -.feedbox div { - height: 320px; - overflow: auto; -} -.feedbox ul { list-style-type: none; margin: 0; } +.feed-grid { height: 180px; overflow: hidden; } +.feed-grid h3 { margin: 15px 0 0; } +.feed-grid span { font-size: 10px; color: #888; margin-left: 24px; } +.feed-grid ul { color: #888; } /* Clouds */ #cloud {