Sémantisation

Alors j’ai fait énoooooormément de modifications… La principale est : un code source (HTML5) *beau* et sémantique. C’est à dire que j’utilise les balises sémantique HTML5, que le code est plus simple, qu’il est correctement indenté (2 espaces à chaque fois, c’est ce que je trouve de plus beau) et *valide*. Ça m’a pris une nuit et un aprèm’ de nettoyer ça, assez simple et très satisfaisant :).

Bon après j’ai fait plusieurs autres modifications de genre divers aussi : j’ai supprimé des balises inutiles, j’ai remplacé la recherche Google par une recherche Startpage, des traits d’union par des tirets, fusion des lignes séparées par des <br> (horrible) en un paragraphe (bien plus joli, organisé, sémantique, etc.), et d’autres choses encore.

Par conséquent j’imagine que peut-être qu’il sera nécessaire de regarder la diff des changements. Mais pour voir le résultat final il y a mon instance : <autoblog.galex-713.eu>.
This commit is contained in:
Garreau Alexandre 2013-10-13 19:11:15 +02:00
parent 862d349e7b
commit d429e29c27

291
index.php
View file

@ -122,7 +122,7 @@ function create_from_opml($opml) {
// Lighten process by checking folderExists first // Lighten process by checking folderExists first
// A CHANGER SELON ISSUE #20 // A CHANGER SELON ISSUE #20
if(folderExists($siteurl)) if(folderExists($siteurl))
throw new Exception('Erreur : l\'autoblog '. $sitename .' existe déjà.'); 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 != 'youtube') if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'youtube')
@ -252,8 +252,8 @@ function svg_status($fill, $text, $back)
$oldvalue = null; $oldvalue = null;
if(file_exists($errorlog)) { $oldvalue = file_get_contents($errorlog); }; if(file_exists($errorlog)) { $oldvalue = file_get_contents($errorlog); };
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_ok);} if(filesize($errorlog) == "0") {die($svg_ok);}
else if(filesize($errorlog) == "1") {die($svg_mv);} else if(filesize($errorlog) == "1") {die($svg_mv);}
@ -471,9 +471,9 @@ if( isset($_GET['updateall']) && ALLOW_FULL_UPDATE) {
} }
$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>';
@ -608,7 +608,7 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO
try { try {
$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>
@ -620,7 +620,7 @@ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLO
} }
} }
else else
$error[] = 'Antibot : Chiffres incorrects.'; $error[] = 'Antibot : chiffres incorrects.';
} }
/** /**
@ -630,9 +630,9 @@ if( !empty($_POST['generic']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_L
if(empty($_POST['rssurl'])) if(empty($_POST['rssurl']))
{$error[] = "Veuillez entrer l'adresse du flux.";} {$error[] = "Veuillez entrer l'adresse du flux.";}
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 {
@ -682,9 +682,9 @@ if( !empty($_POST['generic']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_L
**/ **/
if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE) { if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE) {
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'])) {
@ -706,9 +706,9 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
**/ **/
if( !empty($_POST['opml_link']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK) { if( !empty($_POST['opml_link']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK) {
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.';}
@ -729,10 +729,14 @@ 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>
<meta 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 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
@ -742,178 +746,171 @@ 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>
&rarr; <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> &rarr; <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>
&rarr; <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>
&rarr; <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>&rarr; <a href="https://github.com/mitsukarenai/Projet-Autoblog/archive/master.zip">télécharger la dernière version</a> ;</li>
</div> <li>&rarr; <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 ) {
{
if( API_TWITTER === 'LOCAL' ) if( API_TWITTER === 'LOCAL' )
echo '<input type="radio" name="socialinstance" value="twitter">Twitter (local)<br>'; echo '<input type="radio" name="socialinstance" value="twitter" />Twitter (local)<br />';
else else
echo '<input type="radio" name="socialinstance" value="twitter">Twitter (via <a href="'.strtok(API_TWITTER,'?').'">bridge</a>)<br>'; echo '<input type="radio" name="socialinstance" value="twitter" />Twitter (via <a href="'.strtok(API_TWITTER,'?').'">bridge</a>)<br />';
} }
else echo '<s>Twitter</s><br>'; ?> else echo '<s>Twitter</s><br />'; ?>
<input type="radio" name="socialinstance" value="statusnet"> <input type="radio" name="socialinstance" value="statusnet" />
<input placeholder="statusnet.personnel.com" type="text" name="statusneturl" id="statusneturl"><br> <input placeholder="statusnet.personnel.com" type="text" name="statusneturl" id="statusneturl" /><br />
<input type="radio" name="socialinstance" value="youtube">Youtube<br> <input type="radio" name="socialinstance" value="youtube" />Youtube<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>
<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 &rarr; </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=&quot;<?php echo serverUrl().$_SERVER["REQUEST_URI"]; ?>&quot;;var%20popup=window.open(&quot;&quot;,&quot;Add%20autoblog&quot;,'height=180,width=670');popup.document.writeln('<html><head></head><body><form%20action=&quot;'+autoblog_url+'&quot;%20method=&quot;GET&quot;>');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==&quot;alternate&quot;){popup.document.writeln('<label%20for=&quot;feed_'+i+'&quot;><input%20id=&quot;feed_'+i+'&quot;%20type=&quot;radio&quot;%20name=&quot;rssurl&quot;%20value=&quot;'+links[i].href+'&quot;/>'+links[i].title+&quot;%20(%20&quot;+links[i].href+&quot;%20)</label><br/>&quot;);}}}popup.document.writeln(&quot;<input%20id='number'%20type='hidden'%20name='number'%20value='17'>&quot;);popup.document.writeln(&quot;<input%20type='hidden'%20name='via_button'%20value='1'>&quot;);popup.document.writeln(&quot;<br/><input%20type='submit'%20value='Vérifier'%20name='Ajouter'%20>&quot;);popup.document.writeln(&quot;</form></body></html>&quot;);})();">
Projet Autoblog
</a>
</div>
<?php } ?>
</div>
<?php } ?>
<p>Pour ajouter facilement un autoblog d'un site web, glissez ce bouton dans votre barre de marque-pages &rarr; <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=&quot;<?php echo serverUrl().$_SERVER["REQUEST_URI"]; ?>&quot;;var%20popup=window.open(&quot;&quot;,&quot;Add%20autoblog&quot;,'height=180,width=670');popup.document.writeln('<html><head></head><body><form%20action=&quot;'+autoblog_url+'&quot;%20method=&quot;GET&quot;>');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==&quot;alternate&quot;){popup.document.writeln('<label%20for=&quot;feed_'+i+'&quot;><input%20id=&quot;feed_'+i+'&quot;%20type=&quot;radio&quot;%20name=&quot;rssurl&quot;%20value=&quot;'+links[i].href+'&quot;/>'+links[i].title+&quot;%20(%20&quot;+links[i].href+&quot;%20)</label><br/>&quot;);}}}popup.document.writeln(&quot;<input%20id='number'%20type='hidden'%20name='number'%20value='17'>&quot;);popup.document.writeln(&quot;<input%20type='hidden'%20name='via_button'%20value='1'>&quot;);popup.document.writeln(&quot;<br/><input%20type='submit'%20value='Vérifier'%20name='Ajouter'%20>&quot;);popup.document.writeln(&quot;</form></body></html>&quot;);})();">Projet Autoblog</a>
</section>
<?php } ?>
</section>
<?php } ?>
<?php <?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' ) ) {
$size = ''; $size = '';
if ( is_file($unit) ) { $size = get_size($unit); } if ( is_file($unit) ) { $size = get_size($unit); }
@ -922,39 +919,47 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
} }
} }
if(!empty( $docs )) { if(!empty( $docs )) {
echo '<div class="pbloc"><h2>Autres documents</h2><ul>'; echo '<section id="docs">
<header>
<h2>Autres documents</h2>
</header>
<ul>'."\n";
foreach( $docs as $value ) { foreach( $docs as $value ) {
$str = $value[0]; $str = $value[0];
if ( !empty($value[1]) ) { if ( !empty($value[1]) ) {
$str = sprintf('%s (%s)', $value[0], $value[1]); $str = sprintf('%s (%s)', $value[0], $value[1]);
} }
echo '<li>'. $str . '</li>'; echo ' <li>'. $str . "</li>\n";
} }
echo '</ul></div>'; echo ' </ul>
</section>'."\n";
} }
?> ?>
<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>
<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> <nav class="clear">
<div id="contentVignette"> <a href="?sitemap">sitemap</a> |
<a href="?export" >export<sup>JSON</sup></a> |
<a href="?exportopml">export<sup>OPML</sup></a>
</nav>
<ul>
<?php <?php
$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); $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;
} }
@ -972,23 +977,30 @@ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY
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="./?icon='.escape($autoblog->site_type).'"><img width="15" height="15" alt="" src="./?check='.$key.'"> '.escape($autoblog->site_title).'</a></div> <header>
<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> <a title="'.escape($autoblog->site_title).'" href="'.$key.'/">
</div>'; <img width="15" height="15" alt="" src="./?icon='.escape($autoblog->site_type).'" />
<img width="15" height="15" alt="" src="./?check='.$key.'" />
<h3>'.escape($autoblog->site_title).'</h3>
</a>
</header>
<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;
?> ?>
</div> </ul>
<div class="clear"></div>
<?php echo "<p>".count($autoblogs)." autoblogs hébergés</p>"; ?> <?php echo "<p>".count($autoblogs)." autoblogs hébergés</p>"; ?>
</div> </section>
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>
<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>
<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';"; ?>
@ -1003,7 +1015,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>