当前位置: 首页>>代码示例>>PHP>>正文


PHP getreward函数代码示例

本文整理汇总了PHP中getreward函数的典型用法代码示例。如果您正苦于以下问题:PHP getreward函数的具体用法?PHP getreward怎么用?PHP getreward使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getreward函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: auth

 function auth($uId, $picData, $picExt = 'jpg', $isReward = false)
 {
     global $_SGLOBAL;
     $pic = base64_decode($picData);
     if (!$pic || strlen($pic) == strlen($picData)) {
         $errCode = '200';
         $errMessage = 'Error argument';
         return new APIErrorResponse($errCode, $errMessage);
     }
     $secret = md5($_SGLOBAL['timestamp'] . "\t" . $_SGLOBAL['supe_uid']);
     $picDir = S_ROOT . './data/avatar/' . substr($secret, 0, 1);
     if (!is_dir($picDir)) {
         if (!mkdir($picDir, 0777)) {
             $errCode = '300';
             $errMessage = 'Cannot create directory';
             return new APIErrorResponse($errCode, $errMessage);
         }
     }
     $picDir .= '/' . substr($secret, 1, 1);
     if (!is_dir($picDir)) {
         if (!@mkdir($picDir, 0777)) {
             $errCode = '300';
             $errMessage = 'Cannot create directory';
             return new APIErrorResponse($errCode, $errMessage);
         }
     }
     $picPath = $picDir . '/' . $secret . '.' . $picExt;
     $fp = @fopen($picPath, 'wb');
     if ($fp) {
         if (fwrite($fp, $pic) !== FALSE) {
             fclose($fp);
             //The main table
             updatetable('space', array('videostatus' => 1), array('uid' => $uId));
             //Attached table
             $fields = array('videopic' => $secret);
             updatetable('spacefield', $fields, array('uid' => $uId));
             $result = $_SGLOBAL['db']->affected_rows();
             if ($isReward) {
                 // Bonus Points
                 getreward('videophoto', 1, $uId, '', 0);
             }
             return new APIResponse($result);
         }
     }
     $errCode = '300';
     $errMessage = 'Video Auth Error';
     return new APIErrorResponse($errCode, $errMessage);
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:48,代码来源:VideoAuth.php

示例2: add

 function add($uId, $appId, $appName, $privacy, $allowSideNav, $allowFeed, $allowProfileLink, $defaultBoxType, $defaultMYML, $defaultProfileLink, $version, $displayMethod, $displayOrder = null)
 {
     global $_SGLOBAL;
     $sql = sprintf('SELECT appid FROM %s WHERE uid = %d AND appid = %d', tname('userapp'), $uId, $appId);
     $query = $_SGLOBAL['db']->query($sql);
     $row = $_SGLOBAL['db']->fetch_array($query);
     if ($row['appid']) {
         $errCode = '170';
         $errMessage = 'Application has been already added';
         return new APIErrorResponse($errCode, $errMessage);
     }
     switch ($privacy) {
         case 'public':
             $privacy = 0;
             break;
         case 'friends':
             $privacy = 1;
             break;
         case 'me':
             $privacy = 3;
             break;
         case 'none':
             $privacy = 5;
             break;
         default:
             $privacy = 0;
     }
     $narrow = $defaultBoxType == 'narrow' ? 1 : 0;
     $setarr = array('uid' => $uId, 'appid' => $appId, 'appname' => $appName, 'privacy' => $privacy, 'allowsidenav' => $allowSideNav, 'allowfeed' => $allowFeed, 'allowprofilelink' => $allowProfileLink, 'narrow' => $narrow);
     if ($displayOrder !== null) {
         $setarr['displayorder'] = $displayOrder;
     }
     inserttable('userapp', $setarr);
     $fields = array('uid' => $uId, 'appid' => $appId, 'profilelink' => $defaultProfileLink, 'myml' => $defaultMYML);
     $result = inserttable('userappfield', $fields, 1);
     $reward = getreward('installapp', 0, $uId, $appId, 0);
     // update  user
     $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET updatetime='{$_SGLOBAL['timestamp']}', credit=credit+{$reward['credit']}, experience=experience+{$reward['experience']} WHERE uid='{$uId}'");
     $displayMethod = $displayMethod == 'iframe' ? 1 : 0;
     $this->refreshApplication($appId, $appName, $version, $displayMethod, $narrow, null, null);
     return new APIResponse($result);
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:42,代码来源:UserApplication.php

示例3: updatetable

    //更新状态
    updatetable('session', array('lastactivity' => $_SGLOBAL['timestamp']), array('uid' => $_SGLOBAL['supe_uid']));
}
$app = array();
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('myapp') . " WHERE appid='{$appid}' LIMIT 1");
if ($app = $_SGLOBAL['db']->fetch_array($query)) {
    if ($app['flag'] < 0) {
        showmessage('no_privilege_myapp');
    }
}
//漫游
$my_appId = $appid;
$my_suffix = base64_decode(urldecode($_GET['my_suffix']));
$my_prefix = getsiteurl();
//奖励积分
getreward('useapp', 1, 0, $appid);
if (!$my_suffix) {
    header('Location: userapp.php?id=' . $my_appId . '&my_suffix=' . urlencode(base64_encode('/')));
    exit;
}
if (preg_match('/^\\//', $my_suffix)) {
    $url = 'http://apps.manyou.com/' . $my_appId . $my_suffix;
} else {
    if ($my_suffix) {
        $url = 'http://apps.manyou.com/' . $my_appId . '/' . $my_suffix;
    } else {
        $url = 'http://apps.manyou.com/' . $my_appId;
    }
}
if (strpos($my_suffix, '?')) {
    $url = $url . '&my_uchId=' . $_SGLOBAL['supe_uid'] . '&my_sId=' . $_SCONFIG['my_siteid'];
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:userapp.php

示例4: inserttable

        inserttable('poke', $setarr, 0, true);
        //更新统计
        if (!$oldpoke) {
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET pokenum=pokenum+1 WHERE uid='{$uid}'");
        }
        //更新我的好友关系热度
        addfriendnum($tospace['uid'], $tospace['username']);
        //发送邮件通知
        smail($uid, '', cplang('poke_subject', array($_SN[$space['uid']], getsiteurl() . 'cp.php?ac=poke')), '', 'poke');
        if ($op == 'reply') {
            //删除招呼
            $_SGLOBAL['db']->query("DELETE FROM " . tname('poke') . " WHERE uid='{$_SGLOBAL['supe_uid']}' AND fromuid='{$uid}'");
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET pokenum=pokenum-1 WHERE uid='{$_SGLOBAL['supe_uid']}' AND pokenum>0");
        }
        //奖励
        getreward('poke', 1, 0, $uid);
        //统计
        updatestat('poke');
        showmessage('poke_success', $_POST['refer'], 1, array($_SN[$tospace['uid']]));
    }
} elseif ($op == 'ignore') {
    $where = empty($uid) ? '' : "AND fromuid='{$uid}'";
    $_SGLOBAL['db']->query("DELETE FROM " . tname('poke') . " WHERE uid='{$_SGLOBAL['supe_uid']}' {$where}");
    //统计更新
    $pokenum = getcount('poke', array('uid' => $space['uid']));
    if ($pokenum != $space['pokenum']) {
        updatetable('space', array('pokenum' => $pokenum), array('uid' => $space['uid']));
    }
    showmessage('has_been_hailed_overlooked');
} else {
    $perpage = 20;
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:cp_poke.php

示例5: cplang

        case 'picid':
            $fs['title_template'] = cplang('feed_click_pic');
            $fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$item['uid']}\">{$_SN[$item['uid']]}</a>", 'click' => $click['name']);
            $fs['images'] = array(pic_get($item['filepath'], $item['thumb'], $item['remote']));
            $fs['image_links'] = array("space.php?uid={$item['uid']}&do=album&picid={$item['picid']}");
            $fs['body_general'] = $item['title'];
            $note_type = 'clickpic';
            $q_note = cplang('note_click_pic', array("space.php?uid={$item['uid']}&do=album&picid={$item['picid']}"));
            break;
    }
    //Event Publishing
    if (empty($item['friend']) && ckprivacy('click', 1)) {
        feed_add('click', $fs['title_template'], $fs['title_data'], '', array(), $fs['body_general'], $fs['images'], $fs['image_links']);
    }
    //Reward visitors
    getreward('click', 1, 0, $idtype . $id);
    //Statistics
    updatestat('click');
    //Notice
    notification_add($item['uid'], $note_type, $q_note);
    showmessage('click_success', $_SGLOBAL['refer']);
} elseif ($_GET['op'] == 'show') {
    foreach ($clicks as $key => $value) {
        $value['clicknum'] = $item["click_{$key}"];
        $value['classid'] = mt_rand(1, 4);
        if ($value['clicknum'] > $maxclicknum) {
            $maxclicknum = $value['clicknum'];
        }
        $clicks[$key] = $value;
    }
    $start = intval($_GET['start']);
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:cp_click.php

示例6: exit

/*
	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: do_login.php 8543 2008-08-21 05:51:48Z liguode $
*/
if (!defined('IN_UCHOME')) {
    exit('Access Denied');
}
$uid = 0;
$email = '';
$_GET['hash'] = empty($_GET['hash']) ? '' : trim($_GET['hash']);
if ($_GET['hash']) {
    list($uid, $email) = explode("\t", authcode($_GET['hash'], 'DECODE'));
    $uid = intval($uid);
}
if ($uid && isemail($email)) {
    //检查邮箱唯一性
    if ($_SCONFIG['uniqueemail']) {
        if (getcount('spacefield', array('email' => $email, 'emailcheck' => 1))) {
            showmessage('uniqueemail_recheck');
        }
    }
    // Bonus Points
    getreward('realemail', 1, $uid);
    //修改资料
    updatetable('spacefield', array('email' => addslashes($email), 'emailcheck' => '1', 'newemail' => ''), array('uid' => $uid));
    //跳转页面
    showmessage('email_check_sucess', '', 1, array($email));
} else {
    showmessage('email_check_error');
}
开发者ID:v998,项目名称:discuzx-en,代码行数:30,代码来源:do_emailcheck.php

示例7: empty

} else {
    if (!empty($_SGET['op']) && $_SGET['op'] == 'digest') {
        $cid = empty($_SGET['cid']) ? 0 : intval($_SGET['cid']);
        if (empty($cid)) {
            showmessage('not_found', S_URL);
        }
        $itemid = empty($_SGET['itemid']) ? 0 : intval($_SGET['itemid']);
        if (empty($itemid)) {
            showmessage('not_found', S_URL);
        }
        if ($cid && $itemid && $_SGLOBAL['supe_uid']) {
            $query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('spacecomments') . ' WHERE cid=\'' . $cid . '\'');
            if ($comment = $_SGLOBAL['db']->fetch_array($query)) {
                if (intval($comment['digest']) == 0) {
                    //积分经验,奖励精华评论者
                    getreward('comment_digest', 1, $comment['authorid']);
                    $msg = addslashes($comment['message']) . "<br/><div class=\"old\">" . $lang['digest'] . "</div>";
                    $_SGLOBAL['db']->query("UPDATE " . tname('spacecomments') . " SET message='" . $msg . "' WHERE cid='" . $cid . "'");
                }
                $_SGLOBAL['db']->query('UPDATE ' . tname('spacecomments') . ' SET digest=1 WHERE cid=\'' . $cid . '\'');
            }
        }
    }
}
$perpage = empty($_SCONFIG['commviewnum']) ? 50 : intval($_SCONFIG['commviewnum']);
//显示条数
$page = empty($_SGET['page']) ? 0 : intval($_SGET['page']);
$order = !empty($_SGET['order']) && in_array($_SGET['order'], array('1', '2', '3', '4')) ? intval($_SGET['order']) : 0;
$page = $page < 1 ? 1 : $page;
$start = ($page - 1) * $perpage;
$itemid = empty($_SGET['itemid']) ? 0 : intval($_SGET['itemid']);
开发者ID:superman1982,项目名称:ng-cms,代码行数:31,代码来源:viewcomment.php

