Trying to solve #9

config.php should not be edited for the final 0.3 from now (except maybe fixing the present commit).
+ bug fix
This commit is contained in:
ArthurHoaro 2013-04-10 13:08:15 +02:00
parent 64fa21f2ca
commit 195a6644f5
5 changed files with 49 additions and 49 deletions

View file

@ -722,7 +722,7 @@ echo '
</head>
<body>
<div class="header">
<h1><a href="../../" style="font-size:0.8em;">PROJET AUTOBLOG'. (!empty($head_title) ? ' ~ '. escape($head_title) : '') .'</a></h1>
<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>';

View file

@ -1,53 +1,35 @@
<?php
if(!defined('ROOT_DIR'))
{
define('ROOT_DIR', dirname($_SERVER['SCRIPT_FILENAME']));
}
define('LOCAL_URI', '');
if (!defined('AUTOBLOGS_FOLDER')) define('AUTOBLOGS_FOLDER', './autoblogs/');
if (!defined('DOC_FOLDER')) define('DOC_FOLDER', './docs/');
if (!defined('RESOURCES_FOLDER')) define('RESOURCES_FOLDER', './resources/');
if (!defined('RSS_FILE')) define('RSS_FILE', RESOURCES_FOLDER.'rss.xml');
date_default_timezone_set('Europe/Paris');
setlocale(LC_TIME, 'fr_FR.UTF-8', 'fr_FR', 'fr');
/**
* config.php - Configuration file
* ---
* See how to configure your Autoblog farm at
* https://github.com/mitsukarenai/Projet-Autoblog/wiki/Configuration
**/
define( 'ALLOW_FULL_UPDATE', TRUE );
// Check new version on Github
define( 'ALLOW_CHECK_UPDATE', TRUE );
define( 'ALLOW_NEW_AUTOBLOGS', TRUE );
// If you set ALLOW_NEW_AUTOBLOGS to FALSE, the following options do not matter.
// Generic RSS
define( 'ALLOW_NEW_AUTOBLOGS', TRUE );
define( 'ALLOW_NEW_AUTOBLOGS_BY_LINKS', TRUE );
// Twitter, Identica, Statusnet, Shaarli
define( 'ALLOW_NEW_AUTOBLOGS_BY_SOCIAL', TRUE );
// Bookmark button
define( 'ALLOW_NEW_AUTOBLOGS_BY_BUTTON', TRUE );
// OPML file
define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE', TRUE );
// OPML Link
define( 'ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK', TRUE );
// XSAF
define( 'ALLOW_NEW_AUTOBLOGS_BY_XSAF', TRUE );
// More about TwitterBridge : https://github.com/mitsukarenai/twitterbridge
define( 'API_TWITTER', FALSE );
// URL to Twitterbridge API - Set FALSE to disable Twitter (default).
$apitwitter = FALSE;
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>.');
// Logo à utiliser
$logo=RESOURCES_FOLDER .'icon-logo.svg';
// Marquez ici votre propre message qui apparaîtra en bas de page.
// exemple :
//$HTML_footer="<br/><a href='http://datalove.me/'>Love data</a><br/>Data is essential<br/>Data must flow<br/>Data must be used<br/>Data is neither good nor bad<br/>There is no illegal data<br/>Data is free<br/>Data can not be owned<br/>No man, machine or system shall interrupt the flow of data<br/>Locking data is a crime against datanity";
$HTML_footer='D\'après les premières versions de <a href="http://sebsauvage.net">SebSauvage</a> et <a href="http://bohwaz.net/">Bohwaz</a>.';
$head_title = "";
/* And now, the XSAF links to be imported, with maximal execusion time for import in second !
You should add only trusted sources. */
$autoblog_farm = array(
'https://raw.github.com/mitsukarenai/xsaf-bootstrap/master/3.json' /*,
'https://www.ecirtam.net/autoblogs/?export',
'https://autoblog.suumitsu.eu/?export', */
// 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',
);
?>

View file

