loadXML($data) or die('xml malformé'); $title = $dom->getElementsByTagName('title'); return $title->item(0)->nodeValue; } function get_link_from_feed($url) { return get_link_from_datafeed(file_get_contents($url)); } function get_link_from_datafeed($data) { if($data === false) { return 'url inaccessible'; } $xml = simplexml_load_string($data); // quick feed check // ATOM feed && RSS 1.0 /RDF && RSS 2.0 if (!isset($xml->entry) && !isset($xml->item) && !isset($xml->channel->item)) { die('le flux n\'a pas une syntaxe valide');} $check = substr($data, 0, 5); if($check !== 'channel->link; if($channel['link'] === NULL) { $dom = new DOMDocument; $dom->loadXML($data) or die('xml malformé'); $link = $dom->getElementsByTagName('uri'); return $link->item(0)->nodeValue; } else { 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) { $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"]); if($return_subfolder === true) { $path = pathinfo( $_SERVER['PHP_SELF'] ); $finalslash = ( $path['dirname'] != '/' ) ? '/' : ''; $subfolder = $path['dirname'] . $finalslash; } else $subfolder = ''; return 'http'.($https?'s':'').'://'.$_SERVER["SERVER_NAME"].$serverport.$subfolder; } function objectCmp($a, $b) { return strcasecmp ($a->site_title, $b->site_title); } function generate_antibot() { $letters = array('zéro', 'un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze', 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix-sept', 'dix-huit', 'dix-neuf', 'vingt'); return $letters[mt_rand(1, 20)]; } function check_antibot($number, $text_number) { $letters = array('zéro', 'un', 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', 'onze', 'douze', 'treize', 'quatorze', 'quinze', 'seize', 'dix-sept', 'dix-huit', 'dix-neuf', 'vingt'); return ( array_search( $text_number, $letters ) === intval($number) ) ? true : false; } function create_from_opml($opml) { global $error, $success; $cpt = 0; foreach( $opml->body->outline as $outline ) { if ( !empty( $outline['title'] ) && !empty( $outline['text'] ) && !empty( $outline['xmlUrl']) && !empty( $outline['htmlUrl'] )) { try { $sitename = escape( $outline['title'] ); $siteurl = escape($outline['htmlUrl']); $sitetype = escape($outline['text']); if ( $sitetype != 'microblog' && $sitetype != 'shaarli' && $sitetype != 'twitter' && $sitetype != 'youtube') $sitetype = 'generic'; $rssurl = DetectRedirect(escape($outline['xmlUrl'])); createAutoblog( $sitetype, $sitename, $siteurl, $rssurl ); $message = 'Autoblog "'. $sitename .'" crée avec succès. → afficher l\'autoblog.'; // Do not print iframe on big import (=> heavy and useless) if( ++$cpt < 10 ) $message .= ''; $success[] = $message; } catch (Exception $e) { $error[] = $e->getMessage(); } } } } /** * Simple version check **/ function versionCheck() { $versionfile = 'version'; $lastestUrl = 'https://raw.github.com/mitsukarenai/Projet-Autoblog/master/version'; $expire = time() - 84600 ; // 23h30 en secondes $lockfile = '.versionlock'; if (file_exists($lockfile) && filemtime($lockfile) > $expire) { if( file_get_contents($lockfile) == 'NEW' ) { // No new version installed if( filemtime( $lockfile ) > filemtime( $versionfile ) ) return true; else unlink($lockfile); } else return false; } if (file_exists($lockfile) && filemtime($lockfile) < $expire) { unlink($lockfile); } if( file_get_contents($versionfile) != file_get_contents($lastestUrl) ) { file_put_contents($lockfile, 'NEW'); return true; } file_put_contents($lockfile, '.'); return false; } $update_available = (ALLOW_CHECK_UPDATE) ? versionCheck() : false; /** * RSS Feed * **/ if( !file_exists(RESOURCES_FOLDER.'rss.json')) { file_put_contents(RESOURCES_FOLDER.'rss.json', '', LOCK_EX); } if (isset($_GET['rss'])) { displayXML(); die; } /** * SVG **/ if (isset($_GET['check'])) { 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) */ $expire=time() -$randomtime ; /* SVG minimalistes */ function svg_status($fill, $text, $back) { $svg = ''.$back.''.$text.''; return $svg; } $svg_ok=svg_status('#008000', 'ok', ''); $svg_mv=svg_status('#0000ff', 'mv', ''); $svg_err=svg_status('#000000', 'err', ''); $errorlog="./".escape( $_GET['check'] ) ."/error.log"; $oldvalue = null; 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)) /* errorlog existe encore ? se contenter de lire sa taille pour avoir le statut */ { if(filesize($errorlog) == "0") {die($svg_ok);} else if(filesize($errorlog) == "1") {die($svg_mv);} else {die($svg_err);} } else /* ..sinon, lancer la procédure de contrôle */ { $ini = parse_ini_file("./". escape( $_GET['check'] ) ."/vvb.ini") or die; $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 */ if(empty($headers) || $headers === FALSE || (!empty($code) && ($code[1] == '500' || $code[1] == '404'))) { if( $oldvalue !== null && $oldvalue != '..' ) { updateXML('unavailable', 'nxdomain', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']); } file_put_contents($errorlog, '..'); die($svg_err); } /* code retour 200: flux disponible */ if($code[1] == "200") { if( $oldvalue !== null && $oldvalue != '' ) { updateXML('available', '200', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']); } file_put_contents($errorlog, ''); die($svg_ok); } /* autre code retour: un truc a changé (redirection, changement de CMS, .. bref vvb.ini doit être corrigé) */ else { if( $oldvalue !== null && $oldvalue != '.' ) { updateXML('moved', '3xx', escape($_GET['check']), $ini['SITE_TITLE'], $ini['SITE_URL'], $ini['FEED_URL']); } file_put_contents($errorlog, '.'); die($svg_mv); } } } /** * JSON Export **/ if (isset($_GET['export'])) { header('Content-Type: application/json'); $subdirs = glob(AUTOBLOGS_FOLDER . "*"); foreach($subdirs as $unit) { if(is_dir($unit)) { $ini = parse_ini_file($unit.'/vvb.ini'); $unit=substr($unit, 2); $config = new stdClass; foreach ($ini as $key=>$value) { $key = strtolower($key); $config->$key = $value; } unset($ini); $feed=$config->feed_url; $type=$config->site_type; $title=$config->site_title; $url=$config->site_url; $reponse[$unit] = array("SITE_TYPE"=>"$type", "SITE_TITLE"=>"$title", "SITE_URL"=>"$url", "FEED_URL"=>"$feed"); } } echo json_encode( array( "meta"=> array("xsaf-version"=>XSAF_VERSION,"xsaf-db_transfer"=>"true","xsaf-media_transfer"=>"true"), "autoblogs"=>$reponse)); die; } /** * JSON Allowed Twitter accounts export **/ if (isset($_GET['export_twitter'])) { header('Content-Type: application/json'); $subdirs = glob(AUTOBLOGS_FOLDER . "*"); $response = array(); foreach($subdirs as $unit) { if(is_dir($unit)) { $unit=substr($unit, 2); $ini = parse_ini_file($unit.'/vvb.ini'); if( $ini['SITE_TYPE'] == 'twitter' ) { preg_match('#twitter\.com/(.+)#', $ini['SITE_URL'], $username); $response[] = $username[1]; } unset($ini); } } echo json_encode( $response ); die; } /** * OPML Full Export **/ if (isset($_GET['exportopml'])) // OPML { //header('Content-Type: application/octet-stream'); header('Content-type: text/xml'); header('Content-Disposition: attachment; filename="autoblogs-'. $_SERVER['SERVER_NAME'] .'.xml"'); $opmlfile = new SimpleXMLElement(''); $opmlfile->addAttribute('version', '1.0'); $opmlhead = $opmlfile->addChild('head'); $opmlhead->addChild('title', 'Autoblog OPML export from '. $_SERVER['SERVER_NAME'] ); $opmlhead->addChild('dateCreated', date('r', time())); $opmlbody = $opmlfile->addChild('body'); $subdirs = glob(AUTOBLOGS_FOLDER . "*"); foreach($subdirs as $unit) { if(is_dir($unit)) { $unit=substr($unit, 2); $ini = parse_ini_file($unit.'/vvb.ini'); $config = new stdClass; foreach ($ini as $key=>$value) { $key = strtolower($key); $config->$key = $value; } unset($ini); $outline = $opmlbody->addChild('outline'); $outline->addAttribute('title', escape($config->site_title)); $outline->addAttribute('text', escape($config->site_type)); $outline->addAttribute('htmlUrl', escape($config->site_url)); $outline->addAttribute('xmlUrl', escape($config->feed_url)); } } echo $opmlfile->asXML(); exit; } /** * Site map **/ if (isset($_GET['sitemap'])) { header('Content-Type: application/xml'); $proto=(!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])=='on')?"https://":"http://"; echo ''."\n".''."\n"; echo "\n ".$proto."{$_SERVER['HTTP_HOST']}".str_replace('?sitemap', '', $_SERVER['REQUEST_URI'])."\n"; echo ' '.date('c', time())."\n"; echo " daily\n\n"; $subdirs = glob(AUTOBLOGS_FOLDER . "*"); foreach($subdirs as $unit) { if(is_dir($unit)) { $unit=substr($unit, 2); echo "\n ".$proto.$_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'], 0, -9)."$unit/"."\n"; echo ' '.date('c', filemtime($unit))."\n"; echo " hourly\n\n\n"; } } echo ''; die; } /** * Update ALL autblogs (except .disabled) * This action can be very slow and consume CPU if you have a lot of autoblogs **/ if( isset($_GET['updateall']) ) { $lockfile = ".updatealllock"; 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"; die; }else{ // need update of all autoblogs unlink($lockfile); } } // else we need to update some autoblogs } if( file_put_contents($lockfile, date(DATE_RFC822)) ===FALSE) { echo "Merci d'ajouter des droits d'écriture sur le fichier."; die; } if(!empty($lockfile_contents)) { $subdirs = unserialize($lockfile_contents); unset($lockfile_contents); }else{ $subdirs = glob(AUTOBLOGS_FOLDER . "*"); } } 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( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) { 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(); $form = '
'."\n".'

'; /** * ADD BY BOOKMARK BUTTON **/ if(!empty($_GET['via_button']) && $_GET['number'] === '17' && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_BUTTON ) { $form = ''; if( empty($_GET['rssurl']) ) { $form .= '

URL du flux RSS incorrect.
Fermer la fenêtre.

'; } else { if(isset($_GET['add']) && $_GET['add'] === '1' && !empty($_GET['siteurl']) && !empty($_GET['sitename'])) { try { $rssurl = DetectRedirect(escape($_GET['rssurl'])); $siteurl = escape($_GET['siteurl']); $sitename = escape($_GET['sitename']); $sitetype = updateType($siteurl); // Disabled input doesn't send POST data $sitetype = $sitetype['type']; createAutoblog( $sitetype, $sitename, $siteurl, $rssurl ); if( empty($error)) { $form .= ''; $form .= '

Autoblog '. $sitename .' ajouté avec succès.
'; } else { $form .= '

'; } } catch (Exception $e) { $form .= $e->getMessage(); } $form .= 'Fermer la fenêtre.

'; } else { try { $rssurl = DetectRedirect(escape($_GET['rssurl'])); $datafeed = file_get_contents($rssurl); if( $datafeed !== false ) { $siteurl = get_link_from_datafeed($datafeed); $sitename = get_title_from_datafeed($datafeed); $sitetype = updateType($siteurl); $sitetype = $sitetype['type']; $form .= 'Merci de vérifier les informations suivantes, corrigez si nécessaire.




'; } else { $form .= '

URL du flux RSS incorrecte.
Fermer la fenêtre.

'; } } catch (Exception $e) { $form .= $e->getMessage() .'
Fermer la fenêtre.

'; } } } $form .= ''; echo $form; die; } /** * ADD BY SOCIAL / SHAARLI **/ if( !empty($_POST['socialinstance']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_SOCIAL) { $socialinstance = strtolower(escape($_POST['socialinstance'])); $socialaccount = (!empty($_POST['socialaccount'])) ? strtolower(escape($_POST['socialaccount'])) : false; if( $socialaccount === false && $socialinstance !== 'shaarli') $error[] = 'Le compte social doit être renseigné.'; elseif( !empty($_POST['number']) && !empty($_POST['antibot']) && check_antibot($_POST['number'], $_POST['antibot'])) { if($socialinstance === 'twitter') { if( API_TWITTER !== FALSE ) { $sitetype = 'twitter'; $siteurl = 'http://twitter.com/'. $socialaccount; if ( API_TWITTER === 'LOCAL' ) { $rssurl = serverUrl(true).'twitter2feed.php?u='.$socialaccount; } else { $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:
\n
".htmlentities($twitterbridge['X-twitterbridge']).'
'; } } } else $error[] = 'Vous devez définir une API Twitter -> RSS dans votre fichier de configuration (see TwitterBridge).'; } elseif($socialinstance === 'statusnet' && !empty($_POST['statusneturl'])) { $sitetype = 'microblog'; $siteurl= NoProtocolSiteURL(escape($_POST['statusneturl'])); try { $rssurl = DetectRedirect("http://".$siteurl."/api/statuses/user_timeline/$socialaccount.rss"); $siteurl = DetectRedirect("http://".$siteurl."/$socialaccount"); } catch (Exception $e) { echo $error[] = $e->getMessage(); } } elseif($socialinstance === 'shaarli' && !empty($_POST['shaarliurl'])) { $sitetype = 'shaarli'; $siteurl = NoProtocolSiteURL(escape($_POST['shaarliurl'])); try { $siteurl = DetectRedirect("http://".$siteurl."/"); } catch (Exception $e) { echo $error[] = $e->getMessage(); } $rssurl = $siteurl."?do=rss"; $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) ) { try { $headers = get_headers($rssurl, 1); if (strpos($headers[0], '200') === FALSE) throw new Exception('Flux inaccessible (compte inexistant ?)'); createAutoblog($sitetype, ucfirst($socialinstance) .' - '. $socialaccount, $siteurl, $rssurl); $success[] = ' '.ucfirst($socialinstance) .' - '. $socialaccount.' ajouté avec succès.'; } catch (Exception $e) { echo $error[] = $e->getMessage(); } } } else $error[] = 'Antibot : chiffres incorrects.'; } /** * ADD BY GENERIC LINK **/ if( !empty($_POST['generic']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_LINKS) { if(empty($_POST['rssurl'])) {$error[] = "Veuillez entrer l'adresse du flux.";} if(empty($_POST['number']) || empty($_POST['antibot']) ) {$error[] = "Vous êtes un bot ?";} elseif(! check_antibot($_POST['number'], $_POST['antibot'])) {$error[] = "Antibot : ce n'est pas le bon nombre.";} if(empty($error)) { try { $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'])) { $siteurl = escape($_POST['siteurl']); $sitename = get_title_from_feed($rssurl); createAutoblog('generic', $sitename, $siteurl, $rssurl); $success[] = ' Autoblog '. $sitename .' crée avec succès.afficher l\'autoblog'; } else { // checking procedure $datafeed = file_get_contents($rssurl); if( $datafeed === false ) { $error[] = 'URL "'. $rssurl .'" inaccessible.'; } $sitetype = 'generic'; $siteurl = get_link_from_datafeed($datafeed); $sitename = get_title_from_datafeed($datafeed); $form = 'Merci de vérifier les informations suivantes, corrigez si nécessaire. Tous les champs doivent être renseignés.





'; } } catch (Exception $e) { echo $error[] = $e->getMessage(); } } } /** * ADD BY OPML File **/ if( !empty($_POST['opml_file']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE) { if(empty($_POST['number']) || empty($_POST['antibot']) ) {$error[] = "Vous êtes un bot ?";} elseif(! check_antibot($_POST['number'], $_POST['antibot'])) {$error[] = "Antibot : ce n'est pas le bon nombre.";} if( empty( $error)) { if (is_uploaded_file($_FILES['file']['tmp_name'])) { $opml = null; if( ($opml = simplexml_load_file( $_FILES['file']['tmp_name'])) !== false ) { create_from_opml($opml); } else $error[] = "Impossible de lire le contenu du fichier OPML."; unlink($_FILES['file']['tmp_name']); } else { $error[] = "Le fichier n'a pas été envoyé."; } } } /** * ADD BY OPML Link **/ if( !empty($_POST['opml_link']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK) { if(empty($_POST['number']) || empty($_POST['antibot']) ) {$error[] = "Vous êtes un bot ?";} elseif(! check_antibot($_POST['number'], $_POST['antibot'])) {$error[] = "Antibot : ce n'est pas le bon nombre.";} if( empty( $_POST['opml_url'] )) {$error[] = 'Le lien est incorrect.';} if( empty( $error)) { $opml_url = escape($_POST['opml_url']); if(parse_url($opml_url, PHP_URL_HOST)==FALSE) { $error[] = "URL du fichier OPML non valide."; } else { if ( ($opml = simplexml_load_file( $opml_url )) !== false ) { create_from_opml($opml); } else { $error[] = "Impossible de lire le contenu du fichier OPML ou d'accéder à l'URL donnée."; } } } } ?> Projet Autoblog<?php if(strlen(HEAD_TITLE)>0) echo " | " . HEAD_TITLE; ?> '; } ?>

Projet Autoblog0) echo " | " . HEAD_TITLE; ?>

