Exemple #1
0
 public function doMobileMypage()
 {
     global $_W, $_GPC;
     $foo = $_GPC['foo'];
     $openid = $_W['openid'];
     if (!empty($openid)) {
         $user = pdo_fetch('SELECT * FROM' . tablename('mc_mapping_fans') . " WHERE openid = :openid", array(':openid' => $openid));
     }
     if ($foo == 'show') {
         if (!empty($openid)) {
             $pageIndex = max(1, intval($_GPC['page']));
             $pageSize = 10;
             $total = pdo_fetchcolumn("SELECT count(*) FROM " . tablename($this->tab_items) . " WHERE uniacid = :uniacid", array(':uniacid' => $_W['uniacid']));
             $uniacid = $_W['uniacid'];
             $listall = pdo_fetchall('SELECT t1.id,img,summary,voice,t2.nickname,t1.openid FROM' . tablename($this->tab_items) . " AS t1 JOIN " . tablename('mc_mapping_fans') . " AS t2 ON t1.openid = t2.openid WHERE t1.uniacid = {$uniacid} AND t1.openid  = '{$openid}' LIMIT " . ($pageIndex - 1) * $pageSize . ',' . $pageSize);
             $result = array();
             $result['isok'] = true;
             if ($total - $pageSize * $pageIndex < 0) {
                 $result['hasMore'] = false;
             } else {
                 $result['hasMore'] = true;
             }
             foreach ($listall as $key => $value) {
                 $tempList[] = array('index' => $key, 'id' => $value['id'], 'face' => toimage($value['img']), 'voicePath' => toimage($value['voice']));
             }
             $result['list'] = $tempList;
             return json_encode($result);
         }
     }
     include $this->template('mypage');
 }
 public function fieldsFormDisplay($rid = 0)
 {
     global $_W;
     if ($rid) {
         $activity = pdo_fetch("SELECT id, title, photo, smalltext FROM " . tablename('feng_dialect') . " WHERE rid = :rid", array(':rid' => $rid));
         $activity['photo'] = toimage($activity['photo']);
     }
     include $this->template('form');
 }
Exemple #3
0
 public function respond()
 {
     $content = $this->message['content'];
     //这里定义此模块进行消息处理时的具体过程, 请查看微赞文档来编写你的代码
     $rid = $this->rule;
     $rule = pdo_fetch('select * from ' . tablename($this->modulename . '_rule') . " where rid='{$rid}'");
     if (!empty($rule)) {
         return $this->respNews(array(array('title' => $rule['stitle'], 'description' => $rule['sdesc'], 'picurl' => toimage($rule['sthumb']), 'url' => $this->createMobileUrl('index', array('rid' => $rid)))));
     }
 }
Exemple #4
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $from = $this->message['from'];
     $weid = $_W['uniacid'];
     //当前公众号ID
     //推送分享图文内容
     $sql = "SELECT title,description,start_time,end_time,picture,status FROM " . tablename($this->table_reply) . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if ($row == false) {
         return $this->respText("活动已取消...");
     }
     //查询是否被屏蔽
     $lists = pdo_fetch("SELECT status FROM " . tablename($this->table_list) . " WHERE from_user = '******' and weid = '" . $weid . "' and rid= '" . $rid . "' order by `status` asc");
     if (!empty($lists)) {
         //查询是否有记录
         if ($lists['status'] == 0) {
             $message = "亲," . $row['title'] . "活动中您可能有作弊行为已被管理员暂停了!请联系" . $_W['account']['name'] . "";
             return $this->respText($message);
         }
     }
     //查询是否被屏蔽
     //查询是否中奖
     $lists = pdo_fetch("SELECT zhongjiang FROM " . tablename($this->table_list) . " WHERE from_user = '******' and weid = '" . $weid . "' and rid= '" . $rid . "' order by `zhongjiang` desc");
     if (!empty($lists)) {
         if ($lists['zhongjiang'] == 1) {
             $zhongjiang = "亲!恭喜中奖了,请点击查看!";
         }
     }
     //查询是否中奖
     //查询是否开始活动
     $now = time();
     if ($now < $row['start_time']) {
         $message = "亲," . $row['title'] . "还没有开始,请于" . date("Y-m-d H:i:s", $row['start_time']) . "参加活动";
         return $this->respText($message);
     }
     //查询是否开始活动
     //查询是否结束
     if ($now > $row['end_time']) {
         $zhongjiang .= "亲," . $row['title'] . "活动已结束了!";
     }
     //查询是否结束
     //查询是否暂停
     if ($row['status'] == 0) {
         $zhongjiang .= "亲," . $row['title'] . "活动暂停了!";
     }
     //查询是否暂停
     //转换图片路径
     $picture = toimage($row['picture']);
     //转换图片路径
     //显示图文回复内容
     return $this->respNews(array('Title' => $row['title'], 'Description' => htmlspecialchars_decode($row['description']) . $zhongjiang, 'PicUrl' => $picture, 'Url' => $this->createMobileUrl('chailihe', array('rid' => $rid, 'chufa' => 1, 'from_user' => base64_encode(authcode($from, 'ENCODE'))))));
 }
Exemple #5
0
function site_slide_search($params = array())
{
    global $_GPC, $_W;
    extract($params);
    $sql = "SELECT * FROM " . tablename('site_slide') . " WHERE weid = '{$_W['weid']}' ORDER BY id DESC LIMIT {$limit}";
    $list = pdo_fetchall($sql);
    if (!empty($list)) {
        foreach ($list as &$row) {
            $row['url'] = strexists($row['url'], 'http') ? $row['url'] : $_W['siteroot'] . $row['url'];
            $row['thumb'] = toimage($row['thumb']);
        }
    }
    return $list;
}
Exemple #6
0
 public function respond()
 {
     $content = $this->message['content'];
     //这里定义此模块进行消息处理时的具体过程, 请查看微赞文档来编写你的代码
     $reply = pdo_fetchall("SELECT * FROM " . tablename('album_reply') . " WHERE rid = :rid", array(':rid' => $this->rule));
     if (!empty($reply)) {
         foreach ($reply as $row) {
             $albumids[$row['albumid']] = $row['albumid'];
         }
         $album = pdo_fetchall("SELECT id, title, thumb, content FROM " . tablename('album') . " WHERE id IN (" . implode(',', $albumids) . ")", array(), 'id');
         $response = array();
         foreach ($reply as $row) {
             $row = $album[$row['albumid']];
             $response[] = array('title' => $row['title'], 'description' => $row['content'], 'picurl' => toimage($row['thumb']), 'url' => $this->buildSiteUrl($this->createMobileUrl('detail', array('id' => $row['id']))));
         }
         return $this->respNews($response);
     }
 }
Exemple #7
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $from_user = $this->message['from'];
     $uniacid = $_W['uniacid'];
     //查询活动
     $sql = "SELECT title,description,start_picurl,isshow,starttime,endtime,end_title,end_description,end_picurl FROM " . tablename('stonefish_chailihe_reply') . " WHERE `uniacid` = :uniacid and `rid` = :rid LIMIT 1";
     $row = pdo_fetch($sql, array(':uniacid' => $uniacid, ':rid' => $rid));
     if ($row == false) {
         return $this->respText("活动已取消...");
     }
     if ($row['isshow'] == 0) {
         return $this->respText($row['title'] . "-活动暂停,请稍后...");
     }
     if ($row['starttime'] > time()) {
         return $this->respText("活动未开始,请等待...请于" . date("Y-m-d H:i:s", $row['starttime']) . "参加活动");
     }
     //查询活动
     //查询是否被屏蔽
     $lists = pdo_fetch("SELECT status,zhongjiang FROM " . tablename('stonefish_chailihe_fans') . " WHERE uniacid = :uniacid and rid= :rid and from_user = :from_user", array(':uniacid' => $uniacid, ':rid' => $rid, ':from_user' => $from_user));
     if (!empty($lists)) {
         //查询是否有记录
         if ($lists['status'] == 0) {
             $message = "亲," . $row['title'] . "活动中您可能有作弊行为已被管理员暂停了!请联系[" . $_W['account']['name'] . "]管理员";
             return $this->respText($message);
         }
     }
     //查询是否被屏蔽
     //查询是否中奖
     if (!empty($lists)) {
         if ($lists['zhongjiang'] >= 1) {
             $zhongjiang = "亲!恭喜中奖了!";
         }
     }
     //查询是否中奖
     //推送分享图文内容
     if ($row['endtime'] < time()) {
         return $this->respNews(array('Title' => $row['end_title'], 'description' => $row['end_description'] . $zhongjiang, 'PicUrl' => toimage($row['end_picurl']), 'Url' => $this->createMobileUrl('entry', array('rid' => $rid, 'entrytype' => 'index'))));
     } else {
         return $this->respNews(array('Title' => $row['title'], 'description' => $row['description'] . $zhongjiang, 'PicUrl' => toimage($row['start_picurl']), 'Url' => $this->createMobileUrl('entry', array('rid' => $rid, 'entrytype' => 'index'))));
     }
     //推送分享图文内容
 }
Exemple #8
0
 public function doWebQuery()
 {
     global $_W, $_GPC;
     $kwd = $_GPC['keyword'];
     $sql = 'SELECT * FROM ' . tablename('ewei_exam_paper') . ' WHERE `weid`=:weid AND `title` LIKE :title';
     $params = array();
     $params[':weid'] = $_W['uniacid'];
     $params[':title'] = "%{$kwd}%";
     $ds = pdo_fetchall($sql, $params);
     foreach ($ds as &$row) {
         $r = array();
         $r['id'] = $row['id'];
         $r['title'] = $row['title'];
         $r['content'] = cutstr($row['description'], 30, '...');
         $r['thumb'] = toimage($row['thumb']);
         $row['entry'] = $r;
     }
     include $this->template('query');
 }
Exemple #9
0
 public function doMobileList()
 {
     global $_GPC, $_W;
     $weid = $_W['uniacid'];
     $set = pdo_fetch("SELECT * FROM " . tablename('fineness_sysset') . " WHERE weid=:weid limit 1", array(':weid' => $weid));
     $cid = intval($_GPC['cid']);
     $category = pdo_fetch("SELECT * FROM " . tablename('fineness_article_category') . " WHERE id = '{$cid}'");
     $advlist = pdo_fetchall('SELECT * FROM ' . tablename('fineness_adv') . " WHERE weid=:weid and pid ='{$cid}' ", array(':weid' => $weid));
     $result = pdo_fetchall("SELECT * FROM " . tablename('fineness_article_category') . " WHERE uniacid ={$weid} AND parentid = {$cid} ORDER BY displayorder ASC, id ASC ");
     //独立选择分类模板
     $title = $category['name'];
     $op = $_GPC['op'];
     if (!empty($category['thumb'])) {
         $shareimg = toimage($category['thumb']);
     } else {
         $shareimg = IA_ROOT . '/addons/amouse_article/icon.jpg';
     }
     $childid = $_GPC['childid'];
     $list = pdo_fetchall("SELECT * FROM " . tablename('fineness_article') . " WHERE weid={$weid} AND pcate={$cid} AND ccate={$childid} ORDER BY displayorder ASC ");
     $url = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('Index', array('cid' => $cid, 'uniacid' => $weid), true), 2);
     include $this->template('themes/list14');
 }
Exemple #10
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT title,description,start_picurl,isshow,starttime,endtime,end_theme,end_instruction,end_picurl FROM " . tablename('bigwheel_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if ($row == false) {
         return $this->respText("活动已取消...");
     }
     if ($row['isshow'] == 0) {
         return $this->respText("活动暂停,请稍后...");
     }
     if ($row['starttime'] > time()) {
         return $this->respText("活动未开始,请等待...");
     }
     $endtime = $row['endtime'] + 68399;
     if ($endtime < time()) {
         return $this->respNews(array('Title' => $row['end_theme'], 'Description' => $row['end_instruction'], 'PicUrl' => toimage($row['end_picurl']), 'Url' => $this->createMobileUrl('index', array('id' => $rid))));
     } else {
         return $this->respNews(array('Title' => $row['title'], 'Description' => $row['description'], 'PicUrl' => toimage($row['start_picurl']), 'Url' => $this->createMobileUrl('index', array('id' => $rid))));
     }
 }
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $from_user = $this->message['from'];
     $sql = "SELECT title,description,start_picurl,isshow,starttime,endtime,end_theme,end_instruction,end_picurl FROM " . tablename('stonefish_planting_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if ($row == false) {
         return $this->respText("活动已取消...");
     }
     if ($row['isshow'] == 0) {
         return $this->respText("活动暂停,请稍后...");
     }
     if ($row['starttime'] > time()) {
         return $this->respText("活动未开始,请等待...");
     }
     $endtime = $row['endtime'];
     if ($endtime < time()) {
         return $this->respNews(array('Title' => $row['end_theme'], 'Description' => $row['end_instruction'], 'PicUrl' => toimage($row['end_picurl']), 'Url' => $this->createMobileUrl('index', array('rid' => $rid, 'from_user' => base64_encode(authcode($from_user, 'ENCODE'))))));
     } else {
         return $this->respNews(array('Title' => $row['title'], 'Description' => $row['description'], 'PicUrl' => toimage($row['start_picurl']), 'Url' => $this->createMobileUrl('index', array('rid' => $rid, 'from_user' => base64_encode(authcode($from_user, 'ENCODE'))))));
     }
 }
