<?php
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."photogallery.php";
require_once THEMES."templates/global/photos.php";
if (!defined('SAFEMODE')) define("SAFEMODE", @ini_get("safe_mode") ? TRUE : FALSE);
add_to_title($locale['global_200'].$locale['400']);
add_breadcrumb(array('link'=>BASEDIR.'photogallery.php', 'title'=>$locale['400']));
/* View Photo */
if (isset($_GET['photo_id']) && isnum($_GET['photo_id'])) {
include INCLUDES."comments_include.php";
include INCLUDES."ratings_include.php";
add_to_jquery("$('a.photogallery_photo_link').colorbox({width:'80%', height:'80%', photo:true});");
$result = dbquery("SELECT tp.*, ta.album_id, ta.album_title, ta.album_access,
tu.user_id, tu.user_name, tu.user_status,
SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes,
count(tc.comment_id) AS comment_count
FROM ".DB_PHOTOS." tp
LEFT JOIN ".DB_PHOTO_ALBUMS." ta USING (album_id)
LEFT JOIN ".DB_USERS." tu ON tp.photo_user=tu.user_id
LEFT JOIN ".DB_RATINGS." tr ON tr.rating_item_id = tp.photo_id AND tr.rating_type='P'
LEFT JOIN ".DB_COMMENTS." tc ON tc.comment_item_id=tp.photo_id AND comment_type='P'
WHERE ".groupaccess('album_access')." AND photo_id='".intval($_GET['photo_id'])."' GROUP BY tp.photo_id");
$info = array();
if (dbrows($result)>0) {
$data = dbarray($result);
$info = $data;
/* Declaration */
define("PHOTODIR", PHOTOS.(!SAFEMODE ? "album_".$data['album_id']."/" : ""));
$result = dbquery("UPDATE ".DB_PHOTOS." SET photo_views=(photo_views+1) WHERE photo_id='".$_GET['photo_id']."'");
// order is not working.
$pres = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE photo_order='".($data['photo_order']-1)."' AND album_id='".$data['album_id']."'");
$nres = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE photo_order='".($data['photo_order']+1)."' AND album_id='".$data['album_id']."'");
$fres = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE photo_order='1' AND album_id='".$data['album_id']."'");
$lastres = dbresult(dbquery("SELECT MAX(photo_order) FROM ".DB_PHOTOS." WHERE album_id='".$data['album_id']."'"), 0);
$lres = dbquery("SELECT photo_id FROM ".DB_PHOTOS." WHERE photo_order>='".$lastres."' AND album_id='".$data['album_id']."'");
if (dbrows($pres)) $prev = dbarray($pres);
if (dbrows($nres)) $next = dbarray($nres);
if (dbrows($fres)) $first = dbarray($fres);
if (dbrows($lres)) $last = dbarray($lres);
add_to_title($locale['global_201'].$data['photo_title']);
add_to_head("<link rel='stylesheet' href='".INCLUDES."jquery/colorbox/colorbox.css' type='text/css' media='screen' />");
add_to_head("<script type='text/javascript' src='".INCLUDES."jquery/colorbox/jquery.colorbox.js'></script>");
add_breadcrumb(array('link'=>BASEDIR."photogallery.php?album_id=".$data['album_id'], 'title'=>$data['album_title']));
add_breadcrumb(array('link'=>BASEDIR."photogallery.php?photo_id=".$data['photo_id'], 'title'=>$data['photo_title']));
if ($settings['photo_watermark']) {
if ($settings['photo_watermark_save']) {
$parts = explode(".", $data['photo_filename']);
$wm_file1 = $parts[0]."_w1.".$parts[1];
$wm_file2 = $parts[0]."_w2.".$parts[1];
if (!file_exists(PHOTODIR."/thumbs/".$wm_file1)) {
if ($data['photo_thumb2']) {
$info['photo_thumb'] = "photo.php?photo_id=".$_GET['photo_id'];
}
$info['photo_file'] = "photo.php?photo_id=".$_GET['photo_id']."&full";
} else {
if ($data['photo_thumb2']) {
$info['photo_thumb'] = PHOTODIR."/".$wm_file1;
}
$info['photo_file'] = PHOTODIR."/".$wm_file2;
}
} else {
if ($data['photo_thumb2']) {
$info['photo_thumb'] = "photo.php?photo_id=".$_GET['photo_id'];
}
$info['photo_file'] = "photo.php?photo_id=".$_GET['photo_id']."&full";
}
$info['photo_size'] = @getimagesize(PHOTODIR.$data['photo_filename']);
} else {
$info['photo_thumb'] = $data['photo_thumb2'] ? PHOTODIR."/thumbs/".$data['photo_thumb2'] : "";
$info['photo_file'] = PHOTODIR.$data['photo_filename'];
$info['photo_size'] = @getimagesize($photo_file);
}
$info['photo_byte'] = parsebytesize($settings['photo_watermark'] ? filesize(PHOTODIR.$info['photo_filename']) : filesize($info['photo_file']));
$info['photo_comment'] = $data['photo_allow_comments'] ? number_format($data['comment_count']) : 0;
$info['photo_ratings'] = $data['photo_allow_ratings'] ? number_format(ceil($info['sum_rating']/$info['count_votes'])) : '0';
$info['photo_description'] = $data['photo_description'] ? nl2br(parseubb($info['photo_description'], "b|i|u|center|small|url|mail|img|quote")) : '';
if ((isset($prev['photo_id']) && isnum($prev['photo_id'])) || (isset($next['photo_id']) && isnum($next['photo_id']))) {
if (isset($prev) && isset($first)) {
$info['nav']['first'] = array('link'=>BASEDIR."photogallery.php?photo_id=".$first['photo_id'], 'name'=>$locale['459']);
}
if (isset($prev)) {
$info['nav']['prev'] = array('link'=>BASEDIR."photogallery.php?photo_id=".$prev['photo_id'], 'name'=>$locale['451']);
}
if (isset($next)) {
$info['nav']['next'] = array('link'=>BASEDIR."photogallery.php?photo_id=".$next['photo_id'], 'name'=>$locale['452']);
}
if (isset($next) && isset($last)) {
$info['nav']['last'] = array('link'=>BASEDIR."photogallery.php?photo_id=".$last['photo_id'], 'name'=>$locale['460']);
}
}
render_photo($info);
} else {
redirect(BASEDIR.'photogallery.php');
}
}
echo '<div class="row">
<div class="col-md-10">
<h3>
Najnowsze zdjęcia</h3>
</div>
<div class="col-md-2">
<!-- Controls -->
<div class="controls pull-right hidden-xs">
<a class="left fa fa-chevron-left btn btn-link" href="#carousel-example"
data-slide="prev"></a><a class="right fa fa-chevron-right btn btn-link" href="#carousel-example"
data-slide="next"></a>
</div>
</div>
</div>
<div id="carousel-example" class="slide hidden-xs" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<div class="row">';
$result=dbquery(
"SELECT tp.*, ta.* FROM ".$db_prefix."photos tp
LEFT JOIN ".$db_prefix."photo_albums ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT 2,1"
);
if(dbrows($result)>0){
while ($data=dbarray($result)) {
//$thumb_img = ($data['photo_thumb1'] && file_exists(PHOTODIR."thumbs/".$data['photo_thumb1'])) ? PHOTODIR."thumbs/".$data['photo_thumb1'] : '';
//add_breadcrumb(array('link'=>BASEDIR.'photogallery.php?album_id='.$_GET['album_id'], 'title'=>$info['album_title']));
echo '
<div class="col-sm-4">
<div class="col-item">
<div class="photo">';
echo "<!--photogallery_album_photo_".$data['photo_id']."-->";
echo "<a href='".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' class='photogallery_album_photo_link'>\n";
$thumb_img = ($data['photo_thumb1'] && file_exists(PHOTODIR.$data['photo_thumb1'])) ? PHOTODIR.$data['photo_thumb1'] : DOWNLOADS."images/no_image.jpg";
$title = ($data['album_thumb1'] && file_exists(PHOTOS.$data['album_thumb1'])) ? $data['album_thumb1'] : $locale['432'];
add_breadcrumb(array('link'=>BASEDIR.'photogallery.php?album_id='.$_GET['album_id'], 'title'=>$info['album_title']));
echo "<img class='photogallery_album_photo img-responsive' style='min-width: 100%;' src='".$thumb_img."' title='$title' alt='$title' />\n";
echo "</a>\n";
echo '</div>
<div class="info">
<div class="row">
<div class="price col-md-6">
<h5>
Sample Product</h5>
<h5 class="price-text-color">
</h5>
</div>
<div class="rating hidden-sm col-md-6">
<i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="fa fa-star"></i>
</div>
</div>
<div class="separator clear-left">
<p class="btn-add">
<i class="fa fa-eye"></i>204 razy</p>
<p class="btn-details">
<i class="fa fa-list"></i><a href="http://www.jquery2dotnet.com" class="hidden-sm">Zobacz</a></p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>';
}
}
$result=dbquery(
"SELECT tp.*, ta.* FROM ".$db_prefix."photos tp
LEFT JOIN ".$db_prefix."photo_albums ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT 2,1"
);
if(dbrows($result)>0){
while ($data=dbarray($result)) {
$randphotodir = PHOTOS.(!@ini_get("safe_mode") ? "album_".$data['album_id']."/" : "");
echo '
<div class="col-sm-4">
<div class="col-item">
<div class="photo">';
echo "<img src=".$randphotodir.$data['photo_thumb1']." class='img-responsive' alt='a' />";
echo '</div>
<div class="info">
<div class="row">
<div class="price col-md-6">
<h5>
Sample Product</h5>
<h5 class="price-text-color">
</h5>
</div>
<div class="rating hidden-sm col-md-6">
<i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="fa fa-star"></i>
</div>
</div>
<div class="separator clear-left">
<p class="btn-add">
<i class="fa fa-eye"></i>204 razy</p>
<p class="btn-details">
<i class="fa fa-list"></i><a href="http://www.jquery2dotnet.com" class="hidden-sm">Zobacz</a></p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>';
}
}
$result=dbquery(
"SELECT tp.*, ta.* FROM ".$db_prefix."photos tp
LEFT JOIN ".$db_prefix."photo_albums ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT 3,1"
);
if(dbrows($result)>0){
while ($data=dbarray($result)) {
$randphotodir = PHOTOS.(!@ini_get("safe_mode") ? "album_".$data['album_id']."/" : "");
echo '
<div class="col-sm-4">
<div class="col-item">
<div class="photo">';
echo "<img src=".$randphotodir.$data['photo_thumb1']." class='img-responsive' alt='a' />";
echo '</div>
<div class="info">
<div class="row">
<div class="price col-md-6">
<h5>
Sample Product</h5>
<h5 class="price-text-color">
</h5>
</div>
<div class="rating hidden-sm col-md-6">
<i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="fa fa-star"></i>
</div>
</div>
<div class="separator clear-left">
<p class="btn-add">
<i class="fa fa-eye"></i>204 razy</p>
<p class="btn-details">
<i class="fa fa-list"></i><a href="http://www.jquery2dotnet.com" class="hidden-sm">Zobacz</a></p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="item">
<div class="row">';
}
}
$result=dbquery(
"SELECT tp.*, ta.* FROM ".$db_prefix."photos tp
LEFT JOIN ".$db_prefix."photo_albums ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT 4,1"
);
if(dbrows($result)>0){
while ($data=dbarray($result)) {
$randphotodir = PHOTOS.(!@ini_get("safe_mode") ? "album_".$data['album_id']."/" : "");
echo '
<div class="col-sm-4">
<div class="col-item">
<div class="photo">';
echo "<img src=".$randphotodir.$data['photo_thumb1']." class='img-responsive' alt='a' />";
echo '</div>
<div class="info">
<div class="row">
<div class="price col-md-6">
<h5>
Sample Product</h5>
<h5 class="price-text-color">
</h5>
</div>
<div class="rating hidden-sm col-md-6">
<i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="fa fa-star"></i>
</div>
</div>
<div class="separator clear-left">
<p class="btn-add">
<i class="fa fa-eye"></i>204 razy</p>
<p class="btn-details">
<i class="fa fa-list"></i><a href="http://www.jquery2dotnet.com" class="hidden-sm">Zobacz</a></p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>';
}
}
$result=dbquery(
"SELECT tp.*, ta.* FROM ".$db_prefix."photos tp
LEFT JOIN ".$db_prefix."photo_albums ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT 5,1"
);
if(dbrows($result)>0){
while ($data=dbarray($result)) {
$randphotodir = PHOTOS.(!@ini_get("safe_mode") ? "album_".$data['album_id']."/" : "");
echo '
<div class="col-sm-4">
<div class="col-item">
<div class="photo">';
echo "<img src=".$randphotodir.$data['photo_thumb1']." class='img-responsive' alt='a' />";
echo '</div>
<div class="info">
<div class="row">
<div class="price col-md-6">
<h5>
Sample Product</h5>
<h5 class="price-text-color">
</h5>
</div>
<div class="rating hidden-sm col-md-6">
<i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="fa fa-star"></i>
</div>
</div>
<div class="separator clear-left">
<p class="btn-add">
<i class="fa fa-eye"></i>204 razy</p>
<p class="btn-details">
<i class="fa fa-list"></i><a href="http://www.jquery2dotnet.com" class="hidden-sm">Zobacz</a></p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>';
}
}
$result=dbquery(
"SELECT tp.*, ta.* FROM ".$db_prefix."photos tp
LEFT JOIN ".$db_prefix."photo_albums ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY photo_datestamp DESC LIMIT 6,1"
);
if(dbrows($result)>0){
while ($data=dbarray($result)) {
$randphotodir = PHOTOS.(!@ini_get("safe_mode") ? "album_".$data['album_id']."/" : "");
echo '
<div class="col-sm-4">
<div class="col-item">
<div class="photo">';
echo "<img src=".$randphotodir.$data['photo_thumb1']." class='img-responsive' alt='a' />";
echo '</div>
<div class="info">
<div class="row">
<div class="price col-md-6">
<h5>
Sample Product</h5>
<h5 class="price-text-color">
</h5>
</div>
<div class="rating hidden-sm col-md-6">
<i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">
</i><i class="fa fa-star"></i>
</div>
</div>
<div class="separator clear-left">
<p class="btn-add">
<i class="fa fa-eye"></i>204 razy</p>
<p class="btn-details">
<i class="fa fa-list"></i><a href="http://www.jquery2dotnet.com" class="hidden-sm">Zobacz</a></p>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>';
}
}
echo '</div>
</div>
</div>
</div>';
?>
Category Forum
Addons Open TestingLabels
None yet
Statistics
1 participant
Notifications
You are not receiving notifications from this thread.
Related Questions