'."\n"; ?>

Présentation

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…

Voici une liste d'autoblogs hébergés sur (plus d'infos sur le projet).

Autres fermesRechercher

Mise à jour

Une mise à jour du Projet Autoblog est disponible !

Ajouter un autoblog

Message'. (count($error) ? 's' : '') ." :

\n"; echo "
    \n"; foreach ( $error AS $value ) { echo '
  • '. $value ."
  • \n"; } foreach ( $success AS $value ) { echo '
  • '. $value ."
  • \n"; } echo "
\n"; echo " \n"; echo ' '; } $button_list = '

Ajouter un autoblog via :'."\n"; if(ALLOW_NEW_AUTOBLOGS_BY_LINKS) $button_list .= ' Flux RSS'."\n"; if(ALLOW_NEW_AUTOBLOGS_BY_SOCIAL) { $button_list .= ' Compte réseau social'."\n"; $button_list .= ' Shaarli'."\n"; } if(ALLOW_NEW_AUTOBLOGS_BY_OPML_FILE) $button_list .= ' Fichier OPML'."\n"; if(ALLOW_NEW_AUTOBLOGS_BY_OPML_LINK) $button_list .= ' Lien vers OPML'."\n"; if(ALLOW_NEW_AUTOBLOGS_BY_BUTTON) $button_list .= ' Marque page'."\n"; $button_list .= "

