query("DELETE FROM rains_own WHERE id = $id")) {
echo '';
} else {
echo '';
}
}
if (@$_GET['action'] == 'share' && $id == true) {
if ($con->query("UPDATE rains_own SET share = 1,sharetime = '$time' WHERE id = $id")) {
echo '';
} else {
echo '';
}
}
$userid = $list['0']['id'];
$page = @$_GET['p'] ? @$_GET['p'] : 1;
if ($page < 1) {
exit('参数错误');
}
$start = ($page - 1) * 15;
$content = $con->query("SELECT id, txt, time, author, kind FROM rains_own WHERE userid=$userid order by time DESC LIMIT $start,15");
$total = $con->query("SELECT COUNT(*) FROM rains_own WHERE userid=$userid");
$total = $total->fetchAll();
$total = $total[0][0];
$PageCount = ceil($total / 15);
$PageUp = $page - 1;
$PageNext = $page + 1;
if ($PageCount == $page) {
$PageNext = '#';
}
if ($page == 1) {
$PageUp = '#';
}
$content = $content->fetchAll();
//print_r($content);
$num = count($content);
if ($num == 0) {
echo '';
}
if (isset ($_SERVER['HTTP_USER_AGENT'])) {
$clientkeywords = array(
'nokia',
'sony',
'ericsson',
'mot',
'samsung',
'htc',
'sgh',
'lg',
'sharp',
'sie-',
'philips',
'panasonic',
'alcatel',
'lenovo',
'iphone',
'ipod',
'blackberry',
'meizu',
'android',
'netfront',
'symbian',
'ucweb',
'windowsce',
'palm',
'operamini',
'operamobi',
'openwave',
'nexusone',
'cldc',
'midp',
'wap',
'mobile'
);
if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($_SERVER['HTTP_USER_AGENT']))) {
for ($i = 0; $i < $num; $i++) {
echo '
' . $content[$i]['txt'] . '——【' . $content[$i]['author'] . '】
分享
编辑
删除
|
';
}
} else {
//pc 端
for ($i = 0; $i < $num; $i++) {
echo '
' . $content[$i]['txt'] . '——【' . $content[$i]['author'] . '】
|
分享
编辑
删除
|
';
}
}
}
?>
|
第一页
上一页
下一页
尾页
|