Hint to move folder easily http://0bin.net/paste/8aad32f62c097a09aa83f1f8351b22bdd49b298b#1IO0SmDBGQAspXK0ICwlFpoCO0hEA4rUMRyuQ9A6AzA=
TODO: Check that nothing is broken
This commit is contained in:
ArthurHoaro 2013-04-08 13:41:22 +02:00
parent 5da0e87beb
commit 6f7263d460
3 changed files with 19 additions and 22 deletions

12
0.3/autoblog.php → 0.3/autoblogs/autoblog.php Executable file → Normal file
View file

@ -21,13 +21,13 @@ libxml_disable_entity_loader(true);
// Config and data file locations
if (file_exists(__DIR__ . '/config.php')) {
require_once __DIR__ . '/config.php';
if (file_exists(__DIR__ . '/../config.php')) {
require_once __DIR__ . '/../config.php';
}
else die("Configuration file not found.");
if (file_exists(__DIR__ . '/functions.php')){
require_once __DIR__ . '/functions.php';
if (file_exists(__DIR__ . '/../functions.php')){
require_once __DIR__ . '/../functions.php';
}
else die("Functions file not found.");
@ -722,12 +722,12 @@ 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'. (!empty($head_title) ? ' ~ '. escape($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="../">&lArr; retour index</a></p>';
echo '<p>'.$config->site_description.'<br><a href="../../">&lArr; retour index</a></p>';
echo '
<form method="get" action="'.escape(LOCAL_URL).'" class="searchForm">

View file

@ -4,6 +4,7 @@ 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');

View file

@ -251,11 +251,10 @@ if (isset($_GET['check']))
**/
if (isset($_GET['export'])) {
header('Content-Type: application/json');
$directory = "./";
$subdirs = glob($directory . "*");
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
foreach($subdirs as $unit) {
if(is_dir($unit) && strpos($unit.'/', DOC_FOLDER) === FALSE) {
if(is_dir($unit)) {
$unit=substr($unit, 2);
$ini = parse_ini_file($unit.'/vvb.ini');
$config = new stdClass;
@ -284,12 +283,11 @@ if (isset($_GET['export'])) {
**/
if (isset($_GET['export_twitter'])) {
header('Content-Type: application/json');
$directory = "./";
$subdirs = glob($directory . "*");
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
$response = array();
foreach($subdirs as $unit) {
if(is_dir($unit) && strpos($unit.'/', DOC_FOLDER) === FALSE) {
if(is_dir($unit)) {
$unit=substr($unit, 2);
$ini = parse_ini_file($unit.'/vvb.ini');
if( $ini['SITE_TYPE'] == 'twitter' ) {
@ -319,11 +317,10 @@ if (isset($_GET['exportopml'])) // OPML
$opmlhead->addChild('dateCreated', date('r', time()));
$opmlbody = $opmlfile->addChild('body');
$directory = "./";
$subdirs = glob($directory . "*");
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
foreach($subdirs as $unit) {
if(is_dir($unit) && strpos($unit.'/', DOC_FOLDER) === FALSE) {
if(is_dir($unit)) {
$unit=substr($unit, 2);
$ini = parse_ini_file($unit.'/vvb.ini');
$config = new stdClass;
@ -347,6 +344,7 @@ if (isset($_GET['exportopml'])) // OPML
/**
* Site map
* NEW AUTOBLOG FOLDER - Need update
**/
if (isset($_GET['sitemap']))
{
@ -392,10 +390,9 @@ if( isset($_GET['updateall']) && ALLOW_FULL_UPDATE) {
}
}
$directory = "./";
$subdirs = glob($directory . "*");
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
foreach($subdirs as $unit) {
if(is_dir($unit) && strpos($unit.'/', DOC_FOLDER) === FALSE) {
if(is_dir($unit)) {
if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) {
file_get_contents(serverUrl() . substr($_SERVER['PHP_SELF'], 0, -9) . $unit . '/index.php');
}
@ -816,7 +813,7 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
<?php } ?>
<?php
$directory = "./". DOC_FOLDER;
$directory = DOC_FOLDER;
$docs = array();
if( is_dir($directory) && !file_exists($directory . '.disabled') ) {
$subdirs = glob($directory . "*");
@ -845,12 +842,11 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
<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>
<?php
$directory = "./";
$subdirs = glob($directory . "*");
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
$autoblogs = array();
foreach($subdirs as $unit)
{
if(is_dir($unit) && strpos($unit.'/', DOC_FOLDER) === FALSE)
if(is_dir($unit))
{
if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) {
$ini = parse_ini_file(ROOT_DIR . '/' . $unit . '/vvb.ini');