\n"; echo $button_list; if(ALLOW_NEW_AUTOBLOGS_BY_LINKS == TRUE) { ?>

Ajouter un site web

Si vous souhaitez que héberge un autoblog d'un site, remplissez le formulaire suivant :

Ajouter un compte social


Twitter (local)
'; else echo 'Twitter (via bridge)
'; } else echo 'Twitter
'; ?>
Youtube

Ajouter un Shaarli



Ajouter par fichier OPML



Marque page

Pour ajouter facilement un autoblog d'un site web, glissez ce bouton dans votre barre de marque-pages → ";var%20popup=window.open("","Add%20autoblog",'height=180,width=670');popup.document.writeln('');popup.document.write('Url%20feed%20%20:%20
');var%20feed_links=new%20Array();var%20links=document.getElementsByTagName('link');if(links.length>0){for(var%20i=0;i'+links[i].title+"%20(%20"+links[i].href+"%20)
");}}}popup.document.writeln("");popup.document.writeln("");popup.document.writeln("
");popup.document.writeln("");})();">Projet Autoblog

'. substr($unit, (strrpos($unit, '/')) + 1 ) .'', $size); } } if(!empty( $docs )) { echo '

Autres documents

    '."\n"; foreach( $docs as $value ) { $str = $value[0]; if ( !empty($value[1]) ) { $str = sprintf('%s (%s)', $value[0], $value[1]); } echo '
  • '. $str . "
  • \n"; } echo '
