Merge branch 'master' into myAutoBlog
Conflicts: autoblogs/autoblog.php config.php.example functions.php index.php xsaf3.php
6
.gitignore
vendored
|
@ -1,9 +1,15 @@
|
||||||
config.php
|
config.php
|
||||||
.versionlock
|
.versionlock
|
||||||
.xsaflock
|
.xsaflock
|
||||||
|
.updatealllock
|
||||||
resources/rss.xml
|
resources/rss.xml
|
||||||
resources/rss.json
|
resources/rss.json
|
||||||
.project
|
.project
|
||||||
resources/user.css
|
resources/user.css
|
||||||
autoblogs/*
|
autoblogs/*
|
||||||
!autoblogs/autoblog.php
|
!autoblogs/autoblog.php
|
||||||
|
docs/*
|
||||||
|
!docs/docs.txt
|
||||||
|
robots.txt
|
||||||
|
.idea
|
||||||
|
cache_*
|
||||||
|
|
34
LICENSE.md
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
LICENCE
|
||||||
|
===============
|
||||||
|
|
||||||
|
- domaine public
|
||||||
|
|
||||||
|
LICENSE
|
||||||
|
===============
|
||||||
|
|
||||||
|
- public domain
|
||||||
|
|
||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <http://unlicense.org/>
|
75
README.md
|
@ -1,23 +1,42 @@
|
||||||
|
|
||||||
Projet Autoblog
|
Projet Autoblog
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Création, gestion et échange de blogs automatiques contre la censure (à propos: http://sebsauvage.net/streisand.me/fr/ ).
|
> This project is historically in French. See [our english README](https://github.com/mitsukarenai/Projet-Autoblog/wiki/Autoblog-Project).
|
||||||
|
|
||||||
|
Réplication automatique de contenu à partir de flux RSS/Atom, avec partage des ajouts entre les fermes d'Autoblog.
|
||||||
|
|
||||||
|
L'objectif premier du projet Autoblog est de lutter contre la censure et toute autre forme de pression allant à l'encontre de la liberté d'expression en favorisant l'[effet Streisand](http://fr.wikipedia.org/wiki/Effet_Streisand).
|
||||||
|
|
||||||
|
Le projet a été initialement lancé par Sébastien Sauvage : [plus d'info par ici](http://sebsauvage.net/streisand.me/fr/).
|
||||||
|
|
||||||
|
Exemples d'instances :
|
||||||
|
- [autoblog.suumitsu.eu](http://autoblog.suumitsu.eu/)
|
||||||
|
- [streisand.hoa.ro](http://streisand.hoa.ro/)
|
||||||
|
- [ecirtam.net](https://ecirtam.net/autoblogs/)
|
||||||
|
- [autoblog.ohax.fr](http://autoblog.ohax.fr/)
|
||||||
|
- [flamby.aldarone.fr](http://flamby.aldarone.fr/)
|
||||||
|
- [tcit.fr](http://www.tcit.fr/streisand/)
|
||||||
|
- [kaelsitoo.fr](http://kaelsitoo.fr/autoblog/)
|
||||||
|
- [autoblog.postblue.info](http://autoblog.postblue.info/)
|
||||||
|
|
||||||
|
|
||||||
Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro).
|
Serie 0.3 par [Mitsu](https://github.com/mitsukarenai/), [Oros](https://github.com/Oros42), [Arthur Hoaro](https://github.com/ArthurHoaro).
|
||||||
|
|
||||||
Nouveautés majeures
|
![logo](https://raw.github.com/mitsukarenai/Projet-Autoblog/master/resources/icon-logo.png)
|
||||||
|
Fonctionnalités majeures
|
||||||
===================
|
===================
|
||||||
|
|
||||||
- "ferme" d'autoblogs avec ajout facile par différents formulaires (générique, microblogging, OPML, marque-pages)
|
- Ferme d'autoblogs avec ajout facile par différents formulaires (générique, microblogging, OPML, marque-pages).
|
||||||
- échange de références entre fermes avec XSAF (Cross-Site Autoblog Farming)
|
- Échange de références entre fermes avec XSAF ([Cross-Site Autoblog Farming](https://github.com/mitsukarenai/Projet-Autoblog/wiki/XSAF---Cross-Site-Autoblog-Farming)).
|
||||||
- vérification du statut des sites distants, et flux de suivi des changements
|
- Vérification du statut des sites distants, et flux de suivi des changements.
|
||||||
- export facile des références, articles et médias
|
- Export des références, articles et médias.
|
||||||
- contrôle de version et alerte de mise à jour
|
- Contrôle de version de la ferme et alerte de mise à jour.
|
||||||
- apparence de l'autoblog selon son type
|
- Identification du type d'autoblog.
|
||||||
- CSS utilisateur personnalisable
|
- CSS utilisateur personnalisable.
|
||||||
- hébergement de documents spécifiques
|
- Hébergement de documents divers (PDF, images, réplique de site web, etc.).
|
||||||
|
|
||||||
Branches :
|
Branches
|
||||||
===================
|
===================
|
||||||
|
|
||||||
- [master](https://github.com/mitsukarenai/Projet-Autoblog/tree/master/) _(développement)_ : Autoblog Project serie 0.3 par Mitsu, Oros, Arthur Hoaro
|
- [master](https://github.com/mitsukarenai/Projet-Autoblog/tree/master/) _(développement)_ : Autoblog Project serie 0.3 par Mitsu, Oros, Arthur Hoaro
|
||||||
|
@ -28,4 +47,36 @@ Branches :
|
||||||
Pré-requis techniques
|
Pré-requis techniques
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
- serveur web avec PHP 5.3 et son support SQLite
|
- Serveur web (Apache, nginx, etc.)
|
||||||
|
- PHP 5.3 ou supérieur
|
||||||
|
- Support SQLite 3 pour PHP
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
=====================
|
||||||
|
|
||||||
|
La documentation du projet est sur le [Wiki du repo](https://github.com/mitsukarenai/Projet-Autoblog/wiki).
|
||||||
|
|
||||||
|
Accès hors ligne : `git clone https://github.com/mitsukarenai/Projet-Autoblog.wiki.git`
|
||||||
|
|
||||||
|
Licence
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Domaine public.
|
||||||
|
|
||||||
|
Changelog
|
||||||
|
=====================
|
||||||
|
- 2014-02-12 MILESTONE 0.3.2
|
||||||
|
- separate type icons
|
||||||
|
- cache added
|
||||||
|
- pagination fixes
|
||||||
|
- SVG fixes
|
||||||
|
- fix date() warnings
|
||||||
|
- bugfixes
|
||||||
|
- 2013-10-14 MILESTONE 0.3.1
|
||||||
|
- code semantics
|
||||||
|
- "docs" filesize
|
||||||
|
- robots.txt
|
||||||
|
- bugfixes
|
||||||
|
- 2013-07-30
|
||||||
|
- twitter2feed.php fixed (regex on class "avatar"; ```<fullname>```)
|
||||||
|
- 2013-07-22 MILESTONE 0.3
|
||||||
|
|
|
@ -41,7 +41,7 @@ if (!defined('MEDIA_DIR')) define('MEDIA_DIR', ROOT_DIR . '/media');
|
||||||
if (!defined('LOCAL_URL'))
|
if (!defined('LOCAL_URL'))
|
||||||
{
|
{
|
||||||
// Automagic URL discover
|
// Automagic URL discover
|
||||||
define('LOCAL_URL', 'http' . (!empty($_SERVER['HTTPS']) ? 's' : '')."://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}");
|
define('LOCAL_URL', 'http' . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '')."://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('LOCAL_URI'))
|
if (!defined('LOCAL_URI'))
|
||||||
|
@ -329,6 +329,11 @@ class VroumVroum_Blog
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function mustUpdateXsaf()
|
||||||
|
{
|
||||||
|
return file_exists('import.json');
|
||||||
|
}
|
||||||
|
|
||||||
protected function _getStreamContext()
|
protected function _getStreamContext()
|
||||||
{
|
{
|
||||||
return stream_context_create(
|
return stream_context_create(
|
||||||
|
@ -376,8 +381,11 @@ class VroumVroum_Blog
|
||||||
$date = isset($item->published) ? (string) $item->published : (string) $item->updated;
|
$date = isset($item->published) ? (string) $item->published : (string) $item->updated;
|
||||||
$guid = !empty($item->id) ? (string)$item->id : (string)$item->link['href'];
|
$guid = !empty($item->id) ? (string)$item->id : (string)$item->link['href'];
|
||||||
|
|
||||||
|
if( count($item->content->children()) > 0 ) $content = (string)$item->content->asXML();
|
||||||
|
else $content = (string)$item->content;
|
||||||
|
|
||||||
$id = $this->insertOrUpdateArticle($guid, (string)$item->title,
|
$id = $this->insertOrUpdateArticle($guid, (string)$item->title,
|
||||||
(string)$item->link['href'], strtotime($date), (string)$item->content);
|
(string)$item->link['href'], strtotime($date), $content );
|
||||||
|
|
||||||
if ($id !== false)
|
if ($id !== false)
|
||||||
$updated++;
|
$updated++;
|
||||||
|
@ -426,6 +434,34 @@ class VroumVroum_Blog
|
||||||
return $updated;
|
return $updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateXsaf() {
|
||||||
|
if($this->mustUpdateXsaf()) {
|
||||||
|
$json = json_decode(file_get_contents('import.json'), true);
|
||||||
|
$count = count($json['files']);
|
||||||
|
file_put_contents('import.lock', $count); /* one-process locking */
|
||||||
|
$remoteurl = $json['url'];
|
||||||
|
if (!file_exists('media')) {
|
||||||
|
mkdir('media');
|
||||||
|
}
|
||||||
|
$time = time();
|
||||||
|
$maxtime = $time + 3; /* max exec time: 3 seconds */
|
||||||
|
|
||||||
|
while ($time <= $maxtime) {
|
||||||
|
$file = array_shift($json['files']); /* get first element while unstacking */
|
||||||
|
if(!empty($file)) {
|
||||||
|
$this->_copy($remoteurl.$file, "media/$file");
|
||||||
|
file_put_contents('import.json', json_encode($json));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unlink('import.json');
|
||||||
|
break;
|
||||||
|
} /* first element empty: import finished */
|
||||||
|
$time = time();
|
||||||
|
}
|
||||||
|
unlink('import.lock');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function listArticlesByPage($page = 1)
|
public function listArticlesByPage($page = 1)
|
||||||
{
|
{
|
||||||
$nb = $this->config->articles_per_page;
|
$nb = $this->config->articles_per_page;
|
||||||
|
@ -467,6 +503,7 @@ class VroumVroum_Blog
|
||||||
$res = $this->articles->query('SELECT id, uri, title, content
|
$res = $this->articles->query('SELECT id, uri, title, content
|
||||||
FROM articles
|
FROM articles
|
||||||
WHERE content LIKE \'%'.$this->articles->escapeString($query).'%\'
|
WHERE content LIKE \'%'.$this->articles->escapeString($query).'%\'
|
||||||
|
OR title LIKE \'%'.$this->articles->escapeString($query).'%\'
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
LIMIT 0,100;');
|
LIMIT 0,100;');
|
||||||
|
|
||||||
|
@ -538,6 +575,13 @@ class VroumVroum_Blog
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getXsafCounter() {
|
||||||
|
if($this->mustUpdateXsaf()) {
|
||||||
|
$json = json_decode(file_get_contents('import.json'), true);
|
||||||
|
return count($json['files']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* copy() is buggy with http streams and safe_mode enabled (which is bad), so here's a workaround */
|
/* copy() is buggy with http streams and safe_mode enabled (which is bad), so here's a workaround */
|
||||||
protected function _copy($from, $to)
|
protected function _copy($from, $to)
|
||||||
{
|
{
|
||||||
|
@ -583,7 +627,7 @@ if (isset($_GET['feed'])) // FEED
|
||||||
<updated>'.date(DATE_ATOM, $art['date']).'</updated>
|
<updated>'.date(DATE_ATOM, $art['date']).'</updated>
|
||||||
|
|
||||||
<content type="html">
|
<content type="html">
|
||||||
<![CDATA[(<a href="'.escape($art['feed_id']).'">source</a>)<br />'.escape_content($art['content']).']]>
|
<![CDATA[(<a href="'.escape($art['url']).'">source</a>)<br />'.escape_content($art['content']).']]>
|
||||||
</content>
|
</content>
|
||||||
</entry>';
|
</entry>';
|
||||||
}
|
}
|
||||||
|
@ -649,6 +693,7 @@ if (!$search && !empty($_SERVER['QUERY_STRING']) && !is_numeric($_SERVER['QUERY_
|
||||||
}
|
}
|
||||||
|
|
||||||
// common CSS
|
// common CSS
|
||||||
|
<<<<<<< HEAD
|
||||||
$css=' * { margin: 0; padding: 0; }
|
$css=' * { margin: 0; padding: 0; }
|
||||||
body { font-family:sans-serif; background-color: #efefef; padding: 1%; color: #333; }
|
body { font-family:sans-serif; background-color: #efefef; padding: 1%; color: #333; }
|
||||||
img { max-width: 100%; height: auto; }
|
img { max-width: 100%; height: auto; }
|
||||||
|
@ -676,48 +721,108 @@ $css=' * { margin: 0; padding: 0; }
|
||||||
.content h2 { font-size: 1.4em;color:#000; }
|
.content h2 { font-size: 1.4em;color:#000; }
|
||||||
.result h3 a { color: darkblue; text-decoration: none; text-shadow: 1px 1px 1px #fff; }
|
.result h3 a { color: darkblue; text-decoration: none; text-shadow: 1px 1px 1px #fff; }
|
||||||
#error { position: fixed; top: 0; left: 0; right: 0; padding: 1%; background: #fff; border-bottom: 2px solid red; color: darkred; }
|
#error { position: fixed; top: 0; left: 0; right: 0; padding: 1%; background: #fff; border-bottom: 2px solid red; color: darkred; }
|
||||||
|
||||||| merged common ancestors
|
||||||
|
$css=' * { margin: 0; padding: 0; }
|
||||||
|
body { font-family:sans-serif; background-color: #efefef; padding: 1%; color: #333; }
|
||||||
|
img { max-width: 100%; height: auto; }
|
||||||
|
a { text-decoration: none; color: #000;font-weight:bold; }
|
||||||
|
.header a { text-decoration: none; color: #000;font-weight:bold; }
|
||||||
|
.header { text-align:center; padding: 30px 3%; max-width:70em;margin:0 auto; }
|
||||||
|
.article .title { margin-bottom: 1em; }
|
||||||
|
.article .title h2 a:hover { color:#403976; }
|
||||||
|
.article h4 { font-weight: normal; font-size: small; color: #666; }
|
||||||
|
.article .source a { color: #666; }
|
||||||
|
.searchForm { float:right; }
|
||||||
|
.searchForm input { }
|
||||||
|
.pagination { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; }
|
||||||
|
.pagination b { font-size: 1.2em; color: #333; }
|
||||||
|
.pagination a { color:#000; margin: 0 0.5em; }
|
||||||
|
.pagination a:hover { color:#333; }
|
||||||
|
.footer a { color:#000; }
|
||||||
|
.footer a:hover { color:#333; }
|
||||||
|
.content ul, .content ol { margin-left: 2em; }
|
||||||
|
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6,
|
||||||
|
.content ul, .content ol, .content p, .content object, .content div, .content blockquote,
|
||||||
|
.content dl, .content pre { margin-bottom: 0.8em; }
|
||||||
|
.content pre, .content blockquote { background: #ddd; border: 1px solid #999; padding: 0.2em; max-width: 100%; overflow: auto; }
|
||||||
|
.content h1 { font-size: 1.5em; }
|
||||||
|
.content h2 { font-size: 1.4em;color:#000; }
|
||||||
|
.result h3 a { color: darkblue; text-decoration: none; text-shadow: 1px 1px 1px #fff; }
|
||||||
|
#error { position: fixed; top: 0; left: 0; right: 0; padding: 1%; background: #fff; border-bottom: 2px solid red; color: darkred; }
|
||||||
|
=======
|
||||||
|
$css='* { margin: 0; padding: 0; }
|
||||||
|
body { font-family:sans-serif; background-color: #efefef; padding: 1%; color: #333; }
|
||||||
|
img { max-width: 100%; height: auto; }
|
||||||
|
a { text-decoration: none; color: #000;font-weight:bold; }
|
||||||
|
body > header a { text-decoration: none; color: #000;font-weight:bold; }
|
||||||
|
body > header { text-align:center; padding: 30px 3%; max-width:70em;margin:0 auto; }
|
||||||
|
body > article > header { margin-bottom: 1em; }
|
||||||
|
body > article > header h2 a:hover { color:#403976; }
|
||||||
|
body > article h4 { font-weight: normal; font-size: small; color: #666; }
|
||||||
|
body > article .source a { color: #666; }
|
||||||
|
body > header > form { float:right; }
|
||||||
|
body > header > form input { }
|
||||||
|
body > nav { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; }
|
||||||
|
body > nav strong { font-size: 1.2em; color: #333; }
|
||||||
|
body > nav a { color:#000; margin: 0 0.5em; }
|
||||||
|
body > nav a:hover { color:#333; }
|
||||||
|
body > footer a { color:#000; }
|
||||||
|
body > footer a:hover { color:#333; }
|
||||||
|
.content ul, .content ol { margin-left: 2em; }
|
||||||
|
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6,
|
||||||
|
.content ul, .content ol, .content p, .content object, .content div, .content blockquote,
|
||||||
|
.content dl, .content pre { margin-bottom: 0.8em; }
|
||||||
|
.content pre, .content blockquote { background: #ddd; border: 1px solid #999; padding: 0.2em; max-width: 100%; overflow: auto; }
|
||||||
|
.content h1 { font-size: 1.5em; }
|
||||||
|
.content h2 { font-size: 1.4em;color:#000; }
|
||||||
|
.result h3 a { color: darkblue; text-decoration: none; text-shadow: 1px 1px 1px #fff; }
|
||||||
|
#error { position: fixed; top: 0; left: 0; right: 0; padding: 1%; background: #fff; border-bottom: 2px solid red; color: darkred; }
|
||||||
|
>>>>>>> master
|
||||||
';
|
';
|
||||||
|
|
||||||
if($site_type == 'generic') // custom CSS for generic
|
switch($site_type) {
|
||||||
{
|
case 'microblog':
|
||||||
$css = $css.'.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px;text-transform:uppercase; }
|
case 'twitter':
|
||||||
.article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; }
|
$css .= "\n".' /* twitter/microblog style */
|
||||||
.article .title h2 a { color:#000; text-decoration:none; }
|
body > header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; }
|
||||||
.article .source { font-size: 0.8em; color: #666; }
|
body > article > header h2 { width: 10em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-size: 0.7em;margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; }
|
||||||
.article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; }
|
body > article > header h2 a { color:#333; text-decoration:none; }
|
||||||
.footer { text-align:center; font-size: small; color:#333; clear: both; }';
|
body > article { background-color:white;padding: 12px 10px 33px;border:1px solid #aaa;max-width:70em;margin:0 auto;box-shadow:0px 5px 7px #aaa; }
|
||||||
}
|
body > article .source { font-size: 0.8em; color: #666; }
|
||||||
else if($site_type == 'microblog' || $site_type == 'twitter' || $site_type == 'identica') // custom CSS for microblog
|
body > footer { margin-top:1em;text-align:center; font-size: small; color:#333; clear: both; }
|
||||||
{
|
|
||||||
$css = $css.'.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; }
|
|
||||||
.article .title h2 { width: 10em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-size: 0.7em;margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; }
|
|
||||||
.article .title h2 a { color:#333; text-decoration:none; }
|
|
||||||
.article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:0 auto;box-shadow:0px 5px 7px #aaa; }
|
|
||||||
.article .source { font-size: 0.8em; color: #666; }
|
|
||||||
.footer { margin-top:1em;text-align:center; font-size: small; color:#333; clear: both; }
|
|
||||||
.content {font-size:0.9em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}';
|
.content {font-size:0.9em;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}';
|
||||||
|
break;
|
||||||
|
case 'shaarli':
|
||||||
|
$css .= "\n".' /* shaarli style */
|
||||||
|
body > header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; }
|
||||||
|
body > article > header title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; }
|
||||||
|
body > article > header h2 a { color:#000; text-decoration:none; }
|
||||||
|
body > article { background-color:white;padding: 12px 10px 33px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; }
|
||||||
|
body > article footer.source { margin-top:1em;font-size: 0.8em; color: #666; }
|
||||||
|
body > footer { text-align:center; font-size: small; color:#333; clear: both; }';
|
||||||
|
break;
|
||||||
|
case 'generic':
|
||||||
|
case 'youtube':
|
||||||
|
default:
|
||||||
|
$css .= "\n".' /* youtube style */
|
||||||
|
body > header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px;text-transform:uppercase; }
|
||||||
|
body > article > header h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; }
|
||||||
|
body > article > header h2 a { color:#000; text-decoration:none; }
|
||||||
|
body > article footer.source { font-size: 0.8em; color: #666; }
|
||||||
|
body > article { background-color:white;padding: 12px 10px 33px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; }
|
||||||
|
body > footer { text-align:center; font-size: small; color:#333; clear: both; }';
|
||||||
}
|
}
|
||||||
else if($site_type == 'shaarli') // custom CSS for shaarli
|
|
||||||
{
|
|
||||||
$css = $css.'.header h1 a { color: #333;font-size:40pt;text-shadow: #ccc 0px 5px 5px; }
|
|
||||||
.article .title h2 { margin: 0; color:#333; text-shadow: 1px 1px 1px #fff; }
|
|
||||||
.article .title h2 a { color:#000; text-decoration:none; }
|
|
||||||
.article { background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;box-shadow:0px 5px 7px #aaa; }
|
|
||||||
.article .source { margin-top:1em;font-size: 0.8em; color: #666; }
|
|
||||||
.footer { text-align:center; font-size: small; color:#333; clear: both; }';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// HTML HEADER
|
// HTML HEADER
|
||||||
echo '
|
echo '<!DOCTYPE html>
|
||||||
<!DOCTYPE html>
|
<html lang="fr" dir="ltr">
|
||||||
<html lang="en" dir="ltr">
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="utf-8" />
|
||||||
<title>'.escape($config->site_title).'</title>
|
<title>'.escape($config->site_title).'</title>
|
||||||
<link rel="canonical" href="'.escape($config->site_url).'">
|
<link rel="canonical" href="'.escape($config->site_url).'">
|
||||||
<link rel="alternate" type="application/atom+xml" title="'.__('ATOM Feed').'" href="?feed">
|
<link rel="alternate" type="application/atom+xml" title="'.__('ATOM Feed').'" href="?feed">
|
||||||
<style type="text/css" media="screen,projection">
|
<style type="text/css" media="screen,projection">
|
||||||
|
<<<<<<< HEAD
|
||||||
'.$css.'
|
'.$css.'
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@ -731,48 +836,93 @@ if (!empty($config->site_description)){
|
||||||
echo '<p>'.$config->site_description.'<br><a href="../../">⇐ retour index</a></p>';
|
echo '<p>'.$config->site_description.'<br><a href="../../">⇐ retour index</a></p>';
|
||||||
}
|
}
|
||||||
echo '<p class="pagination">'.$config->site_meta_description.'<br></p>';
|
echo '<p class="pagination">'.$config->site_meta_description.'<br></p>';
|
||||||
|
||||||| merged common ancestors
|
||||||
|
'.$css.'
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="header">
|
||||||
|
<h1><a href="../../" style="font-size:0.8em;">PROJET AUTOBLOG'. (strlen(HEAD_TITLE) > 0 ? ' ~ '. HEAD_TITLE : '') .'</a></h1>
|
||||||
|
<hr>
|
||||||
|
<h1><a href="./">'.escape($config->site_title).'</a></h1>';
|
||||||
|
|
||||||
|
if (!empty($config->site_description))
|
||||||
|
echo '<p>'.$config->site_description.'<br><a href="../../">⇐ retour index</a></p>';
|
||||||
|
|
||||||
|
=======
|
||||||
|
'.$css.'
|
||||||
|
</style>';
|
||||||
|
if( $vvb->mustUpdateXsaf()) {
|
||||||
|
echo ' <meta http-equiv="Refresh" content="1">';
|
||||||
|
}
|
||||||
echo '
|
echo '
|
||||||
<form method="get" action="'.escape(LOCAL_URL).'" class="searchForm">
|
</head>
|
||||||
<div>
|
<body>
|
||||||
<input type="text" name="q" value="'.escape($search).'">
|
<header>
|
||||||
<input type="submit" value="'.__('Search').'">
|
<h1><a href="../../" style="font-size:0.8em;">PROJET AUTOBLOG'. (strlen(HEAD_TITLE) > 0 ? ' ~ '. HEAD_TITLE : '') .'</a></h1>
|
||||||
</div>
|
<hr />
|
||||||
|
<h1><a href="./">'.escape($config->site_title).'</a></h1>';
|
||||||
|
|
||||||
|
if (!empty($config->site_description))
|
||||||
|
echo '
|
||||||
|
<p>'.$config->site_description.'</p>
|
||||||
|
<p><a href="../../">⇐ retour index</a></p>';
|
||||||
|
|
||||||
|
>>>>>>> master
|
||||||
|
echo '
|
||||||
|
<form method="get" action="'.escape(LOCAL_URL).'">
|
||||||
|
<input type="search" name="q" value="'.escape($search).'" />
|
||||||
|
<input type="submit" value="'.__('Search').'" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</header>
|
||||||
';
|
';
|
||||||
|
|
||||||
if ($vvb->mustUpdate())
|
if( $vvb->mustUpdateXsaf()) {
|
||||||
|
echo '
|
||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
<h2>'.__('Update').'</h2>
|
||||||
|
</header>
|
||||||
|
<div class="content" id="update">
|
||||||
|
'.__('Import running: '). $vvb->getXsafCounter() . __(' files remaining').'<br>
|
||||||
|
'.__('The page should refresh every second. If not, <a href="javascript:window.location.reload()">refresh manually</a>.').'
|
||||||
|
</div>
|
||||||
|
</article>';
|
||||||
|
}
|
||||||
|
elseif ($vvb->mustUpdate())
|
||||||
{
|
{
|
||||||
echo '
|
echo '
|
||||||
<div class="article">
|
<article>
|
||||||
<div class="title">
|
<header>
|
||||||
<h2>'.__('Update').'</h2>
|
<h2>'.__('Update').'</h2>
|
||||||
</div>
|
</header>
|
||||||
<div class="content" id="update">
|
<div class="content" id="update">
|
||||||
'.__('Updating database... Please wait.').'
|
'.__('Updating database... Please wait.').'
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
</article>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($search))
|
if (!empty($search))
|
||||||
{
|
{
|
||||||
$results = $vvb->searchArticles($search);
|
$results = $vvb->searchArticles($search);
|
||||||
$text = sprintf(__('<b>%d</b> results for <i>%s</i>'), count($results), escape($search));
|
$text = sprintf(__('<strong>%d</strong> results for <em>%s</em>'), count($results), escape($search));
|
||||||
echo '
|
echo '
|
||||||
<div class="article">
|
<article id="results">
|
||||||
<div class="title">
|
<header>
|
||||||
<h2>'.__('Search').'</h2>
|
<h2>'.__('Search').'</h2>
|
||||||
'.$text.'
|
'.$text.'
|
||||||
</div>
|
</header>
|
||||||
</div>';
|
<article>';
|
||||||
|
|
||||||
foreach ($results as $art)
|
foreach ($results as $art)
|
||||||
{
|
{
|
||||||
echo '
|
echo '
|
||||||
<div class="article result">
|
<article class="result">
|
||||||
|
<header>
|
||||||
<h3><a href="./?'.escape($art['uri']).'">'.escape($art['title']).'</a></h3>
|
<h3><a href="./?'.escape($art['uri']).'">'.escape($art['title']).'</a></h3>
|
||||||
|
</header>
|
||||||
<p>'.$art['content'].'</p>
|
<p>'.$art['content'].'</p>
|
||||||
</div>';
|
</article>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (!is_null($article))
|
elseif (!is_null($article))
|
||||||
|
@ -780,13 +930,13 @@ elseif (!is_null($article))
|
||||||
if (!$article)
|
if (!$article)
|
||||||
{
|
{
|
||||||
echo '
|
echo '
|
||||||
<div class="article">
|
<article>
|
||||||
<div class="title">
|
<header>
|
||||||
<h2>'.__('Not Found').'</h2>
|
<h2>'.__('Not Found').'</h2>
|
||||||
'.(!empty($uri) ? '<p><tt>'.escape($vvb->getLocalURL($uri)) . '</tt></p>' : '').'
|
'.(!empty($uri) ? '<p><tt>'.escape($vvb->getLocalURL($uri)) . '</tt></p>' : '').'
|
||||||
'.__('Article not found.').'
|
'.__('Article not found.').'
|
||||||
</div>
|
</header>
|
||||||
</div>';
|
</article>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -808,35 +958,54 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$max = $vvb->countArticles();
|
$max = $vvb->countArticles();
|
||||||
if ($max > $config->articles_per_page)
|
if ($max > $config->articles_per_page) {
|
||||||
{
|
echo "\n".' <nav>'."\n";
|
||||||
echo '<div class="pagination">';
|
|
||||||
|
|
||||||
if ($page > 1)
|
if ($page > 1)
|
||||||
echo '<a href="'.$vvb->getLocalURL($page - 1).'">← '.__('Newer').'</a> ';
|
echo ' <a rel="prev" href="'.$vvb->getLocalURL($page - 1).'">← '.__('Newer').'</a>'."\n";
|
||||||
|
|
||||||
$last = ceil($max / $config->articles_per_page);
|
$last = ceil($max / $config->articles_per_page);
|
||||||
for ($i = 1; $i <= $last; $i++)
|
for ($i = 1; $i <= $last; $i++) {
|
||||||
{
|
echo ' '.($i == $page ? '<strong>'.$i.'</strong>' : '<a href="'.$vvb->getLocalURL($i).'">'.$i.'</a>')."\n";
|
||||||
echo '<a href="'.$vvb->getLocalURL($i).'">'.($i == $page ? '<b>'.$i.'</b>' : $i).'</a> ';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($page < $last)
|
if ($page < $last)
|
||||||
echo '<a href="'.$vvb->getLocalURL($page + 1).'">'.__('Older').' →</a> ';
|
echo ' <a rel="next" href="'.$vvb->getLocalURL($page + 1).'">'.__('Older').' →</a>'."\n";
|
||||||
|
|
||||||
echo '</div>';
|
echo ' </nav>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
<div class="footer">
|
<footer>
|
||||||
<p>Propulsé par <a href="https://github.com/mitsukarenai/Projet-Autoblog">Projet Autoblog '.$vvbversion.'</a> - <a href="?feed">'.__('ATOM Feed').'</a></p>
|
<p>Propulsé par <a href="https://github.com/mitsukarenai/Projet-Autoblog">Projet Autoblog '.$vvbversion.'</a> - <a href="?feed">'.__('ATOM Feed').'</a></p>
|
||||||
<p>'.__('Download:').' <a href="./'.basename(CONFIG_FILE).'">'.__('configuration').'</a> (<a href="?opml">OPML</a>)
|
<p>'.__('Download:').' <a href="./'.basename(CONFIG_FILE).'">'.__('configuration').'</a> (<a href="?opml">OPML</a>)
|
||||||
- <a href="./'.basename(ARTICLES_DB_FILE).'">'.__('articles').'</a><p/>
|
— <a href="./'.basename(ARTICLES_DB_FILE).'">'.__('articles').'</a></p>
|
||||||
<p><a href="./?media">'.__('Media export').' <sup> JSON</sup></a></p>
|
<p><a href="./?media">'.__('Media export').' <sup> JSON</sup></a></p>
|
||||||
</div>';
|
</footer>';
|
||||||
|
|
||||||
if ($vvb->mustUpdate())
|
if( $vvb->mustUpdateXsaf() ) {
|
||||||
|
try {
|
||||||
|
ob_end_flush();
|
||||||
|
flush();
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
// Silent, not critical
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$updated = $vvb->updateXsaf();
|
||||||
|
}
|
||||||
|
catch (VroumVroum_Feed_Exception $e)
|
||||||
|
{
|
||||||
|
echo '
|
||||||
|
<div id="error">
|
||||||
|
'.escape($e->getMessage()).'
|
||||||
|
</div>';
|
||||||
|
$updated = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($vvb->mustUpdate())
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
|
@ -896,15 +1065,14 @@ function display_article($article)
|
||||||
{
|
{
|
||||||
global $vvb, $config;
|
global $vvb, $config;
|
||||||
echo '
|
echo '
|
||||||
<div class="article">
|
<article>
|
||||||
<div class="title">
|
<header>
|
||||||
<h2><a href="'.$vvb->getLocalURL($article).'">'.escape($article['title']).'</a></h2>
|
<h2><a href="'.$vvb->getLocalURL($article).'">'.escape($article['title']).'</a></h2>
|
||||||
'.strftime(__('_date_format'), $article['date']).'
|
'.strftime(__('_date_format'), $article['date']).'
|
||||||
</div>
|
</header>
|
||||||
<div class="content">'.escape_content($article['content']).'</div>
|
<div class="content">'.escape_content($article['content']).'</div>
|
||||||
<p class="source">'.__('Source:').' <a href="'.escape($article['url']).'">'.escape($article['url']).'</a></p>
|
<footer class="source"><p>'.__('Source:').' <a href="'.escape($article['url']).'">'.escape($article['url']).'</a></p></footer>
|
||||||
<br style="clear: both;" />
|
</article>';
|
||||||
</div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
46
config.php
|
@ -1,46 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* config.php - User configuration file
|
|
||||||
* ---
|
|
||||||
* If you uncomment a setting in this file, it will override default option
|
|
||||||
*
|
|
||||||
* See how to configure your Autoblog farm at
|
|
||||||
* https://github.com/mitsukarenai/Projet-Autoblog/wiki/Configuration
|
|
||||||
**/
|
|
||||||
|
|
||||||
// define( 'LOGO', 'icon-logo.svg' );
|
|
||||||
// define( 'HEAD_TITLE', '');
|
|
||||||
// define( 'FOOTER', 'D\'après les premières versions de <a href="http://sebsauvage.net">SebSauvage</a> et <a href="http://bohwaz.net/">Bohwaz</a>.');
|
|
||||||
|
|
||||||
define( 'ALLOW_FULL_UPDATE', TRUE );
|
|
||||||
define( 'ALLOW_CHECK_UPDATE', TRUE );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If you set ALLOW_NEW_AUTOBLOGS to FALSE, the following options do not matter.
|
|
||||||
**/
|
|
||||||
define( 'ALLOW_NEW_AUTOBLOGS', false );
|
|
||||||
// define( 'ALLOW_NEW_AUTOBLOGS_BY_LINKS', TRUE );
|
|
||||||
// define( 'ALLOW_NEW_AUTOBLOGS_BY_SOCIAL', TRUE );
|
|
||||||
// define( 'ALLOW_NEW_AUTOBLOGS_BY_BUTTON', TRUE );
|
|
||||||
// define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE', TRUE );
|
|
||||||
// define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK', TRUE );
|
|
||||||
// define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge
|
|
||||||
**/
|
|
||||||
// define( 'API_TWITTER', FALSE );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Import autoblogs from friend's autoblog farm - Add a link to the JSON export
|
|
||||||
**/
|
|
||||||
$friends_autoblog_farm = array(
|
|
||||||
'https://raw.github.com/mitsukarenai/xsaf-bootstrap/master/3.json',
|
|
||||||
'https://www.ecirtam.net/autoblogs/?export',
|
|
||||||
'https://autoblog.suumitsu.eu/?export',
|
|
||||||
'http://streisand.hoa.ro/?export'
|
|
||||||
);
|
|
||||||
|
|
||||||
$myOptions['enableThumbShot'] = true;
|
|
||||||
$myOptions['externalThumbSdhot'] = 'http://soshot.knah-tsaeb.org/?key=3400affe9919&s=m&url=';
|
|
||||||
?>
|
|
57
config.php.example
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* config.php.example - User configuration file
|
||||||
|
* ---
|
||||||
|
* 1. Rename this file to config.php.
|
||||||
|
* 2. Uncomment settings in this file, it will override default option
|
||||||
|
*
|
||||||
|
* See how to configure your Autoblog farm at
|
||||||
|
* https://github.com/mitsukarenai/Projet-Autoblog/wiki/Configuration
|
||||||
|
**/
|
||||||
|
|
||||||
|
// define( 'LOGO', 'icon-logo.svg' );
|
||||||
|
// define( 'HEAD_TITLE', '');
|
||||||
|
// define( 'FOOTER', 'D\'après les premières versions de <a href="http://sebsauvage.net">SebSauvage</a> et <a href="http://bohwaz.net/">Bohwaz</a>.');
|
||||||
|
|
||||||
|
// define( 'DOCS_CACHE_DURATION', 1800);
|
||||||
|
// define( 'AUTOBLOGS_CACHE_DURATION', 1800);
|
||||||
|
|
||||||
|
// define( 'ALLOW_FULL_UPDATE', TRUE );
|
||||||
|
// define( 'ALLOW_CHECK_UPDATE', TRUE );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If you set ALLOW_NEW_AUTOBLOGS to FALSE, the following options do not matter.
|
||||||
|
**/
|
||||||
|
// define( 'ALLOW_NEW_AUTOBLOGS', TRUE );
|
||||||
|
// define( 'ALLOW_NEW_AUTOBLOGS_BY_LINKS', TRUE );
|
||||||
|
// define( 'ALLOW_NEW_AUTOBLOGS_BY_SOCIAL', TRUE );
|
||||||
|
// define( 'ALLOW_NEW_AUTOBLOGS_BY_BUTTON', TRUE );
|
||||||
|
// define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE', TRUE );
|
||||||
|
// define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK', TRUE );
|
||||||
|
// define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TwitterBridge: https://github.com/mitsukarenai/twitterbridge
|
||||||
|
* twitter2feed : https://github.com/mitsukarenai/twitter2feed
|
||||||
|
* rss-bridge : https://github.com/sebsauvage/rss-bridge
|
||||||
|
* replace LOCAL with:
|
||||||
|
- the twitterbridge request URL (example: 'http://www.some.website/twitterbridge/?u=' )
|
||||||
|
- or the rss-bridge request URL (example: 'http://www.some.website/rss-bridge/?action=display&bridge=TwitterBridge&format=AtomFormat&u=' )
|
||||||
|
- or leave LOCAL to use the included twitter2feed.php.
|
||||||
|
* set to FALSE if you want to fully disable Twitter support
|
||||||
|
**/
|
||||||
|
// define( 'API_TWITTER', 'LOCAL' );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Import autoblogs from friend's autoblog farm - Add a link to the JSON export
|
||||||
|
**/
|
||||||
|
$friends_autoblog_farm = array(
|
||||||
|
'https://raw.github.com/mitsukarenai/xsaf-bootstrap/master/3.json',
|
||||||
|
// 'https://www.ecirtam.net/autoblogs/?export',
|
||||||
|
// 'http://autoblog.suumitsu.eu/?export',
|
||||||
|
// 'http://streisand.hoa.ro/?export',
|
||||||
|
);
|
||||||
|
|
||||||
|
$myOptions['enableThumbShot'] = true;
|
||||||
|
$myOptions['externalThumbSdhot'] = 'http://soshot.knah-tsaeb.org/?key=apikey&s=m&url=';
|
||||||
|
?>
|
|
@ -16,6 +16,9 @@ if (!defined('FOLDER_MAX_LENGTH')) define('FOLDER_MAX_LENGTH', 80);
|
||||||
date_default_timezone_set('Europe/Paris');
|
date_default_timezone_set('Europe/Paris');
|
||||||
setlocale(LC_TIME, 'fr_FR.UTF-8', 'fr_FR', 'fr');
|
setlocale(LC_TIME, 'fr_FR.UTF-8', 'fr_FR', 'fr');
|
||||||
|
|
||||||
|
if( !defined('DOCS_CACHE_DURATION')) define( 'DOCS_CACHE_DURATION', 1800 );
|
||||||
|
if( !defined('AUTOBLOGS_CACHE_DURATION')) define( 'AUTOBLOGS_CACHE_DURATION', 1800 );
|
||||||
|
|
||||||
if( !defined('ALLOW_FULL_UPDATE')) define( 'ALLOW_FULL_UPDATE', TRUE );
|
if( !defined('ALLOW_FULL_UPDATE')) define( 'ALLOW_FULL_UPDATE', TRUE );
|
||||||
if( !defined('ALLOW_CHECK_UPDATE')) define( 'ALLOW_CHECK_UPDATE', TRUE );
|
if( !defined('ALLOW_CHECK_UPDATE')) define( 'ALLOW_CHECK_UPDATE', TRUE );
|
||||||
|
|
||||||
|
@ -29,7 +32,7 @@ if( !defined('ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK')) define( 'ALLOW_NEW_AUTOBLOGS_B
|
||||||
if( !defined('ALLOW_NEW_AUTOBLOGS_BY_XSAF')) define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE );
|
if( !defined('ALLOW_NEW_AUTOBLOGS_BY_XSAF')) define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE );
|
||||||
|
|
||||||
// More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge
|
// More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge
|
||||||
if( !defined('API_TWITTER')) define( 'API_TWITTER', FALSE );
|
if( !defined('API_TWITTER')) define( 'API_TWITTER', 'LOCAL' );
|
||||||
|
|
||||||
if( !defined('LOGO')) define( 'LOGO', 'icon-logo.svg' );
|
if( !defined('LOGO')) define( 'LOGO', 'icon-logo.svg' );
|
||||||
if( !defined('HEAD_TITLE')) define( 'HEAD_TITLE', '');
|
if( !defined('HEAD_TITLE')) define( 'HEAD_TITLE', '');
|
||||||
|
@ -158,8 +161,12 @@ function getArticlesPerPage( $type ) {
|
||||||
switch( $type ) {
|
switch( $type ) {
|
||||||
case 'microblog':
|
case 'microblog':
|
||||||
return 20;
|
return 20;
|
||||||
|
case 'twitter':
|
||||||
|
return 20;
|
||||||
case 'shaarli':
|
case 'shaarli':
|
||||||
return 20;
|
return 20;
|
||||||
|
case 'youtube':
|
||||||
|
return 10;
|
||||||
default:
|
default:
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
@ -169,6 +176,8 @@ function getInterval( $type ) {
|
||||||
switch( $type ) {
|
switch( $type ) {
|
||||||
case 'microblog':
|
case 'microblog':
|
||||||
return 300;
|
return 300;
|
||||||
|
case 'twitter':
|
||||||
|
return 300;
|
||||||
case 'shaarli':
|
case 'shaarli':
|
||||||
return 1800;
|
return 1800;
|
||||||
default:
|
default:
|
||||||
|
@ -178,10 +187,6 @@ function getInterval( $type ) {
|
||||||
|
|
||||||
function getTimeout( $type ) {
|
function getTimeout( $type ) {
|
||||||
switch( $type ) {
|
switch( $type ) {
|
||||||
case 'microblog':
|
|
||||||
return 30;
|
|
||||||
case 'shaarli':
|
|
||||||
return 30;
|
|
||||||
default:
|
default:
|
||||||
return 30;
|
return 30;
|
||||||
}
|
}
|
||||||
|
@ -191,12 +196,12 @@ function updateType($siteurl) {
|
||||||
if( strpos($siteurl, 'twitter.com') !== FALSE ) {
|
if( strpos($siteurl, 'twitter.com') !== FALSE ) {
|
||||||
return array('type' => 'twitter', 'name' => 'twitter');
|
return array('type' => 'twitter', 'name' => 'twitter');
|
||||||
}
|
}
|
||||||
elseif ( strpos( $siteurl, 'identi.ca') !== FALSE ) {
|
|
||||||
return array('type' => 'identica', 'name' => 'identica');
|
|
||||||
}
|
|
||||||
elseif( strpos( $siteurl, 'shaarli' ) !== FALSE ) {
|
elseif( strpos( $siteurl, 'shaarli' ) !== FALSE ) {
|
||||||
return array('type' => 'shaarli', 'name' => 'shaarli');
|
return array('type' => 'shaarli', 'name' => 'shaarli');
|
||||||
}
|
}
|
||||||
|
elseif( strpos( $siteurl, 'youtube.com' ) !== FALSE ) {
|
||||||
|
return array('type' => 'youtube', 'name' => '');
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return array('type' => 'generic', 'name' => '');
|
return array('type' => 'generic', 'name' => '');
|
||||||
}
|
}
|
||||||
|
@ -256,11 +261,14 @@ function __($str)
|
||||||
return 'Source :';
|
return 'Source :';
|
||||||
case '_date_format':
|
case '_date_format':
|
||||||
return '%A %e %B %Y à %H:%M';
|
return '%A %e %B %Y à %H:%M';
|
||||||
case 'configuration':
|
|
||||||
case 'articles':
|
|
||||||
return $str;
|
|
||||||
case 'Media export':
|
case 'Media export':
|
||||||
return 'Export fichiers media';
|
return 'Export fichiers media';
|
||||||
|
case 'Import running: ':
|
||||||
|
return 'Import en cours : ';
|
||||||
|
case ' files remaining':
|
||||||
|
return ' fichiers restants';
|
||||||
|
case 'The page should refresh every second. If not, <a href="javascript:window.location.reload()">refresh manually</a>.':
|
||||||
|
return 'La page devrait se rafraîchir toutes les secondes. Si non, <a href="javascript:window.location.reload()">rafraîchissez là manuellement.</a>.';
|
||||||
default:
|
default:
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
@ -278,6 +286,7 @@ $json[] = array(
|
||||||
'status'=>$status,
|
'status'=>$status,
|
||||||
'response_code'=>$response_code
|
'response_code'=>$response_code
|
||||||
);
|
);
|
||||||
|
$json = array_slice($json, -50, 50);
|
||||||
if(file_put_contents(RESOURCES_FOLDER.'rss.json', json_encode($json), LOCK_EX) === FALSE)
|
if(file_put_contents(RESOURCES_FOLDER.'rss.json', json_encode($json), LOCK_EX) === FALSE)
|
||||||
{ return FALSE; }
|
{ return FALSE; }
|
||||||
else { return TRUE; }
|
else { return TRUE; }
|
||||||
|
@ -287,34 +296,39 @@ function displayXMLstatus($status, $response_code, $autoblog_url, $autoblog_titl
|
||||||
switch ($status)
|
switch ($status)
|
||||||
{
|
{
|
||||||
case 'unavailable':
|
case 'unavailable':
|
||||||
return 'Autoblog "'.$autoblog_title.'": site distant inaccessible (code '.$response_code.')<br>Autoblog: <a href="'. serverUrl(false).AUTOBLOGS_FOLDER.$autoblog_url.'">'.$autoblog_title.'</a><br>Site: <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS: <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
return 'Autoblog "'.$autoblog_title.'" : site distant inaccessible (code '.$response_code.')<br>Autoblog : <a href="'. serverUrl(true).$autoblog_url.'">'.$autoblog_title.'</a><br>Site : <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS : <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
||||||
case 'moved':
|
case 'moved':
|
||||||
return 'Autoblog "'.$autoblog_title.'": site distant redirigé (code '.$response_code.')<br>Autoblog: <a href="'. serverUrl(false).AUTOBLOGS_FOLDER.$autoblog_url.'">'.$autoblog_title.'</a><br>Site: <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS: <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
return 'Autoblog "'.$autoblog_title.'" : site distant redirigé (code '.$response_code.')<br>Autoblog : <a href="'. serverUrl(true).$autoblog_url.'">'.$autoblog_title.'</a><br>Site : <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS : <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
||||||
case 'not_found':
|
case 'not_found':
|
||||||
return 'Autoblog "'.$autoblog_title.'": site distant introuvable (code '.$response_code.')<br>Autoblog: <a href="'. serverUrl(false).AUTOBLOGS_FOLDER.$autoblog_url.'">'.$autoblog_title.'</a><br>Site: <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS: <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
return 'Autoblog "'.$autoblog_title.'" : site distant introuvable (code '.$response_code.')<br>Autoblog : <a href="'. serverUrl(true).$autoblog_url.'">'.$autoblog_title.'</a><br>Site : <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS : <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
||||||
case 'remote_error':
|
case 'remote_error':
|
||||||
return 'Autoblog "'.$autoblog_title.'": site distant a problème serveur (code '.$response_code.')<br>Autoblog: <a href="'. serverUrl(false).AUTOBLOGS_FOLDER.$autoblog_url.'">'.$autoblog_title.'</a><br>Site: <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS: <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
return 'Autoblog "'.$autoblog_title.'" : site distant a problème serveur (code '.$response_code.')<br>Autoblog : <a href="'. serverUrl(true).$autoblog_url.'">'.$autoblog_title.'</a><br>Site : <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS : <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
||||||
case 'available':
|
case 'available':
|
||||||
return 'Autoblog "'.$autoblog_title.'": site distant à nouveau opérationnel (code '.$response_code.')<br>Autoblog: <a href="'. serverUrl(false).AUTOBLOGS_FOLDER.$autoblog_url.'">'.$autoblog_title.'</a><br>Site: <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS: <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
return 'Autoblog "'.$autoblog_title.'" : site distant à nouveau accessible (code '.$response_code.')<br>Autoblog : <a href="'. serverUrl(true).$autoblog_url.'">'.$autoblog_title.'</a><br>Site : <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS : <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
||||||
case 'new_autoblog_added':
|
case 'new_autoblog_added':
|
||||||
return 'Autoblog "'.$autoblog_title.'" ajouté (code '.$response_code.')<br>Autoblog: <a href="'. serverUrl(false).AUTOBLOGS_FOLDER.$autoblog_url.'">'.$autoblog_title.'</a><br>Site: <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS: <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
return 'Autoblog "'.$autoblog_title.'" ajouté.<br>Autoblog : <a href="'. serverUrl(true).$autoblog_url.'">'.$autoblog_title.'</a><br>Site : <a href="'. $autoblog_sourceurl .'">'. $autoblog_sourceurl .'</a><br>RSS : <a href="'.$autoblog_sourcefeed.'">'.$autoblog_sourcefeed.'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayXML() {
|
function displayXML() {
|
||||||
header('Content-type: application/rss+xml; charset=utf-8');
|
header('Content-type: application/rss+xml; charset=utf-8');
|
||||||
echo '<?xml version="1.0" encoding="UTF-8" ?>
|
echo '<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><link>'.serverUrl(true).'</link>';
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><link>'.serverUrl(true).'</link>';
|
||||||
echo '<atom:link href="'.serverUrl(false) . '/?rss" rel="self" type="application/rss+xml"/><title>Projet Autoblog'. ((strlen(HEAD_TITLE)>0) ? ' | '. HEAD_TITLE : '').'</title><description>'.serverUrl(true),"Projet Autoblog - RSS : Ajouts et changements de disponibilité.".'</description>';
|
echo '<atom:link href="'.serverUrl(true) . '/?rss" rel="self" type="application/rss+xml"/><title>Projet Autoblog'. ((strlen(HEAD_TITLE)>0) ? ' | '. HEAD_TITLE : '').'</title><description>Projet Autoblog - RSS : Ajouts et changements de disponibilité.</description>';
|
||||||
if(file_exists(RESOURCES_FOLDER.'rss.json'))
|
if(file_exists(RESOURCES_FOLDER.'rss.json'))
|
||||||
{
|
{
|
||||||
$json = json_decode(file_get_contents(RESOURCES_FOLDER.'rss.json'), true);
|
$json = json_decode(file_get_contents(RESOURCES_FOLDER.'rss.json'), true);
|
||||||
rsort($json);
|
rsort($json);
|
||||||
foreach ($json as $item)
|
foreach ($json as $uitem)
|
||||||
{
|
{
|
||||||
|
$item = array();
|
||||||
|
foreach($uitem AS $Key => $Value) {
|
||||||
|
$item[$Key] = escape($Value);
|
||||||
|
}
|
||||||
|
|
||||||
$description = displayXMLstatus($item['status'],$item['response_code'],$item['autoblog_url'],$item['autoblog_title'],$item['autoblog_sourceurl'],$item['autoblog_sourcefeed']);
|
$description = displayXMLstatus($item['status'],$item['response_code'],$item['autoblog_url'],$item['autoblog_title'],$item['autoblog_sourceurl'],$item['autoblog_sourcefeed']);
|
||||||
$link = serverUrl(true).AUTOBLOGS_FOLDER.$item['autoblog_url'];
|
$link = serverUrl(true).$item['autoblog_url'];
|
||||||
$date = date("r", $item['timestamp']);
|
$date = date(DATE_RSS, $item['timestamp']);
|
||||||
print <<<EOT
|
print <<<EOT
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
|
@ -322,7 +336,7 @@ if(file_exists(RESOURCES_FOLDER.'rss.json'))
|
||||||
<description><![CDATA[{$description}]]></description>
|
<description><![CDATA[{$description}]]></description>
|
||||||
<link>{$link}</link>
|
<link>{$link}</link>
|
||||||
<guid isPermaLink="false">{$item['timestamp']}</guid>
|
<guid isPermaLink="false">{$item['timestamp']}</guid>
|
||||||
<author>admin@{$_SERVER['SERVER_NAME']}</author>
|
<dc:creator>Autoblog</dc:creator>
|
||||||
<pubDate>{$date}</pubDate>
|
<pubDate>{$date}</pubDate>
|
||||||
</item>
|
</item>
|
||||||
EOT;
|
EOT;
|
||||||
|
|
541
index.php
Executable file → Normal file
|
@ -26,8 +26,6 @@ $success = array();
|
||||||
|
|
||||||
if(file_exists("config.php")){
|
if(file_exists("config.php")){
|
||||||
require_once "config.php";
|
require_once "config.php";
|
||||||
}else{
|
|
||||||
$error[] = "config.php not found !";
|
|
||||||
}
|
}
|
||||||
if(file_exists("functions.php")){
|
if(file_exists("functions.php")){
|
||||||
require_once "functions.php";
|
require_once "functions.php";
|
||||||
|
@ -58,7 +56,7 @@ function get_link_from_datafeed($data) {
|
||||||
|
|
||||||
// ATOM feed && RSS 1.0 /RDF && RSS 2.0
|
// ATOM feed && RSS 1.0 /RDF && RSS 2.0
|
||||||
if (!isset($xml->entry) && !isset($xml->item) && !isset($xml->channel->item))
|
if (!isset($xml->entry) && !isset($xml->item) && !isset($xml->channel->item))
|
||||||
die('le flux n\'a pas une syntaxe valide');
|
{ die('le flux n\'a pas une syntaxe valide');}
|
||||||
|
|
||||||
$check = substr($data, 0, 5);
|
$check = substr($data, 0, 5);
|
||||||
if($check !== '<?xml') {
|
if($check !== '<?xml') {
|
||||||
|
@ -74,17 +72,26 @@ function get_link_from_datafeed($data) {
|
||||||
return $link->item(0)->nodeValue;
|
return $link->item(0)->nodeValue;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $channel['link'];
|
return escape($channel['link']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_size($doc) {
|
||||||
|
$symbol = array('o', 'Kio', 'Mio', 'Gio', 'Tio');
|
||||||
|
$size = filesize($doc);
|
||||||
|
$exp = floor(log($size) / log(1024));
|
||||||
|
$nicesize = $size / pow(1024, floor($exp));
|
||||||
|
return sprintf('%d %s', $nicesize, $symbol[$exp]);
|
||||||
|
}
|
||||||
|
|
||||||
function serverUrl($return_subfolder = false)
|
function serverUrl($return_subfolder = false)
|
||||||
{
|
{
|
||||||
$https = (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS'])=='on')) || $_SERVER["SERVER_PORT"]=='443'; // HTTPS detection.
|
$https = (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS'])=='on')) || $_SERVER["SERVER_PORT"]=='443'; // HTTPS detection.
|
||||||
$serverport = ($_SERVER["SERVER_PORT"]=='80' || ($https && $_SERVER["SERVER_PORT"]=='443') ? '' : ':'.$_SERVER["SERVER_PORT"]);
|
$serverport = ($_SERVER["SERVER_PORT"]=='80' || ($https && $_SERVER["SERVER_PORT"]=='443') ? '' : ':'.$_SERVER["SERVER_PORT"]);
|
||||||
if($return_subfolder === true) {
|
if($return_subfolder === true) {
|
||||||
$path = pathinfo( $_SERVER['PHP_SELF'] );
|
$path = pathinfo( $_SERVER['PHP_SELF'] );
|
||||||
$subfolder = $path['dirname'] .'/';
|
$finalslash = ( $path['dirname'] != '/' ) ? '/' : '';
|
||||||
|
$subfolder = $path['dirname'] . $finalslash;
|
||||||
} else $subfolder = '';
|
} else $subfolder = '';
|
||||||
return 'http'.($https?'s':'').'://'.$_SERVER["SERVER_NAME"].$serverport.$subfolder;
|
return 'http'.($https?'s':'').'://'.$_SERVER["SERVER_NAME"].$serverport.$subfolder;
|
||||||
}
|
}
|
||||||
|
@ -112,18 +119,13 @@ function create_from_opml($opml) {
|
||||||
$sitename = escape( $outline['title'] );
|
$sitename = escape( $outline['title'] );
|
||||||
$siteurl = escape($outline['htmlUrl']);
|
$siteurl = escape($outline['htmlUrl']);
|
||||||
|
|
||||||
// Lighten process by checking folderExists first
|
|
||||||
// A CHANGER SELON ISSUE #20
|
|
||||||
if(folderExists($siteurl))
|
|
||||||
throw new Exception('Erreur : l\'autoblog '. $sitename .' existe déjà.');
|
|
||||||
|
|
||||||
$sitetype = escape($outline['text']);
|
$sitetype = escape($outline['text']);
|
||||||
if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'identica' )
|
if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'youtube')
|
||||||
$sitetype = 'generic';
|
$sitetype = 'generic';
|
||||||
$siteDesc = getSiteDesc(escape($siteurl));
|
|
||||||
$rssurl = DetectRedirect(escape($outline['xmlUrl']));
|
$rssurl = DetectRedirect(escape($outline['xmlUrl']));
|
||||||
|
|
||||||
createAutoblog( $sitetype, $sitename, $siteurl, $rssurl, $siteDesc, $error );
|
createAutoblog( $sitetype, $sitename, $siteurl, $rssurl );
|
||||||
|
|
||||||
$message = 'Autoblog "'. $sitename .'" crée avec succès. → <a target="_blank" href="'. urlToFolder( $siteurl, $rssurl ) .'">afficher l\'autoblog</a>.';
|
$message = 'Autoblog "'. $sitename .'" crée avec succès. → <a target="_blank" href="'. urlToFolder( $siteurl, $rssurl ) .'">afficher l\'autoblog</a>.';
|
||||||
// Do not print iframe on big import (=> heavy and useless)
|
// Do not print iframe on big import (=> heavy and useless)
|
||||||
|
@ -187,18 +189,21 @@ if (isset($_GET['rss'])) {
|
||||||
**/
|
**/
|
||||||
if (isset($_GET['check']))
|
if (isset($_GET['check']))
|
||||||
{
|
{
|
||||||
//echo "1";
|
|
||||||
header('Content-type: image/svg+xml');
|
header('Content-type: image/svg+xml');
|
||||||
$randomtime=rand(86400, 259200); /* intervalle de mise à jour: de 1 à 3 jours (pour éviter que le statut de tous les autoblogs soit rafraichi en bloc et bouffe le CPU) */
|
$randomtime=rand(86400, 259200); /* intervalle de mise à jour: de 1 à 3 jours (pour éviter que le statut de tous les autoblogs soit rafraichi en bloc et bouffe le CPU) */
|
||||||
$expire=time() -$randomtime ;
|
$expire=time() -$randomtime ;
|
||||||
|
|
||||||
/* SVG minimalistes */
|
/* SVG minimalistes */
|
||||||
$svg_vert='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="15" height="15"><g><rect width="15" height="15" x="0" y="0" style="fill:#00ff00;stroke:#008000"/></g><text style="font-size:10px;font-weight:bold;text-anchor:middle;font-family:Arial"><tspan x="7" y="11">OK</tspan></text></svg>';
|
|
||||||
$svg_jaune='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="15" height="15"><g><rect width="15" height="15" x="0" y="0" style="fill:#ffff00;stroke:#ffcc00"/></g><text style="font-size:10px;font-weight:bold;text-anchor:middle;font-family:Arial"><tspan x="7" y="11">mv</tspan></text></svg>';
|
function svg_status($fill, $text, $back)
|
||||||
$svg_rouge='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="15" height="15"><g><rect width="15" height="15" x="0" y="0" style="fill:#ff0000;stroke:#800000"/></g><text style="font-size:10px;font-weight:bold;text-anchor:middle;font-family:Arial"><tspan x="7" y="11">err</tspan></text></svg>';
|
{
|
||||||
$svg_twitter='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="15" height="15"><path d="m 11.679889,7.6290431 a 4.1668792,3.7091539 0 1 1 -8.3337586,0 4.1668792,3.7091539 0 1 1 8.3337586,0 z" style="fill:none;stroke:#3aaae1;stroke-width:4;stroke-miterlimit:4" /></svg>';
|
$svg = '<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="15" height="15">'.$back.'<text style="font-size:10px;font-weight:bold;text-anchor:middle;font-family:Arial;fill:'.$fill.';"><tspan x="8" y="14">'.$text.'</tspan></text></svg>';
|
||||||
$svg_identica='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="15" height="15"><path d="m 11.679889,7.6290431 a 4.1668792,3.7091539 0 1 1 -8.3337586,0 4.1668792,3.7091539 0 1 1 8.3337586,0 z" style="fill:none;stroke:#a00000;stroke-width:4;stroke-miterlimit:4" /></svg>';
|
return $svg;
|
||||||
$svg_statusnet='<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="15" height="15"><path d="m 11.679889,7.6290431 a 4.1668792,3.7091539 0 1 1 -8.3337586,0 4.1668792,3.7091539 0 1 1 8.3337586,0 z" style="fill:none;stroke:#ff6a00;stroke-width:4;stroke-miterlimit:4" /></svg>';
|
}
|
||||||
|
|
||||||
|
$svg_ok=svg_status('#008000', 'ok', '');
|
||||||
|
$svg_mv=svg_status('#0000ff', 'mv', '<rect width="100%" height="100%" fill="#ffd800"/>');
|
||||||
|
$svg_err=svg_status('#000000', 'err', '<rect width="100%" height="100%" fill="#ff0000"/>');
|
||||||
|
|
||||||
$errorlog="./".escape( $_GET['check'] ) ."/error.log";
|
$errorlog="./".escape( $_GET['check'] ) ."/error.log";
|
||||||
|
|
||||||
|
@ -207,35 +212,34 @@ if (isset($_GET['check']))
|
||||||
if(file_exists($errorlog) && filemtime($errorlog) < $expire) { unlink($errorlog); } /* errorlog périmé ? Suppression. */
|
if(file_exists($errorlog) && filemtime($errorlog) < $expire) { unlink($errorlog); } /* errorlog périmé ? Suppression. */
|
||||||
if(file_exists($errorlog)) /* errorlog existe encore ? se contenter de lire sa taille pour avoir le statut */
|
if(file_exists($errorlog)) /* errorlog existe encore ? se contenter de lire sa taille pour avoir le statut */
|
||||||
{
|
{
|
||||||
if(filesize($errorlog) == "0") {die($svg_vert);}
|
if(filesize($errorlog) == "0") {die($svg_ok);}
|
||||||
else if(filesize($errorlog) == "1") {die($svg_jaune);}
|
else if(filesize($errorlog) == "1") {die($svg_mv);}
|
||||||
else {die($svg_rouge);}
|
else {die($svg_err);}
|
||||||
}
|
}
|
||||||
else /* ..sinon, lancer la procédure de contrôle */
|
else /* ..sinon, lancer la procédure de contrôle */
|
||||||
{
|
{
|
||||||
$ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die;
|
$ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die;
|
||||||
|
|
||||||
if(strpos(strtolower($ini['SITE_TITLE']), 'twitter') !== FALSE) { die($svg_twitter); } /* Twitter */
|
|
||||||
if(strpos(strtolower($ini['SITE_TITLE']), 'identica') !== FALSE) { die($svg_identica); } /* Identica */
|
|
||||||
if(strpos(strtolower($ini['SITE_TYPE']), 'microblog') !== FALSE) { die($svg_statusnet); } /* Statusnet */
|
|
||||||
|
|
||||||
$headers = get_headers($ini['FEED_URL']);
|
$headers = get_headers($ini['FEED_URL']);
|
||||||
|
|
||||||
|
if(!empty($headers))
|
||||||
|
$code=explode(" ", $headers[0]);
|
||||||
|
else $code = array();
|
||||||
|
|
||||||
/* le flux est indisponible (typiquement: erreur DNS ou possible censure) - à vérifier */
|
/* le flux est indisponible (typiquement: erreur DNS ou possible censure) - à vérifier */
|
||||||
if(empty($headers) || $headers === FALSE ) {
|
if(empty($headers) || $headers === FALSE || (!empty($code) && ($code[1] == '500' || $code[1] == '404'))) {
|
||||||
if( $oldvalue !== null && $oldvalue != '..' ) {
|
if( $oldvalue !== null && $oldvalue != '..' ) {
|
||||||
updateXML('unavailable', 'nxdomain', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']);
|
updateXML('unavailable', 'nxdomain', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']);
|
||||||
}
|
}
|
||||||
file_put_contents($errorlog, '..');
|
file_put_contents($errorlog, '..');
|
||||||
die($svg_rouge);
|
die($svg_err);
|
||||||
}
|
}
|
||||||
$code=explode(" ", $headers[0]);
|
|
||||||
/* code retour 200: flux disponible */
|
/* code retour 200: flux disponible */
|
||||||
if($code[1] == "200") {
|
if($code[1] == "200") {
|
||||||
if( $oldvalue !== null && $oldvalue != '' ) {
|
if( $oldvalue !== null && $oldvalue != '' ) {
|
||||||
updateXML('available', '200', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']);
|
updateXML('available', '200', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']);
|
||||||
}
|
}
|
||||||
file_put_contents($errorlog, '');
|
file_put_contents($errorlog, '');
|
||||||
die($svg_vert);
|
die($svg_ok);
|
||||||
}
|
}
|
||||||
/* autre code retour: un truc a changé (redirection, changement de CMS, .. bref vvb.ini doit être corrigé) */
|
/* autre code retour: un truc a changé (redirection, changement de CMS, .. bref vvb.ini doit être corrigé) */
|
||||||
else {
|
else {
|
||||||
|
@ -243,7 +247,7 @@ if (isset($_GET['check']))
|
||||||
updateXML('moved', '3xx', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']);
|
updateXML('moved', '3xx', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']);
|
||||||
}
|
}
|
||||||
file_put_contents($errorlog, '.');
|
file_put_contents($errorlog, '.');
|
||||||
die($svg_jaune);
|
die($svg_mv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,8 +261,8 @@ if (isset($_GET['export'])) {
|
||||||
|
|
||||||
foreach($subdirs as $unit) {
|
foreach($subdirs as $unit) {
|
||||||
if(is_dir($unit)) {
|
if(is_dir($unit)) {
|
||||||
$unit=substr($unit, 2);
|
|
||||||
$ini = parse_ini_file($unit.'/vvb.ini');
|
$ini = parse_ini_file($unit.'/vvb.ini');
|
||||||
|
$unit=substr($unit, 2);
|
||||||
$config = new stdClass;
|
$config = new stdClass;
|
||||||
|
|
||||||
foreach ($ini as $key=>$value) {
|
foreach ($ini as $key=>$value) {
|
||||||
|
@ -351,17 +355,17 @@ if (isset($_GET['sitemap']))
|
||||||
{
|
{
|
||||||
header('Content-Type: application/xml');
|
header('Content-Type: application/xml');
|
||||||
$proto=(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')?"https://":"http://";
|
$proto=(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')?"https://":"http://";
|
||||||
echo '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
|
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n".'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\n";
|
||||||
echo '<url><loc>'.$proto."{$_SERVER['HTTP_HOST']}".str_replace('?sitemap', '', $_SERVER['REQUEST_URI'])."</loc>\n";
|
echo "<url>\n <loc>".$proto."{$_SERVER['HTTP_HOST']}".str_replace('?sitemap', '', $_SERVER['REQUEST_URI'])."</loc>\n";
|
||||||
echo ' <lastmod>'.date('c', time())."</lastmod>\n";
|
echo ' <lastmod>'.date('c', time())."</lastmod>\n";
|
||||||
echo '<changefreq>daily</changefreq></url>';
|
echo " <changefreq>daily</changefreq>\n</url>\n";
|
||||||
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
|
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
|
||||||
foreach($subdirs as $unit) {
|
foreach($subdirs as $unit) {
|
||||||
if(is_dir($unit)) {
|
if(is_dir($unit)) {
|
||||||
$unit=substr($unit, 2);
|
$unit=substr($unit, 2);
|
||||||
echo '<url><loc>'.$proto.$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, -9)."$unit/"."</loc>\n";
|
echo "<url>\n <loc>".$proto.$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, -9)."$unit/"."</loc>\n";
|
||||||
echo ' <lastmod>'.date('c', filemtime($unit))."</lastmod>\n";
|
echo ' <lastmod>'.date('c', filemtime($unit))."</lastmod>\n";
|
||||||
echo '<changefreq>hourly</changefreq></url>';
|
echo " <changefreq>hourly</changefreq>\n</url>\n\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo '</urlset>';
|
echo '</urlset>';
|
||||||
|
@ -372,38 +376,73 @@ if (isset($_GET['sitemap']))
|
||||||
* Update ALL autblogs (except .disabled)
|
* Update ALL autblogs (except .disabled)
|
||||||
* This action can be very slow and consume CPU if you have a lot of autoblogs
|
* This action can be very slow and consume CPU if you have a lot of autoblogs
|
||||||
**/
|
**/
|
||||||
if( isset($_GET['updateall']) && ALLOW_FULL_UPDATE) {
|
if( isset($_GET['updateall']) ) {
|
||||||
|
|
||||||
$expire = time() - 84600 ; // 23h30 en secondes
|
|
||||||
$lockfile = ".updatealllock";
|
$lockfile = ".updatealllock";
|
||||||
if (file_exists($lockfile) && filemtime($lockfile) > $expire) {
|
if( !isset( $_GET['force']) ) {
|
||||||
|
$max_exec_time=time()+4; // scipt have 4 seconds to update autoblogs
|
||||||
|
$expire = time() - 5 ; // 5 seconds
|
||||||
|
$lockfile_contents = array();
|
||||||
|
if (file_exists($lockfile)){
|
||||||
|
$lockfile_contents = file_get_contents($lockfile);
|
||||||
|
if( !isset($lockfile_contents[0]) || $lockfile_contents[0] != "a") { // détection d'une serialisation
|
||||||
|
if( filemtime($lockfile) > $expire){
|
||||||
echo "too early";
|
echo "too early";
|
||||||
die;
|
die;
|
||||||
}
|
}else{
|
||||||
else {
|
// need update of all autoblogs
|
||||||
if( file_exists($lockfile) )
|
|
||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// else we need to update some autoblogs
|
||||||
|
}
|
||||||
if( file_put_contents($lockfile, date(DATE_RFC822)) ===FALSE) {
|
if( file_put_contents($lockfile, date(DATE_RFC822)) ===FALSE) {
|
||||||
echo "Merci d'ajouter des droits d'écriture sur le fichier.";
|
echo "Merci d'ajouter des droits d'écriture sur le fichier.";
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if(!empty($lockfile_contents)) {
|
||||||
|
$subdirs = unserialize($lockfile_contents);
|
||||||
|
unset($lockfile_contents);
|
||||||
|
}else{
|
||||||
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
|
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
|
||||||
foreach($subdirs as $unit) {
|
}
|
||||||
|
}
|
||||||
|
elseif (ALLOW_FULL_UPDATE) {
|
||||||
|
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
|
||||||
|
$max_exec_time=time() * 2; // workaround to disable max exec time
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "You're not allowed to force full update.";
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
$todo_subdirs = $subdirs;
|
||||||
|
|
||||||
|
foreach($subdirs as $key => $unit) {
|
||||||
if(is_dir($unit)) {
|
if(is_dir($unit)) {
|
||||||
if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) {
|
if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) {
|
||||||
file_get_contents(serverUrl() . substr($_SERVER['PHP_SELF'], 0, -9) . $unit . '/index.php');
|
file_get_contents(serverUrl() . substr($_SERVER['PHP_SELF'], 0, -9) . $unit . '/index.php');
|
||||||
|
unset($todo_subdirs[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(time() >= $max_exec_time){
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!empty($todo_subdirs)){
|
||||||
|
// if update is not finish
|
||||||
|
// save list of autoblogs who need update
|
||||||
|
file_put_contents($lockfile, serialize($todo_subdirs), LOCK_EX);
|
||||||
|
echo "Not finish";
|
||||||
|
}else{
|
||||||
|
echo "Done";
|
||||||
|
}
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$antibot = generate_antibot();
|
$antibot = generate_antibot();
|
||||||
$form = '<form method="POST"><input type="hidden" name="generic" value="1" />
|
$form = '<form method="POST"><input type="hidden" name="generic" value="1" />'."\n".'
|
||||||
<input placeholder="Adresse du flux RSS/ATOM" type="text" name="rssurl" id="rssurl"><br>
|
<input placeholder="Adresse du flux RSS/ATOM" type="text" name="rssurl" id="rssurl"><br>
|
||||||
<input placeholder="Antibot : Ecrivez '. $antibot .' en chiffre" type="text" name="number"><br>
|
<input placeholder="Antibot : écrivez « '. $antibot .' » en chiffre" type="text" name="number"><br>
|
||||||
<input type="hidden" name="antibot" value="'. $antibot .'" />
|
<input type="hidden" name="antibot" value="'. $antibot .'" />
|
||||||
<input type="submit" value="Vérifier">
|
<input type="submit" value="Vérifier">
|
||||||
</form>';
|
</form>';
|
||||||
|
@ -427,9 +466,9 @@ if(!empty($_GET['via_button']) && $_GET['number'] === '17' && ALLOW_NEW_AUTOBLOG
|
||||||
$sitename = escape($_GET['sitename']);
|
$sitename = escape($_GET['sitename']);
|
||||||
$sitetype = updateType($siteurl); // Disabled input doesn't send POST data
|
$sitetype = updateType($siteurl); // Disabled input doesn't send POST data
|
||||||
$sitetype = $sitetype['type'];
|
$sitetype = $sitetype['type'];
|
||||||
$siteDesc = getSiteDesc(escape($_GET['siteDesc']));
|
|
||||||
|
|
||||||
createAutoblog( $sitetype, $sitename, $siteurl, $rssurl, $siteDesc, $error);
|
createAutoblog( $sitetype, $sitename, $siteurl, $rssurl );
|
||||||
|
|
||||||
if( empty($error)) {
|
if( empty($error)) {
|
||||||
$form .= '<iframe width="1" height="1" frameborder="0" src="'. urlToFolder( $siteurl, $rssurl ) .'/index.php"></iframe>';
|
$form .= '<iframe width="1" height="1" frameborder="0" src="'. urlToFolder( $siteurl, $rssurl ) .'/index.php"></iframe>';
|
||||||
$form .= '<p><span style="color:darkgreen">Autoblog <a href="'. urlToFolder( $siteurl, $rssurl ) .'">'. $sitename .'</a> ajouté avec succès.</span><br>';
|
$form .= '<p><span style="color:darkgreen">Autoblog <a href="'. urlToFolder( $siteurl, $rssurl ) .'">'. $sitename .'</a> ajouté avec succès.</span><br>';
|
||||||
|
@ -460,11 +499,11 @@ if(!empty($_GET['via_button']) && $_GET['number'] === '17' && ALLOW_NEW_AUTOBLOG
|
||||||
$form .= '<span style="color:blue">Merci de vérifier les informations suivantes, corrigez si nécessaire.</span><br>
|
$form .= '<span style="color:blue">Merci de vérifier les informations suivantes, corrigez si nécessaire.</span><br>
|
||||||
<form method="GET">
|
<form method="GET">
|
||||||
<input type="hidden" name="via_button" value="1"><input type="hidden" name="add" value="1"><input type="hidden" name="number" value="17">
|
<input type="hidden" name="via_button" value="1"><input type="hidden" name="add" value="1"><input type="hidden" name="number" value="17">
|
||||||
<input style="width:450px;" type="text" name="sitename" id="sitename" value="'.$sitename.'"><label for="sitename">← titre du site (auto)</label><br>
|
<input style="width:30em;" type="text" name="sitename" id="sitename" value="'.$sitename.'"><label for="sitename">← titre du site (auto)</label><br>
|
||||||
<input style="width:450px;" placeholder="Adresse du site" type="text" name="siteurl" id="siteurl" value="'.$siteurl.'"><label for="siteurl">← page d\'accueil (auto)</label><br>
|
<input style="width:30em;" placeholder="Adresse du site" type="text" name="siteurl" id="siteurl" value="'.$siteurl.'"><label for="siteurl">← page d\'accueil (auto)</label><br>
|
||||||
<input style="width:450px;" placeholder="Adresse du flux RSS/ATOM" type="text" name="rssurl" id="rssurl" value="'.$rssurl.'"><label for="rssurl">← adresse du flux</label><br>
|
<input style="width:30em;" placeholder="Adresse du flux RSS/ATOM" type="text" name="rssurl" id="rssurl" value="'.$rssurl.'"><label for="rssurl">← adresse du flux</label><br>
|
||||||
<input style="width:450px;" type="text" name="sitetype" id="sitetype" value="'.$sitetype.'" disabled><label for="sitetype">← type de site</label><br>
|
<input style="width:30em;" type="text" name="sitetype" id="sitetype" value="'.$sitetype.'" disabled><label for="sitetype">← type de site</label><br>
|
||||||
<textarea style="width:450px;height:8em;" type="text" name="siteDesc" id="siteDesc">'.escape($siteDesc).'</textarea><label for="siteDesc">← description de site</label><br>
|
<textarea style="width:30em;height:8em;" type="text" name="siteDesc" id="siteDesc">'.escape($siteDesc).'</textarea><label for="siteDesc">← description de site</label><br>
|
||||||
<input type="submit" value="Créer"></form>';
|
<input type="submit" value="Créer"></form>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -484,28 +523,30 @@ if(!empty($_GET['via_button']) && $_GET['number'] === '17' && ALLOW_NEW_AUTOBLOG
|
||||||
* ADD BY SOCIAL / SHAARLI
|
* ADD BY SOCIAL / SHAARLI
|
||||||
**/
|
**/
|
||||||
if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_SOCIAL)
|
if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_SOCIAL)
|
||||||
{;
|
{
|
||||||
$socialinstance = strtolower(escape($_POST['socialinstance']));
|
$socialinstance = strtolower(escape($_POST['socialinstance']));
|
||||||
$socialaccount = (!empty($_POST['socialaccount'])) ? strtolower(escape($_POST['socialaccount'])) : false;
|
$socialaccount = (!empty($_POST['socialaccount'])) ? strtolower(escape($_POST['socialaccount'])) : false;
|
||||||
if( $socialaccount === false && $socialinstance !== 'shaarli')
|
if( $socialaccount === false && $socialinstance !== 'shaarli')
|
||||||
$error[] = 'Le compte social doit être renseigné.';
|
$error[] = 'Le compte social doit être renseigné.';
|
||||||
|
elseif( !empty($_POST['number']) && !empty($_POST['antibot']) && check_antibot($_POST['number'], $_POST['antibot'])) {
|
||||||
if( !empty($_POST['number']) && !empty($_POST['antibot']) && check_antibot($_POST['number'], $_POST['antibot']) && empty($error)) {
|
|
||||||
|
|
||||||
if($socialinstance === 'twitter') {
|
if($socialinstance === 'twitter') {
|
||||||
if( API_TWITTER !== FALSE ) {
|
if( API_TWITTER !== FALSE ) {
|
||||||
$sitetype = 'twitter';
|
$sitetype = 'twitter';
|
||||||
$siteurl = 'http://twitter.com/'. $socialaccount;
|
$siteurl = 'http://twitter.com/'. $socialaccount;
|
||||||
|
if ( API_TWITTER === 'LOCAL' ) {
|
||||||
|
$rssurl = serverUrl(true).'twitter2feed.php?u='.$socialaccount;
|
||||||
|
}
|
||||||
|
else {
|
||||||
$rssurl = API_TWITTER.$socialaccount;
|
$rssurl = API_TWITTER.$socialaccount;
|
||||||
|
// check
|
||||||
|
$twitterbridge = get_headers($rssurl, 1);
|
||||||
|
if ($twitterbridge['0'] == 'HTTP/1.1 403 Forbidden') { $error[] = "La twitterbridge a refusé ce nom d'utilisateur: <br>\n<pre>".htmlentities($twitterbridge['X-twitterbridge']).'</pre>'; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$error[] = 'Vous devez définir une API Twitter -> RSS dans votre fichier de configuration (see <a href="https://github.com/mitsukarenai/twitterbridge">TwitterBridge</a>).';
|
$error[] = 'Vous devez définir une API Twitter -> RSS dans votre fichier de configuration (see <a href="https://github.com/mitsukarenai/twitterbridge">TwitterBridge</a>).';
|
||||||
}
|
}
|
||||||
elseif($socialinstance === 'identica') {
|
|
||||||
$sitetype = 'identica';
|
|
||||||
$siteurl = 'http://identi.ca/'.$socialaccount;
|
|
||||||
$rssurl = 'http://identi.ca/api/statuses/user_timeline/'.$socialaccount.'.rss';
|
|
||||||
}
|
|
||||||
elseif($socialinstance === 'statusnet' && !empty($_POST['statusneturl'])) {
|
elseif($socialinstance === 'statusnet' && !empty($_POST['statusneturl'])) {
|
||||||
$sitetype = 'microblog';
|
$sitetype = 'microblog';
|
||||||
$siteurl= NoProtocolSiteURL(escape($_POST['statusneturl']));
|
$siteurl= NoProtocolSiteURL(escape($_POST['statusneturl']));
|
||||||
|
@ -529,31 +570,28 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO
|
||||||
$rssurl = $siteurl."?do=rss";
|
$rssurl = $siteurl."?do=rss";
|
||||||
$socialaccount = get_title_from_feed($rssurl);
|
$socialaccount = get_title_from_feed($rssurl);
|
||||||
}
|
}
|
||||||
|
elseif($socialinstance === 'youtube') {
|
||||||
|
$sitetype = 'youtube';
|
||||||
|
$siteurl = 'https://www.youtube.com/user/'.$socialaccount;
|
||||||
|
$rssurl = 'https://gdata.youtube.com/feeds/base/users/'.$socialaccount.'/uploads?alt=atom&orderby=published';
|
||||||
|
}
|
||||||
if( empty($error) ) {
|
if( empty($error) ) {
|
||||||
try {
|
try {
|
||||||
// TwitterBridge user will be allowed after Autoblog creation
|
|
||||||
// TODO: Twitter user does not exist ?
|
|
||||||
// TODO: get remote like http://wwz.suumitsu.eu/twitter/whitelist.json, decode, check if is in array, return error or continue
|
|
||||||
if($sitetype != 'twitter') {
|
|
||||||
$headers = get_headers($rssurl, 1);
|
$headers = get_headers($rssurl, 1);
|
||||||
if (strpos($headers[0], '200') === FALSE)
|
if (strpos($headers[0], '200') === FALSE)
|
||||||
throw new Exception('Flux inaccessible (compte inexistant ?)');
|
throw new Exception('Flux inaccessible (compte inexistant ?)');
|
||||||
}
|
|
||||||
|
|
||||||
createAutoblog($sitetype, ucfirst($socialinstance) .' - '. $socialaccount, $siteurl, $rssurl);
|
createAutoblog($sitetype, ucfirst($socialinstance) .' - '. $socialaccount, $siteurl, $rssurl);
|
||||||
$success[] = '<iframe width="1" height="1" frameborder="0" src="'. urlToFolder( $siteurl, $rssurl ) .'/index.php"></iframe>
|
$success[] = '<iframe width="1" height="1" frameborder="0" src="'. urlToFolder( $siteurl, $rssurl ) .'/index.php"></iframe>
|
||||||
<b style="color:darkgreen">'.ucfirst($socialinstance) .' - '. $socialaccount.' <a href="'. urlToFolder( $siteurl, $rssurl ) .'">ajouté avec succès</a>.</b>';
|
<b style="color:darkgreen">'.ucfirst($socialinstance) .' - '. $socialaccount.' <a href="'. urlToFolder( $siteurl, $rssurl ) .'">ajouté avec succès</a>.</b>';
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception $e) {
|
catch (Exception $e) {
|
||||||
echo $error[] = $e->getMessage();
|
echo $error[] = $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$error[] = 'Antibot : Chiffres incorrects.';
|
$error[] = 'Antibot : chiffres incorrects.';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -565,26 +603,27 @@ if( !empty($_POST['generic']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_L
|
||||||
if(empty($_POST['number']) || empty($_POST['antibot']) )
|
if(empty($_POST['number']) || empty($_POST['antibot']) )
|
||||||
{$error[] = "Vous êtes un bot ?";}
|
{$error[] = "Vous êtes un bot ?";}
|
||||||
elseif(! check_antibot($_POST['number'], $_POST['antibot']))
|
elseif(! check_antibot($_POST['number'], $_POST['antibot']))
|
||||||
{$error[] = "Antibot : Ce n'est pas le bon nombre.";}
|
{$error[] = "Antibot : ce n'est pas le bon nombre.";}
|
||||||
|
|
||||||
if(empty($error)) {
|
if(empty($error)) {
|
||||||
try {
|
try {
|
||||||
$rssurl = DetectRedirect(escape($_POST['rssurl']));
|
$rssurl = parse_url($_POST['rssurl']);
|
||||||
|
if(!isset($rssurl['query'])) $rssurl['query'] = '';
|
||||||
|
$rssurl = $rssurl['scheme'].'://'.$rssurl['host'].$rssurl['path'].'?'.html_entity_decode($rssurl['query']);
|
||||||
|
$rssurl = DetectRedirect($rssurl);
|
||||||
|
|
||||||
if(!empty($_POST['siteurl'])) {
|
if(!empty($_POST['siteurl'])) {
|
||||||
|
|
||||||
$siteurl = escape($_POST['siteurl']);
|
$siteurl = escape($_POST['siteurl']);
|
||||||
$sitename = get_title_from_feed($rssurl);
|
$sitename = get_title_from_feed($rssurl);
|
||||||
$siteDesc = escape($_POST['siteDesc']);
|
|
||||||
|
|
||||||
createAutoblog('generic', $sitename, $siteurl, $rssurl, $siteDesc, $error);
|
createAutoblog('generic', $sitename, $siteurl, $rssurl);
|
||||||
|
|
||||||
$success[] = '<iframe width="1" height="1" frameborder="0" src="'. urlToFolder( $siteurl, $rssurl ) .'/index.php"></iframe>
|
$success[] = '<iframe width="1" height="1" frameborder="0" src="'. urlToFolder( $siteurl, $rssurl ) .'/index.php"></iframe>
|
||||||
<b style="color:darkgreen">Autoblog '. $sitename .' crée avec succès.</b> → <a target="_blank" href="'. urlToFolder( $siteurl, $rssurl ) .'">afficher l\'autoblog</a>';
|
<b style="color:darkgreen">Autoblog '. $sitename .' crée avec succès.</b> → <a target="_blank" href="'. urlToFolder( $siteurl, $rssurl ) .'">afficher l\'autoblog</a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// checking procedure
|
// checking procedure
|
||||||
|
|
||||||
$datafeed = file_get_contents($rssurl);
|
$datafeed = file_get_contents($rssurl);
|
||||||
if( $datafeed === false ) {
|
if( $datafeed === false ) {
|
||||||
$error[] = 'URL "'. $rssurl .'" inaccessible.';
|
$error[] = 'URL "'. $rssurl .'" inaccessible.';
|
||||||
|
@ -599,7 +638,6 @@ if( !empty($_POST['generic']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_L
|
||||||
<input style="color:black" type="text" id="sitename" value="'.$sitename.'" '.( $datafeed === false?'':'disabled').'><label for="sitename">← titre du site (auto)</label><br>
|
<input style="color:black" type="text" id="sitename" value="'.$sitename.'" '.( $datafeed === false?'':'disabled').'><label for="sitename">← titre du site (auto)</label><br>
|
||||||
<input placeholder="Adresse du site" type="text" name="siteurl" id="siteurl" value="'.$siteurl.'"><label for="siteurl">← page d\'accueil (auto)</label><br>
|
<input placeholder="Adresse du site" type="text" name="siteurl" id="siteurl" value="'.$siteurl.'"><label for="siteurl">← page d\'accueil (auto)</label><br>
|
||||||
<input placeholder="Adresse du flux RSS/ATOM" type="text" name="rssurl" id="rssurl" value="'.$rssurl.'"><label for="rssurl">← adresse du flux</label><br>
|
<input placeholder="Adresse du flux RSS/ATOM" type="text" name="rssurl" id="rssurl" value="'.$rssurl.'"><label for="rssurl">← adresse du flux</label><br>
|
||||||
<textarea style="width:450px;height:8em;" type="text" name="siteDesc" id="siteDesc">'.escape($siteDesc).'</textarea><label for="siteDesc">← description de site</label><br>
|
|
||||||
<input placeholder=""Type de site" type="text" name="sitetype" id="sitetype" value="'.$sitetype.'" '.( $datafeed === false?'':'disabled').'><label for="sitetype">← type de site</label><br>
|
<input placeholder=""Type de site" type="text" name="sitetype" id="sitetype" value="'.$sitetype.'" '.( $datafeed === false?'':'disabled').'><label for="sitetype">← type de site</label><br>
|
||||||
<input placeholder="Antibot: '. escape($_POST['antibot']) .' en chiffre" type="text" name="number" value="'. escape($_POST['number']) .'"><label for="number">← antibot</label><br>
|
<input placeholder="Antibot: '. escape($_POST['antibot']) .' en chiffre" type="text" name="number" value="'. escape($_POST['number']) .'"><label for="number">← antibot</label><br>
|
||||||
<input type="hidden" name="antibot" value="'. escape($_POST['antibot']) .'" /><input type="submit" value="Créer"></form>';
|
<input type="hidden" name="antibot" value="'. escape($_POST['antibot']) .'" /><input type="submit" value="Créer"></form>';
|
||||||
|
@ -619,7 +657,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
|
||||||
if(empty($_POST['number']) || empty($_POST['antibot']) )
|
if(empty($_POST['number']) || empty($_POST['antibot']) )
|
||||||
{$error[] = "Vous êtes un bot ?";}
|
{$error[] = "Vous êtes un bot ?";}
|
||||||
elseif(! check_antibot($_POST['number'], $_POST['antibot']))
|
elseif(! check_antibot($_POST['number'], $_POST['antibot']))
|
||||||
{$error[] = "Antibot : Ce n'est pas le bon nombre.";}
|
{$error[] = "Antibot : ce n'est pas le bon nombre.";}
|
||||||
|
|
||||||
if( empty( $error)) {
|
if( empty( $error)) {
|
||||||
if (is_uploaded_file($_FILES['file']['tmp_name'])) {
|
if (is_uploaded_file($_FILES['file']['tmp_name'])) {
|
||||||
|
@ -643,7 +681,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
|
||||||
if(empty($_POST['number']) || empty($_POST['antibot']) )
|
if(empty($_POST['number']) || empty($_POST['antibot']) )
|
||||||
{$error[] = "Vous êtes un bot ?";}
|
{$error[] = "Vous êtes un bot ?";}
|
||||||
elseif(! check_antibot($_POST['number'], $_POST['antibot']))
|
elseif(! check_antibot($_POST['number'], $_POST['antibot']))
|
||||||
{$error[] = "Antibot : Ce n'est pas le bon nombre.";}
|
{$error[] = "Antibot : ce n'est pas le bon nombre.";}
|
||||||
if( empty( $_POST['opml_url'] ))
|
if( empty( $_POST['opml_url'] ))
|
||||||
{$error[] = 'Le lien est incorrect.';}
|
{$error[] = 'Le lien est incorrect.';}
|
||||||
|
|
||||||
|
@ -664,11 +702,15 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" dir="ltr">
|
<html lang="fr" dir="ltr">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Projet Autoblog<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?></title>
|
<title>Projet Autoblog<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?></title>
|
||||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo serverUrl(false) . '/?rss';?>" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" charset="utf-8" />
|
||||||
|
<meta content="initial-scale=1.0, user-scalable=yes" name="viewport" />
|
||||||
|
|
||||||
|
<meta name="keywords" content="autoblog,effet streisand,censure,replication" />
|
||||||
|
<meta name="description" content="Le Projet Autoblog a pour objectif de répliquer les articles d'un blog ou d'un site site web." />
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo serverUrl(true) . '?rss';?>" />
|
||||||
<link href="<?php echo RESOURCES_FOLDER; ?>autoblog.css" rel="stylesheet" type="text/css">
|
<link href="<?php echo RESOURCES_FOLDER; ?>autoblog.css" rel="stylesheet" type="text/css">
|
||||||
<?php
|
<?php
|
||||||
if(file_exists(RESOURCES_FOLDER .'user.css')){
|
if(file_exists(RESOURCES_FOLDER .'user.css')){
|
||||||
|
@ -677,207 +719,253 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1><a href="<?php echo serverUrl(true); ?>">
|
<header>
|
||||||
PROJET AUTOBLOG
|
<h1><a href="<?php echo serverUrl(true); ?>">Projet Autoblog<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?></a></h1>
|
||||||
<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?>
|
</header>
|
||||||
</a></h1>
|
|
||||||
|
|
||||||
<div class="pbloc">
|
<section id="présentation">
|
||||||
|
<header>
|
||||||
<?php
|
<?php
|
||||||
if (defined('LOGO'))
|
if (defined('LOGO'))
|
||||||
echo '<img id="logo" src="'. RESOURCES_FOLDER . LOGO .'" alt="">';
|
echo '<img id="logo" src="'. RESOURCES_FOLDER . LOGO .'" alt="logo of this autoblog instance" />'."\n";
|
||||||
?>
|
?>
|
||||||
<h2>Présentation</h2>
|
<h2>Présentation</h2>
|
||||||
|
</header>
|
||||||
|
|
||||||
<p>
|
<p>Le Projet Autoblog a pour objectif de répliquer les articles d'un blog ou d'un site site web. Si l'article source est supprimé, et même si le site d'origine disparaît, les articles restent lisibles sur l'autoblog. L'objectif premier de ce projet est de lutter contre la censure et toute sorte de pression…</p>
|
||||||
Le Projet Autoblog a pour objectif de répliquer les articles d'un blog ou d'un site site web.<br/>
|
|
||||||
Si l'article source est supprimé, et même si le site d'origine disparaît, les articles restent lisibles sur l'autoblog. <br/>
|
|
||||||
L'objectif premier de ce projet est de lutter contre la censure et toute sorte de pression...
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<p>Voici une liste d'autoblogs hébergés sur <em><?php echo $_SERVER['SERVER_NAME']; ?></em> (<a href="http://sebsauvage.net/streisand.me/fr/">plus d'infos sur le projet</a>).</p>
|
||||||
Voici une liste d'autoblogs hébergés sur <i><?php echo $_SERVER['SERVER_NAME']; ?></i>
|
|
||||||
(<a href="http://sebsauvage.net/streisand.me/fr/">plus d'infos sur le projet</a>).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<b>Autres fermes</b>
|
|
||||||
→ <a href="https://duckduckgo.com/?q=!g%20%22Voici%20une%20liste%20d'autoblogs%20hébergés%22">Rechercher</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<p><strong>Autres fermes</strong> → <a href="//startpage.com/do/search?query=%22Voici+une+liste+d%27autoblogs+h%C3%A9berg%C3%A9s%22">Rechercher</a></p>
|
||||||
|
</section>
|
||||||
<?php if( $update_available ) { ?>
|
<?php if( $update_available ) { ?>
|
||||||
<div class="pbloc">
|
<section id="màj">
|
||||||
|
<header>
|
||||||
<h2>Mise à jour</h2>
|
<h2>Mise à jour</h2>
|
||||||
<p>
|
</header>
|
||||||
Une mise à jour du Projet Autoblog est disponible !<br>
|
|
||||||
→ <a href="https://github.com/mitsukarenai/Projet-Autoblog/archive/master.zip">Télécharger la dernière version</a><br>
|
<p>Une mise à jour du Projet Autoblog est disponible !</p>
|
||||||
→ <strong>Important : </strong><a href="https://github.com/mitsukarenai/Projet-Autoblog/wiki/Mettre-%C3%A0-jour">Consulter la documentation - mise à jour</a>
|
<ul>
|
||||||
</p>
|
<li>→ <a href="https://github.com/mitsukarenai/Projet-Autoblog/archive/master.zip">télécharger la dernière version</a> ;</li>
|
||||||
</div>
|
<li>→ <strong>important :</strong> <a href="https://github.com/mitsukarenai/Projet-Autoblog/wiki/Mettre-%C3%A0-jour">consulter la documentation — mise à jour</a>.</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if(ALLOW_NEW_AUTOBLOGS == TRUE) { ?>
|
<?php if(ALLOW_NEW_AUTOBLOGS == TRUE) { ?>
|
||||||
<div class="pbloc">
|
<section id="ajouter">
|
||||||
|
<header>
|
||||||
<h2>Ajouter un autoblog</h2>
|
<h2>Ajouter un autoblog</h2>
|
||||||
|
</header>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if( !empty( $error ) || !empty( $success )) {
|
if( !empty( $error ) || !empty( $success )) {
|
||||||
echo '<p>Message'. (count($error) ? 's' : '') .' :</p><ul>';
|
echo '<p>Message'. (count($error) ? 's' : '') ." :</p>\n";
|
||||||
|
echo " <ul>\n";
|
||||||
foreach ( $error AS $value ) {
|
foreach ( $error AS $value ) {
|
||||||
echo '<li class="error">'. $value .'</li>';
|
echo ' <li class="error">'. $value ."</li>\n";
|
||||||
}
|
}
|
||||||
foreach ( $success AS $value ) {
|
foreach ( $success AS $value ) {
|
||||||
echo '<li class="success">'. $value .'</li>';
|
echo ' <li class="success">'. $value ."</li>\n";
|
||||||
}
|
}
|
||||||
echo '</ul>';
|
echo " </ul>\n";
|
||||||
|
echo " \n";
|
||||||
|
echo ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$button_list = '<p id="button_list">Ajouter un autoblog via : ';
|
$button_list = '<p id="button_list">Ajouter un autoblog via :'."\n";
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_LINKS)
|
if(ALLOW_NEW_AUTOBLOGS_BY_LINKS)
|
||||||
$button_list .= '<a href="#add_generic" class="button" id="button_generic" onclick="show_form(\'generic\');return false;">Flux RSS</a> ';
|
$button_list .= ' <a href="#add_generic" class="button" id="button_generic" onclick="show_form(\'generic\');return false;">Flux RSS</a>'."\n";
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_SOCIAL) {
|
if(ALLOW_NEW_AUTOBLOGS_BY_SOCIAL) {
|
||||||
$button_list .= '<a href="#add_social" class="button" id="button_social" onclick="show_form(\'social\');return false;">Compte réseau social</a> ';
|
$button_list .= ' <a href="#add_social" class="button" id="button_social" onclick="show_form(\'social\');return false;">Compte réseau social</a>'."\n";
|
||||||
$button_list .= '<a href="#add_shaarli" class="button" id="button_shaarli" onclick="show_form(\'shaarli\');return false;">Shaarli</a> ';
|
$button_list .= ' <a href="#add_shaarli" class="button" id="button_shaarli" onclick="show_form(\'shaarli\');return false;">Shaarli</a>'."\n";
|
||||||
}
|
}
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE)
|
if(ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE)
|
||||||
$button_list .= '<a href="#add_opmlfile" class="button" id="button_opmlfile" onclick="show_form(\'opmlfile\');return false;">Fichier OPML</a> ';
|
$button_list .= ' <a href="#add_opmlfile" class="button" id="button_opmlfile" onclick="show_form(\'opmlfile\');return false;">Fichier OPML</a>'."\n";
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK)
|
if(ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK)
|
||||||
$button_list .= '<a href="#add_opmllink" class="button" id="button_opmllink" onclick="show_form(\'opmllink\');return false;">Lien vers OPML</a> ';
|
$button_list .= ' <a href="#add_opmllink" class="button" id="button_opmllink" onclick="show_form(\'opmllink\');return false;">Lien vers OPML</a>'."\n";
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_BUTTON)
|
if(ALLOW_NEW_AUTOBLOGS_BY_BUTTON)
|
||||||
$button_list .= '<a href="#add_bookmark" class="button" id="button_bookmark" onclick="show_form(\'bookmark\');return false;">Marque page</a> ';
|
$button_list .= ' <a href="#add_bookmark" class="button" id="button_bookmark" onclick="show_form(\'bookmark\');return false;">Marque page</a>'."\n";
|
||||||
$button_list .= '</p>';
|
$button_list .= " </p>\n";
|
||||||
echo $button_list;
|
echo $button_list;
|
||||||
|
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_LINKS == TRUE) { ?>
|
if(ALLOW_NEW_AUTOBLOGS_BY_LINKS == TRUE) { ?>
|
||||||
<div class="form" id="add_generic">
|
<section class="form" id="add_generic">
|
||||||
|
<header>
|
||||||
<h3>Ajouter un site web</h3>
|
<h3>Ajouter un site web</h3>
|
||||||
<p>
|
</header>
|
||||||
Si vous souhaitez que <i><?php echo $_SERVER['SERVER_NAME']; ?></i> héberge un autoblog d'un site,<br>
|
|
||||||
remplissez le formulaire suivant:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<?php echo $form; ?>
|
<p>Si vous souhaitez que <em><?php echo $_SERVER['SERVER_NAME']; ?></em> héberge un autoblog d'un site, remplissez le formulaire suivant :</p>
|
||||||
</div>
|
|
||||||
|
<?php echo $form; echo "\n"; ?>
|
||||||
|
</section>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_SOCIAL == TRUE) { ?>
|
if(ALLOW_NEW_AUTOBLOGS_BY_SOCIAL == TRUE) { ?>
|
||||||
<div class="form" id="add_social">
|
<section class="form" id="add_social">
|
||||||
|
<header>
|
||||||
<h3>Ajouter un compte social</h3>
|
<h3>Ajouter un compte social</h3>
|
||||||
|
</header>
|
||||||
|
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
<input placeholder="Identifiant du compte" type="text" name="socialaccount" id="socialaccount"><br>
|
<input placeholder="Identifiant du compte" type="text" name="socialaccount" id="socialaccount" /><br />
|
||||||
<?php
|
<?php
|
||||||
if( API_TWITTER !== FALSE )
|
if( API_TWITTER !== FALSE ) {
|
||||||
echo '<input type="radio" name="socialinstance" value="twitter">Twitter<br>';
|
if( API_TWITTER === 'LOCAL' )
|
||||||
else echo '<s>Twitter</s><br>'; ?>
|
echo '<input type="radio" name="socialinstance" value="twitter" />Twitter (local)<br />';
|
||||||
<input type="radio" name="socialinstance" value="identica">Identica<br>
|
else
|
||||||
<input type="radio" name="socialinstance" value="statusnet">
|
echo '<input type="radio" name="socialinstance" value="twitter" />Twitter (via <a href="'.strtok(API_TWITTER,'?').'">bridge</a>)<br />';
|
||||||
<input placeholder="statusnet.personnel.com" type="text" name="statusneturl" id="statusneturl"><br>
|
}
|
||||||
<input placeholder="Antibot : Ecrivez '<?php echo $antibot; ?>' en chiffres" type="text" name="number" class="smallinput"><br>
|
else echo '<s>Twitter</s><br />'; ?>
|
||||||
|
<input type="radio" name="socialinstance" value="statusnet" />
|
||||||
|
<input placeholder="statusnet.personnel.com" type="text" name="statusneturl" id="statusneturl" /><br />
|
||||||
|
<input type="radio" name="socialinstance" value="youtube" />Youtube<br />
|
||||||
|
<input placeholder="Antibot : écrivez « <?php echo $antibot; ?> » en chiffres" type="text" name="number" class="smallinput" /><br />
|
||||||
<input type="hidden" name="antibot" value="<?php echo $antibot; ?>" />
|
<input type="hidden" name="antibot" value="<?php echo $antibot; ?>" />
|
||||||
<input type="submit" value="Créer">
|
<input type="submit" value="Créer" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</section>
|
||||||
|
<section class="form" id="add_shaarli">
|
||||||
<div class="form" id="add_shaarli">
|
<header>
|
||||||
<h3>Ajouter un Shaarli</h3>
|
<h3>Ajouter un Shaarli</h3>
|
||||||
|
</header>
|
||||||
|
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
<input type="hidden" name="socialinstance" value="shaarli">
|
<input type="hidden" name="socialinstance" value="shaarli" />
|
||||||
<input placeholder="shaarli.personnel.com" type="text" name="shaarliurl" id="shaarliurl"><br>
|
<input placeholder="shaarli.personnel.com" type="text" name="shaarliurl" id="shaarliurl" /><br />
|
||||||
<input placeholder="Antibot : Ecrivez '<?php echo $antibot; ?>' en chiffres" type="text" name="number" class="smallinput"><br>
|
<input placeholder="Antibot : écrivez « <?php echo $antibot; ?> » en chiffres" type="text" name="number" class="smallinput" /><br />
|
||||||
<input type="hidden" name="antibot" value="<?php echo $antibot; ?>" />
|
<input type="hidden" name="antibot" value="<?php echo $antibot; ?>" />
|
||||||
<input type="submit" value="Créer">
|
<input type="submit" value="Créer" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</section>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE == TRUE) { ?>
|
if(ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE == TRUE) { ?>
|
||||||
<div class="form" id="add_opmlfile">
|
<section class="form" id="add_opmlfile">
|
||||||
|
<header>
|
||||||
<h3>Ajouter par fichier OPML</h3>
|
<h3>Ajouter par fichier OPML</h3>
|
||||||
|
</header>
|
||||||
|
|
||||||
<form enctype='multipart/form-data' method='POST'>
|
<form enctype='multipart/form-data' method='POST'>
|
||||||
<input type='hidden' name='opml_file' value='1' />
|
<input type='hidden' name='opml_file' value='1' />
|
||||||
<input type='file' name='file' /><br>
|
<input type='file' name='file' /><br />
|
||||||
<input placeholder="Antibot : Ecrivez '<?php echo $antibot; ?>' en chiffres" type="text" name="number" class="smallinput"><br>
|
<input placeholder="Antibot : écrivez « <?php echo $antibot; ?> » en chiffres" type="text" name="number" class="smallinput" /><br />
|
||||||
<input type="hidden" name="antibot" value="<?php echo $antibot; ?>" />
|
<input type="hidden" name="antibot" value="<?php echo $antibot; ?>" />
|
||||||
<input type='submit' value='Importer' />
|
<input type='submit' value='Importer' />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK == TRUE) { ?>
|
if(ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK == TRUE) { ?>
|
||||||
<div class="form" id="add_opmllink">
|
<section class="form" id="add_opmllink">
|
||||||
|
<header>
|
||||||
<h3>Ajouter par lien OPML</h3>
|
<h3>Ajouter par lien OPML</h3>
|
||||||
|
</header>
|
||||||
|
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
<input type="hidden" name="opml_link" value="1">
|
<input type="hidden" name="opml_link" value="1" />
|
||||||
<input placeholder="Lien vers OPML" type="text" name="opml_url" id="opml_url" class="smallinput"><br>
|
<input placeholder="Lien vers OPML" type="text" name="opml_url" id="opml_url" class="smallinput" /><br />
|
||||||
<input placeholder="Antibot : Ecrivez '<?php echo $antibot; ?>' en chiffres" type="text" name="number" class="smallinput"><br>
|
<input placeholder="Antibot : écrivez « <?php echo $antibot; ?> » en chiffres" type="text" name="number" class="smallinput" /><br />
|
||||||
<input type="hidden" name="antibot" value="<?php echo $antibot; ?>" />
|
<input type="hidden" name="antibot" value="<?php echo $antibot; ?>" />
|
||||||
<input type="submit" value="Envoyer">
|
<input type="submit" value="Envoyer" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</section>
|
||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
if(ALLOW_NEW_AUTOBLOGS_BY_BUTTON == TRUE) { ?>
|
if(ALLOW_NEW_AUTOBLOGS_BY_BUTTON == TRUE) { ?>
|
||||||
<div class="form" id="add_bookmark">
|
<section class="form" id="add_bookmark">
|
||||||
|
<header>
|
||||||
<h3>Marque page</h3>
|
<h3>Marque page</h3>
|
||||||
<p>Pour ajouter facilement un autoblog d'un site web, glissez ce bouton dans votre barre de marque-pages →
|
</header>
|
||||||
<a class="bouton" onclick="alert('Glissez ce bouton dans votre barre de marque-pages (ou clic-droit > marque-page sur ce lien)');return false;"
|
|
||||||
href="javascript:(function(){var%20autoblog_url="<?php echo serverUrl().$_SERVER["REQUEST_URI"]; ?>";var%20popup=window.open("","Add%20autoblog",'height=180,width=670');popup.document.writeln('<html><head></head><body><form%20action="'+autoblog_url+'"%20method="GET">');popup.document.write('Url%20feed%20%20:%20<br/>');var%20feed_links=new%20Array();var%20links=document.getElementsByTagName('link');if(links.length>0){for(var%20i=0;i<links.length;i++){if(links[i].rel=="alternate"){popup.document.writeln('<label%20for="feed_'+i+'"><input%20id="feed_'+i+'"%20type="radio"%20name="rssurl"%20value="'+links[i].href+'"/>'+links[i].title+"%20(%20"+links[i].href+"%20)</label><br/>");}}}popup.document.writeln("<input%20id='number'%20type='hidden'%20name='number'%20value='17'>");popup.document.writeln("<input%20type='hidden'%20name='via_button'%20value='1'>");popup.document.writeln("<br/><input%20type='submit'%20value='Vérifier'%20name='Ajouter'%20>");popup.document.writeln("</form></body></html>");})();">
|
<p>
|
||||||
Projet Autoblog
|
Pour ajouter facilement un autoblog d'un site web, glissez ce bouton dans votre barre de marque-pages →
|
||||||
</a>
|
<a class="bouton" onclick=
|
||||||
</div>
|
"alert('Glissez ce bouton dans votre barre de marque-pages (ou clic-droit > marque-page sur ce lien)');
|
||||||
<?php } ?>
|
return false;"
|
||||||
</div>
|
href="javascript:(function(){var%20autoblog_url="<?php echo serverUrl().$_SERVER["REQUEST_URI"]; ?>";var%20popup=window.open("","Add%20autoblog",'height=180,width=670');popup.document.writeln('<html><head></head><body><form%20action="'+autoblog_url+'"%20method="GET">');popup.document.write('Url%20feed%20%20:%20<br/>');var%20feed_links=new%20Array();var%20links=document.getElementsByTagName('link');if(links.length>0){for(var%20i=0;i<links.length;i++){if(links[i].rel=="alternate"){popup.document.writeln('<label%20for="feed_'+i+'"><input%20id="feed_'+i+'"%20type="radio"%20name="rssurl"%20value="'+links[i].href+'"/>'+links[i].title+"%20(%20"+links[i].href+"%20)</label><br/>");}}}popup.document.writeln("<input%20id='number'%20type='hidden'%20name='number'%20value='17'>");popup.document.writeln("<input%20type='hidden'%20name='via_button'%20value='1'>");popup.document.writeln("<br/><input%20type='submit'%20value='Vérifier'%20name='Ajouter'%20>");popup.document.writeln("</form></body></html>");})();">Projet Autoblog</a>
|
||||||
<?php } ?>
|
</section>
|
||||||
|
<?php } ?>
|
||||||
|
</section>
|
||||||
|
<?php }
|
||||||
|
$fichierCache = 'cache_docs';
|
||||||
|
// si la page n'existe pas dans le cache ou si elle a expiré (durée paramétrable)
|
||||||
|
// on lance la génération de la page et on la stoke dans un fichier
|
||||||
|
if (@filemtime($fichierCache)<time()-(DOCS_CACHE_DURATION)) {
|
||||||
|
// on démarre la bufferisation : rien n'est envoyé au navigateur
|
||||||
|
ob_start();
|
||||||
|
|
||||||
<?php
|
|
||||||
$directory = DOC_FOLDER;
|
$directory = DOC_FOLDER;
|
||||||
$docs = array();
|
$docs = array();
|
||||||
if( is_dir($directory) && !file_exists($directory . '.disabled') ) {
|
if( is_dir($directory) && !file_exists($directory . '.disabled') ) {
|
||||||
$subdirs = glob($directory . "*");
|
$subdirs = glob($directory . "*");
|
||||||
foreach($subdirs as $unit)
|
foreach($subdirs as $unit) {
|
||||||
{
|
|
||||||
if(!is_dir($unit) || file_exists( $unit . '/index.html' ) || file_exists( $unit . '/index.htm' ) || file_exists( $unit . '/index.php' ) ) {
|
if(!is_dir($unit) || file_exists( $unit . '/index.html' ) || file_exists( $unit . '/index.htm' ) || file_exists( $unit . '/index.php' ) ) {
|
||||||
$docs[] = '<a href="'. $unit . '">'. substr($unit, (strrpos($unit, '/')) + 1 ) .'</a>';
|
$size = '';
|
||||||
}
|
if ( is_file($unit) ) { $size = get_size($unit); }
|
||||||
|
$docs[] = array('<a href="'. preg_replace('~ ~', '%20', $unit) . '">'. substr($unit, (strrpos($unit, '/')) + 1 ) .'</a>', $size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!empty( $docs )) {
|
if(!empty( $docs )) {
|
||||||
echo '<div class="pbloc"><h2>Autres documents</h2><ul>';
|
echo ' <section id="docs">
|
||||||
foreach( $docs as $value )
|
<header>
|
||||||
echo '<li>'. $value .'</li>';
|
<h2>Autres documents</h2>
|
||||||
echo '</ul></div>';
|
</header>
|
||||||
|
|
||||||
|
<ul>'."\n";
|
||||||
|
|
||||||
|
foreach( $docs as $value ) {
|
||||||
|
$str = $value[0];
|
||||||
|
if ( !empty($value[1]) ) {
|
||||||
|
$str = sprintf('%s (%s)', $value[0], $value[1]);
|
||||||
|
}
|
||||||
|
echo ' <li>'. $str . "</li>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo ' </ul>
|
||||||
|
</section>'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// on recuperre le contenu du buffer
|
||||||
|
$contenuCache = ob_get_contents();
|
||||||
|
ob_end_clean(); // on termine la bufferisation
|
||||||
|
if( !empty($contenuCache) ) {
|
||||||
|
file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache
|
||||||
|
}
|
||||||
|
echo $contenuCache; // et on sort
|
||||||
|
// sinon le fichier cache existe déjà, on ne génère pas la page
|
||||||
|
// et on envoie le fichier statique à la place
|
||||||
|
} else {
|
||||||
|
readfile($fichierCache); // affichage du contenu du fichier
|
||||||
|
echo ' <!-- Section « documents » (présente uniquement si non vide) servie par le cache -->'."\n"; // et un petit message
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
<section id="autoblogs">
|
||||||
<div class="pbloc">
|
<header>
|
||||||
<h2>Autoblogs hébergés <a href="?rss" title="RSS des changements"><img src="<?php echo RESOURCES_FOLDER; ?>rss.png" alt="rss"/></a></h2>
|
<h2>Autoblogs hébergés <a href="?rss" title="RSS des changements"><img src="<?php echo RESOURCES_FOLDER; ?>rss.png" alt="rss"/></a></h2>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<nav class="clear">
|
||||||
|
<a href="?sitemap">sitemap</a> |
|
||||||
|
<a href="?export" >export<sup>JSON</sup></a> |
|
||||||
|
<a href="?exportopml">export<sup>OPML</sup></a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
<div class="clear"><a href="?sitemap">sitemap</a> | <a href="?export">export<sup> JSON</sup></a> | <a href="?exportopml">export<sup> OPML</sup></a></div>
|
|
||||||
<div id="contentVignette">
|
|
||||||
<?php
|
<?php
|
||||||
|
$fichierCache = 'cache_autoblogs';
|
||||||
|
// si la page n'existe pas dans le cache ou si elle a expiré (durée paramétrable)
|
||||||
|
// on lance la génération de la page et on la stoke dans un fichier
|
||||||
|
if (@filemtime($fichierCache)<time()-(AUTOBLOGS_CACHE_DURATION)) {
|
||||||
|
// on démarre la bufferisation : rien n'est envoyé au navigateur
|
||||||
|
ob_start();
|
||||||
|
|
||||||
|
echo '<ul>
|
||||||
|
';
|
||||||
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
|
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
|
||||||
$autoblogs = array();
|
$autoblogs = array();
|
||||||
foreach($subdirs as $unit)
|
foreach($subdirs as $unit) {
|
||||||
{
|
if(is_dir($unit)) {
|
||||||
if(is_dir($unit))
|
|
||||||
{
|
|
||||||
if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) {
|
if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) {
|
||||||
if( file_exists(ROOT_DIR . '/' . $unit . '/vvb.ini')) {
|
if( file_exists(ROOT_DIR . '/' . $unit . '/vvb.ini')) {
|
||||||
$ini = parse_ini_file(ROOT_DIR . '/' . $unit . '/vvb.ini');
|
$ini = parse_ini_file(ROOT_DIR . '/' . $unit . '/vvb.ini');
|
||||||
if($ini)
|
if($ini) {
|
||||||
{
|
|
||||||
$config = new stdClass;
|
$config = new stdClass;
|
||||||
$unit=substr($unit, 2);
|
foreach ($ini as $key=>$value) {
|
||||||
foreach ($ini as $key=>$value)
|
|
||||||
{
|
|
||||||
$key = strtolower($key);
|
$key = strtolower($key);
|
||||||
$config->$key = $value;
|
$config->$key = $value;
|
||||||
}
|
}
|
||||||
|
@ -891,11 +979,18 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
|
||||||
|
|
||||||
uasort($autoblogs, "objectCmp");
|
uasort($autoblogs, "objectCmp");
|
||||||
$autoblogs_display = '';
|
$autoblogs_display = '';
|
||||||
|
|
||||||
if(!empty($autoblogs)){
|
if(!empty($autoblogs)){
|
||||||
foreach ($autoblogs as $key => $autoblog) {
|
foreach ($autoblogs as $key => $autoblog) {
|
||||||
$opml_link='<a href="'.$key.'/?opml">opml</a>';
|
$opml_link='<a href="'.$key.'/?opml">opml</a>';
|
||||||
$autoblogs_display .= '<div class="vignette">
|
$autoblogs_display .= '<li>
|
||||||
<div class="title"><a title="'.escape($autoblog->site_title).'" href="'.$key.'/"><img width="15" height="15" alt="" src="./?check='.$key.'"> '.escape($autoblog->site_title).'</a></div>';
|
<header>
|
||||||
|
<a title="'.escape($autoblog->site_title).'" href="'.$key.'/">
|
||||||
|
<img width="15" height="15" alt="" src="'.RESOURCES_FOLDER.'icon-'.escape($autoblog->site_type).'.svg" />
|
||||||
|
<img width="15" height="15" alt="" src="./?check='.$key.'" />
|
||||||
|
<h3>'.escape($autoblog->site_title).'</h3>
|
||||||
|
</a>
|
||||||
|
</header>';
|
||||||
if($myOptions['enableThumbShot'] === true){
|
if($myOptions['enableThumbShot'] === true){
|
||||||
if(file_exists(ROOT_DIR . '/' . $key . '/thumbshot.png')){
|
if(file_exists(ROOT_DIR . '/' . $key . '/thumbshot.png')){
|
||||||
$autoblogs_display .= '<div class="thumbshot"><img src="'.ROOT_DIR . '/' . $key . '/thumbshot.png" title="Thumbshot de '.escape($autoblog->site_title).'"/></div>
|
$autoblogs_display .= '<div class="thumbshot"><img src="'.ROOT_DIR . '/' . $key . '/thumbshot.png" title="Thumbshot de '.escape($autoblog->site_title).'"/></div>
|
||||||
|
@ -905,21 +1000,40 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
|
||||||
<div class="siteDesc">'.shortSiteDesc(escape($autoblog->site_meta_description)).'</div>';
|
<div class="siteDesc">'.shortSiteDesc(escape($autoblog->site_meta_description)).'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$autoblogs_display .= '<div class="source">config <sup><a href="'.$key.'/vvb.ini">ini</a> '.$opml_link.'</sup> | '.escape($autoblog->site_type).' source: <a href="'.escape($autoblog->site_url).'">'.escape($autoblog->site_url).'</a></div>
|
$autoblogs_display .= '
|
||||||
</div>';
|
<div class="source">config <sup><a href="'.$key.'/vvb.ini">ini</a> '.$opml_link.'</sup> | '.escape($autoblog->site_type).' source : <a href="'.escape($autoblog->site_url).'">'.escape($autoblog->site_url).'</a></div>
|
||||||
|
</li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo $autoblogs_display;
|
echo $autoblogs_display;
|
||||||
|
|
||||||
|
echo '
|
||||||
|
</ul>
|
||||||
|
<p>'.count($autoblogs).' autoblogs hébergés</p>';
|
||||||
|
|
||||||
|
// on recuperre le contenu du buffer
|
||||||
|
$contenuCache = ob_get_contents();
|
||||||
|
ob_end_clean(); // on termine la bufferisation
|
||||||
|
if( !empty($contenuCache) ) {
|
||||||
|
file_put_contents("$fichierCache",$contenuCache, LOCK_EX); // on écrit le contenu du buffer dans le fichier cache
|
||||||
|
}
|
||||||
|
echo $contenuCache; // et on sort
|
||||||
|
// sinon le fichier cache existe déjà, on ne génère pas la page
|
||||||
|
// et on envoie le fichier statique à la place
|
||||||
|
} else {
|
||||||
|
echo '<!-- Début du cache -->'."\n".' '; // un message de début
|
||||||
|
readfile($fichierCache); // affichage du contenu du fichier
|
||||||
|
echo "\n".' <!-- Fin du cache -->'."\n"; // et un petit message
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</section>
|
||||||
<div class="clear"></div>
|
|
||||||
|
<footer>
|
||||||
|
<p>Propulsé par <a href="https://github.com/mitsukarenai/Projet-Autoblog">Projet Autoblog 0.3</a> de <a href="https://www.suumitsu.eu/">Mitsu</a>, <a href="https://www.ecirtam.net/">Oros</a> et <a href="http://hoa.ro">Arthur Hoaro</a> (Domaine Public)</p>
|
||||||
|
<p><?php if(defined('FOOTER') && strlen(FOOTER)>0 ){ echo FOOTER; } ?></p>
|
||||||
|
</footer>
|
||||||
|
|
||||||
<?php echo "<p>".count($autoblogs)." autoblogs hébergés</p>"; ?>
|
|
||||||
</div>
|
|
||||||
Propulsé par <a href="https://github.com/mitsukarenai/Projet-Autoblog">Projet Autoblog 0.3</a> de <a href="https://www.suumitsu.eu/">Mitsu</a>, <a href="https://www.ecirtam.net/">Oros</a> et <a href="http://hoa.ro">Arthur Hoaro</a> (Domaine Public)
|
|
||||||
<?php if(defined('FOOTER') && strlen(FOOTER)>0 ){ echo "<br/>".FOOTER; } ?>
|
|
||||||
<iframe width="1" height="1" style="display:none" src="xsaf3.php"></iframe>
|
<iframe width="1" height="1" style="display:none" src="xsaf3.php"></iframe>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php if( !empty($_POST['generic']) && !empty($_POST['siteurl']) || empty($_POST['generic']) )
|
<?php if( !empty($_POST['generic']) && !empty($_POST['siteurl']) || empty($_POST['generic']) )
|
||||||
echo "document.getElementById('add_generic').style.display = 'none';"; ?>
|
echo "document.getElementById('add_generic').style.display = 'none';"; ?>
|
||||||
|
@ -934,7 +1048,6 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
|
||||||
document.getElementById('button_'+str).className = (document.getElementById('button_'+str).className != 'buttonactive' ? 'buttonactive' : 'button' );
|
document.getElementById('button_'+str).className = (document.getElementById('button_'+str).className != 'buttonactive' ? 'buttonactive' : 'button' );
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -9,38 +9,40 @@
|
||||||
body {background-color:#efefef;text-align:center;color:#333;font-family:sans-serif;}
|
body {background-color:#efefef;text-align:center;color:#333;font-family:sans-serif;}
|
||||||
a {color:black;text-decoration:none;font-weight:bold;}
|
a {color:black;text-decoration:none;font-weight:bold;}
|
||||||
a:hover {color:darkred;}
|
a:hover {color:darkred;}
|
||||||
h1 {text-align:center;font-size:40pt;text-shadow: #ccc 0px 5px 5px;}
|
h1 {text-transform:uppercase;text-align:center;font-size:40pt;text-shadow: #ccc 0px 5px 5px;}
|
||||||
h2 {text-align:center;font-size: 16pt;margin:0 0 1em 0;font-style:italic;text-shadow: #ccc 0px 5px 5px; }
|
h2 {text-align:center;font-size: 16pt;margin:0 0 1em 0;font-style:italic;text-shadow: #ccc 0px 5px 5px; }
|
||||||
.pbloc {background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;text-align:justify;box-shadow:0px 5px 7px #aaa;}
|
body > section {background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;text-align:justify;box-shadow:0px 5px 7px #aaa;}
|
||||||
|
li {list-style-type:none;}
|
||||||
input[type="text"]{width:20em;}
|
input[type="text"]{width:20em;}
|
||||||
input[type="radio"] {width:1em;}
|
input[type="radio"] {width:1em;}
|
||||||
input[type="submit"] {width:8em;}
|
input[type="submit"] {width:8em;}
|
||||||
div.form {padding:0.2em;border:1px solid #fff;}
|
section.form {padding:0.2em;border:1px solid #fff;}
|
||||||
div.form:hover {background-color:#FAF4DA;border:1px dotted;}
|
section.form:hover {background-color:#FAF4DA;border:1px dotted;}
|
||||||
#contentVignette {text-align: center;}
|
section#autoblogs > ul {text-align: center;padding:0;}
|
||||||
.vignette {width:27%;height:2em;display: inline-block;text-align:justify;margin:0; padding:20px;background-color:#eee;border: 1px solid #888;}
|
section#autoblogs > ul > li {width:27%;height:2em;display: inline-block;text-align:justify;margin:0; padding:20px;background-color:#eee;border: 1px solid #888;}
|
||||||
.vignette:hover {background-color:#fff;}
|
section#autoblogs > ul > li:hover {background-color:#fff;}
|
||||||
.vignette .title {font-size: 14pt;text-shadow: #ccc 0px 5px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
section#autoblogs > ul > li header, section#autoblogs > ul > li h3 {font-size: large;text-shadow: #ccc 0px 5px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
.vignette .title a:hover {color:darkred; text-decoration:none;}
|
section#autoblogs > ul > li h3 {display:inline;font-size:large;text-overflow:ellipsis;width:100%;}
|
||||||
.vignette .source {font-size:x-small;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
section#autoblogs > ul > li header a:hover {color:darkred; text-decoration:none;}
|
||||||
.vignette .source a:hover {color:darkred; text-decoration:none;}
|
section#autoblogs > ul > li .source {font-size:x-small;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||||
|
section#autoblogs > ul > li .source a:hover {color:darkred; text-decoration:none;}
|
||||||
.clear {clear:both;text-align:right;font-size:small;}
|
.clear {clear:both;text-align:right;font-size:small;}
|
||||||
#logo {float: right;}
|
#logo {float: right;}
|
||||||
.bouton{background: -moz-linear-gradient(center top , #EDEDED 5%, #DFDFDF 100%) repeat scroll 0 0 #EDEDED;border: 1px none;padding: 10px;border: 1px solid #7777777;border-radius: 8px 8px 8px 8px;box-shadow: 0 1px 0 0 #FFFFFF inset;display: inline-block;}
|
.bouton{border: 1px none;padding: 10px;border: 1px solid #777777;border-radius: 8px 8px 8px 8px;box-shadow: 0 1px 0 0 #FFFFFF inset;display: inline-block;}
|
||||||
.success {color: green;}
|
.success {color: green;}
|
||||||
.error {color: red;}
|
.error {color: red;}
|
||||||
.button_list{display:none;}
|
.button_list{display:none;}
|
||||||
.button{-moz-box-shadow:inset 0 1px 0 0 #d9fbbe;-webkit-box-shadow:inset 0 1px 0 0 #d9fbbe;box-shadow:inset 0 1px 0 0 #d9fbbe;background:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b8e356',endColorstr='#a5cc52');background-color:#b8e356;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;}
|
.button{box-shadow:inset 0 1px 0 0 #d9fbbe;background:0;background-color:#b8e356;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;}
|
||||||
.button:hover{background:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#a5cc52',endColorstr='#b8e356');background-color:#a5cc52;}
|
.button:hover{background:0;background-color:#a5cc52;}
|
||||||
.button:active{position:relative;top:1px;}
|
.button:active{position:relative;top:1px;}
|
||||||
.buttonactive{background-color:#aaa;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;}
|
.buttonactive{background-color:#aaa;border-radius:6px;border:1px solid #83c41a;display:inline-block;color:#fff;font-family:arial;font-size:14px;font-weight:700;text-decoration:none;text-shadow:1px 1px 0 #86ae47;padding:6px 24px;}
|
||||||
@media screen and (max-width:1024px) {
|
@media screen and (max-width:1024px) {
|
||||||
.vignette { width: 40%; }
|
section#autoblogs > ul > li { width: 40%; }
|
||||||
}
|
}
|
||||||
@media screen and (max-width:640px) {
|
@media screen and (max-width:640px) {
|
||||||
h1 { font-size:20pt; }
|
h1 { font-size:20pt; }
|
||||||
.button, .button:hover, .button:active, .buttonactive { display: block; margin: auto; text-align:center; }
|
.button, .button:hover, .button:active, .buttonactive { display: block; margin: auto; text-align:center; }
|
||||||
.vignette { width: 80%; }
|
section#autoblogs > ul > li { width: 80%; }
|
||||||
}
|
}
|
||||||
@media screen and (max-width:480px) {
|
@media screen and (max-width:480px) {
|
||||||
#logo { max-width: 250px; }
|
#logo { max-width: 250px; }
|
||||||
|
|
1
resources/icon-generic.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15"><circle cx="7.5" cy="7.5" r="4" style="stroke:#000;fill:none;stroke-width:4" /></svg>
|
After Width: | Height: | Size: 149 B |
BIN
resources/icon-logo.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
|
@ -1,218 +1,64 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="m 106.4,68.92 h -1.718 v -8.911 c 0,-0.7938 0.026,-1.968 0.0781,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103 l -1.435,1.181 -0.9467,-1.2 3.738,-2.918 h 1.464 v 14.27" />
|
||||||
<svg
|
<g transform="matrix(0.91699047,-0.39890912,0.39890912,0.91699047,0,0)">
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
<path d="m 63.17,105.2 h -1.718 v -8.911 c -6e-6,-0.7938 0.02602,-1.968 0.07808,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103 l -1.435,1.181 -0.9467,-1.2 3.738,-2.918 h 1.464" />
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
version="1.1"
|
|
||||||
width="300"
|
|
||||||
height="180"
|
|
||||||
id="svg2">
|
|
||||||
<defs
|
|
||||||
id="defs4" />
|
|
||||||
<metadata
|
|
||||||
id="metadata7">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<g
|
|
||||||
id="layer5">
|
|
||||||
<g
|
|
||||||
id="text2990-7"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 106.42552,68.920204 -1.71775,0 0,-8.910788 c 0,-0.793795 0.026,-1.968235 0.0781,-3.523323 -0.25376,0.279795 -0.64741,0.647418 -1.18095,1.102868 l -1.4347,1.180948 -0.94671,-1.200468 3.73804,-2.91821 1.46399,0 0,14.268973"
|
|
||||||
id="path3056" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(-0.59341889,-0.8048938,0.8048938,-0.59341889,0,0)">
|
||||||
transform="matrix(-0.96800707,0.25092291,-0.25092291,-0.96800707,0,0)"
|
<path d="m -126.7,27.24 h -1.718 v -8.911 c 0,-0.7938 0.026,-1.968 0.0781,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103 l -1.435,1.181 -0.9467,-1.2 3.738,-2.918 h 1.464" />
|
||||||
id="text2990-7-4"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m -83.665748,-114.1049 -1.717742,0 0,-8.91078 c -6e-6,-0.7938 0.02602,-1.96824 0.07808,-3.52333 -0.253763,0.2798 -0.647411,0.64742 -1.180947,1.10287 l -1.434706,1.18095 -0.94671,-1.20047 3.738042,-2.91821 1.463984,0 0,14.26897"
|
|
||||||
id="path3059" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(0.31316381,-0.94969913,0.94969913,0.31316381,0,0)">
|
||||||
transform="matrix(0.91697723,-0.39893955,0.39893955,0.91697723,0,0)"
|
<path d="m -41.44,113 h -1.718 v -8.911 c -5e-6,-0.7938 0.02602,-1.968 0.07808,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103 l -1.435,1.181 -0.9467,-1.2 3.738,-2.918" />
|
||||||
id="text2990-7-9"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 63.170327,105.14977 -1.717742,0 0,-8.910785 c -6e-6,-0.793796 0.02602,-1.968236 0.07808,-3.523324 -0.253763,0.279796 -0.647412,0.647418 -1.180948,1.102869 l -1.434705,1.180947 -0.94671,-1.200467 3.738041,-2.91821 1.463985,0 0,14.26897"
|
|
||||||
id="path3062" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(-0.26555612,-0.9640954,0.9640954,-0.26555612,0,0)">
|
||||||
transform="matrix(-0.59314555,-0.80509524,0.80509524,-0.59314555,0,0)"
|
<path d="m -101.8,68.7 h -1.718 v -8.911 c -1e-5,-0.7938 0.026,-1.968 0.0781,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103 l -1.435,1.181 -0.9467,-1.2" />
|
||||||
id="text2990-7-5"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m -126.66057,27.239197 -1.71775,0 0,-8.910788 c 0,-0.793796 0.026,-1.968236 0.0781,-3.523324 -0.25376,0.279796 -0.64741,0.647419 -1.18095,1.102869 l -1.4347,1.180948 -0.94671,-1.200468 3.73804,-2.91821 1.46399,0 0,14.268973"
|
|
||||||
id="path3065" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(-0.66392621,0.74779809,-0.74779809,-0.66392621,0,0)">
|
||||||
transform="matrix(0.31319215,-0.94968978,0.94968978,0.31319215,0,0)"
|
<path d="m -10.77,-142.4 h -1.718 v -8.911 c -6e-6,-0.7938 0.02602,-1.968 0.07808,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103 l -1.435,1.181" />
|
||||||
id="text2990-7-81"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m -41.445109,113.0434 -1.717743,0 0,-8.91078 c -5e-6,-0.7938 0.02602,-1.96824 0.07808,-3.52333 -0.253763,0.2798 -0.647412,0.64742 -1.180948,1.10287 l -1.434705,1.18095 -0.946711,-1.20047 3.738042,-2.918209 1.463985,0 0,14.268969"
|
|
||||||
id="path3068" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(0.61648634,0.7873656,-0.7873656,0.61648634,0,0)">
|
||||||
transform="matrix(-0.26611424,-0.9639415,0.9639415,-0.26611424,0,0)"
|
<path d="m 122.5,-67.26 h -1.718 v -8.911 c -1e-5,-0.7938 0.026,-1.968 0.0781,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103 l -1.435,1.181" />
|
||||||
id="text2990-7-99"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m -101.83545,68.705475 -1.71774,0 0,-8.910788 c -1e-5,-0.793796 0.026,-1.968236 0.0781,-3.523324 -0.25376,0.279796 -0.64741,0.647419 -1.18095,1.102869 l -1.4347,1.180948 -0.94671,-1.200468 3.73804,-2.91821 1.46398,0 0,14.268973"
|
|
||||||
id="path3071" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(0.03315518,0.99945022,-0.99945022,0.03315518,0,0)">
|
||||||
transform="matrix(-0.66389743,0.74782364,-0.74782364,-0.66389743,0,0)"
|
<path d="m 86.24,-144.5 h -1.718 v -8.911 c -5e-6,-0.7938 0.02602,-1.968 0.07808,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103" />
|
||||||
id="text2990-7-0"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m -10.770921,-142.41505 -1.717742,0 0,-8.91079 c -6e-6,-0.7938 0.02602,-1.96824 0.07808,-3.52333 -0.253763,0.2798 -0.647412,0.64742 -1.180948,1.10287 l -1.434705,1.18095 -0.94671,-1.20047 3.738041,-2.91821 1.463985,0 0,14.26898"
|
|
||||||
id="path3074" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(0.56208338,0.82708057,-0.82708057,0.56208338,0,0)">
|
||||||
transform="matrix(0.61642924,0.78741031,-0.78741031,0.61642924,0,0)"
|
<path d="m 141.5,-115.3 h -1.718 v -8.911 c -1e-5,-0.7938 0.026,-1.968 0.0781,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103" />
|
||||||
id="text2990-7-47"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 122.52353,-67.256531 -1.71774,0 0,-8.910788 c -1e-5,-0.793795 0.026,-1.968235 0.0781,-3.523323 -0.25377,0.279796 -0.64741,0.647418 -1.18095,1.102868 l -1.43471,1.180948 -0.94671,-1.200468 3.73805,-2.918209 1.46398,0 0,14.268972"
|
|
||||||
id="path3077" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(0.4102414,0.91197697,-0.91197697,0.4102414,0,0)">
|
||||||
transform="matrix(0.03313105,0.99945102,-0.99945102,0.03313105,0,0)"
|
<path d="m 106.6,-165.8 h -1.718 v -8.911 c -1e-5,-0.7938 0.026,-1.968 0.0781,-3.523 -0.2538,0.2798 -0.6474,0.6474 -1.181,1.103" />
|
||||||
id="text2990-7-50"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 86.240953,-144.46338 -1.717743,0 0,-8.91079 c -5e-6,-0.79379 0.02602,-1.96823 0.07808,-3.52332 -0.253762,0.2798 -0.647411,0.64742 -1.180947,1.10287 l -1.434706,1.18095 -0.94671,-1.20047 3.738042,-2.91821 1.463985,0 0,14.26897"
|
|
||||||
id="path3080" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(-0.23683815,0.97154912,-0.97154912,-0.23683815,0,0)">
|
||||||
transform="matrix(0.56201745,0.82712538,-0.82712538,0.56201745,0,0)"
|
<path d="m 21.37,-224.2 h -1.718 v -8.911 c -6e-6,-0.7938 0.02602,-1.968 0.07808,-3.523" />
|
||||||
id="text2990-7-6"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 141.46955,-115.26434 -1.71774,0 0,-8.91079 c -1e-5,-0.7938 0.026,-1.96824 0.0781,-3.52332 -0.25376,0.27979 -0.64741,0.64741 -1.18095,1.10286 l -1.4347,1.18095 -0.94671,-1.20047 3.73804,-2.91821 1.46398,0 0,14.26898"
|
|
||||||
id="path3083" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(0.260336,0.96551808,-0.96551808,0.260336,0,0)">
|
||||||
transform="matrix(0.41026184,0.91196777,-0.91196777,0.41026184,0,0)"
|
<path d="m 109.5,-224.8 h -1.718 v -8.911 c -1e-5,-0.7938 0.026,-1.968 0.0781,-3.523" />
|
||||||
id="text2990-7-68"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 106.62199,-165.76779 -1.71774,0 0,-8.91079 c -1e-5,-0.7938 0.026,-1.96824 0.0781,-3.52332 -0.25376,0.27979 -0.64741,0.64742 -1.18094,1.10287 l -1.43471,1.18094 -0.94671,-1.20046 3.73804,-2.91821 1.46399,0 0,14.26897"
|
|
||||||
id="path3086" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(-0.7254,-0.2967,-0.483,1.181,0,0)">
|
||||||
transform="matrix(-0.23609203,0.9717307,-0.9717307,-0.23609203,0,0)"
|
<path d="m -165.4,43.09 c -0.9741,0 -1.712,-0.4105 -2.214,-1.231" />
|
||||||
id="text2990-7-07"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 21.373971,-224.19429 -1.717742,0 0,-8.91079 c -6e-6,-0.79379 0.02602,-1.96823 0.07808,-3.52332 -0.253763,0.27979 -0.647412,0.64742 -1.180948,1.10287 l -1.434705,1.18094 -0.94671,-1.20046 3.738041,-2.91821 1.463985,0 0,14.26897"
|
|
||||||
id="path3089" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(-0.7582,-0.1986,-0.3232,1.234,0,0)">
|
||||||
transform="matrix(0.26029759,0.96552844,-0.96552844,0.26029759,0,0)"
|
<path d="M -151.5,77.36" />
|
||||||
id="text2990-7-1"
|
|
||||||
style="font-size:19.98827362px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 109.52001,-224.81616 -1.71774,0 0,-8.91079 c -10e-6,-0.7938 0.026,-1.96824 0.0781,-3.52332 -0.25376,0.27979 -0.64741,0.64741 -1.18095,1.10286 l -1.4347,1.18095 -0.94671,-1.20046 3.73804,-2.91821 1.46398,0 0,14.26897"
|
|
||||||
id="path3092" />
|
|
||||||
</g>
|
</g>
|
||||||
|
<g transform="matrix(-0.7675,-0.1589,-0.2587,1.249,0,0)">
|
||||||
|
<path d="m -143.4,102.9 c -0.9741,0 -1.712,-0.4105 -2.214,-1.231 -0.5019,-0.8252 -0.7529,-2.016 -0.7529,-3.573 0,-3.199 0.989,-4.798 2.967,-4.798 0.9868,1e-5 1.731,0.4126 2.233,1.238" />
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(-0.7776,-0.09801,-0.1596,1.266,0,0)">
|
||||||
id="layer3">
|
<path d="m -128.4,130.7 c -0.9741,0 -1.712,-0.4105 -2.214,-1.231 -0.5019,-0.8252 -0.7529,-2.016 -0.7529,-3.573 0,-3.199 0.989,-4.798 2.967,-4.798" />
|
||||||
<g
|
|
||||||
transform="matrix(-0.72542887,-0.29673984,-0.48305239,1.1809002,0,0)"
|
|
||||||
id="text2985-0-36"
|
|
||||||
style="font-size:13.06711483px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans">
|
|
||||||
<path
|
|
||||||
d="m -165.36303,43.093833 c -0.97408,0 -1.71208,-0.410474 -2.21401,-1.231422 -0.50193,-0.8252 -0.75289,-2.016212 -0.75289,-3.573039 0,-3.198713 0.98896,-4.798072 2.9669,-4.798082 0.98683,1e-5 1.73122,0.41261 2.23315,1.237803 0.50617,0.820956 0.75926,2.007714 0.75927,3.560279 -1e-5,3.202975 -0.99748,4.804461 -2.99242,4.804461 m 0,-0.988966 c 0.62528,1e-6 1.08467,-0.297752 1.37817,-0.89326 0.29349,-0.599758 0.44024,-1.573835 0.44025,-2.922235 -1e-5,-1.339884 -0.14676,-2.307581 -0.44025,-2.903095 -0.2935,-0.599752 -0.75289,-0.899632 -1.37817,-0.89964 -0.61678,8e-6 -1.06979,0.297761 -1.35903,0.89326 -0.285,0.59126 -0.42749,1.561084 -0.42749,2.909475 0,1.352653 0.14249,2.326731 0.42749,2.922235 0.28924,0.595508 0.74225,0.893261 1.35903,0.89326"
|
|
||||||
id="path3029"
|
|
||||||
style="font-variant:normal;font-stretch:normal;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(1.222,0.1981,-0.3157,0.7669,0,0)">
|
||||||
transform="matrix(-0.7582023,-0.19857197,-0.32324835,1.234251,0,0)"
|
<path d="m 108.4,118.4 h -1.48 v -7.679 c 0,-0.6841 0.0224,-1.696 0.0673,-3.036 -0.2187,0.2411 -0.5579,0.5579 -1.018,0.9504" />
|
||||||
id="text2985-0-5-3"
|
|
||||||
style="font-size:13.06711483px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans">
|
|
||||||
<path
|
|
||||||
d="m -151.53292,77.359611 c -0.97408,0 -1.71209,-0.410474 -2.21401,-1.231423 -0.50193,-0.8252 -0.75289,-2.016212 -0.75289,-3.573039 0,-3.198713 0.98896,-4.798072 2.9669,-4.798081 0.98683,9e-6 1.73121,0.41261 2.23315,1.237803 0.50617,0.820956 0.75926,2.007714 0.75927,3.560278 -1e-5,3.202976 -0.99748,4.804462 -2.99242,4.804462 m 0,-0.988966 c 0.62527,0 1.08466,-0.297753 1.37817,-0.89326 0.29349,-0.599758 0.44024,-1.573836 0.44025,-2.922236 -1e-5,-1.339884 -0.14676,-2.307581 -0.44025,-2.903094 -0.29351,-0.599752 -0.7529,-0.899632 -1.37817,-0.89964 -0.61678,8e-6 -1.06979,0.297761 -1.35903,0.893259 -0.285,0.59126 -0.42749,1.561084 -0.42749,2.909475 0,1.352654 0.14249,2.326732 0.42749,2.922236 0.28924,0.595507 0.74225,0.89326 1.35903,0.89326"
|
|
||||||
id="path3032"
|
|
||||||
style="font-variant:normal;font-stretch:normal;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(1.238,-0.0259,-0.1721,0.8113,0,0)">
|
||||||
transform="matrix(-0.76749141,-0.15892919,-0.25871525,1.2493724,0,0)"
|
<path d="m 95.07,172.2 h -1.48 v -7.679 c -5e-6,-0.6841 0.02242,-1.696 0.06729,-3.036" />
|
||||||
id="text2985-0-5-3-4"
|
|
||||||
style="font-size:13.06711483px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans">
|
|
||||||
<path
|
|
||||||
d="m -143.35433,102.91132 c -0.97409,0 -1.71209,-0.41048 -2.21401,-1.23143 -0.50193,-0.8252 -0.75289,-2.016209 -0.75289,-3.573036 0,-3.198713 0.98896,-4.798072 2.9669,-4.798082 0.98683,10e-6 1.73121,0.41261 2.23315,1.237803 0.50617,0.820956 0.75926,2.007714 0.75927,3.560279 -1e-5,3.202976 -0.99748,4.804466 -2.99242,4.804466 m 0,-0.98897 c 0.62527,0 1.08466,-0.29775 1.37817,-0.89326 0.29349,-0.59976 0.44024,-1.573836 0.44025,-2.922236 -1e-5,-1.339884 -0.14676,-2.307581 -0.44025,-2.903095 -0.29351,-0.599752 -0.7529,-0.899632 -1.37817,-0.89964 -0.61678,8e-6 -1.06979,0.297761 -1.35903,0.89326 -0.285,0.59126 -0.4275,1.561084 -0.42749,2.909475 -1e-5,1.352653 0.14249,2.326736 0.42749,2.922236 0.28924,0.59551 0.74225,0.89326 1.35903,0.89326"
|
|
||||||
id="path3035"
|
|
||||||
style="font-variant:normal;font-stretch:normal;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(1.238,-0.001471,-0.188,0.8077,0,0)">
|
||||||
transform="matrix(-0.77762174,-0.09801014,-0.15954727,1.2658632,0,0)"
|
<path d="m 97.01,203.2 h -1.48 v -7.679" />
|
||||||
id="text2985-0-5-3-3"
|
|
||||||
style="font-size:13.06711483px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans">
|
|
||||||
<path
|
|
||||||
d="m -128.43879,130.7428 c -0.97408,0 -1.71208,-0.41048 -2.21401,-1.23143 -0.50193,-0.8252 -0.75289,-2.01621 -0.75289,-3.57303 0,-3.19872 0.98896,-4.79808 2.9669,-4.79809 0.98683,1e-5 1.73122,0.41261 2.23315,1.23781 0.50617,0.82095 0.75926,2.00771 0.75927,3.56028 -1e-5,3.20297 -0.99748,4.80446 -2.99242,4.80446 m 0,-0.98897 c 0.62528,0 1.08467,-0.29775 1.37817,-0.89326 0.2935,-0.59976 0.44024,-1.57383 0.44025,-2.92223 -1e-5,-1.33989 -0.14675,-2.30759 -0.44025,-2.9031 -0.2935,-0.59975 -0.75289,-0.89963 -1.37817,-0.89964 -0.61678,1e-5 -1.06979,0.29776 -1.35903,0.89326 -0.285,0.59126 -0.42749,1.56108 -0.42749,2.90948 0,1.35265 0.14249,2.32673 0.42749,2.92223 0.28924,0.59551 0.74225,0.89326 1.35903,0.89326"
|
|
||||||
id="path3038"
|
|
||||||
style="font-variant:normal;font-stretch:normal;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono" />
|
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g transform="matrix(-1.236,0.0417,-0.03046,0.8101,0,0)">
|
||||||
transform="matrix(1.2224283,0.19806604,-0.31571913,0.76688897,0,0)"
|
<path d="M -87.84,107.6" />
|
||||||
id="text2990-7-14"
|
|
||||||
style="font-size:17.2256794px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 108.4038,118.44056 -1.48033,0 0,-7.67922 c 0,-0.68409 0.0224,-1.69621 0.0673,-3.03636 -0.21869,0.24112 -0.55793,0.55793 -1.01773,0.95044 l -1.23641,1.01772 -0.81587,-1.03455 3.22141,-2.51488 1.26164,0 0,12.29685"
|
|
||||||
id="path3041" />
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
transform="matrix(1.2380995,-0.02589828,-0.17206885,0.81128882,0,0)"
|
|
||||||
id="text2990-7-14-7"
|
|
||||||
style="font-size:17.2256794px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 95.070558,172.14899 -1.480332,0 0,-7.67922 c -5e-6,-0.68409 0.02242,-1.69621 0.06729,-3.03637 -0.21869,0.24113 -0.557933,0.55794 -1.017728,0.95044 l -1.236414,1.01773 -0.815864,-1.03455 3.221403,-2.51488 1.261647,0 0,12.29685"
|
|
||||||
id="path3044" />
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
transform="matrix(1.2383695,-0.00147106,-0.18803848,0.80773681,0,0)"
|
|
||||||
id="text2990-7-14-3"
|
|
||||||
style="font-size:17.2256794px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono">
|
|
||||||
<path
|
|
||||||
d="m 97.014077,203.21602 -1.480331,0 0,-7.67922 c -5e-6,-0.68409 0.02242,-1.69621 0.06729,-3.03637 -0.21869,0.24113 -0.557932,0.55794 -1.017728,0.95045 l -1.236413,1.01772 -0.815865,-1.03455 3.221404,-2.51488 1.261646,0 0,12.29685"
|
|
||||||
id="path3047" />
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
transform="matrix(-1.2360182,0.04170273,-0.03045568,0.81007712,0,0)"
|
|
||||||
id="text2985-0-5-3-7"
|
|
||||||
style="font-size:13.94503117px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans">
|
|
||||||
<path
|
|
||||||
d="m -87.840912,107.61557 c -1.039525,0 -1.82711,-0.43805 -2.362757,-1.31415 -0.53565,-0.88064 -0.803474,-2.15167 -0.803473,-3.8131 -10e-7,-3.413614 1.055408,-5.120426 3.16623,-5.120436 1.053135,1e-5 1.847529,0.440331 2.383184,1.320964 0.540181,0.876112 0.810275,2.142602 0.810283,3.799472 -8e-6,3.41817 -1.064496,5.12725 -3.193467,5.12725 m 0,-1.05541 c 0.667287,1e-5 1.157541,-0.31775 1.470765,-0.95327 0.313213,-0.64005 0.469822,-1.67957 0.469828,-3.11857 -6e-6,-1.4299 -0.156615,-2.46261 -0.469828,-3.098135 -0.313224,-0.640046 -0.803478,-0.960073 -1.470765,-0.960082 -0.658216,9e-6 -1.141662,0.317766 -1.450338,0.953273 -0.304142,0.630984 -0.456212,1.665964 -0.456209,3.104944 -3e-6,1.44354 0.152067,2.48306 0.456209,3.11857 0.308676,0.63552 0.792122,0.95328 1.450338,0.95327"
|
|
||||||
id="path3050"
|
|
||||||
style="font-variant:normal;font-stretch:normal;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono" />
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g
|
|
||||||
id="layer4">
|
|
||||||
<g
|
|
||||||
transform="scale(1.3546944,0.73817387)"
|
|
||||||
id="text2985-04"
|
|
||||||
style="font-size:29.82770729px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans">
|
|
||||||
<path
|
|
||||||
d="m 77.811338,118.12566 c -2.223492,0 -3.908095,-0.93697 -5.053816,-2.81091 -1.145729,-1.88365 -1.718591,-4.60232 -1.718589,-8.15602 -2e-6,-7.301552 2.257464,-10.952336 6.772405,-10.952357 2.252602,2.1e-5 3.95177,0.941846 5.097508,2.825476 1.15542,1.873961 1.733137,4.582921 1.733153,8.126881 -1.6e-5,7.31129 -2.276901,10.96693 -6.830661,10.96693 m 0,-2.25747 c 1.427292,0 2.475921,-0.67966 3.145891,-2.039 0.669945,-1.36904 1.004924,-3.59252 1.004937,-6.67046 -1.3e-5,-3.05849 -0.334992,-5.26741 -1.004937,-6.62676 -0.66997,-1.369024 -1.718599,-2.053545 -3.145891,-2.053565 -1.407891,2e-5 -2.441956,0.679687 -3.102198,2.039005 -0.650545,1.34964 -0.975814,3.56341 -0.975809,6.64132 -5e-6,3.08765 0.325264,5.31113 0.975809,6.67046 0.660242,1.35934 1.694307,2.039 3.102198,2.039"
|
|
||||||
id="path3053"
|
|
||||||
style="font-variant:normal;font-stretch:normal;font-family:Droid Sans Mono;-inkscape-font-specification:Droid Sans Mono" />
|
|
||||||
</g>
|
</g>
|
||||||
|
<g transform="scale(1.355,0.7382)">
|
||||||
|
<path d="m 77.81,118.1 c -2.224,0 -3.908,-0.937 -5.054,-2.811 -1.146,-1.884 -1.719,-4.602 -1.719,-8.156 -2e-6,-7.302 2.258,-10.95 6.772,-10.95 2.253,2.1e-5 3.952,0.9418 5.098,2.826" />
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 4.1 KiB |
1
resources/icon-microblog.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15"><circle cx="7.5" cy="7.5" r="4" style="stroke:#F60;fill:none;stroke-width:4" /></svg>
|
After Width: | Height: | Size: 149 B |
1
resources/icon-shaarli.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15"><circle cx="7.5" cy="7.5" r="4" style="stroke:#080;fill:none;stroke-width:4" /></svg>
|
After Width: | Height: | Size: 149 B |
1
resources/icon-twitter.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15"><circle cx="7.5" cy="7.5" r="4" style="stroke:#3AE;fill:none;stroke-width:4" /></svg>
|
After Width: | Height: | Size: 149 B |
1
resources/icon-youtube.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15"><circle cx="7.5" cy="7.5" r="4" style="stroke:#A00;fill:none;stroke-width:4" /></svg>
|
After Width: | Height: | Size: 149 B |
125
twitter2feed.php
Executable file
|
@ -0,0 +1,125 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Récupération du flux RSS d'un compte Twitter
|
||||||
|
* Passez le nom du compte en Paramètre. Exemple: http://monsite.com/twit2rss.php?name=Craftbukkit
|
||||||
|
* 2013 - by Tronics
|
||||||
|
*/
|
||||||
|
|
||||||
|
// ----------------------------
|
||||||
|
// Autoblog Project inclusion
|
||||||
|
// ----------------------------
|
||||||
|
if(file_exists("config.php")) require_once "config.php";
|
||||||
|
if(file_exists("functions.php")) require_once "functions.php";
|
||||||
|
if( !defined('API_TWITTER')) {header("HTTP/1.1 404 Not Found"); die('API_TWITTER is undefined: make it LOCAL in "config.php" if you want me to work for you.');}
|
||||||
|
if ('API_TWITTER' === FALSE) {header("HTTP/1.1 404 Not Found"); die('Twitter support disabled in "config.php". Sorry.');}
|
||||||
|
$api = API_TWITTER;
|
||||||
|
if ($api === 'LOCAL') { } else {header("HTTP/1.1 404 Not Found"); die('Custom twitterbridge defined in "config.php": leave me alone.');}
|
||||||
|
if(!isset($_GET['u'])) {header("HTTP/1.1 404 Not Found"); die('no username provided');}
|
||||||
|
$exclude_reply = '@'; // if you want twitter2feed to return replies too: $exclude_reply = '';
|
||||||
|
// ----------------------------
|
||||||
|
// Let's rock !
|
||||||
|
|
||||||
|
$name = $_GET["u"];
|
||||||
|
$str = file_get_contents("https://twitter.com/$name");
|
||||||
|
|
||||||
|
$nb = preg_match_all('%<div class="tweet original-tweet(.*)'.
|
||||||
|
'data-tweet-id="(?P<id>\d+)"(.*)'.
|
||||||
|
'(data-retweet-id="(?P<retweetid>\d+)"(.*))?'.
|
||||||
|
'data-screen-name="(?P<name>[^"]+)"(.*)'.
|
||||||
|
'<img class="avatar js-action-profile-avatar" src="(?P<avatar>[^"]+)" alt="(?P<fullname>[^"]*)">(.*)'.
|
||||||
|
'data-time="(?P<created>\d+)"(.*)'.
|
||||||
|
'<p class="js-tweet-text tweet-text">(?P<message>.*)</p>'.
|
||||||
|
'%sU', $str, $arr);
|
||||||
|
|
||||||
|
function parsemessage($message)
|
||||||
|
{
|
||||||
|
$message = preg_replace('%<a href="/([^"]+)"([^>]+)>%', '<a href="https://twitter.com/$1" class="twitter_account">', $message);
|
||||||
|
$message = preg_replace('%<s>(@|#)</s><b>([^<]+)</b>%', '$1$2', $message);
|
||||||
|
$message = preg_replace('%<a href="http://t.co/[^"]+" rel="nofollow" dir="ltr" data-expanded-url="([^"]+)" class="twitter-timeline-link" target="_blank" title="[^"]+"%', '<a href="$1" class="twitter_link"', $message);
|
||||||
|
$message = preg_replace('%<span class="[^"]+">([^<]+)</span>%', '$1', $message);
|
||||||
|
$message = preg_replace('%<span class="tco-ellipsis"> …</span>%', '', $message);
|
||||||
|
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
function parsetitle($message)
|
||||||
|
{
|
||||||
|
$message = preg_replace('%<a ([^>]+)>https?://([^/]+)/[^<]*</a>%', '[$2]', $message);
|
||||||
|
$message = strip_tags($message);
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fullname = "?";
|
||||||
|
$updated = "";
|
||||||
|
if ($nb !== false)
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < $nb; $i++)
|
||||||
|
{
|
||||||
|
$mname = $arr["name"][$i];
|
||||||
|
$mfullname = $arr["fullname"][$i];
|
||||||
|
if ($updated == "")
|
||||||
|
$updated = date(DATE_ATOM, $arr["created"][$i]);
|
||||||
|
|
||||||
|
if ($mname == $name)
|
||||||
|
{
|
||||||
|
$fullname = $mfullname;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
header('Content-type: application/xml; charset=UTF-8', true);
|
||||||
|
echo '<?xml version="1.0" encoding="utf-8"?' . '>' . PHP_EOL;
|
||||||
|
?>
|
||||||
|
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
|
||||||
|
<title>Twitter / <?php echo $name ?></title>
|
||||||
|
<id>tag:twitter.com,2013:Status:<?php echo $name ?></id>
|
||||||
|
<link type="text/html" rel="alternate" href="http://twitter.com/<?php echo $name ?>"/>
|
||||||
|
<link type="application/atom+xml" rel="self" href="http://<?php echo $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"] ?>"></link>
|
||||||
|
<updated><?php echo $updated ?></updated>
|
||||||
|
<subtitle>Twitter de <?php echo $fullname ?>.</subtitle>
|
||||||
|
<?php
|
||||||
|
if ($nb !== false)
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < $nb; $i++)
|
||||||
|
{
|
||||||
|
$message = parsemessage($arr["message"][$i]);
|
||||||
|
$mname = $arr["name"][$i];
|
||||||
|
$mfullname = $arr["fullname"][$i];
|
||||||
|
$avatar = $arr["avatar"][$i];
|
||||||
|
$id = $arr["id"][$i];
|
||||||
|
$created = date(DATE_ATOM, $arr["created"][$i]);
|
||||||
|
|
||||||
|
$rt = "";
|
||||||
|
if ($arr["retweetid"][$i] != "")
|
||||||
|
$rt = "RT <a href=\"https://twitter.com/$mname\">@$mname</a> : ";
|
||||||
|
|
||||||
|
$title = htmlspecialchars(parsetitle($rt . $message));
|
||||||
|
|
||||||
|
$header = "<img src=\"$avatar\" alt=\"$mname\"/> $mfullname (<a href=\"https://twitter.com/$mname\">@$mname</a>)<br/>\r\n";
|
||||||
|
$footer = "<br/>\r\n<a href=\"https://twitter.com/$mname/status/$id\">Afficher la conversation</a>";
|
||||||
|
$message = "$header$rt$message$footer";
|
||||||
|
$message = htmlspecialchars($message);
|
||||||
|
if(substr($title, 0, 1) !== $exclude_reply) {
|
||||||
|
echo <<<HTML
|
||||||
|
<entry>
|
||||||
|
<title>$title</title>
|
||||||
|
<content type="html">$message</content>
|
||||||
|
<id>tag:twitter.com,2013:https://twitter.com/$name/status/$id</id>
|
||||||
|
<published>$created</published>
|
||||||
|
<updated>$created</updated>
|
||||||
|
<link type="text/html" rel="alternate" href="https://twitter.com/$name/status/$id"/>
|
||||||
|
<link type="image/png" rel="image" href="$avatar"/>
|
||||||
|
<author>
|
||||||
|
<name>$name</name>
|
||||||
|
<uri>https://twitter.com/$name</uri>
|
||||||
|
</author>
|
||||||
|
</entry>
|
||||||
|
HTML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</feed>
|
||||||
|
|
2
version
|
@ -1 +1 @@
|
||||||
0.3.0-DEV Build 1
|
0.3.2
|
||||||
|
|
47
xsaf3.php
|
@ -2,10 +2,12 @@
|
||||||
|
|
||||||
define('DEBUG', false);
|
define('DEBUG', false);
|
||||||
define('XSAF_VERSION', 3);
|
define('XSAF_VERSION', 3);
|
||||||
define('AUTOBLOG_FILE_NAME', 'autoblog.php');
|
define('AUTOBLOG_FILE_NAME', 'autoblog.php'); // useless ?
|
||||||
define('ALLOW_REMOTE_DB_DL', false);
|
define('ALLOW_REMOTE_DB_DL', true);
|
||||||
define('ALLOW_REMOTE_MEDIA_DL', false);
|
define('ALLOW_REMOTE_MEDIA_DL', true);
|
||||||
define('EXEC_TIME', 20);
|
define('EXEC_TIME', 10);
|
||||||
|
|
||||||
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
header("HTTP/1.0 403 Forbidden"); /* Uncivilized method to prevent bot indexing, huh :) */
|
header("HTTP/1.0 403 Forbidden"); /* Uncivilized method to prevent bot indexing, huh :) */
|
||||||
header('X-Robots-Tag: noindex'); /* more civilized method, but bots may not all take into account */
|
header('X-Robots-Tag: noindex'); /* more civilized method, but bots may not all take into account */
|
||||||
|
@ -75,17 +77,12 @@ function xsafimport($xsafremote, $max_exec_time) {
|
||||||
$get_remote_media = ($json_import['meta']['xsaf-media_transfer'] == "true") ? true : false;
|
$get_remote_media = ($json_import['meta']['xsaf-media_transfer'] == "true") ? true : false;
|
||||||
|
|
||||||
if(!empty($json_import['autoblogs'])) {
|
if(!empty($json_import['autoblogs'])) {
|
||||||
foreach ($json_import['autoblogs'] as $value) {
|
foreach ($json_import['autoblogs'] as $remote_folder => $value) {
|
||||||
|
if(DEBUG) debug('remote = '. $remote_folder);
|
||||||
if(count($value)==4 && !empty($value['SITE_TYPE']) && !empty($value['SITE_TITLE']) && !empty($value['SITE_URL']) && !empty($value['FEED_URL'])) {
|
if(count($value)==4 && !empty($value['SITE_TYPE']) && !empty($value['SITE_TITLE']) && !empty($value['SITE_URL']) && !empty($value['FEED_URL'])) {
|
||||||
$sitetype = escape($value['SITE_TYPE']);
|
$sitetype = escape($value['SITE_TYPE']);
|
||||||
$sitename = escape($value['SITE_TITLE']);
|
$sitename = escape($value['SITE_TITLE']);
|
||||||
$siteurl = escape($value['SITE_URL']);
|
$siteurl = escape($value['SITE_URL']);
|
||||||
if(empty($value['SITE_META_DESCRIPTION'])){
|
|
||||||
$siteDesc = getSiteDesc(escape($value['SITE_URL']));
|
|
||||||
} else {
|
|
||||||
$siteDesc = escape($value['SITE_META_DESCRIPTION']);
|
|
||||||
}
|
|
||||||
// Do not use DetectRedirect because it's slow and it has been used when the feed was added
|
// Do not use DetectRedirect because it's slow and it has been used when the feed was added
|
||||||
//$rssurl = DetectRedirect(escape($value['FEED_URL']));
|
//$rssurl = DetectRedirect(escape($value['FEED_URL']));
|
||||||
$rssurl = escape($value['FEED_URL']);
|
$rssurl = escape($value['FEED_URL']);
|
||||||
|
@ -100,10 +97,10 @@ function xsafimport($xsafremote, $max_exec_time) {
|
||||||
|
|
||||||
/* autoblog */
|
/* autoblog */
|
||||||
if( $result === true ) {
|
if( $result === true ) {
|
||||||
$foldername = urlToFolder($sitename, $rssurl);
|
$foldername = urlToFolder($siteurl, $rssurl);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
createAutoblog($sitetype, $sitename, $siteurl, $rssurl,$siteDesc);
|
createAutoblog($sitetype, $sitename, $siteurl, $rssurl);
|
||||||
|
|
||||||
if( DEBUG ) {
|
if( DEBUG ) {
|
||||||
echo '<p>autoblog '. $sitename .' crée avec succès (DL DB : '. var_dump($get_remote_db) .' - DL media : '. var_dump($get_remote_media) .') : '. $foldername .'</p>';
|
echo '<p>autoblog '. $sitename .' crée avec succès (DL DB : '. var_dump($get_remote_db) .' - DL media : '. var_dump($get_remote_media) .') : '. $foldername .'</p>';
|
||||||
|
@ -114,23 +111,23 @@ function xsafimport($xsafremote, $max_exec_time) {
|
||||||
/* ============================================================================================================================================================================== */
|
/* ============================================================================================================================================================================== */
|
||||||
/* récupération de la DB distante */
|
/* récupération de la DB distante */
|
||||||
if($get_remote_db == true && ALLOW_REMOTE_DB_DL ) {
|
if($get_remote_db == true && ALLOW_REMOTE_DB_DL ) {
|
||||||
$remote_db = str_replace("?export", $foldername."/articles.db", $xsafremote);
|
$remote_db = str_replace("?export", $remote_folder."/articles.db", $xsafremote);
|
||||||
copy($remote_db, './'. $foldername .'/articles.db');
|
copy($remote_db, './'. $foldername .'/articles.db');
|
||||||
}
|
}
|
||||||
|
/* préparation à la récupération des médias distants */
|
||||||
if($get_remote_media == true && ALLOW_REMOTE_MEDIA_DL ) {
|
if($get_remote_media == true && ALLOW_REMOTE_MEDIA_DL ) {
|
||||||
$remote_media=str_replace("?export", $foldername."/?media", $xsafremote);
|
$remote_media=str_replace("?export", $remote_folder."/?media", $xsafremote);
|
||||||
|
if(DEBUG)
|
||||||
|
debug("Récupération de la liste des médias à $remote_media <br>");
|
||||||
$json_media_import = file_get_contents($remote_media);
|
$json_media_import = file_get_contents($remote_media);
|
||||||
if(!empty($json_media_import))
|
if(DEBUG)
|
||||||
|
debug($json_media_import);
|
||||||
|
$media_data = json_decode($json_media_import, true);
|
||||||
|
if(DEBUG)
|
||||||
|
debug($media_data);
|
||||||
|
if(!empty($json_media_import) && $media_data !== null && !empty($media_data['files']))
|
||||||
{
|
{
|
||||||
mkdir('./'.$foldername.'/media/');
|
file_put_contents('./'. $foldername .'/import.json', $json_media_import);
|
||||||
$json_media_import = json_decode($json_media_import, true);
|
|
||||||
$media_path=$json_media_import['url'];
|
|
||||||
if(!empty($json_media_import['files'])) {
|
|
||||||
foreach ($json_media_import['files'] as $value) {
|
|
||||||
copy($media_path.$value, './'.$foldername.'/media/'.$value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|