Exemple #12
0
 public function doMobileDetail()
 {
     global $_GPC, $_W;
     $id = intval($_GPC['id']);
     $weid = $_W['uniacid'];
     $set = pdo_fetch("SELECT * FROM " . tablename('fineness_sysset') . " WHERE weid=:weid limit 1", array(':weid' => $weid));
     $detail = pdo_fetch("SELECT * FROM " . tablename('fineness_article') . " WHERE `id`=:id and weid=:weid", array(':id' => $id, ':weid' => $weid));
     $shareimg = toimage($detail['thumb']);
     $url = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('detail', array('id' => $id, 'uniacid' => $weid), true), 2);
     if ($detail['bg_music_switch'] == 1) {
         if (strexists($detail['musicurl'], 'http://') || strexists($detail['musicurl'], 'https://')) {
             $detail['musicurl'] = $detail['musicurl'];
         } else {
             $detail['musicurl'] = $_W['attachurl'] . $detail['musicurl'];
         }
     }
     if (!empty($detail['outLink'])) {
         if (strtolower(substr($detail['outLink'], 0, 4)) != 'tel:' && !strexists($detail['outLink'], 'http://') && !strexists($detail['outLink'], 'https://')) {
             $detail['outLink'] = $_W['siteroot'] . 'app/' . $detail['outLink'];
         }
         header('Location: ' . $detail['outLink']);
         exit;
     }
     $op = $_GPC['op'];
     if ($op == 'wemedia') {
         $wechat = pdo_fetch("SELECT * FROM " . tablename('account_wechats') . " WHERE acid=:acid AND uniacid=:uniacid limit 1", array(':acid' => $weid, ':uniacid' => $weid));
         include $this->template('themes/detail5');
         exit;
     }
     $wechat = pdo_fetch("SELECT * FROM " . tablename('account_wechats') . " WHERE acid=:acid AND uniacid=:uniacid limit 1", array(':acid' => $weid, ':uniacid' => $weid));
     if (!empty($detail['template'])) {
         include $this->template($detail['templatefile']);
         exit;
     }
     include $this->template('detail');
 }
function tpl_form_field_image($name, $value = '', $default = './resource/image/module-nopic-small.jpg')
{
    $s = '';
    if (!defined('INCLUDE_KINDEDITOR')) {
        $s = '
		<script type="text/javascript" src="./resource/script/kindeditor/kindeditor-min.js"></script>
		<script type="text/javascript" src="./resource/script/kindeditor/lang/zh_CN.js"></script>
		<link type="text/css" rel="stylesheet" href="./resource/script/kindeditor/themes/default/default.css" />';
    }
    if (strexists($name, '[')) {
        $id = str_replace(array('[', ']'), '_', $name);
    } else {
        $id = $name;
    }
    $val = $default;
    if (!empty($value)) {
        $val = toimage($value);
    }
    $s .= '
	<div style="display:block; margin-top:5px;" class="input-append">
	<input type="text" value="' . $value . '" name="' . $name . '" id="upload-image-url-' . $id . '" class="span3" autocomplete="off">
	<input type="hidden" value="" name="' . $name . '_old" id="upload-image-url-' . $id . '-old">
	<button class="btn" type="button" id="upload-image-' . $id . '">选择图片</button>
	</div>
	<div id="upload-image-preview-' . $id . '" style="margin-top:10px;"><img src="' . $val . '" width="100" onload="thumb(this)" /></div>
	<script type="text/javascript">
	function thumb(obj) {
		if (obj.height > obj.width) { obj.style.height = "100px"; obj.style.width = "auto"}
	}
	var editor = KindEditor.editor({
		allowFileManager : true,
		uploadJson : "./index.php?act=attachment&do=upload",
		fileManagerJson : "./index.php?act=attachment&do=manager",
		afterUpload : function(url, data) {
		}
	});
	$("#upload-image-' . $id . '").click(function() {
		editor.loadPlugin("image", function() {
			editor.plugin.imageDialog({
				tabIndex : 1,
				imageUrl : $("#upload-image-url-' . $id . '").val(),
				clickFn : function(url) {
					editor.hideDialog();
					var val = url;
					if(url.toLowerCase().indexOf("http://") == -1 && url.toLowerCase().indexOf("https://") == -1) {
						var filename = /images(.*)/.exec(url);
						if(filename && filename[0]) {
							val = filename[0];
						}
					}
					$("#upload-image-url-' . $id . '-old").val($("#upload-image-url-' . $id . '").val());
					$("#upload-image-url-' . $id . '").val(val);
					$("#upload-image-preview-' . $id . '").html(\'<img src="\'+url+\'" width="100"  onload="thumb(this)" />\');
				}
			});
		});
	});
	</script>';
    define('INCLUDE_KINDEDITOR', true);
    return $s;
}
Exemple #14
0
$now = time();
if ($now - $reply['xuninum_time'] > $reply['xuninumtime']) {
    pdo_update($this->table_reply, array('xuninum_time' => $now, 'xuninum' => $reply['xuninum'] + mt_rand($reply['xuninuminitial'], $reply['xuninumending'])), array('rid' => $rid));
}
//虚拟人数据配置
//参与活动人数
$totals = $reply['xuninum'] + pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_users) . ' WHERE uniacid=:uniacid and rid=:rid', array(':uniacid' => $uniacid, ':rid' => $rid));
//参与活动人数
//查询分享标题以及内容变量
$reply['sharetitle'] = $this->get_share($uniacid, $rid, $from_user, $reply['sharetitle']);
$reply['sharecontent'] = $this->get_share($uniacid, $rid, $from_user, $reply['sharecontent']);
//整理数据进行页面显示
$myavatar = $avatar;
$mynickname = $nickname;
$shareurl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('shareuserview', array('rid' => $rid, 'duli' => '1', 'fromuser' => $from_user, 'tfrom_user' => $tfrom_user));
//分享URL
$shouquan = base64_encode($_SERVER['HTTP_HOST'] . 'anquan_ma_photosvote');
//$title = $unrname . ' 的投票详情!';
$unrname = !empty($user['realname']) ? $user['realname'] : $user['nickname'];
$title = $unrname . '正在参加' . $reply['title'] . ',快来为' . $unrname . '投票及拉票吧!';
$sharetitle = $unrname . '正在参加' . $reply['title'] . ',快来为' . $unrname . '投票及拉票吧!';
$sharecontent = $unrname . '正在参加' . $reply['title'] . ',快来为' . $unrname . '投票及拉票吧!';
$picture = toimage($reply['sharephoto']);
$_share['link'] = $_W['siteroot'] . 'app/' . $this->createMobileUrl('shareuserview', array('rid' => $rid, 'duli' => '1', 'fromuser' => $from_user, 'tfrom_user' => $tfrom_user));
//分享URL
$_share['title'] = $unrname . '正在参加' . $reply['title'] . ',快来为' . $unrname . '投票及拉票吧!';
$_share['content'] = $unrname . '正在参加' . $reply['title'] . ',快来为' . $unrname . '投票及拉票吧!';
//$_share['imgUrl'] = !empty($user['photo']) ? toimage($user['photo']) : toimage($user['avatar']);
$_share['imgUrl'] = !empty($user['avatar']) ? toimage($user['avatar']) : toimage($user['photo']);
$toye = $this->_stopllq('tuser');
include $this->template($toye);
Exemple #15
0
        "sendFriendLink": "<?php 
echo $loclurl;
?>
",
        "fTitle": "<?php 
echo $reply['title'];
?>
",
        "fContent": "<?php 
echo $reply['description'];
?>
"
    };
    var shareData = {
        "imgUrl" : '<?php 
echo toimage($reply['share_txt']);
?>
',
        "link" : window.eso_shareData.sendFriendLink,
        "title" : '<?php 
echo $reply['share_title'];
?>
',
        "desc" : '<?php 
echo $reply['share_desc'];
?>
'
    };
    if (!shareData.imgUrl) {
        shareData.imgUrl = window.eso_shareData.imgUrl;
    }
/**
 * 女神来了模块定义
 *
 * @author 微赞科技
 * @url http://bbs.wdlcms.com/
 */
