<?php
$c=$_GET['c'];$zan=$_GET['zan'];$qie=$_GET['qie'];
$time= time();
$sql_server=getenv('HTTP_BAE_ENV_ADDR_SQL_IP').":".getenv('HTTP_BAE_ENV_ADDR_SQL_PORT');
$sql_user=getenv('HTTP_BAE_ENV_AK');
$sql_pwd=getenv('HTTP_BAE_ENV_SK');
$conn=mysql_connect( $sql_server,$sql_user,$sql_pwd);
if(!$conn){die("error");}
@mysql_select_db("SJwkHCnvzyJDtyTldZHs", $conn);
$sql="insert into plog (token,pltime) values ('$c',CURRENT_TIMESTAMP)";
$query=mysql_query($sql, $conn);
if($zan!=""){
$sql="insert into zan (pid,token,type,zdate,ztime) values ('$zan','$c','zan','$time',CURRENT_TIMESTAMP)";
$query=mysql_query($sql, $conn);
}
if($qie!=""){
$sql="insert into zan (pid,token,type,zdate,ztime) values ('$qie','$c','qie','$time',CURRENT_TIMESTAMP)";
$query=mysql_query($sql, $conn);
}
?>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>一起晒照片~分享美好</title>
<!-- base href="http://www.apiwx.com/" -->
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta charset="utf-8">
<link href="photocss/photo.css" rel="stylesheet" type="text/css">
<link href="photocss/photoswipe.css" type="text/css" rel="stylesheet">
<link href="css/message.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript" src="photocss/klass.js"></script>
<script type="text/javascript" src="photocss/code.js"></script>
<script type="text/javascript">
(function(window, PhotoSwipe){
document.addEventListener('DOMContentLoaded', function(){
var
options = {},
instance = PhotoSwipe.attach( window.document.querySelectorAll('#Gallery a'), options );
}, false);
}(window, window.Code.PhotoSwipe));
</script>
</head>
<body id="photo"><!-- //先载入jquery -->
<!-- //再载入lazyload -->
<script type="text/javascript" src="photocss/jquery_003.js"></script>
<script type="text/javascript">
jQuery(document).ready(
function($){
$("img").lazyload({
placeholder : "images/grey.gif", //加载图片前的占位图片
effect : "fadeIn" //加载图片使用的效果(淡入)
});
});
</script>
<div class="qiandaobanner"> <img src="http://bcs.duapp.com/vcixian/bg.jpg"> </div>
<div><b style="color:#F03;">回复“#昵称”设置你的昵称</b><br> </div>
<div style="height: 424px;" id="main" role="main">
<ul id="Gallery" class="gallery">
<?php $sql="select * from photo where state='1' order by id desc ";
$query=mysql_query($sql, $conn);
$num = mysql_num_rows($query);
$perpage = 20;
$totalpage = @ceil($num/$perpage);
$page =$_GET['page'];
if(!isset($page)){ $page = 1; }
$start = ($page-1)*$perpage;
$sql2="select * from photo where state='1' order by id desc limit $start,$perpage";
$rs3=mysql_query($sql2, $conn);;
$info = array();
while($row3=mysql_fetch_array($rs3)){
$info[] = $row3; }
foreach($info as $row){
$sql3="select * from zan where pid='$row[id]' and type='zan'";
$query3=mysql_query($sql3, $conn);
$znum=mysql_num_rows($query3);
$sqlq="select * from zan where pid='$row[id]' and type='qie'";
$queryq=mysql_query($sqlq, $conn);
$qnum=mysql_num_rows($queryq);
?>
<li style="position: absolute; left: 8px; top: 0px; display: list-item;">
<a href="http://demowxapi.duapp.com/?url=<?php echo $row['url'] ?>">
<img src="<?php echo $row['url'] ?>" alt="<?php echo $row['id'] ?>">
</a><input type="hidden" id="img" value="<?php echo $row['id'] ?>">
<div align="right"><!--<i style="margin-right:5px;color:#333; font-size:13px;" id="qie< ?php echo $row['id'] ?>" onClick="ck1(this.id)" >切(< ?php echo $qnum ?>) </i>--> <?php echo $row['name'] ?>
<!-- <a style="margin-right:5px;color:#F03; font-size:13px;" href="http://vvcixian.duapp.com/photo.php?zan=< ?php echo $row['id'] ?>">赞(< ?php echo $znum ?>)</a>-->
<i style="margin-right:5px;color:#F03; font-size:13px;" id="zan<?php echo $row['id'] ?>" onClick="ck(this.id)" >赞(<?php echo $znum ?>) </i> </div>
<p> <?php echo $row['ptime'] ?></p></li>
<?php } ?>
</ul>
</div>
<!-- <a href="photo.php?wxid=602f1e8347c8a74df87a3fd046208e05&p=0">上一页</a> <a href="photo.php?wxid=602f1e8347c8a74df87a3fd046208e05&p=1">下一页</a> -->
<div class="pagination">
<?php if($page==1){ ?>
<div class="left disabled"><a>上一页</a></div>
<?php }else{ ?>
<div class="left ok"><a href="photo.php?page=<?php echo $page-1; ?>">上一页</a></div>
<?php } ?>
<div class="allpage">
<div class="currentpage"> <?php echo $page; ?> / <?php echo $totalpage; ?></div>
</div>
<?php if($page==$totalpage){ ?>
<div class="right disabled"><a>下一页</a></div>
<?php }else{ ?>
<div class="right ok" > <a href="photo.php?page=<?php echo $page+1; ?>">下一页</a></div>
<?php } mysql_close($conn); ?>
<div class="clr"></div>
</div>
<!--jquery.min-->
<script src="photocss/jquery_004.js"></script>
<!--下面是瀑布流js-->
<script src="photocss/jquery_002.js"></script>
<script src="photocss/jquery.js"></script>
<script type="text/javascript">
(function ($){
$('#Gallery').imagesLoaded(function() {
// Prepare layout options.
var options = {
autoResize: true, // This will auto-update the layout when the browser window is resized.
container: $('#main'), // Optional, used for some extra CSS styling
offset: 4, // Optional, the distance between grid items
itemWidth: 150 // Optional, the width of a grid item
};
// Get a reference to your grid items.
var handler = $('#Gallery li');
// Call the layout function.
handler.wookmark(options);
});
})(jQuery);
</script>
<!--http://vvcixian.duapp.com/photocss/plugback.js -->
<script src="photocss/plugback.js" type="text/javascript"></script>
<script type="text/javascript">
function ck(id){
var url=window.location.href;
url1=url+'&zan='+id.substring(3);
//alert(url1);
window.location.href=url1;
}
function ck1(id){
var url=window.location.href;
url1=url+'&qie='+id.substring(3);
//alert(url1);
window.location.href=url1;
}
/*function ck(id){
$(document).ready(function () {
$("#id").click(function () {
alert(1);alert($("#img").val());
var img = $("#img").val();
alert(img);
var submitData = {
nickname:wxname,
info: info,
action: "setly"
};
$.post('dd.php?c=< ?php echo $c ?>', submitData,
function(data) {
if (data.success == true) {
alert(data.msg);
setTimeout('window.location.href=location.href',1000);
return
} else {}
},
"json")
});
}); }*/
</script>
</body></html>
- 1
- 2
前往页