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