defined('IN_IA') or exit('Access Denied');
header('Content-type: application/json');
$fmmid = random(16);
$now = time();
$udata = array('uniacid' => $uniacid, 'rid' => $rid, 'from_user' => $from_user, 'fmmid' => $fmmid, 'mediaid' => $_POST['serverId'], 'timelength' => $_GPC['timelength'], 'ip' => getip(), 'createtime' => $now);
if ($udata['mediaid']) {
    $voice = $this->downloadVoice($udata['mediaid'], $fmmid);
    if ($qiniu['isqiniu']) {
        $nfilename = 'FMVOICE' . date('YmdHis') . random(16) . '.amr';
        $upurl = toimage($voice);
        $username = pdo_fetch("SELECT * FROM " . tablename($this->table_users_name) . " WHERE uniacid = :uniacid and from_user = :from_user and rid = :rid", array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
        $audiotype = 'voice';
        $qiniuaudios = $this->fmqnaudios($nfilename, $qiniu, $upurl, $audiotype, $username);
        $nfilenamefop = $qiniuaudios['nfilenamefop'];
        if ($qiniuaudios['success'] == '-1') {
            //	var_dump($err);
            $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
            echo json_encode($fmdata);
            exit;
        } else {
            $insertdata = array();
            if ($qiniuaudios['success'] == '-2') {
                //var_dump($err);
                $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
                echo json_encode($fmdata);
Exemple #17
0
;url=<?php 
echo $this->createMobileUrl('index', array('rid' => $rid));
?>
">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,user-scalable=yes;" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <meta content="email=no" name="format-detection" />
</head>
<style>
    body{background:<?php 
echo $reply['bgcolor'];
?>
;color:<?php 
echo $reply['textcolor'];
?>
;}
	img{max-width:100%!important;}
    body,div{margin:0; padding:0;}
</style>
<body>
<div style="position:absolute; width:100%; height:100%; z-index:-1"><img style="position:fixed;" src="<?php 
echo toimage($reply['homepic']);
?>
" width="100%" height="100%" /></div>
<?php 
!empty($this) && $this instanceof WeModuleSite ? include $this->template('jssdkhide', TEMPLATE_INCLUDEPATH) : (include template('jssdkhide', TEMPLATE_INCLUDEPATH));
?>
</body>
</html>
Exemple #18
0
$acid = $_W['acid'];
$account = $uniaccount = array();
$uniaccount = pdo_fetch("SELECT * FROM " . tablename('uni_account') . " WHERE uniacid = :uniacid", array(':uniacid' => $weid));
$acid = !empty($acid) ? $acid : $uniaccount['default_acid'];
$account = account_fetch($acid);
$detail = pdo_fetch("SELECT * FROM " . tablename('fineness_article') . " WHERE `id`=:id and weid=:weid", array(':id' => $id, ':weid' => $weid));
$where = " WHERE `aid`={$id} and weid={$weid} ";
if ($set && $set['iscomment'] == 1) {
    //不开启审核
    $where .= " and status=1 ";
}
$cList = pdo_fetchall("SELECT * FROM " . tablename('fineness_comment') . $where);
if (!empty($detail)) {
    pdo_update('fineness_article', array('clickNum' => $detail['clickNum'] + 1), array('id' => $detail['id']));
}
$shareimg = toimage($detail['thumb']);
$url = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('detail', array('id' => $id, 'uniacid' => $weid), true), 2);
if ($detail['bg_music_switch'] == 1) {
    if (strexists($detail['musicurl'], 'http://') || strexists($detail['musicurl'], 'https://')) {
        $detail['musicurl'] = $detail['musicurl'];
    } else {
        $detail['musicurl'] = $_W['attachurl'] . $detail['musicurl'];
    }
}
if (!empty($detail['outLink'])) {
    if (strtolower(substr($detail['outLink'], 0, 4)) != 'tel:' && !strexists($detail['outLink'], 'http://') && !strexists($detail['outLink'], 'https://')) {
        $detail['outLink'] = $_W['siteroot'] . 'app/' . $detail['outLink'];
    }
    header('Location: ' . $detail['outLink']);
    exit;
}
Exemple #19
0
<?php

/**
 * 女神来了模块定义
 *
 * @author 微赞科技
 * @url http://bbs.wdlcms.com/
 */
defined('IN_IA') or exit('Access Denied');
$status = $_GPC['status'];
if ($status == '-1') {
    $title = $reply['title'] . ' 即将开始哦 - ';
    $stopbg = toimage($reply['nostart']);
} elseif ($status == '0') {
    $title = $reply['title'] . ' 暂停中哦 - ';
    $stopbg = toimage($reply['stopping']);
} elseif ($status == '1') {
    $title = $reply['title'] . ' 已经停止了,期待下一次吧!';
    $stopbg = toimage($reply['end']);
}
$toye = $this->_stopllq('stop');
include $this->template($toye);
Exemple #20
0
 public function getdefaultfullviewpic($type, $picurl)
 {
     global $_W;
     switch ($type) {
         case 1:
             if (empty($picurl)) {
                 $img_url = $_W['siteroot'] . 'addons/lxy_buildpro/template/img/qian.jpg';
             } else {
                 $img_url = toimage($picurl);
             }
             break;
         case 2:
             if (empty($picurl)) {
                 $img_url = $_W['siteroot'] . 'addons/lxy_buildpro/template/img/hou.jpg';
             } else {
                 $img_url = toimage($picurl);
             }
             break;
         case 3:
             if (empty($picurl)) {
                 $img_url = $_W['siteroot'] . 'addons/lxy_buildpro/template/img/zuo.jpg';
             } else {
                 $img_url = toimage($picurl);
             }
             break;
         case 4:
             if (empty($picurl)) {
                 $img_url = $_W['siteroot'] . 'addons/lxy_buildpro/template/img/you.jpg';
             } else {
                 $img_url = toimage($picurl);
             }
             break;
         case 5:
             if (empty($picurl)) {
                 $img_url = $_W['siteroot'] . 'addons/lxy_buildpro/template/img/shang.jpg';
             } else {
                 $img_url = toimage($picurl);
             }
             break;
         case 6:
             if (empty($picurl)) {
                 $img_url = $_W['siteroot'] . 'addons/lxy_buildpro/template/img/xia.jpg';
             } else {
                 $img_url = toimage($picurl);
             }
             break;
         default:
             $img_url = '';
     }
     return $img_url;
 }
Exemple #21
0
</div>
<!--修改 by 场景应用-->
<div class="m-storeDetail-con f-mag-t-20" style="margin-left:20px;">
<div class="con-left m-cardScan" style="left: 0;">
<div class="u-listShow f-card">
<div class="item-top">
<img alt="<?php 
echo $app['title'];
?>
" src="<?php 
echo toimage($app['thumb']);
?>
" />
<span></span>
<p class='f-tc'><img src="<?php 
echo toimage($app['qrcode']);
?>
" alt="二维码" /></p>
</div>
<div class="item-bottom s-bg-fff">
<div class="tit">
<h4 title="<?php 
echo $app['title'];
?>
"><?php 
echo $app['title'];
?>
</h4>
<p title="<?php 
echo $app['author'];
?>
Exemple #22
0
 public function respond()
 {
     global $_GPC, $_W;
     $rid = $this->rule;
     $message = $this->message;
     $content = $message['content'];
     //触发的内容
     $openid = $message['from'];
     //用户的openid
     $createtime = $message['createtime'];
     //消息发送的时间
     $msgtype = $message['msgtype'];
     //消息类型
     $reply = pdo_fetch('SELECT * FROM' . tablename($this->tab_reply) . " WHERE uniacid = :uniacid AND rid = :rid", array(':uniacid' => $_W['uniacid'], ':rid' => $rid));
     $tabid = pdo_fetchcolumn('SELECT tabid FROM' . tablename($this->tab_tabs) . " WHERE uniacid = :uniacid AND openid = :openid", array(':uniacid' => $_W['uniacid'], ':openid' => $openid));
     if (empty($reply)) {
         return $this->respText('您要参加的活动还没开始哦..请旁边玩会儿..O(∩_∩)O哈哈~');
     }
     if ($this->inContext) {
         if ($content == $reply['quit']) {
             $this->endContext();
             if (empty($tabid)) {
                 return $this->respText('一定要再回来制作一张留声卡哦..');
             }
             return $this->respText('真棒,您的留声卡已经制作喽..<a href="' . $this->createMobileUrl('index') . '">点击查看</a>');
         }
         if ($msgtype == 'image' && empty($tabid)) {
             $img = $this->copyMedia('IMG', $message['picurl']);
             $insert = array('img' => $img, 'uniacid' => $_W['uniacid'], 'openid' => $openid, 'createtime' => TIMESTAMP);
             pdo_insert($this->tab_items, $insert);
             $id = pdo_insertid();
             pdo_insert($this->tab_tabs, array('uniacid' => $_W['uniacid'], 'tabid' => $id, 'openid' => $openid));
             $this->refreshContext(60 * 5);
             //刷新过期时间
             return $this->respText($reply['txt_note'] . "\n" . $reply['voc_note'] . "完成制作请按\"" . $reply['quit'] . "\"");
         }
         if ($msgtype == 'text' && !empty($tabid)) {
             pdo_update($this->tab_items, array('summary' => $content), array('id' => $tabid));
             $this->refreshContext(60 * 5);
             //刷新过期时间
             return $this->respText($reply['voc_note'] . "完成制作请按\"" . $reply['quit'] . "\"");
         }
         if ($msgtype == 'voice' && !empty($tabid)) {
             $filename = $this->copyMedia('VOX', $message['mediaid']);
             $amrurl = toimage($filename);
             pdo_update($this->tab_items, array('amr' => $amrurl), array('id' => $tabid));
             if (!empty($amrurl)) {
                 $mp3 = $this->amrTomp3($amrurl);
                 pdo_update($this->tab_items, array('voice' => $mp3), array('id' => $tabid));
             }
             pdo_delete($this->tab_tabs, array('id' => $tabid));
             $this->endContext();
             return $this->respText('真棒,您的留声卡已经制作喽..<a href="' . $this->createMobileUrl('index') . '">点击查看</a>');
         }
         return $this->respText($reply['welcome'] . "\n" . "完成制作请按\"" . $reply['quit'] . "\"");
     } else {
         pdo_delete($this->tab_tabs, array('uniacid' => $_W['uniacid'], 'openid' => $openid));
         $this->beginContext(60 * 5);
         //开启上下文模式默认设置为5分钟..
         return $this->respText($reply['welcome'] . "完成制作请按\"" . $reply['quit'] . "\"");
     }
 }
Exemple #23
0
 /**
  * 查看好友的钱包
  */
 public function doMobileUserRedEnvelope()
 {
     global $_W, $_GPC;
     $uid = $_GPC['uid'];
     $rid = $_GPC['rid'];
     $reply = pdo_fetch("SELECT * FROM " . tablename('stonefish_redenvelope_reply') . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
     if ($reply == false) {
         message('抱歉,活动已经结束,下次再来吧!', '', 'error');
     }
     $fans = pdo_fetch("SELECT * FROM " . tablename('stonefish_redenvelope_fans') . " WHERE rid = '" . $rid . "' and id='" . $uid . "'");
     $acid = $_W['acid'];
     if (empty($acid)) {
         $acid = pdo_fetchcolumn("SELECT share_acid FROM " . tablename('stonefish_redenvelope_reply') . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
     }
     $share = pdo_fetch("SELECT * FROM " . tablename('stonefish_redenvelope_share') . " WHERE rid = :rid AND acid = :acid", array(':rid' => $rid, ':acid' => $acid));
     //分享信息
     $sharelink = $_W['siteroot'] . 'app/' . $this->createMobileUrl('share', array('rid' => $rid, 'uid' => $uid));
     $sharetitle = empty($share['share_title']) ? '欢迎参加全民抢红包活动' : $share['share_title'];
     $sharedesc = empty($share['share_desc']) ? '亲,欢迎参加全民抢红包活动,祝您好运哦!!' : str_replace("\r\n", " ", $share['share_desc']);
     $sharetitle = $this->get_share($uniacid, $rid, $fans['from_user'], $sharetitle);
     $sharedesc = $this->get_share($uniacid, $rid, $fans['from_user'], $sharedesc);
     if (!empty($share['share_imgurl'])) {
         $shareimg = toimage($share['share_imgurl']);
     } else {
         $shareimg = toimage($reply['start_picurl']);
     }
     include $this->template("userredenvelope");
 }
Exemple #24
0
 public function doMobileviewlihe()
 {
     //分享页面显示。
     global $_GPC, $_W;
     $weid = $_W['uniacid'];
     //当前公众号ID
     $rid = $_GPC['rid'];
     //当前规则ID
     $fromuser = authcode(base64_decode($_GPC['fromuser']), 'DECODE');
     $page_fromuser = $_GPC['fromuser'];
     $uid = $_GPC['info-prize2'];
     //礼盒分享人ID
     //活动规则
     if (!empty($rid)) {
         $reply = pdo_fetch("SELECT * FROM " . tablename($this->table_reply) . " WHERE rid = :rid ORDER BY `id` DESC", array(':rid' => $rid));
         $picture = toimage($reply['picture']);
         $picbg01 = toimage($reply['picbg01']);
         $bgcolor = $reply['bgcolor'];
         $text01color = $reply['text01color'];
         $text02color = $reply['text02color'];
         $text03color = $reply['text03color'];
         $text04color = $reply['text04color'];
         $text05color = $reply['text05color'];
         $picnojiang = toimage($reply['picnojiang']);
         if ($reply['status'] == 0) {
             $statpraisetitle = '<h1>活动暂停!请稍候再试!</h1>';
         }
         if (time() < $reply['start_time']) {
             //判断活动是否已经开始
             $statpraisetitle = '<h1>活动未开始!</h1>';
         } elseif (time() > $reply['end_time']) {
             //判断活动是否已经结束
             $statpraisetitle = '<h1>活动已结束!</h1>';
         }
     }
     //虚拟人数据配置
     $now = time();
     if ($now - $reply['xuninum_time'] > $reply['xuninumtime']) {
         pdo_update($this->table_reply, array('xuninum_time' => $now, 'xuninum' => $reply['xuninum'] + mt_rand($reply['xuninuminitial'], $reply['xuninumending'])), array('rid' => $rid));
     }
     //虚拟人数据配置
     //判断是否还可以领取礼盒
     if (!empty($fromuser)) {
         $giftnum = pdo_fetchcolumn("SELECT count(*) FROM " . tablename($this->table_list) . " WHERE weid=" . $weid . " AND rid= " . $rid . " AND from_user='******'");
         //领取礼盒数总数
         $todaytimestamp = strtotime(date('Y-m-d'));
         $daygiftnum = pdo_fetchcolumn("SELECT count(*) FROM " . tablename($this->table_list) . " WHERE weid=" . $weid . " AND rid= " . $rid . " AND from_user='******' AND datatime >= '" . $todaytimestamp . "'");
         //领取礼盒数今日数
         $gift_num = $reply['number_num'] - $giftnum;
         //总数还有多少次机会
         $gift_num_day = $reply['number_num_day'] - $daygiftnum;
         //今日还有多少次机会
         $giftlihe = 0;
         //默认没有机会
         if ($gift_num >= 1) {
             if ($gift_num_day >= 1) {
                 if ($gift_num < $gift_num_day) {
                     $giftlihe = $gift_num;
                 } else {
                     $giftlihe = $gift_num_day;
                 }
             }
         }
         //查询是否可以重复中奖,不允许时中奖用户即使有领取礼盒机会也不能中领取礼盒
         if ($reply['repeatzj'] == 0) {
             $zhongjiangnum = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_list) . ' WHERE weid= :weid and rid= :rid and zhongjiang>=1 and from_user= :from_user', array(':weid' => $weid, ':rid' => $rid, ':from_user' => $fromuser));
             if ($zhongjiangnum >= 1) {
                 $giftlihe = 0;
                 //只能中奖一次,已没有机会了
             }
         }
         //查询是否可以重复中奖,不允许时中奖用户即使有领取礼盒机会也不能中领取礼盒
     }
     //中奖礼盒信息
     $lihegift = pdo_fetch('SELECT a.zhongjiang,a.mikaid,b.* FROM ' . tablename($this->table_list) . ' as a left join ' . tablename($this->table_gift) . ' as b on a.liheid=b.id  WHERE a.id=:id', array(':id' => $uid));
     $zhongjiang = $lihegift['zhongjiang'];
     //查询是是否为密卡类开始
     if ($lihegift['inkind'] == 0 && $zhongjiang == 1 && $lihegift['mikaid'] >= 1) {
         $mikaid = pdo_fetch("SELECT * FROM " . tablename($this->table_giftmika) . " WHERE id=:id", array(':id' => $lihegift['mikaid']));
     }
     //查询是是否为密卡类完成
     //兑奖地点区域选择
     if ($reply['awarding'] == 1) {
     } else {
     }
     $lihegift['awardpic'] = empty($lihegift['awardpic']) ? "../addons/stonefish_chailihe/template/images/award.jpg" : $lihegift['awardpic'];
     $awardpic = toimage($lihegift['awardpic']);
     $againreglihe = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('reglihe', array('rid' => $rid, 'fromuser' => $page_fromuser), true), 2);
     $shareurl = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('shareuserview', array('rid' => $rid), true), 2);
     $liheduijiang = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('duijiang', array('rid' => $rid, 'fromuser' => $page_fromuser), true), 2);
     $mylihe = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('mylihe', array('rid' => $rid, 'fromuser' => $page_fromuser), true), 2);
     $gohome = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('chailihe', array('rid' => $rid, 'from_user_oauth' => $page_fromuser), true), 2);
     $gotoduijiang = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('viewlihe', array('rid' => $rid, 'info-prize2' => $uid, 'fromuser' => $page_fromuser), true), 2);
     //查询分享标题以及内容变量
     $reply['sharetitle'] = $this->get_share($weid, $rid, $fromuser, $reply['sharetitle'], $lihegift['id']);
     $reply['sharecontent'] = $this->get_share($weid, $rid, $fromuser, $reply['sharecontent'], $lihegift['id']);
     //判断是否被屏蔽
     $mystatus = pdo_fetch("SELECT status FROM " . tablename($this->table_list) . " WHERE from_user = '******' and weid = '" . $weid . "' and rid= '" . $rid . "' order by `status` asc");
     if (!empty($mystatus)) {
         //查询是否有记录
         if ($mystatus['status'] == 0) {
             $message = "亲," . $reply['title'] . "活动中您可能有作弊行为已被管理员暂停了!请联系" . $_W['account']['name'];
             include $this->template('reminds');
             exit;
         }
     }
     //判断是否被屏蔽
     //查询是否需要重新填写中奖资料
     if ($reply['isrealname']) {
         $userinfos .= 'realname,';
     }
     if ($reply['ismobile']) {
         $userinfos .= 'mobile,';
     }
     if ($reply['isqq']) {
         $userinfos .= 'qq,';
     }
     if ($reply['isemail']) {
         $userinfos .= 'email,';
     }
     if ($reply['isaddress']) {
         $userinfos .= 'address,';
     }
     $userinfos = substr($userinfos, 0, strlen($userinfos) - 1);
     $userinfo = pdo_fetchall("SELECT " . $userinfos . " FROM " . tablename($this->table_list) . " WHERE from_user = '******' and weid = '" . $weid . "' and rid= '" . $rid . "'");
     foreach ($userinfo as $userinfolist) {
         if ($reply['isrealname']) {
             if (empty($userinfolist['realname'])) {
                 $isinfo = true;
                 break;
             }
         }
         if ($reply['ismobile']) {
             if (empty($userinfolist['mobile'])) {
                 $isinfo = true;
                 break;
             }
         }
         if ($reply['isqq']) {
             if (empty($userinfolist['qq'])) {
                 $isinfo = true;
                 break;
             }
         }
         if ($reply['isemail']) {
             if (empty($userinfolist['email'])) {
                 $isinfo = true;
                 break;
             }
         }
         if ($reply['isaddress']) {
             if (empty($userinfolist['address'])) {
                 $isinfo = true;
                 break;
             }
         }
     }
     $userinfosave = $_W['siteroot'] . "app/" . substr($this->createMobileUrl('userinfosave', array('rid' => $rid, 'uid' => $uid, 'fromuser' => $page_fromuser), true), 2);
     //查询是否需要重新填写中奖资料
     $serverapp = $_W['account']['level'];
     //是否为高级号
     if ($serverapp == 4) {
         $fromuser_my = $fromuser;
         //取用户资料
         $fans = pdo_fetch("SELECT uid,follow FROM " . tablename('mc_mapping_fans') . " Where openid=:openid and uniacid=:uniacid ORDER BY `fanid` DESC", array(":openid" => $fromuser_my, ":uniacid" => $weid));
         $profile = mc_fetch($fans['uid'], array('avatar', 'nickname', 'realname', 'mobile', 'qq', 'email', 'address', 'gender', 'telephone', 'idcard', 'company', 'occupation', 'position'));
     } else {
         $fromuser_my = $_COOKIE["chailihe_chufa_openid"];
         if (empty($fromuser_my)) {
             $userinfo = pdo_fetch("SELECT from_user,qq,realname,mobile,nickname,address,email FROM " . tablename($this->table_list) . " WHERE weid= :weid AND rid= :rid AND from_user= :fromuser", array(':weid' => $weid, ':rid' => $rid, ':fromuser' => $fromuser));
             if (!empty($userinfo)) {
                 $fromuser_my = $userinfo['from_user'];
                 $profile = $userinfo;
                 $fans['follow'] = 1;
             }
         } else {
             //取用户资料
             $fans = pdo_fetch("SELECT uid,follow FROM " . tablename('mc_mapping_fans') . " Where openid=:openid and uniacid=:uniacid ORDER BY `fanid` DESC", array(":openid" => $fromuser_my, ":uniacid" => $weid));
             $profile = mc_fetch($fans['uid'], array('avatar', 'nickname', 'realname', 'mobile', 'qq', 'email', 'address', 'gender', 'telephone', 'idcard', 'company', 'occupation', 'position'));
         }
     }
     $user_agent = $_SERVER['HTTP_USER_AGENT'];
     if (strpos($user_agent, 'MicroMessenger') === false) {
         //echo "本页面仅支持微信访问!非微信浏览器禁止浏览!";
         include $this->template('remindnotweixin');
     } else {
         include $this->template('openlihe');
     }
 }