@ -1,6 +1,19 @@
<?php
// Technical configuration
if(!defined('ROOT_DIR'))
{
define('ROOT_DIR', dirname($_SERVER['SCRIPT_FILENAME']));
}
define('LOCAL_URI', '');
if (!defined('AUTOBLOGS_FOLDER')) define('AUTOBLOGS_FOLDER', './autoblogs/');
if (!defined('DOC_FOLDER')) define('DOC_FOLDER', './docs/');
if (!defined('RESOURCES_FOLDER')) define('RESOURCES_FOLDER', './resources/');
if (!defined('RSS_FILE')) define('RSS_FILE', RESOURCES_FOLDER.'rss.xml');
date_default_timezone_set('Europe/Paris');
setlocale(LC_TIME, 'fr_FR.UTF-8', 'fr_FR', 'fr');
// Functions
function NoProtocolSiteURL($url) {
$protocols = array("http://", "https://");
$siteurlnoproto = str_replace($protocols, "", $url);
@ -47,7 +60,7 @@ function urlToFolderSlash($url) {
}
function folderExists($url) {
return file_exists(urlToFolder($url)) || file_exists(urlToFolderSlash($url));
return file_exists(AUTOBLOGS_FOLDER . urlToFolder($url)) || file_exists(AUTOBLOGS_FOLDER . urlToFolderSlash($url));
}
function escape($str) {

View file

@ -165,7 +165,7 @@ function versionCheck() {
if( !file_exists(RSS_FILE)) {
require_once('class_rssfeed.php');
$rss = new AutoblogRSS(RSS_FILE);
$rss->create('Projet Autoblog'. ((!empty($head_title)) ? ' | '. $head_title : ''), serverUrl(true),"Projet Autoblog - RSS : Ajouts et changements de disponibilité.", serverUrl(true) . RSS_FILE);
$rss->create('Projet Autoblog'. ((strlen(HEAD_TITLE)>0) ? ' | '. HEAD_TITLE : ''), serverUrl(true),"Projet Autoblog - RSS : Ajouts et changements de disponibilité.", serverUrl(true) . RSS_FILE);
}
if (isset($_GET['rss'])) {
require_once('class_rssfeed.php');
@ -487,10 +487,10 @@ if(!empty($_POST['socialaccount']) && !empty($_POST['socialinstance']) && ALLOW_
$socialinstance = strtolower(escape($_POST['socialinstance']));
if($socialinstance === 'twitter') {
if( $apitwitter !== FALSE ) {
if( API_TWITTER !== FALSE ) {
$sitetype = 'twitter';
$siteurl = "http://twitter.com/$socialaccount";
$rssurl = $apitwitter.$socialaccount;
$rssurl = API_TWITTER.$socialaccount;
}
else
$error[] = "Twitter veut mettre à mort son API ouverte. Du coup on peut plus faire ça comme ça.";
@ -651,7 +651,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Projet Autoblog<?php if(!empty($head_title)) { echo " | " . escape($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(true) . RSS_FILE;?>" />
<link href="<?php echo RESOURCES_FOLDER; ?>autoblog.css" rel="stylesheet" type="text/css">
<?php
@ -661,11 +661,16 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
?>
</head>
<body>
<h1><a href="<?php echo serverUrl(true); ?>">PROJET AUTOBLOG<?php if(!empty($head_title)) { echo " | " . escape($head_title); } ?></a></h1>
<h1><a href="<?php echo serverUrl(true); ?>">
PROJET AUTOBLOG
<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?>
</a></h1>
<div class="pbloc">
<img id="logo" src="<?php if(isset($logo)) { echo $logo; }else{ echo RESOURCES_FOLDER.'icon-logo.svg'; } ?>" alt="">
<?php
if (defined('LOGO'))
echo '<img id="logo" src="'. RESOURCES_FOLDER . LOGO .'" alt="">';
?>
<h2>Présentation</h2>
<p>
@ -743,7 +748,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
<form method="POST">
<input placeholder="Identifiant du compte" type="text" name="socialaccount" id="socialaccount"><br>
<?php
if( $apitwitter !== FALSE )
if( API_TWITTER !== FALSE )
echo '<input type="radio" name="socialinstance" value="twitter">Twitter<br>';
else echo '<s>Twitter</s><br>'; ?>
<input type="radio" name="socialinstance" value="identica">Identica<br>

View file

@ -155,8 +155,8 @@ function xsafimport($xsafremote, $max_exec_time) {
}
if( DEBUG ) echo '<html><body>';
if( ALLOW_NEW_AUTOBLOGS and ALLOW_NEW_AUTOBLOGS_BY_XSAF && !empty($autoblog_farm) ) {
foreach( $autoblog_farm AS $value ) {
if( ALLOW_NEW_AUTOBLOGS and ALLOW_NEW_AUTOBLOGS_BY_XSAF && !empty($friends_autoblog_farm) ) {
foreach( $friends_autoblog_farm AS $value ) {
if( !empty($value) )
xsafimport($value, EXEC_TIME);
}