コード例 #1
0
ファイル: index.php プロジェクト: henare/theyworkforyou
	if ($gid_actual['video_status']&4) {
		$q = $db->query("select timediff(current_timestamp,max(whenstamped)) as ws from video_timestamps where gid='$q_gid' and (user_id is null or user_id != -1) and deleted=0");
		$max = $q->field(0, 'ws');
		echo '<p id="video_already">Thanks, but this speech has <strong>already been stamped</strong>';
		if ($max < '00:15:00') {
			echo ' <strong>within the last 15 minutes</strong>, so it\'s possible you and someone
else are timestamping the same debate at the same time';
		} elseif ($from == 'next') {
			echo ' (probably by someone coming by at random when you\'ve been clicking Next)';
		}
		echo '. You can <a href="/video/next.php?action=nextneeded&amp;gid=',
$gid_safe, '&amp;file=', $file, '&amp;time=', $start,
'">go to the next unstamped speech on this day</a>,
or <a href="/video/next.php?action=random">get a new unstamped speech at random</a>.</p>';
	}
	print video_object($file, $start, $gid_safe, 1, $pid);
	video_quote($gid_actual, $parent_gid, $parent_body);
	if (get_http_var('from') != 'next' || !$hidden_int)
		previous_speeches($surrounding_speeches, $gids_previous);
	# print $summary;
	echo '</td><td>';
	echo '<div id="basic_hints"';
	if ($hidden_int)
		echo ' style="display:none"';
	echo '>';
	echo '<p style="float: right; border: solid 1px #666666; padding:3px;"><a onclick="return hideInstructions();" href=""><small>Hide instructions</small></a></p>';
	basic_instructions($pid);
	basic_hints($gid_safe, $file, $pid);
	echo '</div>';
	echo '<div id="advanced_hints"';
	if (!$hidden_int)
コード例 #2
0
ファイル: hansard_gid.php プロジェクト: henare/theyworkforyou
function video_sidebar($row, $section, $count, $major) {
	include_once INCLUDESPATH . 'easyparliament/video.php';
	$db = new ParlDB;
	if ($major == 1) {
		$gid_type = 'debate';
	} elseif ($major == 101) {
		$gid_type = 'lords';
	}
	$vq = $db->query("select id,adate,atime from video_timestamps where gid='uk.org.publicwhip/$gid_type/$row[gid]' and (user_id!=-1 or user_id is null) and deleted=0 order by (user_id is null) limit 1");
	$ts_id = $vq->field(0, 'id'); if (!$ts_id) $ts_id='*';
	$adate = $vq->field(0, 'adate');
	$time = $vq->field(0, 'atime');
	$videodb = video_db_connect();
	if (!$videodb) return '';
	$video = video_from_timestamp($videodb, $adate, $time);
	$start = $video['offset'];
	$out = '';
	if ($count > 1) {
		$out .= '<div id="video_wrap"><div style="position:relative">';
		if ($row['gid'] != $section['first_gid']) {
			$out .= '<p style="margin:0">This video starts around ' . ($row['hpos']-$section['hpos']) . ' speeches in (<a href="#g' . gid_to_anchor($row['gid']) . '">move there in text</a>)</p>';
		}
	}
	$out .= video_object($video['id'], $start, "$gid_type/$row[gid]");
	$flashvars = 'gid=' . "$gid_type/$row[gid]" . '&amp;file=' . $video['id'] . '&amp;start=' . $start;
	$out .= "<br><b>Add this video to another site:</b><br><input readonly onclick='this.focus();this.select();' type='text' name='embed' size='40' value=\"<embed src='http://www.theyworkforyou.com/video/parlvid.swf' width='320' height='230' allowfullscreen='true' allowscriptaccess='always' flashvars='$flashvars'></embed>\"><br><small>(copy and paste the above)</small>";
	$out .= "<p style='margin-bottom:0'>Is this not the right video? <a href='mailto:team&#64;theyworkforyou.com?subject=Incorrect%20video,%20id%20$row[gid];$video[id];$ts_id'>Let us know</a></p>";
	if ($count > 1) {
		$out .= '<p style="position:absolute;bottom:0;right:0;margin:0"><a href="" onclick="return showVideo();">Hide</a></p>';
		$out .= '</div></div>';
		$out .= '<div id="video_show" style="display:none;position:fixed;bottom:5px;right:5px;border:solid 1px #666666; background-color: #eeeeee; padding: 4px;">
<p style="margin:0"><a href="" onclick="return hideVideo();">Show video</a></p></div>';
	}
	return $out;
}
コード例 #3
0
ファイル: DebatesView.php プロジェクト: udp12/theyworkforyou
 private function video_sidebar($row, $heading_hpos, $count)
 {
     include_once INCLUDESPATH . 'easyparliament/video.php';
     $db = new \ParlDB();
     $gid_type = $this->video_gid_type();
     $vq = $db->query("select id,adate,atime from video_timestamps where gid='uk.org.publicwhip/{$gid_type}/{$row['gid']}' and (user_id!=-1 or user_id is null) and deleted=0 order by (user_id is null) limit 1");
     $adate = $vq->field(0, 'adate');
     $time = $vq->field(0, 'atime');
     $videodb = video_db_connect();
     if (!$videodb) {
         return '';
     }
     $video = video_from_timestamp($videodb, $adate, $time);
     $start = $video['offset'];
     $out = '';
     if ($count > 1) {
         $out .= '<div class="debate__video" id="video_wrap"><div>';
         if ($row['gid'] != $this->first_gid) {
             $out .= '<p class="video-instructions">This video starts around ' . ($row['hpos'] - $heading_hpos) . ' speeches in (<a href="#g' . gid_to_anchor($row['gid']) . '">move there in text</a>)</p>';
         }
     }
     $out .= video_object($video['id'], $start, "{$gid_type}/{$row['gid']}");
     $flashvars = 'gid=' . "{$gid_type}/{$row['gid']}" . '&amp;file=' . $video['id'] . '&amp;start=' . $start;
     $out .= "<strong>Embed this video</strong><p class='video-instructions'>Copy and paste this code on your website</p><input readonly onclick='this.focus();this.select();' type='text' name='embed' size='40' value=\"<embed src='http://www.theyworkforyou.com/video/parlvid.swf' width='320' height='230' allowfullscreen='true' allowscriptaccess='always' flashvars='{$flashvars}'></embed>\">";
     if ($count > 1) {
         $out .= '<p class="hide-video"><a href="" onclick="return showVideo();">Hide</a></p>';
         $out .= '</div></div>';
         $out .= '<div id="video_show" class="show-video" style="display:none;">
 <p style="margin:0"><a href="" onclick="return hideVideo();">Show video</a></p></div>';
     }
     return $out;
 }