Exemple #25
0
 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $from_user = $this->message['from'];
     $tag = $this->message['content'];
     $uniacid = $_W['uniacid'];
     //当前公众号ID
     load()->func('communication');
     $sql = "SELECT * FROM " . tablename($this->table_reply) . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($row['id'])) {
         if (!$this->inContext && ($this->message['type'] == 'image' || $this->message['type'] == 'voice' || $this->message['type'] == 'video')) {
             $message = "请按活动规则参与活动,谢谢您的支持!";
         } else {
             $message = "亲,您还没有设置完成关键字或者未添加活动!";
         }
         return $this->respText($message);
     }
     $qiniu = iunserializer($row['qiniu']);
     if ($row['status'] == 0) {
         $message = "亲," . $row['title'] . "活动暂停了!您可以\n";
         $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&rid=" . $rid . "&m=fm_photosvote&do=paihang&uniacid=" . $uniacid . "'>看看排行榜</a>\n";
         if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
             $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
         }
         return $this->respText($message);
     }
     $now = time();
     if ($now >= $row['start_time'] && $now <= $row['end_time']) {
         if ($row['status'] == 0) {
             $message = "亲," . $row['title'] . "活动暂停了!";
             return $this->respText($message);
         } else {
             $command = $row['command'];
             $ckcommand = $row['ckcommand'];
             if (empty($command)) {
                 $zjrets = preg_match('/^[0-9]{1,5}$/i', $tag);
                 if ($_SESSION['ok'] != 1) {
                     if (!$zjrets && !is_numeric($this->message['content'])) {
                         $picture = $row['picture'];
                         if (substr($picture, 0, 6) == 'images') {
                             $picture = $_W['attachurl'] . $picture;
                         } else {
                             $picture = $_W['siteroot'] . $picture;
                         }
                         return $this->respNews(array('Title' => $row['title'], 'Description' => htmlspecialchars_decode($row['description']), 'PicUrl' => $picture, 'Url' => $this->createMobileUrl('photosvoteview', array('rid' => $rid))));
                     }
                     $this->beginContext(60);
                     //锁定60秒
                     $_SESSION['ok'] = 1;
                     $_SESSION['content'] = $this->message['content'];
                     $_SESSION['code'] = random(4, true);
                     return $this->respText("为防止恶意刷票,请回复验证码:" . $_SESSION["code"]);
                 } else {
                     if ($this->message['content'] != $_SESSION['code']) {
                         $_SESSION['code'] = random(4, true);
                         return $this->respText("验证码错误,请重新回复验证码:" . $_SESSION['code']);
                     } else {
                         $tag = $_SESSION['content'];
                         //$rets = preg_match('/'.$command.'/i', $tag);
                         //$ckrets = preg_match('/'.$ckcommand.'/i', $tag);
                         $this->endContext();
                         if ($zjrets) {
                             if ($now <= $row['tstart_time']) {
                                 return $this->respText($row['ttipstart']);
                             }
                             if ($now >= $row['tend_time']) {
                                 return $this->respText($row['ttipend']);
                             }
                             $starttime = mktime(0, 0, 0);
                             //当天:00:00:00
                             $endtime = mktime(23, 59, 59);
                             //当天:23:59:59
                             $times = '';
                             $times .= ' AND createtime >=' . $starttime;
                             $times .= ' AND createtime <=' . $endtime;
                             $where .= " AND id = '" . $tag . "'";
                             $t = pdo_fetch("SELECT * FROM " . tablename($this->table_users) . " WHERE uniacid = :uniacid and rid = :rid " . $where . " LIMIT 1", array(':uniacid' => $uniacid, ':rid' => $rid));
                             if (empty($t)) {
                                 $message = '未找到参赛者编号为 ' . $tag . ' 的用户,请重新输入!';
                                 $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&rid=" . $rid . "&m=fm_photosvote&do=photosvoteview'>活动首页</a>\n";
                                 if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                                     $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
                                 }
                                 return $this->respText($message);
                             }
                             if ($t['status'] != '1') {
                                 $message = '您投票的用户编号为 ' . $tag . '还未通过审核,请稍后再试,您可以:';
                                 $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&rid=" . $rid . "&m=fm_photosvote&do=photosvoteview&uniacid=" . $uniacid . "'>活动首页</a>\n";
                                 if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                                     $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
                                 }
                                 return $this->respText($message);
                             }
                             if ($row['isdaojishi']) {
                                 $votetime = $reply['votetime'] * 3600 * 24;
                                 $isvtime = $now - $t['createtime'];
                                 if ($isvtime >= $votetime) {
                                     $message = empty($row['ttipvote']) ? $t['nickname'] . ' 的投票时间已经结束' : $row['ttipvote'];
                                     return $this->respText($message);
                                 }
                             }
                             $tfrom_user = $t['from_user'];
                             $daytpxz = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_log) . ' WHERE uniacid= :uniacid AND from_user = :from_user AND rid = :rid ' . $times . ' ORDER BY createtime DESC', array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
                             $fansmostvote = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_log) . ' WHERE uniacid= :uniacid AND from_user = :from_user AND rid = :rid ORDER BY createtime DESC', array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
                             //总共可以投几次
                             if ($fansmostvote < $row['fansmostvote']) {
                                 if ($daytpxz >= $row['daytpxz']) {
                                     $message = '您当前最多可以投' . $row['daytpxz'] . '个参赛选手,您当天的次数已经投完,请明天再来';
                                     return $this->respText($message);
                                 } else {
                                     if ($tfrom_user == $from_user) {
                                         //message('您不能为自己投票',referer(),'error');
                                         $message = '您不能为自己投票';
                                         return $this->respText($message);
                                     } else {
                                         $dayonetp = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_log) . ' WHERE uniacid= :uniacid AND from_user = :from_user AND tfrom_user = :tfrom_user AND rid = :rid ' . $times . ' ORDER BY createtime DESC', array(':uniacid' => $uniacid, ':from_user' => $from_user, ':tfrom_user' => $tfrom_user, ':rid' => $rid));
                                         $allonetp = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_log) . ' WHERE uniacid= :uniacid AND from_user = :from_user AND tfrom_user = :tfrom_user AND rid = :rid ORDER BY createtime DESC', array(':uniacid' => $uniacid, ':from_user' => $from_user, ':tfrom_user' => $tfrom_user, ':rid' => $rid));
                                         if ($allonetp >= $row['allonetp']) {
                                             $message = "您总共可以给她投票" . $row['allonetp'] . "次,您已经投完!您还可以:\n";
                                             $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&tfrom_user="******"&rid=" . $rid . "&m=fm_photosvote&do=tuserphotos&uniacid=" . $uniacid . "'>查看她的投票</a>\n";
                                             if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                                                 $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
                                             }
                                             return $this->respText($message);
                                         } else {
                                             if ($dayonetp >= $row['dayonetp']) {
                                                 $message = "您当天最多可以给她投票" . $row['dayonetp'] . "次,您已经投完,请明天再来。您还可以:\n";
                                                 $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&tfrom_user="******"&rid=" . $rid . "&m=fm_photosvote&do=tuserphotos&uniacid=" . $uniacid . "'>查看她的投票</a>\n";
                                                 if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                                                     $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
                                                 }
                                                 return $this->respText($message);
                                                 //exit;
                                             } else {
                                                 $atype = 'weixin';
                                                 $token = $_W['account']['access_token']['token'];
                                                 $urls = sprintf("https://api.weixin.qq.com/cgi-bin/user/info?access_token=%s&openid=%s&lang=zh_CN", $token, $from_user);
                                                 $contents = ihttp_get($urls);
                                                 $dats = $contents['content'];
                                                 $re = @json_decode($dats, true);
                                                 $nickname = $re['nickname'];
                                                 $avatar = $re['headimgurl'];
                                                 $votedate = array('uniacid' => $uniacid, 'rid' => $rid, 'tptype' => '2', 'avatar' => $avatar, 'nickname' => $nickname, 'from_user' => $from_user, 'afrom_user' => $_COOKIE["user_fromuser_openid"], 'tfrom_user' => $tfrom_user, 'ip' => getip(), 'createtime' => time());
                                                 $votedate['iparr'] = $this->getiparr($votedate['ip']);
                                                 pdo_insert($this->table_log, $votedate);
                                                 pdo_update($this->table_users, array('hits' => $t['hits'] + 1, 'photosnum' => $t['photosnum'] + 1), array('rid' => $rid, 'from_user' => $tfrom_user, 'uniacid' => $uniacid));
                                                 //message('您成功的为Ta投了一票!',referer(),'success');
                                                 if (!empty($t['realname'])) {
                                                     $tname = '姓名为: ' . $t['realname'];
                                                 } else {
                                                     $tname = '昵称为: ' . $t['nickname'];
                                                 }
                                                 $message = "恭喜您成功的为编号为: " . $t['id'] . " , " . $tname . " 的参赛者投了一票!";
                                                 //$message .= "1、<a href='".$_W['siteroot']."app/index.php?i=".$_W['uniacid']."&j=".$_W['acid']."&c=entry&rid=".$rid."&m=fm_photosvote&do=tuserphotos&tfrom_user="******"'>查看她的投票</a>\n";
                                                 //return $this->respText($message);
                                                 $rowtp = array();
                                                 $rowtp['title'] = $message;
                                                 $rowtp['description'] = htmlspecialchars_decode($message);
                                                 $rowtp['picurl'] = !empty($t['photo']) ? toimage($t['photo']) : toimage($t['avatar']);
                                                 $rowtp['url'] = $this->createMobileUrl('tuserphotos', array('rid' => $rid, 'tfrom_user' => $tfrom_user));
                                                 $news[] = $rowtp;
                                                 if ($row['isindex'] == 1) {
                                                     $advs = pdo_fetchall("SELECT * FROM " . tablename($this->table_advs) . " WHERE enabled=1 AND ismiaoxian = 0 AND uniacid= '{$uniacid}'  AND rid= '{$rid}' ORDER BY displayorder ASC LIMIT 6");
                                                     foreach ($advs as $c) {
                                                         $rowadv = array();
                                                         $rowadv['title'] = $c['advname'];
                                                         $rowadv['description'] = $c['description'];
                                                         $rowadv['picurl'] = toimage($c['thumb']);
                                                         $rowadv['url'] = empty($c['link']) ? $this->createMobileUrl('photosvoteview', array('rid' => $rid)) : $c['link'];
                                                         $news[] = $rowadv;
                                                     }
                                                 }
                                                 $huodong = iunserializer($row['huodong']);
                                                 if ($huodong['ishuodong'] == 1 && !empty($huodong['huodongurl'])) {
                                                     $rowhd = array();
                                                     $rowhd['title'] = $huodong['huodongname'];
                                                     $rowhd['description'] = $huodong['huodongdes'];
                                                     $rowhd['picurl'] = toimage($huodong['hhhdpicture']);
                                                     $rowhd['url'] = $huodong['huodongurl'] . "&from=fm_photosvote&oid=" . $from_user;
                                                     $news[] = $rowhd;
                                                 }
                                                 return $this->respNews($news);
                                             }
                                         }
                                     }
                                 }
                                 //end daytpxz
                             } else {
                                 $message = '在此活动期间,你总共可以投 ' . $row['fansmostvote'] . ' 票,目前你已经投完!';
                                 return $this->respText($message);
                             }
                         }
                         //end zjrets
                     }
                 }
             } else {
                 switch ($this->message['type']) {
                     case 'text':
                         if ($this->message['content'] == $command) {
                             //报名判断
                             if (empty($_SESSION['bmstart'])) {
                                 $isuser = pdo_fetch("SELECT * FROM " . tablename($this->table_users) . " WHERE uniacid = '{$uniacid}' AND `from_user` = '{$from_user}' AND rid = '{$rid}' ");
                                 if (!empty($isuser)) {
                                     if ($row['isindex'] == 1) {
                                         $advs = pdo_fetch("SELECT * FROM " . tablename($this->table_advs) . " WHERE enabled=1 AND ismiaoxian = 0 AND uniacid= '{$uniacid}'  AND rid= '{$rid}' ORDER BY id ASC LIMIT 1");
                                     } else {
                                         $advs = array();
                                         $advs['advname'] = $isuser['description'];
                                         $advs['thumb'] = $isuser['photo'];
                                     }
                                     return $this->respNews(array('Title' => '您已经报过名了,点击以完善信息', 'Description' => $advs['advname'], 'PicUrl' => toimage($advs['thumb']), 'Url' => $this->createMobileUrl('tuser', array('rid' => $rid, 'tfrom_user' => $from_user))));
                                 }
                                 $this->beginContext(1800);
                                 $_SESSION['bmstart'] = $this->message['content'];
                                 //$_SESSION['mediaid']= $this->message['mediaid'];
                                 //$_SESSION['ok']= 1;
                                 $msg = "欢迎参加" . $row['title'] . "的活动,现在开始报名\n\n" . "请按下面的顺序报名:\n";
                                 $msg .= " 上传封面\n";
                                 if ($row['mediatype']) {
                                     $msg .= " 上传相册照片\n";
                                 }
                                 if ($row['mediatypem']) {
                                     $msg .= " 录制好声音\n";
                                 }
                                 if ($row['mediatypev']) {
                                     $msg .= " 录制视频\n";
                                 }
                                 $msg .= " 根据提示,填写报名资料\n\n";
                                 $msg .= $_W['account']['name'] . "感谢您的参与!\n";
                                 return $this->respText($msg);
                             } else {
                                 $_SESSION['bmstart'] = $this->message['content'];
                                 $msg = "帮助信息:\n--------------\n\n" . "请按下面的顺序报名:\n";
                                 $msg .= " 上传封面\n";
                                 if ($row['mediatype']) {
                                     $msg .= " 上传相册照片\n";
                                 }
                                 if ($row['mediatypem']) {
                                     $msg .= " 录制好声音\n";
                                 }
                                 if ($row['mediatypev']) {
                                     $msg .= " 录制视频\n";
                                 }
                                 $msg .= " 根据提示,填写报名资料\n\n";
                                 $msg .= $_W['account']['name'] . "感谢您的参与!\n";
                                 return $this->respText($msg);
                             }
                         } else {
                             if ($this->inContext && !empty($_SESSION['bmstart'])) {
                                 if ($this->message['content'] == 't') {
                                     $this->endContext();
                                     return $this->respText('退出成功!');
                                 }
                                 if ($this->message['content'] == "n" || $this->message['content'] == "N") {
                                     $_SESSION['imageid'] = '';
                                     $_SESSION['imageurl'] = '';
                                     load()->func('file');
                                     file_delete($_SESSION['imageurl']);
                                     $msg = $_W['account']['name'] . " 提请您:\n 请重新重新上传的封面\n";
                                     return $this->respText($msg);
                                 }
                                 if ($_SESSION['imageok'] != 1) {
                                     $msg = $_W['account']['name'] . " 提请您:\n 请先上传封面\n";
                                     return $this->respText($msg);
                                 }
                                 if ($row['mediatype']) {
                                     if ($_SESSION['imagesok'] != 1) {
                                         $msg = $_W['account']['name'] . " 提请您:\n 请上传相册照片\n";
                                         return $this->respText($msg);
                                     }
                                 }
                                 if ($row['mediatypem']) {
                                     if ($_SESSION['voiceok'] != 1) {
                                         $msg = $_W['account']['name'] . " 提请您:\n 请录制好声音\n";
                                         return $this->respText($msg);
                                     }
                                 }
                                 if ($row['mediatypev']) {
                                     if ($_SESSION['videook'] != 1) {
                                         $msg = $_W['account']['name'] . " 提请您:\n 请录制视频\n";
                                         return $this->respText($msg);
                                     }
                                 }
                             }
                             if (!$this->inContext || empty($_SESSION['bmstart'])) {
                                 $zjrets = preg_match('/^[0-9]{1,5}$/i', $tag);
                                 if ($_SESSION['ok'] != 1) {
                                     if (!$zjrets && !is_numeric($this->message['content'])) {
                                         $picture = $row['picture'];
                                         if (substr($picture, 0, 6) == 'images') {
                                             $picture = $_W['attachurl'] . $picture;
                                         } else {
                                             $picture = $_W['siteroot'] . $picture;
                                         }
                                         return $this->respNews(array('Title' => $row['title'], 'Description' => htmlspecialchars_decode($row['description']), 'PicUrl' => $picture, 'Url' => $this->createMobileUrl('photosvoteview', array('rid' => $rid))));
                                     }
                                     $this->beginContext(60);
                                     //锁定60秒
                                     $_SESSION['ok'] = 1;
                                     $_SESSION['content'] = $this->message['content'];
                                     $_SESSION['code'] = random(4, true);
                                     return $this->respText("为防止恶意刷票,请回复验证码:" . $_SESSION["code"]);
                                 } else {
                                     if ($this->message['content'] != $_SESSION['code']) {
                                         $_SESSION['code'] = random(4, true);
                                         return $this->respText("验证码错误,请重新回复验证码:" . $_SESSION['code']);
                                     } else {
                                         $tag = $_SESSION['content'];
                                         //$rets = preg_match('/'.$command.'/i', $tag);
                                         //$ckrets = preg_match('/'.$ckcommand.'/i', $tag);
                                         $this->endContext();
                                         if ($zjrets) {
                                             if ($now <= $row['tstart_time']) {
                                                 return $this->respText($row['ttipstart']);
                                             }
                                             if ($now >= $row['tend_time']) {
                                                 return $this->respText($row['ttipend']);
                                             }
                                             $starttime = mktime(0, 0, 0);
                                             //当天:00:00:00
                                             $endtime = mktime(23, 59, 59);
                                             //当天:23:59:59
                                             $times = '';
                                             $times .= ' AND createtime >=' . $starttime;
                                             $times .= ' AND createtime <=' . $endtime;
                                             $where .= " AND id = '" . $tag . "'";
                                             $t = pdo_fetch("SELECT * FROM " . tablename($this->table_users) . " WHERE uniacid = :uniacid and rid = :rid " . $where . " LIMIT 1", array(':uniacid' => $uniacid, ':rid' => $rid));
                                             if (empty($t)) {
                                                 $message = '未找到参赛者编号为 ' . $tag . ' 的用户,请重新输入!';
                                                 $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&rid=" . $rid . "&m=fm_photosvote&do=photosvoteview'>活动首页</a>\n";
                                                 if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                                                     $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
                                                 }
                                                 return $this->respText($message);
                                             }
                                             if ($t['status'] != '1') {
                                                 $message = '您投票的用户编号为 ' . $tag . '还未通过审核,请稍后再试,您可以:';
                                                 $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&rid=" . $rid . "&m=fm_photosvote&do=photosvoteview&uniacid=" . $uniacid . "'>活动首页</a>\n";
                                                 if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                                                     $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
                                                 }
                                                 return $this->respText($message);
                                             }
                                             if ($row['isdaojishi']) {
                                                 $votetime = $reply['votetime'] * 3600 * 24;
                                                 $isvtime = $now - $t['createtime'];
                                                 if ($isvtime >= $votetime) {
                                                     $message = empty($row['ttipvote']) ? $t['nickname'] . ' 的投票时间已经结束' : $row['ttipvote'];
                                                     return $this->respText($message);
                                                 }
                                             }
                                             $tfrom_user = $t['from_user'];
                                             $daytpxz = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_log) . ' WHERE uniacid= :uniacid AND from_user = :from_user AND rid = :rid ' . $times . ' ORDER BY createtime DESC', array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
                                             $fansmostvote = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_log) . ' WHERE uniacid= :uniacid AND from_user = :from_user AND rid = :rid ORDER BY createtime DESC', array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
                                             //总共可以投几次
                                             if ($fansmostvote < $row['fansmostvote']) {
                                                 if ($daytpxz >= $row['daytpxz']) {
                                                     $message = '您当前最多可以投' . $row['daytpxz'] . '个参赛选手,您当天的次数已经投完,请明天再来';
                                                     return $this->respText($message);
                                                 } else {
                                                     if ($tfrom_user == $from_user) {
                                                         //message('您不能为自己投票',referer(),'error');
                                                         $message = '您不能为自己投票';
                                                         return $this->respText($message);
                                                     } else {
                                                         $dayonetp = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_log) . ' WHERE uniacid= :uniacid AND from_user = :from_user AND tfrom_user = :tfrom_user AND rid = :rid ' . $times . ' ORDER BY createtime DESC', array(':uniacid' => $uniacid, ':from_user' => $from_user, ':tfrom_user' => $tfrom_user, ':rid' => $rid));
                                                         $allonetp = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename($this->table_log) . ' WHERE uniacid= :uniacid AND from_user = :from_user AND tfrom_user = :tfrom_user AND rid = :rid ORDER BY createtime DESC', array(':uniacid' => $uniacid, ':from_user' => $from_user, ':tfrom_user' => $tfrom_user, ':rid' => $rid));
                                                         if ($allonetp >= $row['allonetp']) {
                                                             $message = "您总共可以给她投票" . $row['allonetp'] . "次,您已经投完!您还可以:\n";
                                                             $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&tfrom_user="******"&rid=" . $rid . "&m=fm_photosvote&do=tuserphotos&uniacid=" . $uniacid . "'>查看她的投票</a>\n";
                                                             if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                                                                 $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
                                                             }
                                                             return $this->respText($message);
                                                         } else {
                                                             if ($dayonetp >= $row['dayonetp']) {
                                                                 $message = "您当天最多可以给她投票" . $row['dayonetp'] . "次,您已经投完,请明天再来。您还可以:\n";
                                                                 $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&tfrom_user="******"&rid=" . $rid . "&m=fm_photosvote&do=tuserphotos&uniacid=" . $uniacid . "'>查看她的投票</a>\n";
                                                                 if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                                                                     $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
                                                                 }
                                                                 return $this->respText($message);
                                                                 //exit;
                                                             } else {
                                                                 $atype = 'weixin';
                                                                 $token = $_W['account']['access_token']['token'];
                                                                 $urls = sprintf("https://api.weixin.qq.com/cgi-bin/user/info?access_token=%s&openid=%s&lang=zh_CN", $token, $from_user);
                                                                 $contents = ihttp_get($urls);
                                                                 $dats = $contents['content'];
                                                                 $re = @json_decode($dats, true);
                                                                 $nickname = $re['nickname'];
                                                                 $avatar = $re['headimgurl'];
                                                                 $votedate = array('uniacid' => $uniacid, 'rid' => $rid, 'tptype' => '2', 'avatar' => $avatar, 'nickname' => $nickname, 'from_user' => $from_user, 'afrom_user' => $_COOKIE["user_fromuser_openid"], 'tfrom_user' => $tfrom_user, 'ip' => getip(), 'createtime' => time());
                                                                 $votedate['iparr'] = $this->getiparr($votedate['ip']);
                                                                 pdo_insert($this->table_log, $votedate);
                                                                 pdo_update($this->table_users, array('hits' => $t['hits'] + 1, 'photosnum' => $t['photosnum'] + 1), array('rid' => $rid, 'from_user' => $tfrom_user, 'uniacid' => $uniacid));
                                                                 //message('您成功的为Ta投了一票!',referer(),'success');
                                                                 if (!empty($t['realname'])) {
                                                                     $tname = '姓名为: ' . $t['realname'];
                                                                 } else {
                                                                     $tname = '昵称为: ' . $t['nickname'];
                                                                 }
                                                                 $message = "恭喜您成功的为编号为: " . $t['id'] . " , " . $tname . " 的参赛者投了一票!";
                                                                 //$message .= "1、<a href='".$_W['siteroot']."app/index.php?i=".$_W['uniacid']."&j=".$_W['acid']."&c=entry&rid=".$rid."&m=fm_photosvote&do=tuserphotos&tfrom_user="******"'>查看她的投票</a>\n";
                                                                 //return $this->respText($message);
                                                                 $rowtp = array();
                                                                 $rowtp['title'] = $message;
                                                                 $rowtp['description'] = htmlspecialchars_decode($message);
                                                                 $rowtp['picurl'] = !empty($t['photo']) ? toimage($t['photo']) : toimage($t['avatar']);
                                                                 $rowtp['url'] = $this->createMobileUrl('tuserphotos', array('rid' => $rid, 'tfrom_user' => $tfrom_user));
                                                                 $news[] = $rowtp;
                                                                 if ($row['isindex'] == 1) {
                                                                     $advs = pdo_fetchall("SELECT * FROM " . tablename($this->table_advs) . " WHERE enabled=1 AND ismiaoxian = 0 AND uniacid= '{$uniacid}'  AND rid= '{$rid}' ORDER BY displayorder ASC LIMIT 6");
                                                                     foreach ($advs as $c) {
                                                                         $rowadv = array();
                                                                         $rowadv['title'] = $c['advname'];
                                                                         $rowadv['description'] = $c['description'];
                                                                         $rowadv['picurl'] = toimage($c['thumb']);
                                                                         $rowadv['url'] = empty($c['link']) ? $this->createMobileUrl('photosvoteview', array('rid' => $rid)) : $c['link'];
                                                                         $news[] = $rowadv;
                                                                     }
                                                                 }
                                                                 $huodong = iunserializer($row['huodong']);
                                                                 if ($huodong['ishuodong'] == 1 && !empty($huodong['huodongurl'])) {
                                                                     $rowhd = array();
                                                                     $rowhd['title'] = $huodong['huodongname'];
                                                                     $rowhd['description'] = $huodong['huodongdes'];
                                                                     $rowhd['picurl'] = toimage($huodong['hhhdpicture']);
                                                                     $rowhd['url'] = $huodong['huodongurl'] . "&from=fm_photosvote&oid=" . $from_user;
                                                                     $news[] = $rowhd;
                                                                 }
                                                                 return $this->respNews($news);
                                                             }
                                                         }
                                                     }
                                                 }
                                                 //end daytpxz
                                             } else {
                                                 $message = '在此活动期间,你总共可以投 ' . $row['fansmostvote'] . ' 票,目前你已经投完!';
                                                 return $this->respText($message);
                                             }
                                         }
                                         //end zjrets
                                     }
                                 }
                             }
                         }
                         $isuser = pdo_fetch("SELECT * FROM " . tablename($this->table_users) . " WHERE uniacid = '{$uniacid}' AND `from_user` = '{$from_user}' AND rid = '{$rid}' ");
                         if (!empty($isuser)) {
                             if ($row['isindex'] == 1) {
                                 $advs = pdo_fetch("SELECT * FROM " . tablename($this->table_advs) . " WHERE enabled=1 AND ismiaoxian = 0 AND uniacid= '{$uniacid}'  AND rid= '{$rid}' ORDER BY id ASC LIMIT 1");
                             } else {
                                 $advs = array();
                                 $advs['advname'] = $isuser['description'];
                                 $advs['thumb'] = $isuser['photo'];
                             }
                             return $this->respNews(array('Title' => '您已经报过名了,点击以完善信息', 'Description' => $advs['advname'], 'PicUrl' => toimage($advs['thumb']), 'Url' => $this->createMobileUrl('tuser', array('rid' => $rid, 'tfrom_user' => $from_user))));
                         }
                         if (empty($_SESSION['photoname'])) {
                             $_SESSION['photoname'] = $this->message['content'];
                             $_SESSION['photonameok'] = 1;
                             $msg = $_W['account']['name'] . " 提请您:\n 请回复主题介绍:";
                             //$_SESSION['imageok']= 1;
                             return $this->respText($msg);
                         }
                         if (empty($_SESSION['description'])) {
                             $_SESSION['description'] = $this->message['content'];
                             $_SESSION['descriptionok'] = 1;
                             $msg = $_W['account']['name'] . " 提请您:\n 请回复真实姓名:";
                             //$_SESSION['imageok']= 1;
                             return $this->respText($msg);
                         }
                         if (empty($_SESSION['realname'])) {
                             $_SESSION['realname'] = $this->message['content'];
                             $_SESSION['realnameok'] = 1;
                             $msg = $_W['account']['name'] . " 提请您:\n 请回复手机号码:";
                             //$_SESSION['imageok']= 1;
                             return $this->respText($msg);
                         }
                         if (empty($_SESSION['mobile'])) {
                             $_SESSION['mobile'] = $this->message['content'];
                             $_SESSION['mobileok'] = 1;
                         }
                         $sql = 'SELECT uid FROM ' . tablename('mc_mapping_fans') . ' WHERE `uniacid`=:uniacid AND `openid`=:openid';
                         $pars = array();
                         $pars[':uniacid'] = $_W['uniacid'];
                         $pars[':openid'] = $from_user;
                         $uid = pdo_fetchcolumn($sql, $pars);
                         $fan = pdo_fetch("SELECT avatar,nickname FROM " . tablename('mc_members') . " WHERE uniacid = '{$uniacid}' AND `uid` = '{$uid}'");
                         if (!empty($fan)) {
                             $avatar = $fan['avatar'];
                             $nickname = $fan['nickname'];
                         }
                         $data = array('rid' => $rid, 'uniacid' => $uniacid, 'from_user' => $from_user, 'avatar' => $avatar, 'nickname' => $nickname, 'photo' => $_SESSION["imageurl"], 'music' => $_SESSION["voiceurl"], 'voice' => $_SESSION["voiceurl"], 'vedio' => $_SESSION["videourl"], 'picarr_1' => $_SESSION["imagesurl1"], 'picarr_2' => $_SESSION["imagesurl2"], 'picarr_3' => $_SESSION["imagesurl3"], 'picarr_4' => $_SESSION["imagesurl4"], 'picarr_5' => $_SESSION["imagesurl5"], 'picarr_6' => $_SESSION["imagesurl6"], 'picarr_7' => $_SESSION["imagesurl7"], 'picarr_8' => $_SESSION["imagesurl8"], 'description' => $_SESSION["description"], 'photoname' => $_SESSION["photoname"], 'realname' => $_SESSION["realname"], 'mobile' => $_SESSION["mobile"], 'photosnum' => '0', 'xnphotosnum' => '0', 'hits' => '1', 'xnhits' => '1', 'yaoqingnum' => '0', 'status' => $row['tpsh'] == 1 ? '0' : '1', 'createip' => getip(), 'lastip' => getip(), 'lasttime' => time(), 'sharetime' => time(), 'createtime' => time());
                         $data['iparr'] = $this->getiparr($data['lastip']);
                         pdo_insert($this->table_users, $data);
                         $this->endContext();
                         //$msg = $_W['account']['name']." 提请您:\n恭喜您报名成功!";
                         $_SESSION['bmsuccess'] = 1;
                         return $this->respNews(array('Title' => '恭喜' . $nickname . '报名成功!', 'Description' => '点击以完善信息', 'PicUrl' => toimage($avatar), 'Url' => $this->createMobileUrl('tuser', array('rid' => $rid, 'tfrom_user' => $from_user))));
                         //return $this->respText($msg);
                         break;
                     case 'image':
                         $fmmid = random(16);
                         if (empty($_SESSION['imageid'])) {
                             $_SESSION['imageid'] = $this->message['mediaid'];
                             if ($row['mediatypev']) {
                                 $info = " 请开始录制您的视频";
                             }
                             if ($row['mediatypem']) {
                                 $info = " 请开始录制您的好声音";
                             }
                             if ($row['mediatype']) {
                                 $info = " 请开始上传相册照片";
                             }
                             if (!$row['mediatypev'] && !$row['mediatypem'] && !$row['mediatype']) {
                                 $info = " 请回复您的照片主题宣言:";
                             }
                             $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您的封面\n" . " 如果满意," . $info . "\n" . " 如果不满意,请回复:n\n";
                             $imageurl = $this->downloadMedia($_SESSION['imageid'], $fmmid, 'images');
                             //$imageurl = str_replace("../attachment/", '', $imageurl);
                             $_SESSION['imageurl'] = $imageurl;
                             if ($qiniu['isqiniu']) {
                                 $nfilename = 'FMFetchiHH' . date('YmdHis') . random(16) . '.jpeg';
                                 $qiniu['upurl'] = $_W['siteroot'] . 'attachment/' . $_SESSION['imageurl'];
                                 $mid = 0;
                                 $username = pdo_fetch("SELECT * FROM " . tablename($this->table_users_name) . " WHERE uniacid = :uniacid and from_user = :from_user and rid = :rid", array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
                                 $qiniuimages = $this->fmqnimages($nfilename, $qiniu, $mid, $username);
                                 if ($qiniuimages['success'] == '-1') {
                                     $fmdata = array("success" => -1, "msg" => $qiniuimages['msg']);
                                     return $this->respText($fmdata['msg']);
                                 } else {
                                     if ($username) {
                                         $insertdataname = array();
                                         $insertdataname['photoname'] = $nfilename;
                                         pdo_update($this->table_users_name, $insertdataname, array('from_user' => $from_user, 'rid' => $rid, 'uniacid' => $uniacid));
                                     } else {
                                         $insertdataname = array('rid' => $rid, 'uniacid' => $uniacid, 'from_user' => $from_user, 'photoname' => $nfilename);
                                         pdo_insert($this->table_users_name, $insertdataname);
                                     }
                                 }
                                 $_SESSION['imageurl'] = $qiniuimages['imgurl'];
                                 //return $this->respText($_SESSION['imageurl']);
                             }
                             //$msg .= "封面地址" . "\n" . toimage($_SESSION['imageurl']);
                             $_SESSION['imageok'] = 1;
                             return $this->respText($msg);
                         } else {
                             if ($_SESSION['realnameok'] == 1) {
                                 $msg = $_W['account']['name'] . " 提请您:\n 请回复您的手机号码\n" . $_SESSION['voiceid'];
                                 return $this->respText($msg);
                             }
                             if ($_SESSION['descriptionok'] == 1) {
                                 $msg = $_W['account']['name'] . " 提请您:\n 请回复您的真实姓名\n" . $_SESSION['voiceid'];
                                 return $this->respText($msg);
                             }
                             if ($_SESSION['photonameok'] == 1) {
                                 $msg = $_W['account']['name'] . " 提请您:\n 请回复您的主题介绍\n" . $_SESSION['voiceid'];
                                 return $this->respText($msg);
                             }
                             if ($row['mediatypev']) {
                                 if ($_SESSION['videook'] == 1) {
                                     $msg = $_W['account']['name'] . " 提请您:\n 请回复您的照片主题宣言\n" . $_SESSION['voiceid'];
                                     return $this->respText($msg);
                                 }
                             }
                             if ($row['mediatypem']) {
                                 if ($_SESSION['voiceok'] == 1) {
                                     $msg = $_W['account']['name'] . " 提请您:\n 请录制您的视频\n" . $_SESSION['voiceid'];
                                     return $this->respText($msg);
                                 }
                             }
                         }
                         for ($i = 1; $i <= $row['tpxz']; $i++) {
                             if (empty($_SESSION['imagesid' . $i])) {
                                 if ($row['mediatype']) {
                                     $_SESSION['imagesid' . $i] = $this->message['mediaid'];
                                     if ($row['mediatypev']) {
                                         $info = " 请开始录制您的视频";
                                     }
                                     if ($row['mediatypem']) {
                                         $info = " 请开始录制您的好声音";
                                     }
                                     if (!$row['mediatypev'] && !$row['mediatypem']) {
                                         $info = " 请回复您的照片主题宣言:";
                                     }
                                     $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您的相册照片,您总共可以上传" . $row['tpxz'] . "张相册照片\n" . "您已经上了" . $i . "张相册照片\n" . "如果您只想上传到当前的照片数," . $info;
                                     $imagesurl = $this->downloadMedia($_SESSION['imagesid' . $i], $fmmid, 'images');
                                     //$imagesurl = str_replace("../attachment/", '', $imagesurl);
                                     $_SESSION['imagesurl' . $i] = $imagesurl;
                                     if ($qiniu['isqiniu']) {
                                         $nfilename = 'FMFetchiHH' . date('YmdHis') . random(16) . '.jpeg';
                                         //$qiniu['upurl'] = $_SESSION['imagesurl'.$i];
                                         $qiniu['upurl'] = $_W['siteroot'] . 'attachment/' . $_SESSION['imagesurl' . $i];
                                         $mid = $i;
                                         $username = pdo_fetch("SELECT * FROM " . tablename($this->table_users_name) . " WHERE uniacid = :uniacid and from_user = :from_user and rid = :rid", array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
                                         $qiniuimages = $this->fmqnimages($nfilename, $qiniu, $mid, $username);
                                         if ($qiniuimages['success'] == '-1') {
                                             $fmdata = array("success" => -1, "msg" => $qiniuimages['msg']);
                                             return $this->respText($fmdata['msg']);
                                         } else {
                                             if ($username) {
                                                 $insertdataname = array();
                                                 $insertdataname['picarr_' . $mid . '_name'] = $nfilename;
                                                 pdo_update($this->table_users_name, $insertdataname, array('from_user' => $from_user, 'rid' => $rid, 'uniacid' => $uniacid));
                                             } else {
                                                 $insertdataname = array('rid' => $rid, 'uniacid' => $uniacid, 'from_user' => $from_user);
                                                 $insertdataname['picarr_' . $mid . '_name'] = $nfilename;
                                                 pdo_insert($this->table_users_name, $insertdataname);
                                             }
                                         }
                                         $_SESSION['imagesurl' . $i] = $qiniuimages['imgurl'];
                                     }
                                     //$msg .= "\n相册图片地址" . $i . "\n" . toimage($_SESSION['imagesurl'.$i]);
                                     $_SESSION['imagesok'] = 1;
                                     return $this->respText($msg);
                                 } else {
                                     $_SESSION['imagesok'] = 0;
                                     $msg = $_W['account']['name'] . " 提请您:\n本次活动未开启相册功能,请回复”报名“,按其顺序(要求)上传资料报名\n" . $_W['account']['name'] . "感谢您的支持!";
                                     return $this->respText($msg);
                                 }
                             }
                         }
                         //for ($i = 1; $i <= $row['tpxz']; $i++) {
                         //if (!empty($_SESSION['imagesid'.$i])) {
                         if (!$row['mediatype']) {
                             $_SESSION['imagesok'] = 0;
                             $msg = $_W['account']['name'] . " 提请您:\n本次活动未开启相册功能,请回复”报名“,按其顺序(要求)上传资料报名\n" . $_W['account']['name'] . "感谢您的支持!";
                             return $this->respText($msg);
                         }
                         if ($_SESSION['realnameok'] == 1) {
                             $info = $_W['account']['name'] . " 提请您:\n 请回复您的手机号码\n";
                             //return $this->respText($msg);
                         }
                         if ($_SESSION['descriptionok'] == 1) {
                             $info = $_W['account']['name'] . " 提请您:\n 请回复您的真实姓名\n";
                             //return $this->respText($msg);
                         }
                         if ($_SESSION['photonameok'] == 1) {
                             $info = $_W['account']['name'] . " 提请您:\n 请回复您的主题介绍\n";
                             //return $this->respText($msg);
                         }
                         if ($row['mediatypev'] == 1) {
                             if ($_SESSION['videook']) {
                                 $info = $_W['account']['name'] . " 提请您:\n 请回复您的照片主题宣言\n";
                                 //return $this->respText($msg);
                             }
                         }
                         if ($row['mediatypem'] == 1) {
                             if ($_SESSION['voiceok']) {
                                 $info = $_W['account']['name'] . " 提请您:\n 请录制您的视频\n";
                                 //return $this->respText($msg);
                             }
                         }
                         if ($row['mediatype'] == 1) {
                             if ($_SESSION['imagesok']) {
                                 $info = $_W['account']['name'] . " 提请您:\n 请录制您的好声音\n";
                                 //return $this->respText($msg);
                             }
                         }
                         $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您的相册照片,您总共可以上传" . $row['tpxz'] . "张相册照片\n" . "您已经上了" . $row['tpxz'] . "张相册照片\n" . "" . $info;
                         //$_SESSION['imagesok']= 1;
                         return $this->respText($msg);
                         //}
                         break;
                     case 'voice':
                         $fmmid = random(16);
                         if (empty($_SESSION['voiceid'])) {
                             $_SESSION['voiceid'] = $this->message['mediaid'];
                             if ($row['mediatypev']) {
                                 $info = " 请开始录制您的视频";
                             } else {
                                 $info = " 请回复您的照片主题宣言:";
                             }
                             $voiceurl = $this->downloadMedia($_SESSION['voiceid'], $fmmid, 'voice');
                             $_SESSION['voiceurl'] = $voiceurl;
                             if ($qiniu['isqiniu']) {
                                 $nfilename = 'FMVOICEHH' . date('YmdHis') . random(16) . '.amr';
                                 $upurl = tomedia($_SESSION['voiceurl']);
                                 $username = pdo_fetch("SELECT * FROM " . tablename($this->table_users_name) . " WHERE uniacid = :uniacid and from_user = :from_user and rid = :rid", array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
                                 $audiotype = 'voice';
                                 $qiniuaudios = $this->fmqnaudios($nfilename, $qiniu, $upurl, $audiotype, $username);
                                 $nfilenamefop = $qiniuaudios['nfilenamefop'];
                                 if ($qiniuaudios['success'] == '-1') {
                                     //	var_dump($err);
                                     $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
                                     return $this->respText($fmdata['msg']);
                                 } else {
                                     $insertdata = array();
                                     if ($qiniuaudios['success'] == '-2') {
                                         //var_dump($err);
                                         $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
                                         return $this->respText($fmdata['msg']);
                                     } else {
                                         $voice = $qiniuaudios[$audiotype];
                                         //$udata[$audiotype] = $qiniuaudios[$audiotype];
                                         //pdo_insert($this->table_users_voice, $udata);
                                         //pdo_update($this->table_users, array('fmmid' => $fmmid,'mediaid'  =>$_POST['serverId'],'lastip' => getip(),'lasttime' => $now,'voice' => $voice,'timelength' => $_GPC['timelength']), array('uniacid' => $uniacid, 'rid' => $rid, 'from_user' => $from_user));
                                         if ($username) {
                                             $insertdataname = array();
                                             $insertdataname[$audiotype . 'name'] = $nfilename;
                                             $insertdataname[$audiotype . 'namefop'] = $nfilenamefop;
                                             pdo_update($this->table_users_name, $insertdataname, array('from_user' => $from_user, 'rid' => $rid, 'uniacid' => $uniacid));
                                         } else {
                                             $insertdataname = array('rid' => $rid, 'uniacid' => $uniacid, 'from_user' => $from_user);
                                             $insertdataname[$audiotype . 'name'] = $nfilename;
                                             $insertdataname[$audiotype . 'namefop'] = $nfilenamefop;
                                             pdo_insert($this->table_users_name, $insertdataname);
                                         }
                                     }
                                 }
                                 $_SESSION['voiceurl'] = $voice;
                             }
                             $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您录制的好声音\n" . " 如果满意," . $info . "\n" . " 如果不满意,请重新录制好声音\n";
                             //$msg .= "\n好声音地址" . "\n" . tomedia($_SESSION['voiceurl']);
                             $_SESSION['voiceok'] = 1;
                             return $this->respText($msg);
                         } else {
                             $_SESSION['voiceid'] = $this->message['mediaid'];
                             if ($_SESSION['realnameok']) {
                                 $info = " 请回复您的手机号码\n";
                                 //return $this->respText($msg);
                             }
                             if ($_SESSION['descriptionok']) {
                                 $info = " 请回复您的真实姓名\n";
                                 //return $this->respText($msg);
                             }
                             if ($_SESSION['photonameok']) {
                                 $info = " 请回复您的主题介绍\n";
                                 //return $this->respText($msg);
                             }
                             if ($row['mediatypev']) {
                                 if ($_SESSION['videook']) {
                                     $info = " 请回复您的照片主题宣言\n";
                                     //return $this->respText($msg);
                                 }
                             }
                             if ($row['mediatypem']) {
                                 if ($_SESSION['voiceok']) {
                                     $info = " 请录制您的视频\n";
                                     //return $this->respText($msg);
                                 }
                             }
                             $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您重新录制的好声音\n" . " 如果满意," . $info . "\n" . " 如果不满意,请再次重新录制好声音\n";
                             $voiceurl = $this->downloadMedia($_SESSION['voiceid'], $fmmid, 'voice');
                             load()->func('file');
                             file_delete($_SESSION['voiceurl']);
                             $_SESSION['voiceurl'] = $voiceurl;
                             //return $this->respText($qiniu);
                             if ($qiniu['isqiniu']) {
                                 $nfilename = 'FMVOICEHH' . date('YmdHis') . random(16) . '.amr';
                                 $upurl = tomedia($_SESSION['voiceurl']);
                                 $username = pdo_fetch("SELECT * FROM " . tablename($this->table_users_name) . " WHERE uniacid = :uniacid and from_user = :from_user and rid = :rid", array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
                                 $audiotype = 'voice';
                                 $qiniuaudios = $this->fmqnaudios($nfilename, $qiniu, $upurl, $audiotype, $username);
                                 $nfilenamefop = $qiniuaudios['nfilenamefop'];
                                 if ($qiniuaudios['success'] == '-1') {
                                     //	var_dump($err);
                                     $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
                                     return $this->respText($fmdata['msg']);
                                 } else {
                                     $insertdata = array();
                                     if ($qiniuaudios['success'] == '-2') {
                                         //var_dump($err);
                                         $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
                                         return $this->respText($fmdata['msg']);
                                     } else {
                                         $voice = $qiniuaudios[$audiotype];
                                         //$udata[$audiotype] = $qiniuaudios[$audiotype];
                                         //pdo_insert($this->table_users_voice, $udata);
                                         //pdo_update($this->table_users, array('fmmid' => $fmmid,'mediaid'  =>$_POST['serverId'],'lastip' => getip(),'lasttime' => $now,'voice' => $voice,'timelength' => $_GPC['timelength']), array('uniacid' => $uniacid, 'rid' => $rid, 'from_user' => $from_user));
                                         if ($username) {
                                             $insertdataname = array();
                                             $insertdataname[$audiotype . 'name'] = $nfilename;
                                             $insertdataname[$audiotype . 'namefop'] = $nfilenamefop;
                                             pdo_update($this->table_users_name, $insertdataname, array('from_user' => $from_user, 'rid' => $rid, 'uniacid' => $uniacid));
                                         } else {
                                             $insertdataname = array('rid' => $rid, 'uniacid' => $uniacid, 'from_user' => $from_user);
                                             $insertdataname[$audiotype . 'name'] = $nfilename;
                                             $insertdataname[$audiotype . 'namefop'] = $nfilenamefop;
                                             pdo_insert($this->table_users_name, $insertdataname);
                                         }
                                     }
                                 }
                                 $_SESSION['voiceurl'] = $voice;
                             }
                             //$msg .= "\n好声音地址" . "\n" . tomedia($_SESSION['voiceurl']);
                             $_SESSION['voiceok'] = 1;
                             return $this->respText($msg);
                         }
                         break;
                     case 'video':
                         $fmmid = random(16);
                         if (empty($_SESSION['videoid'])) {
                             $_SESSION['videoid'] = $this->message['mediaid'];
                             $videourl = $this->downloadMedia($_SESSION['videoid'], $fmmid, 'video');
                             $_SESSION['videourl'] = $videourl;
                             if ($qiniu['isqiniu']) {
                                 //开启七牛存储
                                 $audiotype = 'vedio';
                                 $nfilename = 'FMHH' . date('YmdHis') . random(8) . 'hhvideo.mp4';
                                 $upmediatmp = toimage($_SESSION['videourl']);
                                 $qiniuaudios = $this->fmqnaudios($nfilename, $qiniu, $upmediatmp, $audiotype, $username);
                                 $nfilenamefop = $qiniuaudios['nfilenamefop'];
                                 if ($qiniuaudios['success'] == '-1') {
                                     //	var_dump($err);
                                     $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
                                     return $this->respText($fmdata['msg']);
                                 } else {
                                     $insertdata = array();
                                     if ($qiniuaudios['success'] == '-2') {
                                         //var_dump($err);
                                         $fmdata = array("success" => -1, "msg" => $err);
                                         return $this->respText($fmdata['msg']);
                                     } else {
                                         //var_dump($ret);
                                         $insertdata[$audiotype] = $qiniuaudios[$audiotype];
                                         //pdo_update($this->table_users, $insertdata, array('from_user'=>$from_user, 'rid' => $rid, 'uniacid' => $uniacid));
                                         if ($username) {
                                             $insertdataname = array();
                                             $insertdataname[$audiotype . 'name'] = $nfilename;
                                             $insertdataname[$audiotype . 'namefop'] = $nfilenamefop;
                                             pdo_update($this->table_users_name, $insertdataname, array('from_user' => $from_user, 'rid' => $rid, 'uniacid' => $uniacid));
                                         } else {
                                             $insertdataname = array('rid' => $rid, 'uniacid' => $uniacid, 'from_user' => $from_user);
                                             $insertdataname[$audiotype . 'name'] = $nfilename;
                                             $insertdataname[$audiotype . 'namefop'] = $nfilenamefop;
                                             pdo_insert($this->table_users_name, $insertdataname);
                                         }
                                     }
                                 }
                                 $_SESSION['videourl'] = $qiniuaudios[$audiotype];
                             }
                             $_SESSION['videook'] = 1;
                             $info = " 请回复您的照片主题宣言:";
                             $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您录制的视频\n" . " 如果满意," . $info . "\n" . " 如果不满意,请重新录制视频\n";
                             //$msg .= "\n视频地址" . "\n" . tomedia($_SESSION['videourl']);
                             return $this->respText($msg);
                         } else {
                             //$this->istip('video');
                             $_SESSION['videoid'] = $this->message['mediaid'];
                             load()->func('file');
                             file_delete($_SESSION['videourl']);
                             $videourl = $this->downloadMedia($_SESSION['videoid'], $fmmid, 'video');
                             $_SESSION['videourl'] = $videourl;
                             if ($qiniu['isqiniu']) {
                                 //开启七牛存储
                                 $audiotype = 'vedio';
                                 $nfilename = 'FMHH' . date('YmdHis') . random(8) . 'hhvideo.mp4';
                                 $upmediatmp = toimage($_SESSION['videourl']);
                                 $qiniuaudios = $this->fmqnaudios($nfilename, $qiniu, $upmediatmp, $audiotype, $username);
                                 $nfilenamefop = $qiniuaudios['nfilenamefop'];
                                 if ($qiniuaudios['success'] == '-1') {
                                     //	var_dump($err);
                                     $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
                                     return $this->respText($fmdata['msg']);
                                 } else {
                                     $insertdata = array();
                                     if ($qiniuaudios['success'] == '-2') {
                                         //var_dump($err);
                                         $fmdata = array("success" => -1, "msg" => $err);
                                         return $this->respText($fmdata['msg']);
                                     } else {
                                         //var_dump($ret);
                                         $insertdata[$audiotype] = $qiniuaudios[$audiotype];
                                         if ($username) {
                                             $insertdataname = array();
                                             $insertdataname[$audiotype . 'name'] = $nfilename;
                                             $insertdataname[$audiotype . 'namefop'] = $nfilenamefop;
                                             pdo_update($this->table_users_name, $insertdataname, array('from_user' => $from_user, 'rid' => $rid, 'uniacid' => $uniacid));
                                         } else {
                                             $insertdataname = array('rid' => $rid, 'uniacid' => $uniacid, 'from_user' => $from_user);
                                             $insertdataname[$audiotype . 'name'] = $nfilename;
                                             $insertdataname[$audiotype . 'namefop'] = $nfilenamefop;
                                             pdo_insert($this->table_users_name, $insertdataname);
                                         }
                                     }
                                 }
                                 $_SESSION['videourl'] = $qiniuaudios[$audiotype];
                             }
                             if ($_SESSION['realnameok']) {
                                 $info = " 请回复您的手机号码\n";
                                 //return $this->respText($msg);
                             }
                             if ($_SESSION['descriptionok']) {
                                 $info = " 请回复您的真实姓名\n";
                                 //return $this->respText($msg);
                             }
                             if ($_SESSION['photonameok']) {
                                 $info = " 请回复您的主题介绍\n";
                                 //return $this->respText($msg);
                             }
                             if ($row['mediatypev']) {
                                 if ($_SESSION['videook']) {
                                     $info = " 请回复您的照片主题宣言\n";
                                     //return $this->respText($msg);
                                 }
                             }
                             $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您重新录制的视频\n" . " 如果满意," . $info . "\n" . " 如果不满意,请再次重新录制视频\n";
                             //$msg .= "\n视频地址" . "\n" . tomedia($_SESSION['videourl']);
                             $_SESSION['videook'] = 1;
                             return $this->respText($msg);
                         }
                         break;
                     case 'shortvideo':
                         $fmmid = random(16);
                         if (empty($_SESSION['videoid'])) {
                             $_SESSION['videoid'] = $this->message['mediaid'];
                             $videourl = $this->downloadMedia($_SESSION['videoid'], $fmmid, 'video');
                             $_SESSION['videourl'] = $videourl;
                             $_SESSION['videook'] = 1;
                             $info = " 请回复您的照片主题宣言:";
                             $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您录制的视频\n" . " 如果满意," . $info . "\n" . " 如果不满意,请重新录制视频\n";
                             //$msg .= "\n视频地址" . "\n" . tomedia($_SESSION['videourl']);
                             return $this->respText($msg);
                         } else {
                             //$this->istip('video');
                             $_SESSION['videoid'] = $this->message['mediaid'];
                             load()->func('file');
                             file_delete($_SESSION['videourl']);
                             $videourl = $this->downloadMedia($_SESSION['videoid'], $fmmid, 'video');
                             $_SESSION['videourl'] = $videourl;
                             if ($_SESSION['realnameok']) {
                                 $info = " 请回复您的手机号码\n";
                                 //return $this->respText($msg);
                             }
                             if ($_SESSION['descriptionok']) {
                                 $info = " 请回复您的真实姓名\n";
                                 //return $this->respText($msg);
                             }
                             if ($_SESSION['photonameok']) {
                                 $info = " 请回复您的主题介绍\n";
                                 //return $this->respText($msg);
                             }
                             if ($row['mediatypev']) {
                                 if ($_SESSION['videook']) {
                                     $info = " 请回复您的照片主题宣言\n";
                                     //return $this->respText($msg);
                                 }
                             }
                             $msg = $_W['account']['name'] . " 提请您:\n我们已经收到您重新录制的视频\n" . " 如果满意," . $info . "\n" . " 如果不满意,请再次重新录制视频\n";
                             //$msg .= "\n视频地址" . "\n" . tomedia($_SESSION['videourl']);
                             $_SESSION['videook'] = 1;
                             return $this->respText($msg);
                         }
                         break;
                     default:
                         break;
                 }
             }
         }
         //总的结束
     } else {
         if ($now <= $row['start_time']) {
             $message = "亲," . $row['title'] . "活动将在" . date("Y-m-d H:i:s", $row['start_time']) . "时准时开放投票,您可以:\n";
             $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&rid=" . $rid . "&m=fm_photosvote&do=photosvoteview&uniacid=" . $uniacid . "'>先睹为快</a>\n";
             if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                 $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
             }
         } elseif ($now >= $row['end_time']) {
             $message = "亲," . $row['title'] . "活动已经于" . date("Y-m-d H:i:s", $row['end_time']) . "时结束,您可以:\n";
             $message .= "1、<a href='" . $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&j=" . $_W['acid'] . "&c=entry&rid=" . $rid . "&m=fm_photosvote&do=paihang&uniacid=" . $uniacid . "'>看看排行榜</a>\n";
             if ($row['ishuodong'] == 1 && !empty($row['huodongurl'])) {
                 $message .= "2、<a href='" . $row['huodongurl'] . "'>" . $row['huodongname'] . "</a>";
             }
         }
         return $this->respText($message);
     }
 }
