mirror of
https://github.com/sorenpeter/timeline.git
synced 2025-12-15 10:57:01 +00:00
fix(refresh): uncomment ob_start and fix style in refresh.php
This commit is contained in:
parent
97a97122bb
commit
1256ebfa22
1 changed files with 16 additions and 23 deletions
|
|
@ -1,38 +1,32 @@
|
|||
<?php
|
||||
|
||||
require_once("partials/base.php");
|
||||
require_once "partials/base.php";
|
||||
|
||||
if (!isset($_SESSION['password'])) {
|
||||
header('Location: ./login');
|
||||
exit();
|
||||
}
|
||||
|
||||
//ob_start();
|
||||
ob_start();
|
||||
|
||||
$title = "Refresh - ".$title;
|
||||
$title = "Refresh - $title";
|
||||
|
||||
ob_end_flush();
|
||||
|
||||
include 'partials/header.php';
|
||||
|
||||
?>
|
||||
|
||||
<p id="refreshLabel">
|
||||
<strong id="refreshInfo">Loading feeds followed by:</strong>
|
||||
<span id="refreshURL"><?= preg_replace('(^https?://)', '', $url) ?></span>
|
||||
<span id="refreshCounter"></span>
|
||||
</p>
|
||||
<progress id="refreshProgress" value=""></progress>
|
||||
|
||||
<?php
|
||||
|
||||
include 'partials/footer.php';
|
||||
ob_start();
|
||||
|
||||
flush();
|
||||
|
||||
// Get URL from query
|
||||
|
||||
// Get URL from query
|
||||
$url = $config['public_txt_url'];
|
||||
|
||||
if (!empty($_GET['url'])) {
|
||||
|
|
@ -54,31 +48,30 @@ foreach ($fileLines as $currentLine) {
|
|||
}
|
||||
}
|
||||
|
||||
// Loop over feeds followed
|
||||
|
||||
/* Progress bar based on: https://github.com/w3shaman/php-progress-bar */
|
||||
// Loop over feeds followed
|
||||
|
||||
// Progress bar based on: https://github.com/w3shaman/php-progress-bar
|
||||
$i = 1;
|
||||
$total = count($twtFollowingList);
|
||||
|
||||
echo '<script language="javascript">document.getElementById("refreshInfo").innerHTML = "Updating feed from:"</script>';
|
||||
|
||||
foreach ($twtFollowingList as $following) {
|
||||
foreach ($twtFollowingList as $following) {
|
||||
//ob_start();
|
||||
$float = $i/$total;
|
||||
$percent = intval($float * 100)."%";
|
||||
$float = $i / $total;
|
||||
$percent = intval($float * 100) . "%";
|
||||
$feed = $following[1];
|
||||
//$feed = preg_replace('(^https?://)', '', $feed);
|
||||
//$feed = $following[0].'@'. parse_url($following[1], PHP_URL_HOST);
|
||||
$feed = $following[0].' ('.$following[1].')';
|
||||
$feed = "{$following[0]} ({$following[1]})";
|
||||
|
||||
// Javascript for updating the progress bar and information
|
||||
echo '<script language="javascript">
|
||||
document.getElementById("refreshURL").innerHTML = "'.$feed.'";
|
||||
document.getElementById("refreshCounter").innerHTML = "('.$i.' of '.$total.')";
|
||||
document.getElementById("refreshProgress").value = "'.$float.'";
|
||||
document.getElementById("refreshProgress").innerHTML = "'.$percent.'";
|
||||
</script>';
|
||||
echo "<script language=\"javascript\">
|
||||
document.getElementById(\"refreshURL\").innerHTML = \"$feed\";
|
||||
document.getElementById(\"refreshCounter\").innerHTML = \"($i of $total.')\";
|
||||
document.getElementById(\"refreshProgress\").value = \"$float\";
|
||||
document.getElementById(\"refreshProgress\").innerHTML = \"$percent\";
|
||||
</script>";
|
||||
|
||||
updateCachedFile($following[1]);
|
||||
ob_flush(); // Send output to browser immediately
|
||||
|
|
|
|||
Loading…
Reference in a new issue