示例8: modelpost


//.........这里部分代码省略.........
                        }
                        @unlink(A_DIR . '/' . $defaultmessage[$value['fieldname']]);
                    }
                }
            }
        }
    }
    //内容
    $setsqlarr = $uploadfilearr = $ids = array();
    $setsqlarr = getsetsqlarr($resultmessage);
    $uploadfilearr = $feedcolum = uploadfile($resultmessage, $_POST['mid'], $itemid, 0);
    $setsqlarr['message'] = trim($_POST['message']);
    $setsqlarr['postip'] = $_SGLOBAL['onlineip'];
    if (!empty($uploadfilearr)) {
        foreach ($uploadfilearr as $tmpkey => $tmpvalue) {
            if (empty($tmpvalue['error'])) {
                $setsqlarr[$tmpkey] = $tmpvalue['filepath'];
            }
            if (!empty($tmpvalue['aid'])) {
                $ids[] = $tmpvalue['aid'];
            }
        }
    }
    //添加内容
    if (!empty($modelsinfoarr['allowfilter'])) {
        $setsqlarr = scensor($setsqlarr, 1);
    }
    if (!checkperm('allowdirectpost') || checkperm('managemodpost') || checkperm('allowdirectpost') && $op == 'update') {
        //不需要审核时入message表
        if ($op == 'add') {
            $setsqlarr['itemid'] = $itemid;
            //添加内容
            inserttable($modelsinfoarr['modelname'] . 'message', $setsqlarr);
            getreward('postinfo');
            if (allowfeed() && !empty($_POST['addfeed']) && !empty($_SGLOBAL['supe_uid'])) {
                $feed['icon'] = 'comment';
                $feed['title_template'] = 'feed_model_title';
                $murl = geturl('action/model/name/' . $modelsinfoarr['modelname'] . '/itemid/' . $itemid);
                $aurl = A_URL;
                if (empty($_SCONFIG['siteurl'])) {
                    $siteurl = getsiteurl();
                    $murl = $siteurl . $murl;
                    $aurl = $siteurl . $aurl;
                } else {
                    $siteurl = S_URL_ALL;
                }
                $feed['title_data'] = array('modelname' => '<a href="' . $siteurl . '/m.php?name=' . $modelsinfoarr['modelname'] . '">' . $modelsinfoarr['modelalias'] . '</a>');
                $feed['body_template'] = 'feed_model_message';
                $feed['body_data'] = array('subject' => '<a href="' . $murl . '">' . $_POST['subject'] . '</a>', 'message' => cutstr(strip_tags(preg_replace("/\\[.+?\\]/is", '', $_POST['message'])), 150));
                if (!empty($feedsubjectimg)) {
                    $feed['images'][] = array('url' => $aurl . '/' . $feedsubjectimg['subjectimage']['filepath'], 'link' => $murl);
                } else {
                    foreach ($feedcolum as $feedimgvalue) {
                        if ($feedimgvalue['filepath']) {
                            $feed['images'][] = array('url' => $aurl . '/' . $feedimgvalue['filepath'], 'link' => $murl);
                            break;
                        }
                    }
                    if (empty($feed['images'])) {
                        $picurl = getmessagepic(stripslashes($_POST['message']));
                        if ($picurl && strpos($picurl, '://') === false) {
                            $picurl = $siteurl . '/' . $picurl;
                        }
                        if (!empty($picurl)) {
                            $feed['images'][] = array('url' => $picurl, 'link' => $murl);
                        }
开发者ID:superman1982,项目名称:ng-cms,代码行数:67,代码来源:model.func.php

示例9: cksearch

function cksearch($theurl)
{
    global $_SGLOBAL, $_SCONFIG, $space;
    $theurl = stripslashes($theurl) . "&page=" . $_GET['page'];
    if ($searchinterval = checkperm('searchinterval')) {
        $waittime = $searchinterval - ($_SGLOBAL['timestamp'] - $space['lastsearch']);
        if ($waittime > 0) {
            showmessage('search_short_interval', '', 1, array($waittime, $theurl));
        }
    }
    if (!checkperm('searchignore')) {
        $reward = getreward('search', 0);
        if ($reward['credit'] || $reward['experience']) {
            if (empty($_GET['confirm'])) {
                $theurl .= '&confirm=yes';
                showmessage('points_deducted_yes_or_no', '', 1, array($reward['credit'], $reward['experience'], $theurl));
            } else {
                if ($space['credit'] < $reward['credit'] || $space['experience'] < $reward['experience']) {
                    showmessage('points_search_error');
                } else {
                    //扣分
                    $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET lastsearch='{$_SGLOBAL['timestamp']}', credit=credit-{$reward['credit']}, experience=experience-{$reward['experience']} WHERE uid='{$_SGLOBAL['supe_uid']}'");
                }
            }
        }
    }
}
开发者ID:NaturalWill,项目名称:UCQA,代码行数:27,代码来源:function_common.php

示例10: foreach

    }
    $pollnum = 0;
    foreach ($votekeys as $votekey) {
        if (isset($options[$votekey]['num'])) {
            $options[$votekey]['num']++;
            $pollnum++;
        } else {
            showmessage('no_votekey');
        }
    }
    $options = addslashes(serialize($options));
    $voters[] = $ip;
    $voters = addslashes(serialize($voters));
    $_SGLOBAL['db']->query('UPDATE ' . tname('polls') . ' SET pollnum=pollnum+' . $pollnum . ', updatetime=' . $_SGLOBAL['timestamp'] . ', options=\'' . $options . '\', voters=\'' . $voters . '\' WHERE pollid=\'' . $pollid . '\'');
    //积分 和 经验
    getreward('postvote');
    showmessage('do_success', geturl('action/poll/pollid/' . $pollid));
}
$poll['options'] = unserialize($poll['options']);
if (empty($poll['voters'])) {
    $poll['voters'] = array();
} else {
    $poll['voters'] = unserialize($poll['voters']);
}
//投票人数
$poll['votersnum'] = count($poll['voters']);
$poll['dateline'] = sgmdate($poll['dateline'], 'Y-m-d H:i:s');
$poll['updatetime'] = sgmdate($poll['updatetime'], 'Y-m-d H:i:s');
foreach ($poll['options'] as $key => $options) {
    $options['percent'] = @sprintf("%01.2f", $options['num'] * 100 / $poll['pollnum']);
    $poll['options'][$key] = $options;
开发者ID:hongz1125,项目名称:devil,代码行数:31,代码来源:poll.php

示例11: array

    $psetarr = array('tagid' => $tagid, 'tid' => $tid, 'uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'ip' => getonlineip(), 'dateline' => $_SGLOBAL['timestamp'], 'message' => $msg, 'isthread' => 1);
    //添加
    inserttable('post', $psetarr);
    //更新群组统计
    $_SGLOBAL['db']->query("UPDATE " . tname("mtag") . " SET threadnum=threadnum+1 WHERE tagid='{$tagid}'");
    //统计
    updatestat('thread');
    //更新用户统计
    if (empty($space['threadnum'])) {
        $space['threadnum'] = getcount('thread', array('uid' => $space['uid']));
        $threadnumsql = "threadnum=" . $space['threadnum'];
    } else {
        $threadnumsql = 'threadnum=threadnum+1';
    }
    //积分
    $reward = getreward('publishthread', 0);
    $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET {$threadnumsql}, lastpost='{$_SGLOBAL['timestamp']}', updatetime='{$_SGLOBAL['timestamp']}', credit=credit+{$reward['credit']}, experience=experience+{$reward['experience']} WHERE uid='{$_SGLOBAL['supe_uid']}'");
    $returnarr = array("tagid" => $tagid, "tid" => $tid);
    echo json_encode($returnarr);
    return;
}
if ($_GET['sync'] == 'false') {
    if ($_POST['remember'] == "true") {
        $_SGLOBAL['db']->query("UPDATE " . tname("space") . " SET overseas_tip='never' WHERE uid='" . $_SGLOBAL['supe_uid'] . "'");
        $_SGLOBAL['db']->query("UPDATE " . tname("spaceforeign") . " SET sync='no'  WHERE uid='" . $_SGLOBAL['supe_uid'] . "'");
    }
    return;
}
include template('cp_doing');
//ɸѡ
function ckicon_uid($feed)
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:cp_doing.php

示例12: exit

<?php

/*
	[UCenter Home] (C) 2007-2008 Comsenz Inc.
	$Id: cp_invite.php 12971 2009-07-31 07:04:02Z liguode $
*/
if (!defined('IN_UCHOME')) {
    exit('Access Denied');
}
$siteurl = getsiteurl();
$maxcount = 50;
//最多好友邀请
$reward = getreward('invitecode', 0);
$appid = empty($_GET['app']) ? 0 : intval($_GET['app']);
$inviteapp = $invite_code = '';
if (empty($reward['credit']) || $appid) {
    $reward['credit'] = 0;
    $invite_code = space_key($space, $appid);
}
$siteurl = getsiteurl();
$spaceurl = $siteurl . 'space.php?uid=' . $_SGLOBAL['supe_uid'];
$mailvar = array("<a href=\"{$spaceurl}\">" . avatar($space['uid'], 'middle') . "</a><br>" . $_SN[$space['uid']], $_SN[$space['uid']], $_SCONFIG['sitename'], '', '', $spaceurl, '');
//取出相应的应用
$appinfo = array();
if ($appid) {
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('myapp') . " WHERE appid='{$appid}'");
    $appinfo = $_SGLOBAL['db']->fetch_array($query);
    if ($appinfo) {
        $inviteapp = "&amp;app={$appid}";
        $mailvar[6] = $appinfo['appname'];
    } else {
开发者ID:AlexChien,项目名称:ey_uhome,代码行数:31,代码来源:cp_invite.php

示例13: showmessage

     //不能小于4个字符
     showmessage('realname_too_short');
 }
 if ($setarr['name'] != $space['name'] || $setarr['namestatus']) {
     //第一次填写实名
     if ($_SCONFIG['realname'] && empty($space['name']) && $setarr['name'] != $space['name'] && $setarr['namestatus']) {
         $reward = getreward('realname', 0);
         if ($reward['credit']) {
             $setarr['credit'] = $space['credit'] + $reward['credit'];
         }
         if ($reward['experience']) {
             $setarr['experience'] = $space['experience'] + $reward['experience'];
         }
     } elseif ($_SCONFIG['realname'] && $space['namestatus'] && !checkperm('managename')) {
         //扣减积分
         $reward = getreward('editrealname', 0);
         //积分
         if ($space['name'] && $setarr['name'] != $space['name'] && ($reward['credit'] || $reward['experience'])) {
             //验证经验值
             if ($space['experience'] >= $reward['experience']) {
                 $setarr['experience'] = $space['experience'] - $reward['experience'];
             } else {
                 showmessage('experience_inadequate', '', 1, array($space['experience'], $reward['experience']));
             }
             if ($space['credit'] >= $reward['credit']) {
                 $setarr['credit'] = $space['credit'] - $reward['credit'];
             } else {
                 showmessage('integral_inadequate', '', 1, array($space['credit'], $reward['credit']));
             }
         }
     }
开发者ID:AlexChien,项目名称:ey_uhome,代码行数:31,代码来源:cp_profile.php

示例14: empty

	$Id: batch.download.php 13342 2009-09-16 05:43:20Z zhaofei $
*/
include_once './common.php';
$aid = empty($_GET['aid']) ? 0 : intval($_GET['aid']);
if (empty($aid)) {
    exit('Access Denied');
}
$query = $_SGLOBAL['db']->query('SELECT a.*, i.* FROM ' . tname('attachments') . ' a LEFT JOIN ' . tname('spaceitems') . ' i ON i.itemid=a.itemid WHERE a.aid=\'' . $aid . '\'');
if ($item = $_SGLOBAL['db']->fetch_array($query)) {
    //权限
    $channel = $item['type'];
    if (!checkperm('allowgetattach')) {
        showmessage('no_permission');
    }
    //积分、经验
    if (!getreward('download')) {
        showmessage('credit_not_enough');
    }
} else {
    showmessage('not_found');
}
$_SGLOBAL['db']->query('UPDATE ' . tname('attachments') . ' SET downloads=downloads+1 WHERE aid=\'' . $aid . '\'');
$filename = A_DIR . '/' . $item['filepath'];
if (is_readable($filename)) {
    if (!empty($item['isimage'])) {
        echo '<img src="' . A_URL . '/' . $item['filepath'] . '" />';
    } else {
        header('Cache-control: max-age=31536000');
        header('Expires: ' . gmdate('D, d M Y H:i:s', $_SGLOBAL['timestamp'] + 31536000) . ' GMT');
        header('Content-Encoding: none');
        $item['filename'] = strtolower($_SCONFIG['charset']) == 'utf-8' && strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? urlencode($item['filename']) : $item['filename'];
开发者ID:hongz1125,项目名称:devil,代码行数:31,代码来源:batch.download.php

示例15: addslashes

     $message = addslashes("<div class=\"quote\"><span class=\"q\"><b>" . $_SN[$post['uid']] . "</b>: " . getstr($post['message'], 150, 0, 0, 0, 2, 1) . '</span></div>') . $message;
 }
 $anonymous = empty($_POST['anonymous']) ? 0 : intval($_POST['anonymous']);
 $setarr = array('tagid' => intval($thread['tagid']), 'anonymous' => $anonymous, 'tid' => $tid, 'uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'ip' => getonlineip(), 'dateline' => $_SGLOBAL['timestamp'], 'message' => $message);
 $pid = inserttable('post', $setarr, 1);
 //邮件通知
 smail($thread['uid'], '', cplang('mtag_reply', array($_SN[$space['uid']], shtmlspecialchars(getsiteurl() . "space.php?uid={$thread['uid']}&do=thread&id={$thread['tid']}"))), '', 'mtag_reply');
 //更新统计数据
 $last_author_name = $anonymous ? 'null' : $_SGLOBAL[supe_username];
 $_SGLOBAL['db']->query("UPDATE " . tname('thread') . "\r\n\t\tSET replynum=replynum+1, lastpost='{$_SGLOBAL['timestamp']}', lastauthor='{$last_author_name}', lastauthorid='{$_SGLOBAL['supe_uid']}'\r\n\t\tWHERE tid='{$tid}'");
 //更新群组统计
 $_SGLOBAL['db']->query("UPDATE " . tname("mtag") . " SET postnum=postnum+1 WHERE tagid='{$thread['tagid']}'");
 //普通回复
 if (empty($post) && $thread['uid'] != $_SGLOBAL['supe_uid']) {
     //积分
     getreward('replythread', 1, 0, $thread['tid']);
     realname_set($thread['uid'], $thread['username']);
     realname_get();
     if (empty($mtag['viewperm'])) {
         $fs = array();
         $fs['icon'] = 'post';
         $fs['body_template'] = '';
         $fs['body_data'] = array();
         $fs['body_general'] = '';
         $fs['title_template'] = cplang('feed_thread_reply');
         $fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$thread['uid']}\">" . $_SN[$thread['uid']] . "</a>", 'thread' => "<a href=\"space.php?uid={$thread['uid']}&do=thread&id={$thread['tid']}\">{$thread['subject']}</a>");
         if (ckprivacy('post', 1)) {
             feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general']);
         }
     }
     //通知
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:cp_thread.php


注:本文中的getreward函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。