modified: 0.3/functions.php

modified:   0.3/index.php
	modified:   0.3/xsaf3.php
- fix valeurs VVB.ini pour microblog & shaarli
- fix CSS
- suppression code inutile de xsaf3.php
This commit is contained in:
Mitsukarenai 2013-02-23 15:27:29 +01:00
parent 8e99dd9ec2
commit 32e040465f
3 changed files with 32 additions and 24 deletions

View file

@ -71,9 +71,9 @@ SITE_TITLE="'. $sitename .'"
SITE_DESCRIPTION="Site original : <a href=\''. $siteurl .'\'>'. $sitename .'</a>"
SITE_URL="'. $siteurl .'"
FEED_URL="'. $rssurl .'"
ARTICLES_PER_PAGE="5"
ARTICLES_PER_PAGE="'. getArticlesPerPage( $type ) .'"
UPDATE_INTERVAL="'. getInterval( $type ) .'"
UPDATE_TIMEOUT="30"') )
UPDATE_TIMEOUT="'. getTimeout( $type ) .'"') )
$error[] = "Impossible d'écrire le fichier vvb.ini";
fclose($fp);
}
@ -83,6 +83,17 @@ UPDATE_TIMEOUT="30"') )
return $error;
}
function getArticlesPerPage( $type ) {
switch( $type ) {
case 'microblog':
return 20;
case 'shaarli':
return 20;
default:
return 5;
}
}
function getInterval( $type ) {
switch( $type ) {
case 'microblog':
@ -94,6 +105,17 @@ function getInterval( $type ) {
}
}
function getTimeout( $type ) {
switch( $type ) {
case 'microblog':
return 30;
case 'shaarli':
return 30;
default:
return 30;
}
}
function updateType($siteurl) {
if( strpos($siteurl, 'twitter.com') !== FALSE ) {
return array('type' => 'microblog', 'name' => 'twitter');

View file

@ -1,4 +1,6 @@
<?php
//ini_set('display_errors','1');
//error_reporting(E_ALL);
/*
Projet Autoblog 0.3-beta-fah
Code: https://github.com/mitsukarenai/Projet-Autoblog
@ -422,9 +424,10 @@ if( !empty($_POST['opml']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML
.pbloc {background-color:white;padding: 12px 10px 12px 10px;border:1px solid #aaa;max-width:70em;margin:1em auto;text-align:justify;box-shadow:0px 5px 7px #aaa;}
input {width:30em;}
input[type="radio"] { width:1em; }
input#socialaccount, input#statusneturl, input#shaarliurl, input#socialsub {width:12em;}
div.form {padding:0.2em;margin:1px;}
div.form:hover {background-color:#FAF4DA;border:1px dotted;margin:0; }
input[type="submit"] { width:8em; }
input[type="text"]#socialaccount, input[type="text"]#statusneturl, input[type="text"]#shaarliurl, input[type="text"]#socialsub {width:12em;}
div.form {padding:0.2em;border:1px solid #fff;}
div.form:hover {background-color:#FAF4DA;border:1px dotted; }
.vignette { width:20em;height:2em;float:left;margin:0; padding:20px;background-color:#eee;border: 1px solid #888;}
.vignette:hover { background-color:#fff;}
.vignette .title { font-size: 14pt;text-shadow: #ccc 0px 5px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@ -515,7 +518,7 @@ if( !empty($_POST['opml']) && ALLOW_NEW_AUTOBLOGS && ALLOW_NEW_AUTOBLOGS_BY_OPML
if(ALLOW_NEW_AUTOBLOGS_BY_OPML == TRUE) { ?>
<div class="form">
<h3>Ajout par fichier OPML</h3>
<h3>Ajouter par fichier OPML</h3>
<form enctype='multipart/form-data' method='POST'>
<input type='hidden' name='opml' value='1' />

View file

@ -78,23 +78,6 @@ function xsafimport($xsafremote, $max_exec_time) {
// Do not use DetectRedirect because it's slow and it has been used when the feed was added
//$rssurl = DetectRedirect(escape($value['FEED_URL']));
$rssurl = escape($value['FEED_URL']);
if($sitetype == 'shaarli') {
$articles_per_page = "20";
$update_interval = "1800";
$update_timeout = "30";
}
else if( $sitetype == 'microblog' ) {
$articles_per_page = "20";
$update_interval = "300";
$update_timeout = "30";
}
else {
$articles_per_page = "5";
$update_interval = "3600";
$update_timeout = "30";
}
$foldername = urlToFolder($siteurl);
}
@ -187,4 +170,4 @@ if(DEBUG) {
echo "<p>XSAF import finished</p>";
}
if( DEBUG ) echo '</body></html>';
?>
?>