Exemple #26
0
 public function fm_qrcode($value = 'http://012wz.com', $filename = '', $pathname = '', $logo, $scqrcode = array('errorCorrectionLevel' => 'H', 'matrixPointSize' => '4', 'margin' => '5'))
 {
     global $_W;
     $uniacid = !empty($_W['uniacid']) ? $_W['uniacid'] : $_W['acid'];
     require_once '../framework/library/qrcode/phpqrcode.php';
     load()->func('file');
     $filename = empty($filename) ? date("YmdHis") . '' . random(10) : date("YmdHis") . '' . random(istrlen($filename));
     if (!empty($pathname)) {
         $dfileurl = 'attachment/images/' . $uniacid . '/qrcode/cache/' . date("Ymd") . '/' . $pathname;
         $fileurl = '../' . $dfileurl;
     } else {
         $dfileurl = 'attachment/images/' . $uniacid . '/qrcode/cache/' . date("Ymd");
         $fileurl = '../' . $dfileurl;
     }
     mkdirs($fileurl);
     $fileurl = empty($pathname) ? $fileurl . '/' . $filename . '.png' : $fileurl . '/' . $filename . '.png';
     QRcode::png($value, $fileurl, $scqrcode['errorCorrectionLevel'], $scqrcode['matrixPointSize'], $scqrcode['margin']);
     $dlogo = $_W['attachurl'] . 'headimg_' . $uniacid . '.jpg?uniacid=' . $uniacid;
     if (!$logo) {
         $logo = toimage($dlogo);
     }
     $QR = $_W['siteroot'] . $dfileurl . '/' . $filename . '.png';
     if ($logo !== FALSE) {
         $QR = imagecreatefromstring(file_get_contents($QR));
         $logo = imagecreatefromstring(file_get_contents($logo));
         $QR_width = imagesx($QR);
         $QR_height = imagesy($QR);
         $logo_width = imagesx($logo);
         $logo_height = imagesy($logo);
         $logo_qr_width = $QR_width / 5;
         $scale = $logo_width / $logo_qr_width;
         $logo_qr_height = $logo_height / $scale;
         $from_width = ($QR_width - $logo_qr_width) / 2;
         imagecopyresampled($QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height);
     }
     if (!empty($pathname)) {
         $dfileurllogo = 'attachment/images/' . $uniacid . '/qrcode/fm_qrcode/' . date("Ymd") . '/' . $pathname;
         $fileurllogo = '../' . $dfileurllogo;
     } else {
         $dfileurllogo = 'attachment/images/' . $uniacid . '/qrcode/fm_qrcode';
         $fileurllogo = '../' . $dfileurllogo;
     }
     mkdirs($fileurllogo);
     $fileurllogo = empty($pathname) ? $fileurllogo . '/' . $filename . '_logo.png' : $fileurllogo . '/' . $filename . '_logo.png';
     imagepng($QR, $fileurllogo);
     return $fileurllogo;
 }
