rss locker + themes rss links updated
This commit is contained in:
parent
91e519fd96
commit
6e9d448e96
6 changed files with 44 additions and 31 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,3 +2,5 @@ photos/
|
||||||
thumbs/
|
thumbs/
|
||||||
db_feed_source
|
db_feed_source
|
||||||
db_old_files
|
db_old_files
|
||||||
|
rss.locker
|
||||||
|
new_files_list
|
||||||
|
|
51
rss.php
51
rss.php
|
@ -69,38 +69,49 @@
|
||||||
$to_store = "";
|
$to_store = "";
|
||||||
// Init files
|
// Init files
|
||||||
if (!file_exists($old_files_list))
|
if (!file_exists($old_files_list))
|
||||||
|
{
|
||||||
file_put_contents($old_files_list, "");
|
file_put_contents($old_files_list, "");
|
||||||
|
}
|
||||||
if (!file_exists($db_feed_source))
|
if (!file_exists($db_feed_source))
|
||||||
|
{
|
||||||
file_put_contents($db_feed_source, "");
|
file_put_contents($db_feed_source, "");
|
||||||
|
}
|
||||||
|
|
||||||
/*===================*/
|
/*===================*/
|
||||||
/*Computing*/
|
/*Computing*/
|
||||||
/*===================*/
|
/*===================*/
|
||||||
#Todo : ajouter une condition : dois-je regénérer le flux ou utiliser les anciens fichiers ?
|
#Todo : ajouter une condition : dois-je regénérer le flux ou utiliser les anciens fichiers ?
|
||||||
|
$temp = file_get_contents($db_feed_source);
|
||||||
|
|
||||||
// Load the list from files.
|
//If the RSS generation is already launched, don't do à second generation at the same time
|
||||||
$old_files_list_content = explode("\n", file_get_contents($old_files_list));
|
if (file_exists("rss.locker") == false)
|
||||||
$new_files_list_content = explode("\n", $content); #debug
|
{
|
||||||
|
file_put_contents("rss.locker", "");
|
||||||
// Generate and stock new elements
|
// Load the list from files.
|
||||||
$differences = diff($old_files_list_content, $new_files_list_content);
|
$old_files_list_content = explode("\n", file_get_contents($old_files_list));
|
||||||
for ($i=0; $i < count($differences); $i++) {
|
$new_files_list_content = explode("\n", $content); #debug
|
||||||
if (is_array($differences[$i])){
|
// Generate and stock new elements
|
||||||
for ($j=0; $j < count($differences[$i]["i"]); $j++) {
|
$differences = diff($old_files_list_content, $new_files_list_content);
|
||||||
if (strlen($differences[$i]["i"][$j]) > 2)
|
for ($i=0; $i < count($differences); $i++)
|
||||||
$to_store .= $differences[$i]["i"][$j] . "\n";
|
{
|
||||||
|
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 = $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);
|
||||||
|
unlink("rss.locker");
|
||||||
}
|
}
|
||||||
|
|
||||||
//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*/
|
/*XML Gen*/
|
||||||
/*===================*/
|
/*===================*/
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<meta name="generator" content="MinigalNano <% version %>" />
|
<meta name="generator" content="MinigalNano <% version %>" />
|
||||||
<title><% title %></title>
|
<title><% title %></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="alternate" type="application/rss+xml" title="<% title %>" href="rss/" />
|
<link rel="alternate" type="application/rss+xml" title="<% title %>" href="rss.php" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="<% gallery_root %>css/mediaboxWhite.css" type="text/css" media="screen" />
|
<link rel="stylesheet" href="<% gallery_root %>css/mediaboxWhite.css" type="text/css" media="screen" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
@ -206,7 +206,7 @@
|
||||||
<a href="https://github.com/sebsauvage/MinigalNano" title="Powered by MiniGal Nano" target="_blank">
|
<a href="https://github.com/sebsauvage/MinigalNano" title="Powered by MiniGal Nano" target="_blank">
|
||||||
Powered by MiniGal Nano <% version %>
|
Powered by MiniGal Nano <% version %>
|
||||||
</a> |
|
</a> |
|
||||||
<a title="<% title %> RSS" href="rss/">
|
<a title="<% title %> RSS" href="rss.php">
|
||||||
RSS
|
RSS
|
||||||
</a>
|
</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<meta name="generator" content="MinigalNano <% version %>" />
|
<meta name="generator" content="MinigalNano <% version %>" />
|
||||||
<title><% title %></title>
|
<title><% title %></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="alternate" type="application/rss+xml" title="<% title %>" href="rss/" />
|
<link rel="alternate" type="application/rss+xml" title="<% title %>" href="rss.php" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="<% gallery_root %>css/mediaboxWhite.css" type="text/css" media="screen" />
|
<link rel="stylesheet" href="<% gallery_root %>css/mediaboxWhite.css" type="text/css" media="screen" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
<a href="http://tomcanac.com/minigal/" title="Tom Canac" target="_blank">
|
<a href="http://tomcanac.com/minigal/" title="Tom Canac" target="_blank">
|
||||||
Board theme by Tom Canac
|
Board theme by Tom Canac
|
||||||
</a> /
|
</a> /
|
||||||
<a title="<% title %> RSS" href="rss/">
|
<a title="<% title %> RSS" href="rss.php">
|
||||||
RSS
|
RSS
|
||||||
</a>
|
</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<meta name="generator" content="MinigalNano <% version %>" />
|
<meta name="generator" content="MinigalNano <% version %>" />
|
||||||
<title><% title %></title>
|
<title><% title %></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="alternate" type="application/rss+xml" title="<% title %>" href="rss/" />
|
<link rel="alternate" type="application/rss+xml" title="<% title %>" href="rss.php" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="<% gallery_root %>css/mediaboxWhite.css" type="text/css" media="screen" />
|
<link rel="stylesheet" href="<% gallery_root %>css/mediaboxWhite.css" type="text/css" media="screen" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
@ -209,7 +209,7 @@
|
||||||
<a href="http://tomcanac.com/minigal/" title="Tom Canac" target="_blank">
|
<a href="http://tomcanac.com/minigal/" title="Tom Canac" target="_blank">
|
||||||
Rounded theme by Tom Canac
|
Rounded theme by Tom Canac
|
||||||
</a> /
|
</a> /
|
||||||
<a title="<% title %> RSS" href="rss/">
|
<a title="<% title %> RSS" href="rss.php">
|
||||||
RSS
|
RSS
|
||||||
</a>
|
</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<meta name="generator" content="MinigalNano <% version %>" />
|
<meta name="generator" content="MinigalNano <% version %>" />
|
||||||
<title><% title %></title>
|
<title><% title %></title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="alternate" type="application/rss+xml" title="<% title %>" href="rss/" />
|
<link rel="alternate" type="application/rss+xml" title="<% title %>" href="rss.php" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="<% gallery_root %>css/mediaboxWhite.css" type="text/css" media="screen" />
|
<link rel="stylesheet" href="<% gallery_root %>css/mediaboxWhite.css" type="text/css" media="screen" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
@ -187,7 +187,7 @@
|
||||||
<a href="http://tomcanac.com/minigal/" title="Tom Canac" target="_blank">
|
<a href="http://tomcanac.com/minigal/" title="Tom Canac" target="_blank">
|
||||||
Squares theme by Tom Canac
|
Squares theme by Tom Canac
|
||||||
</a> /
|
</a> /
|
||||||
<a title="<% title %> RSS" href="rss/">
|
<a title="<% title %> RSS" href="rss.php">
|
||||||
RSS
|
RSS
|
||||||
</a>
|
</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
Loading…
Reference in a new issue