View file _modules/tag/index.php

File size: 2.25Kb
<?php

	# author Drk in

	require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );

	$id =  isset( $_GET['id'] ) ? htmlspecialchars($_GET['id']): null;

	if($id == null)system::header('/');

	$page = isset( $_GET['page'] ) ? abs(intval($_GET['page'])) : 0;

	$tag = ($page != 0 ? '/cat/'.$id.'/'.$page:'/cat/'.$id.'.html');

	# cache 

	$cache = cache::tag($tag);

	# meta

	$title = $cache->meta[0]->title.' на '.domain;
	$description = $cache->meta[0]->description.' на '.domain;
	$keywords = $cache->meta[0]->keywords.' на '.domain;
	$tl = $cache->meta[0]->tl;

	# head

	require_once ( head );
	
	# video 

	echo '<div style="background: #ffffff;"><div class="row">';

	foreach ($cache->video as $video):
	
	if ($video->href != null ):	

	$img = $config['url'].$video->src;	

	#cn
	$cn_view = DB :: $dbh -> querySingle("SELECT count(*) FROM `view` WHERE `video`=?;", array($video->href));
	$cn_like = DB :: $dbh -> querySingle("SELECT count(*) FROM `like` WHERE `video`=?;", array($video->href));		

	echo '
	<div class="col-sm-7 col-md-4">
	<div class="list-group">
	<div class="image" itemscope itemtype="http://schema.org/ImageObject">
	<a href="/watch/'.$video->href.'"><h2>
	<span class="namev" itemprop="name">'.$video->title.'</span></h2></a>
	<a href="/watch/'.$video->href.'">
	<img width="103.3%" height="200px" src="'.$img.'" alt="'.$video->title.'" title="'.$video->title.'" itemprop="thumbnail"></a>
	<span class = "like"><img src = "'.ico.'like_up.png" width = "16" alt = "*"> '.$cn_like.'</span>						
	<span class = "videoviews" itemprop="userInteractionCount">
	<img src="'.ico.'heylook.png" width = "16" alt = "*"> '.$cn_view.'</span>
	<span class = "timevideo"><meta itemprop="duration" content="'.$video->duration.'">'.$video->duration.' 
	</span></div></div></div>
	';	

	endif;

	endforeach;	

	echo '</div> <div class="center"><ul class="pagination">';

	# page

	foreach ($cache->page_all as $page):
	
	if ($page->href != null ):	


	echo '<li><a href="?page='.$page->href.'"><span class="unsel">'.$page->name.'</span></a></li>';


	endif;

	endforeach;	
	
	echo '</ul></div></div><div class="list-group-item">'.system::foot($id).'</div>';

	# foot

	require_once ( foot ) ;
?>