Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=37701
Postga havola
LEVEL100 [62] [off]
Salom shuni qayeri xato
<?php
defined('_IN_JOHNCMS') or die('Error: restricted access');
require('../incfiles/head.php');
if (!$al) {
echo functions::display_error($lng['error_wrong_data']);
require('../incfiles/end.php');
exit;
}
$req = mysql_query("SELECT * FROM `album_cat` WHERE `id` = '$al'");
if (!mysql_num_rows($req)) {
echo functions::display_error($lng['error_wrong_data']);
require('../incfiles/end.php');
exit;
}
$album = mysql_fetch_assoc($req);
$view = isset($_GET['view']);
/*
-----------------------------------------------------------------
Просмотр альбома и фотографий
-----------------------------------------------------------------
*/
if ($view) {
$kmess = 1;
$start = (mysql_result(mysql_query("SELECT COUNT(*) FROM `album_files` WHERE `album_id` = '$al' AND `id` > '$img'"), 0));
// Обрабатываем ссылку для возврата
if (empty($_SESSION['ref']))
$_SESSION['ref'] = htmlspecialchars($_SERVER['HTTP_REFERER']);
} else {
unset($_SESSION['ref']);
}
echo '<div class="phdr">'.($view ? '<a href="?act=show&al=' . $al . '"><b>' . functions::checkout($album['name']) . '</b></a>' : '<b>' . functions::checkout($album['name']) . '</b>').'</div>';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `album_files` WHERE `album_id` = '$al' AND `moder` = '0'"), 0);
if ($total) {
$req = mysql_query("SELECT * FROM `album_files` WHERE `album_id` = '$al' AND `moder` = '0' ORDER BY `id` DESC LIMIT $start, $kmess");
while (($res = mysql_fetch_assoc($req)) !== FALSE) {
if ($view) {
/*
-----------------------------------------------------------------
Предпросмотр отдельного изображения
-----------------------------------------------------------------
*/
echo '<div class="menu"><p><img src="../files/album/' . $res['tmb_name'] . '" /></p>';
// Счетчик просмотров
if (!mysql_result(mysql_query("SELECT COUNT(*) FROM `album_views` WHERE `file_id` = '" . $res['id'] . "'"), 0)) {
mysql_query("INSERT INTO `album_views` SET `file_id` = '" . $res['id'] . "', `time` = '" . time() . "'");
$views = mysql_result(mysql_query("SELECT COUNT(*) FROM `album_views` WHERE `file_id` = '" . $res['id'] . "'"), 0);
mysql_query("UPDATE `album_files` SET `views` = '$views' WHERE `id` = '" . $res['id'] . "'");
}
if ($rights == 9) {
echo '<div class="sub">';
echo functions::display_menu(array(
'<a href="?act=image_edit&img=' . $res['id'] . '">' . $lng['edit'] . '</a>',
'<a href="?act=image_move&img=' . $res['id'] . '">' . $lng['move'] . '</a>',
'<a href="?act=image_delete&img=' . $res['id'] . '">' . $lng['delete'] . '</a>'
));
echo '</div>';
}
echo $lng['category'] . ': <b>' . functions::checkout($album['name']) . '</b><br/>
' . $lng['date'] . ': <b>' . functions::display_date($res['time']) . '</b><br/>
' . $lng['count_views'] . ': <b>' . $res['views'] . '</b><br/>
' . $lng['count_downloads'] . ': <b>' . $res['downloads'] . '</b><br/>' .
'<p><img src="../images/download.png" alt="*" /> <a href="?act=image_download&img=' . $res['id'] . '"><b>' . $lng['download'] . '</b></a></p></div>';
echo '<div class="phdr"><b>Похожие фото</b></div><div class="menu">';
$oxshash = mysql_query("SELECT * FROM `album_files` WHERE `album_id` = '$al' AND `moder` = '0' ORDER BY RAND() LIMIT 5");
while (($ohshash = mysql_fetch_assoc($oxshash)) !== FALSE) {
echo '<a href="?act=show&al=' . $al . '&img=' . $ohshash['id'] . '&view"><img width="70" height="70" src="../files/album/' . $ohshash['tmb_name'] . '" alt="#"/> </a>';
}
echo '</div>';
} else {
/*
-----------------------------------------------------------------
Предпросмотр изображения в списке
-----------------------------------------------------------------
*/
echo '<div class="menu"><img src="../files/album/' . $res['tmb_name'] . '" style="width: 105px; height: 105px; float: left;" alt="#"/>';
echo '<div class="gray" style="min-height: 110px; margin-left: 110px;">
' . $lng['count_views'] . ': <b>' . $res['views'] . '</b><br/>
' . $lng['count_downloads'] . ': <b>' . $res['downloads'] . '</b><br/>
<b>' . functions::display_date($res['time']) . '</b><br/><br/>
<a href="?act=show&al=' . $al . '&img=' . $res['id'] . '&view"><h3>Просмотр...</h3></a>
</div><div style="clear: both;"></div></div>';
}
}
} else {
echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
if (!$view) {
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('?act=show&al=' . $al . '&' . ($view ? 'view&' : ''), $start, $total, $kmess) . '</div>';
}
}
Saytim nykyc.zadc.ru rasm qoysam skachat ham prosmostr 1 bolib turaveradi ozgarmay
<?php
defined('_IN_JOHNCMS') or die('Error: restricted access');
require('../incfiles/head.php');
if (!$al) {
echo functions::display_error($lng['error_wrong_data']);
require('../incfiles/end.php');
exit;
}
$req = mysql_query("SELECT * FROM `album_cat` WHERE `id` = '$al'");
if (!mysql_num_rows($req)) {
echo functions::display_error($lng['error_wrong_data']);
require('../incfiles/end.php');
exit;
}
$album = mysql_fetch_assoc($req);
$view = isset($_GET['view']);
/*
-----------------------------------------------------------------
Просмотр альбома и фотографий
-----------------------------------------------------------------
*/
if ($view) {
$kmess = 1;
$start = (mysql_result(mysql_query("SELECT COUNT(*) FROM `album_files` WHERE `album_id` = '$al' AND `id` > '$img'"), 0));
// Обрабатываем ссылку для возврата
if (empty($_SESSION['ref']))
$_SESSION['ref'] = htmlspecialchars($_SERVER['HTTP_REFERER']);
} else {
unset($_SESSION['ref']);
}
echo '<div class="phdr">'.($view ? '<a href="?act=show&al=' . $al . '"><b>' . functions::checkout($album['name']) . '</b></a>' : '<b>' . functions::checkout($album['name']) . '</b>').'</div>';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `album_files` WHERE `album_id` = '$al' AND `moder` = '0'"), 0);
if ($total) {
$req = mysql_query("SELECT * FROM `album_files` WHERE `album_id` = '$al' AND `moder` = '0' ORDER BY `id` DESC LIMIT $start, $kmess");
while (($res = mysql_fetch_assoc($req)) !== FALSE) {
if ($view) {
/*
-----------------------------------------------------------------
Предпросмотр отдельного изображения
-----------------------------------------------------------------
*/
echo '<div class="menu"><p><img src="../files/album/' . $res['tmb_name'] . '" /></p>';
// Счетчик просмотров
if (!mysql_result(mysql_query("SELECT COUNT(*) FROM `album_views` WHERE `file_id` = '" . $res['id'] . "'"), 0)) {
mysql_query("INSERT INTO `album_views` SET `file_id` = '" . $res['id'] . "', `time` = '" . time() . "'");
$views = mysql_result(mysql_query("SELECT COUNT(*) FROM `album_views` WHERE `file_id` = '" . $res['id'] . "'"), 0);
mysql_query("UPDATE `album_files` SET `views` = '$views' WHERE `id` = '" . $res['id'] . "'");
}
if ($rights == 9) {
echo '<div class="sub">';
echo functions::display_menu(array(
'<a href="?act=image_edit&img=' . $res['id'] . '">' . $lng['edit'] . '</a>',
'<a href="?act=image_move&img=' . $res['id'] . '">' . $lng['move'] . '</a>',
'<a href="?act=image_delete&img=' . $res['id'] . '">' . $lng['delete'] . '</a>'
));
echo '</div>';
}
echo $lng['category'] . ': <b>' . functions::checkout($album['name']) . '</b><br/>
' . $lng['date'] . ': <b>' . functions::display_date($res['time']) . '</b><br/>
' . $lng['count_views'] . ': <b>' . $res['views'] . '</b><br/>
' . $lng['count_downloads'] . ': <b>' . $res['downloads'] . '</b><br/>' .
'<p><img src="../images/download.png" alt="*" /> <a href="?act=image_download&img=' . $res['id'] . '"><b>' . $lng['download'] . '</b></a></p></div>';
echo '<div class="phdr"><b>Похожие фото</b></div><div class="menu">';
$oxshash = mysql_query("SELECT * FROM `album_files` WHERE `album_id` = '$al' AND `moder` = '0' ORDER BY RAND() LIMIT 5");
while (($ohshash = mysql_fetch_assoc($oxshash)) !== FALSE) {
echo '<a href="?act=show&al=' . $al . '&img=' . $ohshash['id'] . '&view"><img width="70" height="70" src="../files/album/' . $ohshash['tmb_name'] . '" alt="#"/> </a>';
}
echo '</div>';
} else {
/*
-----------------------------------------------------------------
Предпросмотр изображения в списке
-----------------------------------------------------------------
*/
echo '<div class="menu"><img src="../files/album/' . $res['tmb_name'] . '" style="width: 105px; height: 105px; float: left;" alt="#"/>';
echo '<div class="gray" style="min-height: 110px; margin-left: 110px;">
' . $lng['count_views'] . ': <b>' . $res['views'] . '</b><br/>
' . $lng['count_downloads'] . ': <b>' . $res['downloads'] . '</b><br/>
<b>' . functions::display_date($res['time']) . '</b><br/><br/>
<a href="?act=show&al=' . $al . '&img=' . $res['id'] . '&view"><h3>Просмотр...</h3></a>
</div><div style="clear: both;"></div></div>';
}
}
} else {
echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
}
if (!$view) {
echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
if ($total > $kmess) {
echo '<div class="topmenu">' . functions::display_pagination('?act=show&al=' . $al . '&' . ($view ? 'view&' : ''), $start, $total, $kmess) . '</div>';
}
}
Saytim nykyc.zadc.ru rasm qoysam skachat ham prosmostr 1 bolib turaveradi ozgarmay