Exemple #27
0
$ljtp = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename($this->table_log) . " WHERE rid= " . $rid . "") + pdo_fetchcolumn("SELECT sum(xnphotosnum) FROM " . tablename($this->table_users) . " WHERE rid= " . $rid . "");
//累计投票
$cyrs = $csrs + $reply['hits'] + pdo_fetchcolumn("SELECT sum(hits) FROM " . tablename($this->table_users) . " WHERE rid= " . $rid . "") + pdo_fetchcolumn("SELECT sum(xnhits) FROM " . tablename($this->table_users) . " WHERE rid= " . $rid . "") + $reply['xuninum'];
//参与人数
if (!empty($from_user)) {
    $mygift = pdo_fetch("SELECT * FROM " . tablename($this->table_users) . " WHERE uniacid = :uniacid and from_user = :from_user and rid = :rid", array(':uniacid' => $uniacid, ':from_user' => $from_user, ':rid' => $rid));
    //此处更新一下分享量和邀请量
}
$reply['sharetitle'] = $this->get_share($uniacid, $rid, $from_user, $reply['sharetitle']);
$reply['sharecontent'] = $this->get_share($uniacid, $rid, $from_user, $reply['sharecontent']);
//整理数据进行页面显示
$myavatar = $avatar;
$mynickname = $nickname;
$shareurl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('shareuserview', array('rid' => $rid, 'fromuser' => $from_user));
//分享URL
$regurl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('reg', array('rid' => $rid));
//关注或借用直接注册页
$guanzhu = $reply['shareurl'];
//没有关注用户跳转引导页
$lingjiangurl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('lingjiang', array('rid' => $rid));
//领奖URL
$mygifturl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('photosvoteview', array('rid' => $rid));
//我的页面
$title = $reply['title'];
$_share['link'] = $_W['siteroot'] . 'app/' . $this->createMobileUrl('shareuserview', array('rid' => $rid, 'fromuser' => $from_user));
//分享URL
$_share['title'] = $reply['sharetitle'];
$_share['content'] = $reply['sharecontent'];
$_share['imgUrl'] = toimage($reply['sharephoto']);
$toye = $this->_stopllq('des');
include $this->template($toye);
Exemple #28
0
 if ($qiniu['videologo']) {
     $qiniu['videologo'] = toimage($qiniu['videologo']);
 }
 if ($upmediatmp) {
     $ext = $_FILES[$audiotype]["type"];
     $nfilename = 'FM' . date('YmdHis') . random(8) . $_FILES[$audiotype]["name"];
     $updir = '../attachment/audios/' . $uniacid . '/' . date("Y") . '/' . date("m") . '/';
     mkdirs($updir);
     if ($mygift[$audiotype]) {
         file_delete($mygift[$audiotype]);
     }
     $music = file_upload($_FILES[$audiotype], 'audio');
     $videopath = $music['path'];
     if ($qiniu['isqiniu']) {
         //开启七牛存储
         $upmediatmp = toimage($videopath);
         $qiniuaudios = $this->fmqnaudios($nfilename, $qiniu, $upmediatmp, $audiotype, $username);
         $nfilenamefop = $qiniuaudios['nfilenamefop'];
         if ($qiniuaudios['success'] == '-1') {
             //	var_dump($err);
             $fmdata = array("success" => -1, "msg" => $qiniuaudios['msg']);
             echo json_encode($fmdata);
             exit;
         } else {
             $insertdata = array();
             if ($qiniuaudios['success'] == '-2') {
                 //var_dump($err);
                 $fmdata = array("success" => -1, "msg" => $err);
                 echo json_encode($fmdata);
                 exit;
             } else {
Exemple #29
0
$cid = $_GPC['cid'];
//如果是从人脉页面跳转过来的,则没有cid
if ($op == 'renmai') {
    $cid = pdo_fetchcolumn("SELECT id FROM " . tablename('amouse_weicard_card') . " WHERE mid=" . $id);
    if (empty($cid)) {
        message('名片不存在!');
    }
}
$member = pdo_fetch("SELECT * FROM " . tablename('amouse_weicard_member') . " WHERE id=" . $id);
$card = pdo_fetch("SELECT * FROM " . tablename('amouse_weicard_card') . " WHERE id=" . $cid);
$guanzhuUrl = pdo_fetchcolumn("SELECT guanzhuUrl FROM " . tablename('amouse_weicard_sysset') . " WHERE weid=" . $_W['uniacid']);
//生成二维码图片
$linkUrl = $_W['siteroot'] . 'app/' . $this->createMobileUrl('share', array('id' => $member['id'], 'cid' => $card['id'], 'wid' => $member['openid']), true);
//生成二维码图片
$imgName = $member['id'] . "amouseerweima_" . $_W['uniacid'] . ".png";
$shareimg = toimage($member['headimg']);
$path = "/addons/amouse_eicard";
$filename = IA_ROOT . $path . "/data/" . $imgName;
$imgUrl = "addons/amouse_ecard/data/{$imgName}";
$a = $this->CreateQRImage($imgName, $linkUrl, $imgUrl);
$isCompany = pdo_fetchcolumn("SELECT id FROM " . tablename('amouse_weicard_companyinfo') . " WHERE mid=" . $member['id']);
$isPhoto = pdo_fetchcolumn("SELECT id FROM " . tablename('amouse_weicard_photo') . " WHERE mid=" . $member['id']);
$ispresence = pdo_fetchcolumn("SELECT id FROM " . tablename('amouse_weicard_presence') . " WHERE mid=" . $member['id']);
//背景音乐
$isbjyy = pdo_fetchcolumn("SELECT musicid FROM " . tablename('amouse_weicard_bjyy') . " WHERE mid=" . $member['id']);
if (!empty($isbjyy)) {
    $musicUrl = pdo_fetchcolumn("SELECT musicUrl FROM " . tablename('amouse_weicard_music') . " WHERE id=" . $isbjyy);
    if (strexists($musicUrl, 'http://') || strexists($musicUrl, 'https://')) {
        $musicUrl = $musicUrl;
    } else {
        $musicUrl = $_W['attachurl'] . $musicUrl;
Exemple #30
0
 public function doMobiledetail()
 {
     global $_W, $_GPC;
     $id = intval($_GPC['id']);
     if (empty($id)) {
         message('参数错误', 'refresh', 'error');
     }
     if ($_W['isajax']) {
         if ($_GPC['op'] == 'share') {
             pdo_query("UPDATE " . tablename($this->dialect) . " SET share_num=share_num+1 WHERE id=" . $id);
         } else {
             pdo_query("UPDATE " . tablename($this->dialect) . " SET people=people+1 WHERE id=" . $id);
         }
     }
     // 访问人数
     pdo_query("UPDATE " . tablename($this->dialect) . " SET viewnum=viewnum+1 WHERE id=" . $id);
     $r = pdo_fetch("SELECT * FROM " . tablename($this->dialect) . " WHERE id={$id} ORDER BY id DESC LIMIT 1");
     // 问题
     if ($r['questions']) {
         $questions = iunserializer($r['questions']);
         unset($r['questions']);
     }
     // 评分
     if ($r['scoretext']) {
         $scoretext = iunserializer($r['scoretext']);
         unset($r['scoretext']);
     }
     $setting = $this->module['config'];
     $setting['thumb'] = toimage($setting['thumb']);
     include $this->template('detail');
 }