Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor fixes #44

Merged
merged 5 commits into from Oct 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions fof-db.php
Expand Up @@ -1257,9 +1257,9 @@ function fof_db_get_subscription_to_tags() {
$user_id = $row['user_id'];
$prefs = unserialize($row['subscription_prefs']);
if (!isset($r[$feed_id])) {
$r[$feed_id] = array();
$r[(int)$feed_id] = array();
}
$r[$feed_id][$user_id] = $prefs['tags'];
$r[(int)$feed_id][(int)$user_id] = $prefs['tags'];
}

return $r;
Expand Down
24 changes: 1 addition & 23 deletions fof-main.php
Expand Up @@ -310,7 +310,7 @@ function fof_tag_item($user_id, $item_id, $tag) {

foreach ($tags as $tag) {
// remove tag, if it starts with '-'
if ($tag{0} == '-') {
if ($tag[0] == '-') {
fof_untag_item($user_id, $item_id, substr($tag, 1));
continue;
}
Expand Down Expand Up @@ -1515,28 +1515,6 @@ function fof_repair_drain_bamage() {
if (ini_get('register_globals')) {
foreach ($_REQUEST as $k => $v) {unset($GLOBALS[$k]);}
}

// thanks to submitter of http://bugs.php.net/bug.php?id=39859
if (get_magic_quotes_gpc()) {
function undoMagicQuotes($array, $topLevel = true) {
$newArray = array();
foreach ($array as $key => $value) {
if (!$topLevel) {
$key = stripslashes($key);
}
if (is_array($value)) {
$newArray[$key] = undoMagicQuotes($value, false);
} else {
$newArray[$key] = stripslashes($value);
}
}
return $newArray;
}
$_GET = undoMagicQuotes($_GET);
$_POST = undoMagicQuotes($_POST);
$_COOKIE = undoMagicQuotes($_COOKIE);
$_REQUEST = undoMagicQuotes($_REQUEST);
}
}

/** Fetch the specified image, cache it, and return its cached name.
Expand Down
10 changes: 10 additions & 0 deletions fof.css
Expand Up @@ -673,3 +673,13 @@ td.feed-prefs-header {
z-index: 1501;
}
}

#marker {
width: 100%;
height: 1em;
border: dotted rgba(0, 100, 100, 0.5) 1px;
background: rgba(255,255,0,0.25);
position: absolute;
top: -10px;
transform: translateY(-100%);
}
2 changes: 2 additions & 0 deletions fof.js
Expand Up @@ -298,11 +298,13 @@ function keyboard(e) {
if (itemBottom > scrollBottom) {
// There is more to read, so scroll down
window.scrollTo(0, getScrollY() + windowHeight*0.8);
document.getElementById('marker').style.top = scrollBottom + 'px';
} else if (isItem(nextElement)) {
// Jump to the next item
unselect(itemElement);
itemElement = nextElement;
select(nextElement, true);
document.getElementById('marker').style.top = '-100px';
} else if (confirm("No more items! Mark flagged as read?")) {
mark_read();
}
Expand Down
1 change: 1 addition & 0 deletions header.php
Expand Up @@ -71,3 +71,4 @@
<div id="handle" class="hide-on-mobile" onmousedown="startResize(event)"></div>

<div id="items">
<div id="marker"></div>
2 changes: 1 addition & 1 deletion update-quiet.php
Expand Up @@ -31,7 +31,7 @@

$now = time();
while (($feed = fof_db_get_row($result)) !== false) {
if (($now - $feed['feed_cache_date']) > ($fof_admin_prefs['autotimeout'] * 60)
if (($now - $feed['feed_cache_attempt_date']) > ($fof_admin_prefs['autotimeout'] * 60)
&& ($now > $feed['feed_cache_next_attempt'])) {
$feeds[] = $feed;
} else {
Expand Down
2 changes: 1 addition & 1 deletion update.php
Expand Up @@ -40,7 +40,7 @@
}

while (($feed = fof_db_get_row($result)) !== false) {
if ((time() - $feed['feed_cache_date']) < ($admin_prefs['manualtimeout'] * 60)) {
if ((time() - $feed['feed_cache_attempt_date']) < ($admin_prefs['manualtimeout'] * 60)) {
list($timestamp) = fof_nice_time_stamp($feed['feed_cache_date']);
$feed_status = " was just updated $timestamp!";
} else if (time() < $feed['feed_cache_next_attempt']) {
Expand Down