'.__('Update').'
-- '.__('The page should refresh every second. If not, refresh manually.').' -
diff --git a/autoblogs/autoblog.php b/autoblogs/autoblog.php
index 9b9031d..f0d6c45 100644
--- a/autoblogs/autoblog.php
+++ b/autoblogs/autoblog.php
@@ -1,14 +1,14 @@
='))
@@ -34,9 +34,9 @@ else die("Functions file not found.");
if (!defined('ROOT_DIR'))
define('ROOT_DIR', __DIR__);
-if (!defined('CONFIG_FILE')) define('CONFIG_FILE', ROOT_DIR . '/vvb.ini');
-if (!defined('ARTICLES_DB_FILE')) define('ARTICLES_DB_FILE', ROOT_DIR . '/articles.db');
-if (!defined('MEDIA_DIR')) define('MEDIA_DIR', ROOT_DIR . '/media');
+if (!defined('CONFIG_FILE')) define('CONFIG_FILE', ROOT_DIR . '/vvb.ini');
+if (!defined('ARTICLES_DB_FILE')) define('ARTICLES_DB_FILE', ROOT_DIR . '/articles.db');
+if (!defined('MEDIA_DIR')) define('MEDIA_DIR', ROOT_DIR . '/media');
if (!defined('LOCAL_URL'))
{
@@ -74,7 +74,7 @@ class VroumVroum_Feed_Exception extends Exception
foreach ($errors as $error)
{
- $return = $xml[$error->line - 1] . "\n";
+ $return = $xml[$error->line - 1] . "\n";
$return .= str_repeat('-', $error->column) . "^\n";
switch ($error->level) {
@@ -90,11 +90,11 @@ class VroumVroum_Feed_Exception extends Exception
}
$return .= trim($error->message) .
- "\n Line: ".$error->line .
- "\n Column: ".$error->column;
+ "\n Line: ".$error->line .
+ "\n Column: ".$error->column;
if ($error->file) {
- $return .= "\n File: ".$error->file;
+ $return .= "\n File: ".$error->file;
}
$out[] = $return;
@@ -145,7 +145,6 @@ class VroumVroum_Config
public $site_type = '';
public $site_title = '';
public $site_description = '';
- public $site_meta_description = '';
public $site_url = '';
public $feed_url = '';
public $articles_per_page = 10;
@@ -227,23 +226,23 @@ class VroumVroum_Blog
if ($create_articles_db)
{
$this->articles->exec('
- CREATE TABLE articles (
- id INTEGER PRIMARY KEY,
- feed_id TEXT,
- title TEXT,
- uri TEXT,
- url TEXT,
- date INT,
- content TEXT
- );
- CREATE TABLE update_log (
- date INT PRIMARY KEY,
- success INT,
- log TEXT
- );
- CREATE UNIQUE INDEX feed_id ON articles (feed_id);
- CREATE INDEX date ON articles (date);
- ');
+CREATE TABLE articles (
+id INTEGER PRIMARY KEY,
+feed_id TEXT,
+title TEXT,
+uri TEXT,
+url TEXT,
+date INT,
+content TEXT
+);
+CREATE TABLE update_log (
+date INT PRIMARY KEY,
+success INT,
+log TEXT
+);
+CREATE UNIQUE INDEX feed_id ON articles (feed_id);
+CREATE INDEX date ON articles (date);
+');
}
$this->articles->createFunction('countintegers', array($this, 'sql_countintegers'));
@@ -257,7 +256,7 @@ class VroumVroum_Blog
protected function log_update($success, $log = '')
{
$this->articles->exec('INSERT INTO update_log (date, success, log) VALUES (\''.time().'\', \''.(int)(bool)$success.'\',
- \''.$this->articles->escapeString($log).'\');');
+\''.$this->articles->escapeString($log).'\');');
// Delete old log
$this->articles->exec('DELETE FROM update_log WHERE date > (SELECT date FROM update_log ORDER BY date DESC LIMIT 100,1);');
@@ -281,9 +280,9 @@ class VroumVroum_Blog
$content = $this->mirrorMediasForArticle($content, $url);
$this->articles->exec('INSERT INTO articles (id, feed_id, title, uri, url, date, content) VALUES (NULL,
- \''.$this->articles->escapeString($feed_id).'\', \''.$this->articles->escapeString($title).'\',
- \''.$this->articles->escapeString($uri).'\', \''.$this->articles->escapeString($url).'\',
- \''.(int)$date.'\', \''.$this->articles->escapeString($content).'\');');
+\''.$this->articles->escapeString($feed_id).'\', \''.$this->articles->escapeString($title).'\',
+\''.$this->articles->escapeString($uri).'\', \''.$this->articles->escapeString($url).'\',
+\''.(int)$date.'\', \''.$this->articles->escapeString($content).'\');');
$id = $this->articles->lastInsertRowId();
@@ -305,8 +304,8 @@ class VroumVroum_Blog
$content = $this->mirrorMediasForArticle($content, $url);
$this->articles->exec('UPDATE articles SET title=\''.$this->articles->escapeString($title).'\',
- url=\''.$this->articles->escapeString($url).'\', content=\''.$this->articles->escapeString($content).'\',
- date=\''.(int)$date.'\' WHERE id = \''.(int)$id.'\';');
+url=\''.$this->articles->escapeString($url).'\', content=\''.$this->articles->escapeString($content).'\',
+date=\''.(int)$date.'\' WHERE id = \''.(int)$id.'\';');
$title = self::removeHTML($title);
$content = self::removeHTML($content);
@@ -328,9 +327,9 @@ class VroumVroum_Blog
return true;
}
-
+
public function mustUpdateXsaf()
- {
+ {
return file_exists('import.json');
}
@@ -338,10 +337,10 @@ class VroumVroum_Blog
{
return stream_context_create(
array(
- 'http' => array(
- 'method' => 'GET',
- 'timeout' => $this->config->update_timeout,
- 'header' => "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0; Autoblogs; +https://github.com/mitsukarenai/Projet-Autoblog/) Gecko/20100101 Firefox/20.0\r\n",
+ 'http' => array(
+ 'method' => 'GET',
+ 'timeout' => $this->config->update_timeout,
+ 'header' => "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0; Autoblogs; +https://github.com/mitsukarenai/Projet-Autoblog/) Gecko/20100101 Firefox/20.0\r\n",
)
)
);
@@ -380,10 +379,10 @@ class VroumVroum_Blog
{
$date = isset($item->published) ? (string) $item->published : (string) $item->updated;
$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,
(string)$item->link['href'], strtotime($date), $content );
@@ -433,33 +432,33 @@ class VroumVroum_Blog
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');
+ $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));
+ $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');
- }
+ else {
+ unlink('import.json');
+ break;
+ } /* first element empty: import finished */
+ $time = time();
+}
+ unlink('import.lock');
+}
}
public function listArticlesByPage($page = 1)
@@ -501,11 +500,11 @@ class VroumVroum_Blog
public function searchArticles($query)
{
$res = $this->articles->query('SELECT id, uri, title, content
- FROM articles
- WHERE content LIKE \'%'.$this->articles->escapeString($query).'%\'
- OR title LIKE \'%'.$this->articles->escapeString($query).'%\'
- ORDER BY id DESC
- LIMIT 0,100;');
+FROM articles
+WHERE content LIKE \'%'.$this->articles->escapeString($query).'%\'
+OR title LIKE \'%'.$this->articles->escapeString($query).'%\'
+ORDER BY id DESC
+LIMIT 0,100;');
$out = array();
@@ -526,7 +525,7 @@ class VroumVroum_Blog
}
$schemes = array('http', 'https');
- $extensions = explode(',', preg_quote('jpg,jpeg,png,apng,gif,svg,pdf,odt,ods,epub,webp,wav,mp3,ogg,aac,wma,flac,opus,mp4,webm', '!'));
+$extensions = explode(',', preg_quote('jpg,jpeg,png,apng,gif,svg,pdf,odt,ods,epub,webp,wav,mp3,ogg,aac,wma,flac,opus,mp4,webm', '!'));
$extensions = implode('|', $extensions);
$from = parse_url($url);
@@ -574,7 +573,7 @@ class VroumVroum_Blog
}
return $content;
}
-
+
public function getXsafCounter() {
if($this->mustUpdateXsaf()) {
$json = json_decode(file_get_contents('import.json'), true);
@@ -604,36 +603,36 @@ if (isset($_GET['feed'])) // FEED
{
header('Content-Type: application/atom+xml; charset=UTF-8');
echo '
-
'.escape_content($art['content']).']]>
-
'.escape_content($art['content']).']]>
+
'.$config->site_description.'
⇐ retour index
'.$config->site_meta_description.'
'.$config->site_description.'
⇐ retour index
'.$config->site_description.'
- '; +'.$config->site_description.'
+'; ->>>>>>> master echo ' - -'.$art['content'].'
-'.$art['content'].'
+'.escape($vvb->getLocalURL($uri)) . '
' : '').' - '.__('Article not found.').' -'.escape($vvb->getLocalURL($uri)) . '
' : '').' +'.__('Article not found.').' +