<?php require_once '../inc/mryw.inc.php'; require_once '../inc/utils.inc.php'; $mryw = new Mryw(); $cnt = $mryw->count_all(); $num = rand(0, $cnt * 2) % $cnt; $data = $mryw->random_one($num); $descrip = substr_ext(strip_tags($data['m_content']), 0, 80); $descrip = preg_replace("/\\s/", "", $descrip); $data['m_content'] = $descrip . '...'; $data['m_pic'] = 'http://pomelo-setin.stor.sinaapp.com/' . rand(1, 4751) . '.jpg'; echo json_encode($data); Mysql::close();
require_once '../inc/utils.inc.php'; $num = isset($_GET['num']) ? strip_tags(mysql_escape_string($_GET['num'])) : -1; $mryw_dao = new Mryw(); if ($num == -1) { $mryw = $mryw_dao->get_lastest_article(); } else { $mryw = $mryw_dao->find_by_id($num); } if ($mryw == false) { echo "<script>location.href='http://www.setin.cn/';</script>"; exit; } $num = $mryw['m_id']; $nextid = $mryw_dao->search_next_article_id($num); $preid = $mryw_dao->search_prev_article_id($num); $total_num = $mryw_dao->count_all(); if ($total_num == false) { $total_num = 0; } Mysql::close(); $descrip = substr_ext(strip_tags($mryw['m_content']), 0, 100); $descrip = preg_replace("/\\s/", "", $descrip); ?> <html lang="zh-CN"> <head> <meta charset="UTF-8" /> <meta name="renderer" content="webkit" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <meta http-equiv="Cache-Control" content="no-transform " /> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />