Add 'unrm' option when in show_seen mode
This commit is contained in:
parent
e886fb3d59
commit
8cf6fde5ca
|
@ -208,7 +208,7 @@ function get_permissions($settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Print one row given the video details
|
# Print one row given the video details
|
||||||
function print_video($video,$settings,$mobile)
|
function print_video($video,$settings,$mobile,$show_seen)
|
||||||
{
|
{
|
||||||
$html = '
|
$html = '
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -256,13 +256,25 @@ function print_video($video,$settings,$mobile)
|
||||||
}
|
}
|
||||||
$html .= '
|
$html .= '
|
||||||
<a href="https://'.($mobile ? 'm' : 'www').'.youtube.com/watch?v=' . $video['videoId'] . '" target="_blank"><div class="web"><img src="images/web.svg"></div></a>
|
<a href="https://'.($mobile ? 'm' : 'www').'.youtube.com/watch?v=' . $video['videoId'] . '" target="_blank"><div class="web"><img src="images/web.svg"></div></a>
|
||||||
<a onclick="clipboard(\'' . $video['videoId'] . '\',\'https://youtube.com/watch?v=' . $video['videoId'] . '\');"><div class="clip"><img src="images/clip.svg"></div></a>
|
<a onclick="clipboard(\'' . $video['videoId'] . '\',\'https://youtube.com/watch?v=' . $video['videoId'] . '\');"><div class="clip"><img src="images/clip.svg"></div></a>';
|
||||||
|
if (isset($show_seen) && $show_seen && isset($video['seen']) && $video['seen']) {
|
||||||
|
$html .= '
|
||||||
|
<a href="?unrm=' . $video['videoId'] . '">
|
||||||
|
<div class="seen">
|
||||||
|
<span class="unmark">
|
||||||
|
<h3>*</h3>
|
||||||
|
</span>
|
||||||
|
</div>';
|
||||||
|
} else {
|
||||||
|
$html .= '
|
||||||
<a href="?rm=' . $video['videoId'] . '">
|
<a href="?rm=' . $video['videoId'] . '">
|
||||||
<div class="seen">
|
<div class="seen">
|
||||||
<span class="mark">
|
<span class="mark">
|
||||||
<h3>X</h3>
|
<h3><b>X</b></h3>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>';
|
||||||
|
}
|
||||||
|
$html .= '
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
' . $default .'
|
' . $default .'
|
||||||
|
@ -300,9 +312,17 @@ function print_video($video,$settings,$mobile)
|
||||||
$html .= '
|
$html .= '
|
||||||
<div class="web"><a href="https://'.($mobile ? 'm' : 'www').'.youtube.com/watch?v=' . $video['videoId'] . '" target="_blank"><img src="images/web.svg"></a></div>
|
<div class="web"><a href="https://'.($mobile ? 'm' : 'www').'.youtube.com/watch?v=' . $video['videoId'] . '" target="_blank"><img src="images/web.svg"></a></div>
|
||||||
<div class="clip"><a onclick="clipboard(\'' . $video['videoId'] . '\',\'https://youtube.com/watch?v=' . $video['videoId'] . '\');"><img src="images/clip.svg"></a></div>
|
<div class="clip"><a onclick="clipboard(\'' . $video['videoId'] . '\',\'https://youtube.com/watch?v=' . $video['videoId'] . '\');"><img src="images/clip.svg"></a></div>
|
||||||
</div>
|
</div>';
|
||||||
|
if (isset($show_seen) && $show_seen && isset($video['seen']) && $video['seen']) {
|
||||||
|
$html .= '
|
||||||
|
<a href="?unrm=' . $video['videoId'] . '">
|
||||||
|
<div class="seen"><span class="unmark"><h3>*</h3></span></div></a>';
|
||||||
|
} else {
|
||||||
|
$html .= '
|
||||||
<a href="?rm=' . $video['videoId'] . '">
|
<a href="?rm=' . $video['videoId'] . '">
|
||||||
<div class="seen"><span class="mark"><h3>X</h3></span></div></a>
|
<div class="seen"><span class="mark"><h3><b>X</b></h3></span></div></a>';
|
||||||
|
}
|
||||||
|
$html .= '
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -560,6 +580,16 @@ if ( !$no_db && $reload && $permissions['writable'] ) {
|
||||||
$target = remove_arg($target,'rm');
|
$target = remove_arg($target,'rm');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Mark one or all videos as played.
|
||||||
|
if (isset($args['unrm'])) {
|
||||||
|
if (preg_match("/^([^']{11})$/",urldecode($args['unrm']))) {
|
||||||
|
$debug_text .= "<p>Restoring " . urldecode($args['unrm']) . "</p>";
|
||||||
|
$unrm = sql_escape(urldecode($args['unrm']));
|
||||||
|
$handle->query("UPDATE videos SET seen = 0 WHERE videoId = '$unrm'");
|
||||||
|
}
|
||||||
|
$target = remove_arg($target,'unrm');
|
||||||
|
}
|
||||||
|
|
||||||
# Update the refresh interval
|
# Update the refresh interval
|
||||||
if (isset($args['refresh'])) {
|
if (isset($args['refresh'])) {
|
||||||
$interval = urldecode($args['refresh']);
|
$interval = urldecode($args['refresh']);
|
||||||
|
@ -911,7 +941,7 @@ if (isset($permissions['readable']) && $permissions['readable']) {
|
||||||
}
|
}
|
||||||
$header .= '</input>
|
$header .= '</input>
|
||||||
<button type="submit">Search</button>
|
<button type="submit">Search</button>
|
||||||
<button type="submit" name="search_clear">X</button>
|
<button type="submit" name="search_clear"><b>X</b></button>
|
||||||
</form>';
|
</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1128,7 +1158,7 @@ if (isset($permissions['readable']) && $permissions['readable']) {
|
||||||
<li>
|
<li>
|
||||||
<a href="https://'.($mobile ? 'm' : 'www').'.youtube.com/channel/' . $row['channelId'] . '/videos" target="_blank"><img title="' . $row['channelName'] . '" src="' . $row['channelThumbnail'] . '"></a>
|
<a href="https://'.($mobile ? 'm' : 'www').'.youtube.com/channel/' . $row['channelId'] . '/videos" target="_blank"><img title="' . $row['channelName'] . '" src="' . $row['channelThumbnail'] . '"></a>
|
||||||
<div class="unsubscribe" title="Unsubscribe from ' . $row['channelName'] . '">
|
<div class="unsubscribe" title="Unsubscribe from ' . $row['channelName'] . '">
|
||||||
<a onclick="if (confirm(\'Unsubscribe from ' . $row['channelName'] . '?\')) { window.location = \'' . $target . ((isset($category)) ? '?filter='.$category.'&' : '?') . 'unsub=' . $row['channelId'] . '\'; }">X</a>
|
<a onclick="if (confirm(\'Unsubscribe from ' . $row['channelName'] . '?\')) { window.location = \'' . $target . ((isset($category)) ? '?filter='.$category.'&' : '?') . 'unsub=' . $row['channelId'] . '\'; }"><b>X</b></a>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
if (isset($chan_filter)) {
|
if (isset($chan_filter)) {
|
||||||
|
@ -1232,7 +1262,7 @@ if (isset($permissions['readable']) && $permissions['readable']) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
$row['channelThumbnail'] = $thumbnails[$row['channelId']];
|
$row['channelThumbnail'] = $thumbnails[$row['channelId']];
|
||||||
$body .= print_video($row,$settings,$mobile);
|
$body .= print_video($row,$settings,$mobile,$show_seen);
|
||||||
$x++;
|
$x++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue