View file m/files.php

File size: 5.99Kb
<?php
// 3020.ru - качай скрипты тут
require('../sys/system.php');
// Фильтруем переменные
$url1 = functions::htmlred($_GET['url1']);
$url2 = functions::htmlred($_GET['url2']);
// Проверка на существование файла
$row = DB::$dbs->queryFetch('SELECT `id`,`time`,`ip`,`counter`,`idus` FROM `kanal` WHERE `url1` = ? and `url2` = ? and `counter` > 0 LIMIT 1', [$url1,$url2]);
// Создаем разделы в файле
switch($act) {
	default:
		if(empty($row['id']) or $row['counter'] == 0):
			$_SESSION['err'] = 'Такой картинки не существует.';
			header('location: /'); exit;
		endif;
		// Первое изображение
		$sqlf1 = DB::$dbs->query("SELECT `name` FROM `images` WHERE `idkan` = ? ORDER BY `time` DESC LIMIT 1",[$row['id']])->fetchAll(PDO::FETCH_ASSOC);
		foreach ($sqlf1 as $fillk):
			$title->SetOg(SETT[0].'/'.$url1.'/'.$url2.'/',$fillk['name'],SETT[0].'/files/'.$fillk['name']);
		endforeach;
		//
		$title->SetTitle('Просмотр изображений - '.SETT[1]);
		$title->GetHeader();
		?>
			<?php if($row['idus'] == 0) {?>
				<div class="files3 margin" style="padding: 10px 10px 14px 10px;">
					<?php echo $row['counter'] == 1?'Загружено':'Загружены';?> <span style="color: #ff4700;"><?php echo functions::vremja($row['time']);?></span> (<?php echo functions::slv($row['counter'],'изображение','изображения','изображений');?>)
				</div>			
			<?php }else{ ?>
				<div class="files3 margin" style="padding: 10px 10px 14px 10px;">
					<div class="post_image">
						<img src="<?php echo functions::usava($row['idus']);?>" width="50" height="50" class="post_img">
					</div>
				  	<div class="post_header_info">
				        <h5 class="post_author">
				        	<?php echo functions::usname($row['idus']);?>
				        </h5>
				        <div class="post_date">
				    		<?php echo functions::vremja($row['time']);?> (<?php echo functions::slv($row['counter'],'изображение','изображения','изображений');?>)
				        </div>
				    </div>
				</div>
			<?php } ?>
				<div class="birez1 margin" style="margin-bottom: 15px;border-radius: 0 0 5px 5px;"> 
					<table class="birez2" style=""> 
						<tbody>
							<tr> 
								<td class="birez3" style="border-right: 1px solid #1f1f1f;width: 33%;">      
									<div onclick="bbeye();" class="birez4" id="bbeye">
                                        BB
									</div>     
								</td> 
								<td class="birez3" style="border-right: 1px solid #1f1f1f;width: 33%;">      
									<div onclick="eyeall();" class="birez4 aktiv2 clic" id="eyeall">
                                        СМОТРЕТЬ
									</div>     
								</td> 
								<?php if(isset($user['id']) and $user['id'] == $row['idus']): ?>
								<td class="birez3" id="loadsss" style="width: 33%;">      
				                    <form id="loadess" action="/uploads/add/<?php echo $row['id'];?>/" method="post" enctype="multipart/form-data" style="">
				                        <label for="myfile" class="birez4" style="text-transform: uppercase;">ДОБАВИТЬ</label>
				                        <input type="file" class="load-no" id="myfile" name="file[]" multiple="multiple" onchange="this.form.submit ()"/>
				                    </form>    
								</td> 
							<?php endif;?>
							</tr>
						</tbody>
					</table> 
				</div>
				<div id="bbeye2" style="display: none;">
					<div class="files4">
						<div class="verhinp"> Ссылка на Мипикс (страница просмотра изображения)</div>
						<input class="inputs1" type="text" value="https://conff.org/<?php echo $url1;?>/<?php echo $url2;?>/">
						<div class="verhinp"> HTML (блоги и веб-сайты)</div>
						<input class="inputs1" type="text" value='<a href="https://conff.org/<?php echo $url1;?>/<?php echo $url2;?>/" title="Фотография загружена на фотохостинг mepx.ru">Посмотреть изображение</a>'>
						<div class="verhinp"> Поделиться изображением прямо сейчас:</div>
						<a target="_blank" title="vk.com" rel="nofollow noopener" style="opacity: .7" href="https://vk.com/share.php?url=https://mepx.ru/<?php echo $url1;?>/<?php echo $url2;?>/&title=Просмотреть изображение&utm_source=share2"><img src="/img/soc/vkontakte.png"></a>
						<a target="_blank" title="facebook.com" rel="nofollow noopener" style="opacity: .7" href="https://www.facebook.com/sharer.php?src=&u=https://mepx.ru/<?php echo $url1;?>/<?php echo $url2;?>/&title=Просмотреть изображение&utm_source=share2"><img src="/img/soc/facebook.png"></a>
						<a target="_blank" title="ok.ru" rel="nofollow noopener" style="opacity: .7" href="https://connect.ok.ru/offer?url=https://mepx.ru/<?php echo $url1;?>/<?php echo $url2;?>/&title=Просмотреть изображение&utm_source=share2"><img src="/img/soc/odnoklassniki.png"></a>
						<a target="_blank" title="twitter.com" rel="nofollow noopener" style="opacity: .7" href="https://twitter.com/intent/tweet?text=Просмотреть изображение&url=https://mepx.ru/<?php echo $url1;?>/<?php echo $url2;?>/&utm_source=share2"><img src="/img/soc/twitter.png"></a>
					</div>
				</div>
		</div>
		</div>
		<div class="countru" id="imagres">
			<div class="row">
				<div class="popos">
					<?php
					$sqlfill = DB::$dbs->query("SELECT `name` FROM `images` WHERE `idkan` = ? ORDER BY `time` DESC LIMIT 20",[$row['id']])->fetchAll(PDO::FETCH_ASSOC);
					foreach ($sqlfill as $fill): ?>
						<div><img class="pros" id="image" name="image" border="0" onclick="resizeimage();" src="/files/<?php echo $fill['name'];?>" style="width: 100%;"></div>
					<?php endforeach;?>
				</div>
			</div>
		</div>
		<div class="countru">
			<div class="row">
				<?php
				$title->GetFooter();
	break;
}
?>