'."\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 ' '."\n"; // et un petit message } ?>

Autoblogs hébergés rss

'; $subdirs = glob(AUTOBLOGS_FOLDER . "*"); $autoblogs = array(); foreach($subdirs as $unit) { if(is_dir($unit)) { if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) { if( file_exists(ROOT_DIR . '/' . $unit . '/vvb.ini')) { $ini = parse_ini_file(ROOT_DIR . '/' . $unit . '/vvb.ini'); if($ini) { $config = new stdClass; foreach ($ini as $key=>$value) { $key = strtolower($key); $config->$key = $value; } $autoblogs[$unit] = $config; unset($ini); } } } } } uasort($autoblogs, "objectCmp"); $autoblogs_display = ''; if(!empty($autoblogs)){ foreach ($autoblogs as $key => $autoblog) { $opml_link='opml'; $autoblogs_display .= '
  • '.escape($autoblog->site_title).'

    config ini '.$opml_link.' | '.escape($autoblog->site_type).' source : '.escape($autoblog->site_url).'
  • '; } } echo $autoblogs_display; echo '

    '.count($autoblogs).' autoblogs hébergés

    '; // 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 ''."\n".' '; // un message de début readfile($fichierCache); // affichage du contenu du fichier echo "\n".' '."\n"; // et un petit message } ?>