Пример #1
0
//ᅲ○ᄑ애﾿ᅪ테ᅡᄐ
if (!$space['self'] && $_SGLOBAL['supe_uid']) {
    $query = $_SGLOBAL['db']->query("SELECT dateline FROM " . tname('visitor') . " WHERE uid='{$space['uid']}' AND vuid='{$_SGLOBAL['supe_uid']}'");
    $visitor = $_SGLOBAL['db']->fetch_array($query);
    $is_anonymous = empty($_SCOOKIE['anonymous_visit_' . $_SGLOBAL['supe_uid'] . '_' . $space['uid']]) ? 0 : 1;
    if (empty($visitor['dateline'])) {
        $setarr = array('uid' => $space['uid'], 'vuid' => $_SGLOBAL['supe_uid'], 'vusername' => $is_anonymous ? '' : $_SGLOBAL['supe_username'], 'dateline' => $_SGLOBAL['timestamp']);
        inserttable('visitor', $setarr, 0, true);
        show_credit();
        //ᄒᄎ틔ᅤᅤᅢ
    } else {
        if ($_SGLOBAL['timestamp'] - $visitor['dateline'] >= 300) {
            updatetable('visitor', array('dateline' => $_SGLOBAL['timestamp'], 'vusername' => $is_anonymous ? '' : $_SGLOBAL['supe_username']), array('uid' => $space['uid'], 'vuid' => $_SGLOBAL['supe_uid']));
        }
        if ($_SGLOBAL['timestamp'] - $visitor['dateline'] >= 3600) {
            show_credit();
            //1￐겨ᄆᄎ￳ᄒᄎ틔ᅤᅤᅢ
        }
    }
    //ᄑᄆ￀￸애﾿ᅪ
    getreward('visit', 1, 0, $space['uid']);
}
//ᄎ↓ᄚᄉ￀ᄒ￟
$space['magiccredit'] = 0;
if ($_SGLOBAL['magic']['gift'] && $_SGLOBAL['supe_uid']) {
    $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('magicuselog') . " WHERE uid='{$space['uid']}' AND mid='gift' LIMIT 1");
    if ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $data = empty($value['data']) ? array() : unserialize($value['data']);
        if ($data['left'] <= 0) {
            $_SGLOBAL['db']->query('DELETE FROM ' . tname('magicuselog') . " WHERE uid = '{$space['uid']}' AND mid = 'gift'");
        }
Пример #2
0
	$is_anonymous = empty($_SCOOKIE['anonymous_visit_'.$_SGLOBAL['supe_uid'].'_'.$space['uid']]) ? 0 : 1;
	if(empty($visitor['dateline'])) {
		$setarr = array(
			'uid' => $space['uid'],
			'vuid' => $_SGLOBAL['supe_uid'],
			'vusername' => $is_anonymous ? '' : $_SGLOBAL['supe_username'],
			'dateline' => $_SGLOBAL['timestamp']
		);
		inserttable('visitor', $setarr, 0, true);
		show_credit();//竞价排名
	} else {
		if($_SGLOBAL['timestamp'] - $visitor['dateline'] >= 300) {
			updatetable('visitor', array('dateline'=>$_SGLOBAL['timestamp'], 'vusername'=>$is_anonymous ? '' : $_SGLOBAL['supe_username']), array('uid'=>$space['uid'], 'vuid'=>$_SGLOBAL['supe_uid']));
		}
		if($_SGLOBAL['timestamp'] - $visitor['dateline'] >= 3600) {
			show_credit();//1小时后竞价排名
		}
	}
	//奖励访客
	getreward('visit', 1, 0, $space['uid']);
}

//红包道具
$space['magiccredit'] = 0;
if($_SGLOBAL['magic']['gift'] && $_SGLOBAL['supe_uid']) {
	$query = $_SGLOBAL['db']->query('SELECT * FROM '.tname('magicuselog')." WHERE uid='$space[uid]' AND mid='gift' LIMIT 1");
	if($value = $_SGLOBAL['db']->fetch_array($query)) {
		$data = empty($value['data'])?array():unserialize($value['data']);
		if($data['left'] <= 0) {
			$_SGLOBAL['db']->query('DELETE FROM '.tname('magicuselog')." WHERE uid = '$space[uid]' AND mid = 'gift'");
		}