From 9df67440ae30a5bf79e2438e437568b1445bc62e Mon Sep 17 00:00:00 2001 From: Tom Canac Date: Tue, 25 Feb 2014 10:24:36 +0100 Subject: [PATCH 01/11] frst rss draft --- config.php | 4 ++ db_feed_source | 136 +++++++++++++++++++++++++++++++++++++++++++ db_old_files | 136 +++++++++++++++++++++++++++++++++++++++++++ rss.php | 134 ++++++++++++++++++++++++++++++++++++++++++ templates/board.html | 4 +- 5 files changed, 412 insertions(+), 2 deletions(-) mode change 100644 => 100755 config.php create mode 100644 db_feed_source create mode 100644 db_old_files create mode 100644 rss.php diff --git a/config.php b/config.php old mode 100644 new mode 100755 index 79157a1..adeb2a8 --- a/config.php +++ b/config.php @@ -37,6 +37,10 @@ $label_all = "All"; //Text used for link to display all images in one page $label_noimages = "No images"; //Empty folder text $label_loading = "Loading..."; //Thumbnail loading text +//RSS SETTINGS +$gallery_link = "http://localhost/work/fred"; +$description = "Description of the John Doe Gallery"; +$nb_items_rss = 25; //ADVANCED SETTINGS $thumb_size = 320; //Thumbnail height/width (square thumbs). Changing this will most likely require manual altering of the template file to make it look properly! $label_max_length = 40; //Maximum chars of a folder name that will be displayed on the folder thumbnail diff --git a/db_feed_source b/db_feed_source new file mode 100644 index 0000000..45f4e26 --- /dev/null +++ b/db_feed_source @@ -0,0 +1,136 @@ +http://localhost/work/fred/photos/interfaces/20131202-1602_tilling-gala.png +http://localhost/work/fred/photos/interfaces/20140119-0953_conky.png +http://localhost/work/fred/photos/animaux/20131218-0714_pars-polairejpg.jpg +http://localhost/work/fred/photos/animaux/20131211-2057_bisougif.gif +http://localhost/work/fred/photos/animaux/20131201-1101_fox.jpg +http://localhost/work/fred/photos/animaux/20131201-1104_macro.jpg +http://localhost/work/fred/photos/animaux/20140129-2255_birds.jpg +http://localhost/work/fred/photos/animaux/20140114-1611_syperain_flying_squirel.jpg +http://localhost/work/fred/photos/animaux/20131127-0818_foanjpg.jpg +http://localhost/work/fred/photos/animaux/20140114-1621_wolf.png +http://localhost/work/fred/photos/animaux/20131130-1340_foxypng.png +http://localhost/work/fred/photos/animaux/20131208-2240_renard.jpg +http://localhost/work/fred/photos/animaux/20140129-2302_fox.png +http://localhost/work/fred/photos/animaux/20131209-1834_fenec.jpg +http://localhost/work/fred/photos/animaux/20140114-1609_tumblr_biche_500.jpg +http://localhost/work/fred/photos/animaux/20131201-1110_owl.jpg +http://localhost/work/fred/photos/animaux/20131125-2147_faons.jpg +http://localhost/work/fred/photos/animaux/20131220-0710_tigre.jpg +http://localhost/work/fred/photos/animaux/20131201-1049_owl.jpg +http://localhost/work/fred/photos/animaux/20140114-1609_grizzly_bear.jpg +http://localhost/work/fred/photos/animaux/20131130-1340_squirell.jpg +http://localhost/work/fred/photos/animaux/20131219-0723_lapin.jpg +http://localhost/work/fred/photos/animaux/20140107-0841_tigre.jpg +http://localhost/work/fred/photos/animaux/20131221-1403_little-owl.jpg +http://localhost/work/fred/photos/animaux/20131219-1856_baby-owl.jpg +http://localhost/work/fred/photos/animaux/20140106-2250_wolfs.png +http://localhost/work/fred/photos/animaux/20140107-0840_owl2.gif +http://localhost/work/fred/photos/animaux/20131209-1834_renard2.jpg +http://localhost/work/fred/photos/animaux/20131215-1602_cuteness-overlod.jpg +http://localhost/work/fred/photos/animaux/20131126-0030_red-fox-shaking.jpg +http://localhost/work/fred/photos/animaux/20131218-0714_ours.jpg +http://localhost/work/fred/photos/animaux/20131201-1104_gecko.jpg +http://localhost/work/fred/photos/animaux/20140109-1820_dog.jpg +http://localhost/work/fred/photos/animaux/20131216-2124_lion.jpg +http://localhost/work/fred/photos/animaux/20140111-2215_cat-waking-up-gif.gif +http://localhost/work/fred/photos/animaux/20140106-2249_cat.jpg +http://localhost/work/fred/photos/animaux/20131125-2143_elan.png +http://localhost/work/fred/photos/animaux/20131201-1104_puppy-massacrejpg.jpg +http://localhost/work/fred/photos/animaux/20140107-0840_owl.jpg +http://localhost/work/fred/photos/animaux/20131214-1116_owl.jpg +http://localhost/work/fred/photos/animaux/20140114-1607_animaux.jpg +http://localhost/work/fred/photos/animaux/20140114-1609_tumblr_owl.png +http://localhost/work/fred/photos/animaux/20140114-1621_fox.jpg +http://localhost/work/fred/photos/animaux/20131218-0714_mouton.jpg +http://localhost/work/fred/photos/animaux/20131213-1834_ours.png +http://localhost/work/fred/photos/animaux/20131130-1339_herisson.jpg +http://localhost/work/fred/photos/animaux/20131215-1603_tigre.jpg +http://localhost/work/fred/photos/animaux/20140106-2250_fox.jpg +http://localhost/work/fred/photos/animaux/20131209-1834_renard1.jpg +http://localhost/work/fred/photos/animaux/20140106-2246_foxpng.png +http://localhost/work/fred/photos/animaux/20131214-1114_cow.jpg +http://localhost/work/fred/photos/animaux/20131218-0725_lapin.jpg +http://localhost/work/fred/photos/animaux/20131211-2120_dalma.gif +http://localhost/work/fred/photos/animaux/20131218-0713_renard.jpg +http://localhost/work/fred/photos/animaux/20131201-1102_firefox.jpg +http://localhost/work/fred/photos/animaux/20131126-2339_chouette.jpg +http://localhost/work/fred/photos/animaux/20131219-0725_biche.png +http://localhost/work/fred/photos/animaux/20131221-1403_owl.jpg +http://localhost/work/fred/photos/animaux/20131219-2152_cute-baby-owl.jpg +http://localhost/work/fred/photos/animaux/20131201-1052_pearycaribou.jpg +http://localhost/work/fred/photos/animaux/20140109-1820_dogs.jpg +http://localhost/work/fred/photos/animaux/20131201-1049_foxjpg.jpg +http://localhost/work/fred/photos/animaux/20140106-2246_tiger.png +http://localhost/work/fred/photos/animaux/20131209-1834_Renard3.jpg +http://localhost/work/fred/photos/animaux/20131130-1339_fox.png +http://localhost/work/fred/photos/animaux/20131211-2100_walk.jpg +http://localhost/work/fred/photos/animaux/20140114-1623_bears.jpg +http://localhost/work/fred/photos/animaux/20131213-1837_renard.gif +http://localhost/work/fred/photos/animaux/20131125-2148_tigre.jpg +http://localhost/work/fred/photos/animaux/20131220-0033_renard.jpg +http://localhost/work/fred/photos/animaux/20140114-1606_dancing_bear.jpg +http://localhost/work/fred/photos/animaux/20140106-2249_tiger.jpg +http://localhost/work/fred/photos/animaux/20140129-2303_bird.jpg +http://localhost/work/fred/photos/jeux/20140127-2111_Legend_of_Grimrock_2_screenshot_2.jpg +http://localhost/work/fred/photos/jeux/20140127-2111_Legend_of_Grimrock_2_screenshot_3.jpg +http://localhost/work/fred/photos/jeux/20140127-2112_LoG_2_logo_small.jpg +http://localhost/work/fred/photos/jeux/20140102-2047_grim.jpg +http://localhost/work/fred/photos/jeux/20140127-2111_Legend_of_Grimrock_2_screenshot_1.jpg +http://localhost/work/fred/photos/jeux/20140127-2111_Legend_of_Grimrock_2_screenshot_4.jpg +http://localhost/work/fred/photos/20131126-0018_luna.jpg +http://localhost/work/fred/photos/folder/20131125-2113_galaxy01.jpg +http://localhost/work/fred/photos/folder/20131126-0021_mars8.jpg +http://localhost/work/fred/photos/folder/20131125-2113_Saturne2013.jpg +http://localhost/work/fred/photos/folder/20131126-0018_luna.jpg +http://localhost/work/fred/photos/folder/20131126-0021_mars6.jpg +http://localhost/work/fred/photos/nature/20131219-0724_yukon.png +http://localhost/work/fred/photos/nature/20131125-1913_lake-tahoe-sierra-nevada-united-states.jpg +http://localhost/work/fred/photos/nature/20140112-1125_zion.jpg +http://localhost/work/fred/photos/nature/20131216-2124_fall.jpg +http://localhost/work/fred/photos/nature/20140119-0958_china-karst.jpg +http://localhost/work/fred/photos/nature/20140112-1124_nature.jpg +http://localhost/work/fred/photos/nature/20131216-2123_montagneux.jpg +http://localhost/work/fred/photos/nature/20140106-2245_volcano_500.png +http://localhost/work/fred/photos/nature/20131213-1836_bear.png +http://localhost/work/fred/photos/nature/20131125-1913_mountain.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Mountain-Tianmen-National-Park-Zhangjiajie-Hunan-Province-China.jpg +http://localhost/work/fred/photos/nature/20131125-1913_volcano_02.png +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland2.jpg +http://localhost/work/fred/photos/nature/20131125-1913_autumn_forest.jpg +http://localhost/work/fred/photos/nature/20131125-1913_switzerlan.jpg +http://localhost/work/fred/photos/nature/20131125-1913_water-fall.jpg +http://localhost/work/fred/photos/nature/20131125-1913_entwined.jpg +http://localhost/work/fred/photos/nature/20131126-2326_colorado.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland4.jpeg +http://localhost/work/fred/photos/nature/20140114-1610_mountain.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland5.jpg +http://localhost/work/fred/photos/nature/20140129-2259_indian-summer.jpg +http://localhost/work/fred/photos/nature/20131125-1913_biche.jpg +http://localhost/work/fred/photos/nature/20131216-2123_relief.jpg +http://localhost/work/fred/photos/nature/20140106-2250_fire.jpg +http://localhost/work/fred/photos/nature/20131125-1913_meteora_monastere.jpg +http://localhost/work/fred/photos/nature/20131216-2123_fluvial.jpg +http://localhost/work/fred/photos/nature/20140106-2246_dolomites.png +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland3.jpg +http://localhost/work/fred/photos/nature/20140112-1125_zion3.jpg +http://localhost/work/fred/photos/nature/20131125-1913_lake_hd.jpg +http://localhost/work/fred/photos/nature/20140106-2248_sunpawatajpg.jpg +http://localhost/work/fred/photos/nature/20131125-1913_giant-tortoises-galpagos-island.jpg +http://localhost/work/fred/photos/nature/20131125-1913_heaven_sky.jpg +http://localhost/work/fred/photos/nature/20131125-1913_mountain.png +http://localhost/work/fred/photos/nature/20131126-2325_colorado.jpg +http://localhost/work/fred/photos/nature/20131126-2327_sky.jpg +http://localhost/work/fred/photos/nature/20140114-1623_volcane-and-lights.jpg +http://localhost/work/fred/photos/nature/20131201-1050_landscape.jpg +http://localhost/work/fred/photos/nature/20131125-1913_mountain_flowers.jpg +http://localhost/work/fred/photos/nature/20131221-1403_volcan.jpg +http://localhost/work/fred/photos/nature/20131125-1913_forest.jpg +http://localhost/work/fred/photos/nature/20131125-1913_volcano.jpg +http://localhost/work/fred/photos/nature/20131130-1339_etna.jpg +http://localhost/work/fred/photos/nature/20131125-1913_ecureuil.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Autumn-Railway.png +http://localhost/work/fred/photos/nature/20131125-1913_lake.jpg +http://localhost/work/fred/photos/nature/20140114-1626_bird.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland1.jpg +http://localhost/work/fred/photos/nature/20140129-2257_alpinism.jpg +http://localhost/work/fred/photos/nature/20131125-1913_bridge-mount-tai-china.jpg diff --git a/db_old_files b/db_old_files new file mode 100644 index 0000000..45f4e26 --- /dev/null +++ b/db_old_files @@ -0,0 +1,136 @@ +http://localhost/work/fred/photos/interfaces/20131202-1602_tilling-gala.png +http://localhost/work/fred/photos/interfaces/20140119-0953_conky.png +http://localhost/work/fred/photos/animaux/20131218-0714_pars-polairejpg.jpg +http://localhost/work/fred/photos/animaux/20131211-2057_bisougif.gif +http://localhost/work/fred/photos/animaux/20131201-1101_fox.jpg +http://localhost/work/fred/photos/animaux/20131201-1104_macro.jpg +http://localhost/work/fred/photos/animaux/20140129-2255_birds.jpg +http://localhost/work/fred/photos/animaux/20140114-1611_syperain_flying_squirel.jpg +http://localhost/work/fred/photos/animaux/20131127-0818_foanjpg.jpg +http://localhost/work/fred/photos/animaux/20140114-1621_wolf.png +http://localhost/work/fred/photos/animaux/20131130-1340_foxypng.png +http://localhost/work/fred/photos/animaux/20131208-2240_renard.jpg +http://localhost/work/fred/photos/animaux/20140129-2302_fox.png +http://localhost/work/fred/photos/animaux/20131209-1834_fenec.jpg +http://localhost/work/fred/photos/animaux/20140114-1609_tumblr_biche_500.jpg +http://localhost/work/fred/photos/animaux/20131201-1110_owl.jpg +http://localhost/work/fred/photos/animaux/20131125-2147_faons.jpg +http://localhost/work/fred/photos/animaux/20131220-0710_tigre.jpg +http://localhost/work/fred/photos/animaux/20131201-1049_owl.jpg +http://localhost/work/fred/photos/animaux/20140114-1609_grizzly_bear.jpg +http://localhost/work/fred/photos/animaux/20131130-1340_squirell.jpg +http://localhost/work/fred/photos/animaux/20131219-0723_lapin.jpg +http://localhost/work/fred/photos/animaux/20140107-0841_tigre.jpg +http://localhost/work/fred/photos/animaux/20131221-1403_little-owl.jpg +http://localhost/work/fred/photos/animaux/20131219-1856_baby-owl.jpg +http://localhost/work/fred/photos/animaux/20140106-2250_wolfs.png +http://localhost/work/fred/photos/animaux/20140107-0840_owl2.gif +http://localhost/work/fred/photos/animaux/20131209-1834_renard2.jpg +http://localhost/work/fred/photos/animaux/20131215-1602_cuteness-overlod.jpg +http://localhost/work/fred/photos/animaux/20131126-0030_red-fox-shaking.jpg +http://localhost/work/fred/photos/animaux/20131218-0714_ours.jpg +http://localhost/work/fred/photos/animaux/20131201-1104_gecko.jpg +http://localhost/work/fred/photos/animaux/20140109-1820_dog.jpg +http://localhost/work/fred/photos/animaux/20131216-2124_lion.jpg +http://localhost/work/fred/photos/animaux/20140111-2215_cat-waking-up-gif.gif +http://localhost/work/fred/photos/animaux/20140106-2249_cat.jpg +http://localhost/work/fred/photos/animaux/20131125-2143_elan.png +http://localhost/work/fred/photos/animaux/20131201-1104_puppy-massacrejpg.jpg +http://localhost/work/fred/photos/animaux/20140107-0840_owl.jpg +http://localhost/work/fred/photos/animaux/20131214-1116_owl.jpg +http://localhost/work/fred/photos/animaux/20140114-1607_animaux.jpg +http://localhost/work/fred/photos/animaux/20140114-1609_tumblr_owl.png +http://localhost/work/fred/photos/animaux/20140114-1621_fox.jpg +http://localhost/work/fred/photos/animaux/20131218-0714_mouton.jpg +http://localhost/work/fred/photos/animaux/20131213-1834_ours.png +http://localhost/work/fred/photos/animaux/20131130-1339_herisson.jpg +http://localhost/work/fred/photos/animaux/20131215-1603_tigre.jpg +http://localhost/work/fred/photos/animaux/20140106-2250_fox.jpg +http://localhost/work/fred/photos/animaux/20131209-1834_renard1.jpg +http://localhost/work/fred/photos/animaux/20140106-2246_foxpng.png +http://localhost/work/fred/photos/animaux/20131214-1114_cow.jpg +http://localhost/work/fred/photos/animaux/20131218-0725_lapin.jpg +http://localhost/work/fred/photos/animaux/20131211-2120_dalma.gif +http://localhost/work/fred/photos/animaux/20131218-0713_renard.jpg +http://localhost/work/fred/photos/animaux/20131201-1102_firefox.jpg +http://localhost/work/fred/photos/animaux/20131126-2339_chouette.jpg +http://localhost/work/fred/photos/animaux/20131219-0725_biche.png +http://localhost/work/fred/photos/animaux/20131221-1403_owl.jpg +http://localhost/work/fred/photos/animaux/20131219-2152_cute-baby-owl.jpg +http://localhost/work/fred/photos/animaux/20131201-1052_pearycaribou.jpg +http://localhost/work/fred/photos/animaux/20140109-1820_dogs.jpg +http://localhost/work/fred/photos/animaux/20131201-1049_foxjpg.jpg +http://localhost/work/fred/photos/animaux/20140106-2246_tiger.png +http://localhost/work/fred/photos/animaux/20131209-1834_Renard3.jpg +http://localhost/work/fred/photos/animaux/20131130-1339_fox.png +http://localhost/work/fred/photos/animaux/20131211-2100_walk.jpg +http://localhost/work/fred/photos/animaux/20140114-1623_bears.jpg +http://localhost/work/fred/photos/animaux/20131213-1837_renard.gif +http://localhost/work/fred/photos/animaux/20131125-2148_tigre.jpg +http://localhost/work/fred/photos/animaux/20131220-0033_renard.jpg +http://localhost/work/fred/photos/animaux/20140114-1606_dancing_bear.jpg +http://localhost/work/fred/photos/animaux/20140106-2249_tiger.jpg +http://localhost/work/fred/photos/animaux/20140129-2303_bird.jpg +http://localhost/work/fred/photos/jeux/20140127-2111_Legend_of_Grimrock_2_screenshot_2.jpg +http://localhost/work/fred/photos/jeux/20140127-2111_Legend_of_Grimrock_2_screenshot_3.jpg +http://localhost/work/fred/photos/jeux/20140127-2112_LoG_2_logo_small.jpg +http://localhost/work/fred/photos/jeux/20140102-2047_grim.jpg +http://localhost/work/fred/photos/jeux/20140127-2111_Legend_of_Grimrock_2_screenshot_1.jpg +http://localhost/work/fred/photos/jeux/20140127-2111_Legend_of_Grimrock_2_screenshot_4.jpg +http://localhost/work/fred/photos/20131126-0018_luna.jpg +http://localhost/work/fred/photos/folder/20131125-2113_galaxy01.jpg +http://localhost/work/fred/photos/folder/20131126-0021_mars8.jpg +http://localhost/work/fred/photos/folder/20131125-2113_Saturne2013.jpg +http://localhost/work/fred/photos/folder/20131126-0018_luna.jpg +http://localhost/work/fred/photos/folder/20131126-0021_mars6.jpg +http://localhost/work/fred/photos/nature/20131219-0724_yukon.png +http://localhost/work/fred/photos/nature/20131125-1913_lake-tahoe-sierra-nevada-united-states.jpg +http://localhost/work/fred/photos/nature/20140112-1125_zion.jpg +http://localhost/work/fred/photos/nature/20131216-2124_fall.jpg +http://localhost/work/fred/photos/nature/20140119-0958_china-karst.jpg +http://localhost/work/fred/photos/nature/20140112-1124_nature.jpg +http://localhost/work/fred/photos/nature/20131216-2123_montagneux.jpg +http://localhost/work/fred/photos/nature/20140106-2245_volcano_500.png +http://localhost/work/fred/photos/nature/20131213-1836_bear.png +http://localhost/work/fred/photos/nature/20131125-1913_mountain.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Mountain-Tianmen-National-Park-Zhangjiajie-Hunan-Province-China.jpg +http://localhost/work/fred/photos/nature/20131125-1913_volcano_02.png +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland2.jpg +http://localhost/work/fred/photos/nature/20131125-1913_autumn_forest.jpg +http://localhost/work/fred/photos/nature/20131125-1913_switzerlan.jpg +http://localhost/work/fred/photos/nature/20131125-1913_water-fall.jpg +http://localhost/work/fred/photos/nature/20131125-1913_entwined.jpg +http://localhost/work/fred/photos/nature/20131126-2326_colorado.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland4.jpeg +http://localhost/work/fred/photos/nature/20140114-1610_mountain.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland5.jpg +http://localhost/work/fred/photos/nature/20140129-2259_indian-summer.jpg +http://localhost/work/fred/photos/nature/20131125-1913_biche.jpg +http://localhost/work/fred/photos/nature/20131216-2123_relief.jpg +http://localhost/work/fred/photos/nature/20140106-2250_fire.jpg +http://localhost/work/fred/photos/nature/20131125-1913_meteora_monastere.jpg +http://localhost/work/fred/photos/nature/20131216-2123_fluvial.jpg +http://localhost/work/fred/photos/nature/20140106-2246_dolomites.png +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland3.jpg +http://localhost/work/fred/photos/nature/20140112-1125_zion3.jpg +http://localhost/work/fred/photos/nature/20131125-1913_lake_hd.jpg +http://localhost/work/fred/photos/nature/20140106-2248_sunpawatajpg.jpg +http://localhost/work/fred/photos/nature/20131125-1913_giant-tortoises-galpagos-island.jpg +http://localhost/work/fred/photos/nature/20131125-1913_heaven_sky.jpg +http://localhost/work/fred/photos/nature/20131125-1913_mountain.png +http://localhost/work/fred/photos/nature/20131126-2325_colorado.jpg +http://localhost/work/fred/photos/nature/20131126-2327_sky.jpg +http://localhost/work/fred/photos/nature/20140114-1623_volcane-and-lights.jpg +http://localhost/work/fred/photos/nature/20131201-1050_landscape.jpg +http://localhost/work/fred/photos/nature/20131125-1913_mountain_flowers.jpg +http://localhost/work/fred/photos/nature/20131221-1403_volcan.jpg +http://localhost/work/fred/photos/nature/20131125-1913_forest.jpg +http://localhost/work/fred/photos/nature/20131125-1913_volcano.jpg +http://localhost/work/fred/photos/nature/20131130-1339_etna.jpg +http://localhost/work/fred/photos/nature/20131125-1913_ecureuil.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Autumn-Railway.png +http://localhost/work/fred/photos/nature/20131125-1913_lake.jpg +http://localhost/work/fred/photos/nature/20140114-1626_bird.jpg +http://localhost/work/fred/photos/nature/20131125-1913_Landwasser-Viaduct-Graubunden-Switzerland1.jpg +http://localhost/work/fred/photos/nature/20140129-2257_alpinism.jpg +http://localhost/work/fred/photos/nature/20131125-1913_bridge-mount-tai-china.jpg diff --git a/rss.php b/rss.php new file mode 100644 index 0000000..0fd8f14 --- /dev/null +++ b/rss.php @@ -0,0 +1,134 @@ +"; + $content .= $current_adress. "\n"; + } + } + } + closedir($dir); + return $content; + } + + # Paul's Simple Diff Algorithm v 0.1 : http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/ + function diff($old, $new){ + $matrix = array(); + $maxlen = 0; + foreach($old as $oindex => $ovalue){ + $nkeys = array_keys($new, $ovalue); + foreach($nkeys as $nindex){ + $matrix[$oindex][$nindex] = isset($matrix[$oindex - 1][$nindex - 1]) ? + $matrix[$oindex - 1][$nindex - 1] + 1 : 1; + if($matrix[$oindex][$nindex] > $maxlen){ + $maxlen = $matrix[$oindex][$nindex]; + $omax = $oindex + 1 - $maxlen; + $nmax = $nindex + 1 - $maxlen; + } + } + } + if($maxlen == 0) return array(array('d'=>$old, 'i'=>$new)); + return array_merge( + diff(array_slice($old, 0, $omax), array_slice($new, 0, $nmax)), + array_slice($new, $nmax, $maxlen), + diff(array_slice($old, $omax + $maxlen), array_slice($new, $nmax + $maxlen))); + } + + function print_array($array_to_display) { + echo '
';
+		print_r($array_to_display);
+		echo '
'; + } +/*===================*/ +/*Variables*/ +/*===================*/ + require("config.php"); + #$content = ""; + $old_files_list = "db_old_files"; //list of files in ./photos + $new_files_list = "new_files_list"; + $db_feed_source = "db_feed_source"; + $Folder = 'photos'; + $SkipExts = array('html', 'txt', 'php'); + $SkipObjects = array('UnDossier', 'UnFichier'); + $content = ListFiles($gallery_link, $content, $Folder, $SkipExts, $SkipObjects); + $to_store = ""; + // Init files + if (!file_exists($old_files_list)) + file_put_contents($old_files_list, ""); + if (!file_exists($db_feed_source)) + file_put_contents($db_feed_source, ""); + +/*===================*/ +/*Computing*/ +/*===================*/ + #Todo : ajouter une condition : dois-je regénérer le flux ou utiliser les anciens fichiers ? + + // Load the list from files. + $old_files_list_content = explode("\n", file_get_contents($old_files_list)); + $new_files_list_content = explode("\n", $content); #debug + + // Generate and stock new elements + $differences = diff($old_files_list_content, $new_files_list_content); + for ($i=0; $i < count($differences); $i++) { + if (is_array($differences[$i])){ + for ($j=0; $j < count($differences[$i]["i"]); $j++) { + if (strlen($differences[$i]["i"][$j]) > 2) + $to_store .= $differences[$i]["i"][$j] . "\n"; + } + } + } + + //Add new elements at the top of the feed's source + $temp = file_get_contents($db_feed_source); + $temp = $to_store . $temp; + file_put_contents($db_feed_source, $temp); + + // Store the current file list for the next generation + file_put_contents($old_files_list, $content); + +/*===================*/ +/*XML Gen*/ +/*===================*/ + $temp = explode("\n", $temp); + + echo " + + + ".$title." + ".$gallery_link." + ".$description." + "; + for ($i=0; $i <= $nb_items_rss; $i++) { + echo + " + " . $temp[$i] . " + ". $temp[$i] . " + + ]]> + + " + ; + } + echo" + + + "; +?> \ No newline at end of file diff --git a/templates/board.html b/templates/board.html index 8c9ce88..960c0eb 100644 --- a/templates/board.html +++ b/templates/board.html @@ -6,7 +6,7 @@ <% title %> - +