Exemplo n.º 1
0
 function creditcheck($user, $groupid)
 {
     if ($this->foruminfo['allowvisit']) {
         return;
     }
     $check = 1;
     $this->forumset['rvrcneed'] = intval($this->forumset['rvrcneed']);
     $this->forumset['moneyneed'] = intval($this->forumset['moneyneed']);
     $this->forumset['creditneed'] = intval($this->forumset['creditneed']);
     $this->forumset['postnumneed'] = intval($this->forumset['postnumneed']);
     if ($this->forumset['rvrcneed'] && intval($user['rvrc'] / 10) < $this->forumset['rvrcneed']) {
         $check = 0;
     } elseif ($this->forumset['moneyneed'] && $user['money'] < $this->forumset['moneyneed']) {
         $check = 0;
     } elseif ($this->forumset['creditneed'] && $user['credit'] < $this->forumset['creditneed']) {
         $check = 0;
     } elseif ($this->forumset['postnumneed'] && $user['postnum'] < $this->forumset['postnumneed']) {
         $check = 0;
     }
     if (!$check) {
         if ($groupid == 'guest') {
             Showmsg('forum_guestlimit');
         } else {
             $GLOBALS['forumset'] = $this->forumset;
             Showmsg('forum_creditlimit');
         }
     }
 }
Exemplo n.º 2
0
function CheckUserTool($uid, $tooldb)
{
    global $db, $groupid, $credit;
    if (!$tooldb['state']) {
        Showmsg('tool_close');
    }
    $condition = unserialize($tooldb['conditions']);
    if ($condition['group'] && strpos($condition['group'], ",{$groupid},") === false) {
        Showmsg('tool_grouplimit');
    }
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $userdb = $userService->get($uid, false, true);
    require_once R_P . 'require/credit.php';
    $creditdb = $credit->get($uid, 'CUSTOM');
    foreach ($condition['credit'] as $key => $value) {
        if ($value) {
            if (is_numeric($key)) {
                $creditdb[$key] < $value && Showmsg('tool_creditlimit');
            } elseif ($userdb[$key] < $value) {
                Showmsg('tool_creditlimit');
            }
        }
    }
}
Exemplo n.º 3
0
 function _delete()
 {
     if (!$this->stopic_service->isAllowDeleteCategory($this->categoryid)) {
         Showmsg("对不起,分类下还有专题或者是系统默认分类,不能删除", $this->jump);
     }
     intval($this->categoryid) > 0 && $this->stopic_service->deleteCategory($this->categoryid);
 }
Exemplo n.º 4
0
 function Mailconfig($smtp = array())
 {
     $this->S_method = $smtp['method'];
     if (!($this->smtp['ifopen'] = $smtp['ifopen'])) {
         Showmsg('mail_close');
     }
     if ($this->S_method == 1) {
         //不用设置
     } elseif ($this->S_method == 2) {
         $this->smtp['host'] = $smtp['host'];
         $this->smtp['port'] = $smtp['port'];
         $this->smtp['auth'] = $smtp['auth'];
         $this->smtp['from'] = $smtp['from'];
         $this->smtp['user'] = $smtp['user'];
         $this->smtp['pass'] = $smtp['pass'];
     } elseif ($this->S_method == 3) {
         $this->smtp['port'] = $smtp['port'];
         $this->smtp['auth'] = $smtp['auth'];
         $this->smtp['from'] = $smtp['from'];
         $this->smtp['smtphelo'] = $smtp['smtphelo'];
         $this->smtp['smtpmxmailname'] = $smtp['smtpmxmailname'];
         $this->smtp['mxdns'] = $smtp['mxdns'];
         $this->smtp['mxdnsbak'] = $smtp['mxdnsbak'];
         //hacker
     } else {
         //hacker
     }
 }
Exemplo n.º 5
0
 function init($id)
 {
     $this->_hid = $id;
     require_once R_P . 'mode/house/require/core.php';
     $houseService = house::loadClass('house');
     $housefieldsService = House::loadService('HouseFieldsService');
     $house = $houseService->getHouseInfoByHid($id);
     empty($house) && Showmsg('data_error');
     $title = $content = sprintf("[url=%s] %s [/url]", $this->_url . "&q=info&hid=" . $this->_hid, $house['name']);
     $position = '';
     if ($house['area']) {
         $areaField = $housefieldsService->getCompsiteFieldsByType('area');
         //所属区域
         $area = $areaField[$house['area']];
         $area = sprintf("[url=%s] %s [/url]", $this->_url . "&q=list&area=" . $house['area'], $area);
         $postion .= $area;
     }
     if ($house['plate']) {
         $plateField = $housefieldsService->getCompsiteFieldsByType('plate');
         //所在商圈
         $plate = $plateField[$house['plate']];
         $plate = sprintf("[url=%s] %s [/url]", $this->_url . "&q=list&plate=" . $house['plate'], $plate);
         $postion .= $plate;
     }
     $postion .= $house['address'];
     $mailSubject = getLangInfo('app', 'house_recommend');
     $mailContent = getLangInfo('app', 'ajax_sendweibo_houseinfo', array('title' => $title, 'postion' => $postion));
     $this->_content = $content;
     $this->_mailSubject = $mailSubject;
     $this->_mailContent = $mailContent;
 }
Exemplo n.º 6
0
function getGroupByCyid($cyid)
{
    global $winduid, $db;
    $colony = $db->get_one("SELECT c.*,cm.id AS ifcyer,cm.ifadmin,cm.lastvisit FROM pw_colonys c LEFT JOIN pw_cmembers cm ON c.id=cm.colonyid AND cm.uid=" . S::sqlEscape($winduid) . ' WHERE c.id=' . S::sqlEscape($cyid));
    empty($colony) && Showmsg('data_error');
    return $colony;
}
 function _checkData($data)
 {
     if (!is_array($data) || !count($data)) {
         Showmsg('data_is_not_array');
     }
     $data = $this->_checkAllowField($data, $this->getStruct());
     return $data;
 }
Exemplo n.º 8
0
function forum_sell($fid)
{
    global $db, $winduid, $timestamp;
    $rt = $db->get_one("SELECT MAX(overdate) AS u FROM pw_forumsell WHERE uid=" . pwEscape($winduid) . ' AND fid=' . pwEscape($fid));
    if ($rt['u'] < $timestamp) {
        Showmsg('forum_sell');
    }
}
Exemplo n.º 9
0
 function insertData($array)
 {
     $array = $this->_checkData($array);
     if (!$array['name'] || !$array['tagcode']) {
         Showmsg('tpl_insert_data_error');
     }
     $this->_db->update("INSERT INTO " . $this->_tableName . " SET " . pwSqlSingle($array, false));
     return $this->_db->insert_id();
 }
Exemplo n.º 10
0
function app_router($app)
{
    (empty($app) || !is_dir($basePath = A_P . $app)) && Showmsg('undefined_action');
    $baseFile = $basePath . '/index.php';
    if (!file_exists($baseFile)) {
        Showmsg("包含文件不存在,请创建index.php");
    }
    return array($basePath, $baseFile);
}
Exemplo n.º 11
0
 function GetInfo($init, $reality = false)
 {
     global $db, $db_cachenum;
     if (M_E != $init) {
         Showmsg('element_can_not_construct');
     } else {
         $this->db = $db;
         $this->cachenum = intval($db_cachenum) ? intval($db_cachenum) : 20;
         $this->reality = $reality;
     }
 }
Exemplo n.º 12
0
 function alipayurl($order_no, $fee, $paytype, $extra = '')
 {
     $param = array('_input_charset' => $this->charset, 'service' => 'create_direct_pay_by_user', 'notify_url' => $this->baseurl . '/alipay.php', 'return_url' => $this->baseurl . '/alipay.php', 'payment_type' => '1', 'subject' => getLangInfo('olpay', "olpay_{$paytype}_title", array('order_no' => $order_no)), 'body' => getLangInfo('olpay', "olpay_{$paytype}_content"), 'out_trade_no' => $order_no, 'total_fee' => $fee, 'extra_common_param' => $this->formatExtra($extra), 'seller_email' => $this->seller_email);
     if ($this->alipay_key && $this->alipay_partnerID) {
         $url = $this->urlCompound($this->alipay_url, $this->alipay_partnerID, $this->alipay_key, $param);
     } else {
         Showmsg('支付失败,本站点尚未填写支付宝商户信息(partnerID和key),请登录后台->网上支付填写!');
         $url = $this->urlCompound($this->pwpay_url, $this->pwpay_partnerID, $this->pwpay_key, $param);
     }
     return $url;
 }
Exemplo n.º 13
0
 function initData()
 {
     global $timestamp;
     !$_POST['vt_select'] && Showmsg('postfunc_noempty');
     $vt_select = S::getGP('vt_select', 'P');
     $vt_select = explode("\n", $vt_select);
     $votearray = array();
     foreach ($vt_select as $key => $option) {
         if ($option = trim($option)) {
             $votearray[] = array(stripslashes($option), 0);
         }
     }
     $vtcount = count($votearray);
     if ($vtcount > $this->maxselect) {
         Showmsg('vote_num_limit');
     }
     $regdatelimit = S::getGP('regdatelimit', 'P');
     $multiplevote = intval(S::getGP('multiplevote', 'P'));
     $mostvotes = intval(S::getGP('mostvotes', 'P'));
     $timelimit = intval(S::getGP('timelimit', 'P'));
     $modifiable = intval(S::getGP('modifiable', 'P'));
     $previewable = intval(S::getGP('previewable', 'P'));
     $leastvotes = intval(S::getGP('leastvotes', 'P'));
     $postnumlimit = intval(S::getGP('postnumlimit', 'P'));
     if (empty($multiplevote)) {
         $mostvotes = 1;
     } elseif ($mostvotes > $vtcount || $mostvotes < 1) {
         $mostvotes = $vtcount;
     }
     if (empty($multiplevote) || $leastvotes > $mostvotes || $leastvotes < 1) {
         $leastvotes = 1;
     }
     $timelimit < 0 && ($timelimit = 0);
     $postnumlimit < 0 && ($postnumlimit = 0);
     $regdatelimit = strtotime($regdatelimit);
     $regdatelimit = $regdatelimit > $timestamp ? $timestamp : $regdatelimit;
     $creditlimit = S::getGP('creditlimit', 'P');
     $creditlimit_temp = array();
     foreach ($creditlimit as $key => $value) {
         if (!empty($value)) {
             $creditlimit_temp[$key] = (int) $value;
         }
     }
     $this->data['voteopts'] = serialize($votearray);
     $this->data['modifiable'] = $modifiable;
     $this->data['previewable'] = $previewable;
     $this->data['multiple'] = $multiplevote;
     $this->data['mostvotes'] = $mostvotes;
     $this->data['leastvotes'] = $leastvotes;
     $this->data['timelimit'] = $timelimit;
     $this->data['regdatelimit'] = $regdatelimit;
     $this->data['creditlimit'] = serialize($creditlimit_temp);
     $this->data['postnumlimit'] = $postnumlimit;
 }
Exemplo n.º 14
0
 function check()
 {
     global $db_allowupload, $winddb, $_G, $tdtime;
     if (!$db_allowupload) {
         Showmsg('upload_close');
     }
     if ($winddb['uploadtime'] < $tdtime) {
         $winddb['uploadnum'] = 0;
     }
     if ($_G['allownum'] > 0 && $winddb['uploadnum'] + count($_FILES) + count($this->flashatt) > $_G['allownum']) {
         Showmsg('upload_num_error');
     }
 }
Exemplo n.º 15
0
function checkCreditLimit($creditlimit)
{
    global $winddb, $winduid, $db;
    $creditlimit = unserialize($creditlimit);
    foreach ((array) $creditlimit as $key => $value) {
        if (in_array($key, array('money', 'rvrc', 'credit', 'currency'))) {
            $key == 'rvrc' && ($winddb[$key] = floor($winddb[$key] / 10));
            $winddb[$key] < $value && Showmsg('job_vote_creditlimit');
        } else {
            $user_credit = $db->get_value("SELECT value FROM pw_membercredit WHERE uid=" . S::sqlEscape($winduid) . " AND cid=" . S::sqlEscape($key));
            $user_credit < $value && Showmsg('job_vote_creditlimit');
        }
    }
}
Exemplo n.º 16
0
 function _setData()
 {
     $goodsname = S::escapeChar(S::getGP('goodsname'));
     $price = S::escapeChar(S::getGP('price'));
     $costprice = S::escapeChar(S::getGP('costprice'));
     $locus = S::escapeChar(S::getGP('locus'));
     $mailfee = S::escapeChar(S::getGP('mailfee'));
     $expressfee = S::escapeChar(S::getGP('expressfee'));
     $emsfee = S::escapeChar(S::getGP('emsfee'));
     $icon = S::escapeChar(S::getGP('attachment_1'));
     $degree = intval(S::getGP('degree'));
     $ptype = intval(S::getGP('ptype'));
     $goodsnum = intval(S::getGP('goodsnum'));
     $paymethod = S::escapeChar(S::getGP('paymethod'), 1);
     $transport = intval(S::getGP('transport'));
     !$goodsname && ($goodsname = S::escapeChar($_POST['atc_title']));
     if (!is_numeric($costprice) || $costprice <= 0) {
         Showmsg('goods_setprice');
     }
     $goodsnum < 1 && Showmsg('goods_num_error');
     $paymethod && ($paymethod = array_sum($paymethod));
     $paymethod < 1 && Showmsg('goods_pay_error');
     !is_numeric($price) && ($price = 0);
     if ($transport) {
         !is_numeric($mailfee) && ($mailfee = 0);
         !is_numeric($expressfee) && ($expressfee = 0);
         !is_numeric($emsfee) && ($emsfee = 0);
         if (!$mailfee && !$expressfee && !$emsfee) {
             Showmsg('goods_logistics');
         }
     } else {
         $mailfee = $expressfee = $emsfee = 0;
     }
     $goodsicon = '';
     $this->data['name'] = $goodsname;
     $this->data['price'] = $price;
     $this->data['costprice'] = $costprice;
     $this->data['locus'] = $locus;
     $this->data['mailfee'] = $mailfee;
     $this->data['expressfee'] = $expressfee;
     $this->data['emsfee'] = $emsfee;
     $this->data['degree'] = $degree;
     $this->data['type'] = $ptype;
     $this->data['num'] = $goodsnum;
     $this->data['paymethod'] = $paymethod;
     $this->data['transport'] = $transport;
     $icon && ($this->data['icon'] = $icon);
 }
Exemplo n.º 17
0
 function init($id)
 {
     $this->_cid = $id;
     require_once R_P . 'mode/cms/require/core.php';
     $articleDB = C::loadDB('article');
     $article = $articleDB->get($this->_cid);
     empty($article) && Showmsg('data_error');
     $this->_url = $this->_url . "&id=" . $this->_cid;
     $title = $content = '我发现了一篇文章' . sprintf("[url=%s] %s [/url]", urlRewrite($this->_url), $article['subject']) . ',特别推荐。';
     $descrip = $article['descrip'];
     $mailSubject = getLangInfo('app', 'cms_recommend');
     $mailContent = getLangInfo('app', 'ajax_sendweibo_cmsinfo', array('title' => $title, 'descrip' => $descrip));
     $this->_content = $content;
     $this->_mailSubject = $mailSubject;
     $this->_mailContent = $mailContent;
 }
Exemplo n.º 18
0
 function setOpts($opts, $oldopts = array())
 {
     $array = array();
     foreach ($opts as $key => $value) {
         if ($value = trim($value)) {
             $array[$key] = array(stripslashes($value), isset($oldopts[$key][1]) ? $oldopts[$key][1] : 0);
         }
     }
     $vtcount = count($array);
     if ($vtcount < 1) {
         Showmsg('postfunc_noempty');
     } elseif ($vtcount > $this->maxselect) {
         Showmsg('vote_num_limit');
     }
     $this->data['voteopts'] = serialize($array);
     return $vtcount;
 }
Exemplo n.º 19
0
 function check()
 {
     global $db_allowupload, $_G, $winddb;
     if (!$db_allowupload) {
         Showmsg('upload_close');
     } elseif ($_G['allowupload'] == 0) {
         Showmsg('upload_group_right');
     }
     if ($winddb['uploadtime'] < $GLOBALS['tdtime']) {
         $winddb['uploadnum'] = 0;
         $userService = L::loadClass('UserService', 'user');
         /* @var $userService PW_UserService */
         $userService->update($this->uid, array(), array('uploadnum' => 0));
     }
     if ($_G['allownum'] > 0 && $winddb['uploadnum'] + count($_FILES) + count($this->flashatt) >= $_G['allownum']) {
         Showmsg('upload_num_error');
     }
 }
Exemplo n.º 20
0
 function _checkData()
 {
     $title = trim($this->_rateconfig['title']);
     $icon = trim($this->_rateconfig['icon']);
     $typeid = in_array($this->_rateconfig['typeid'], array(1, 2, 3)) ? $this->_rateconfig['typeid'] : 1;
     $isopen = in_array($this->_rateconfig['isopen'], array(1, 0)) ? $this->_rateconfig['isopen'] : 1;
     $jumpUrl = $this->_getDefaultUrl() . "&typeid=" . $typeid;
     if ($title == "" || $icon == "") {
         Showmsg("对不起,标题或图标不能为空不能为空", $jumpUrl);
     }
     if (strlen($title) > 6) {
         Showmsg("对不起,标题长度不能大于6个字节", $jumpUrl);
     }
     $iconExt = substr($icon, strrpos($icon, ".") + 1);
     if (!in_array($iconExt, array("gif", "png", "jpg", "jpeg"))) {
         Showmsg("对不起,图标格式不正确,请确定后缀是gif,png,jpg或jpeg", $jumpUrl);
     }
     return array($title, $icon, $typeid, $isopen, $jumpUrl);
 }
Exemplo n.º 21
0
 function tplParsePW()
 {
     $invokeService = $this->_getinvokeService();
     $reg = $this->_pregPW();
     $replace = array();
     foreach ($reg[1] as $id => $val) {
         $parsePW = $this->_initParesPW($val);
         $pwName = $this->_getPWName($parsePW);
         if (!$pwName) {
             continue;
         }
         $temp = $invokeService->getInvokeByName($pwName);
         if (!$temp) {
             Showmsg($pwName . 'parse pw error');
         }
         $replace[$id] = $this->_adminDiv($temp['parsecode'], $pwName, $temp['title']);
     }
     $this->string = str_replace($reg[0], $replace, $this->string);
 }
Exemplo n.º 22
0
 function _modify()
 {
     //先删除,这样就能少做更新操作
     //考虑到每条SQL不可共同,每次都执行foreach循环更新,而且删除需要判断是否可以删除
     if ($this->background_check != "" && $this->background_delete != "") {
         foreach ($this->background_check as $pictureId => $value) {
             if ($value != 1) {
                 continue;
             }
             $result = $this->stopic_service->deletePicture($pictureId);
             !$result && Showmsg("对不起,背景图片已在使用中", $this->jump);
         }
     }
     if ($this->background_select != "" && $this->background_update != "") {
         foreach ($this->background_select as $pictureId => $categoryId) {
             $result = $this->stopic_service->updatePicture(array("categoryid" => $categoryId), $pictureId);
             //(! $result) && Showmsg ( "对不起,背景图片分类更新失败", $this->jump );
         }
     }
 }
Exemplo n.º 23
0
 function replaceCommentTag()
 {
     $ajax_comment_file = DEDETEMPLATE . '/default/ajaxfeedback.htm';
     $ajax_comment_file_bak = DEDETEMPLATE . '/default/ajaxfeedback.bak.htm';
     if (file_exists($ajax_comment_file)) {
         if (!file_exists($ajax_comment_file_bak)) {
             $ret = copy($ajax_comment_file, $ajax_comment_file_bak);
             if (!$ret) {
                 Showmsg('备份' . $ajax_comment_file . '失败,请检查该目录权限,或手动复制到' . $ajax_comment_file_bak, -1, 0, 2000);
             }
         }
         file_put_contents($ajax_comment_file, Duoshuo_Dedecms::$commentTag);
         if (isset($_POST['next_step'])) {
             Showmsg('备份成功!', './duoshuo.php?action=' . $_POST['next_step'], 0, 1000);
         } else {
             Showmsg('备份成功!', './duoshuo.php?action=localConfig', 0, 1000);
         }
     } else {
         Showmsg(DEDETEMPLATE . '/default/ajaxfeedback.bak.htm' . '不存在,请手动插入标签', './duoshuo.php?action=localConfig', 0, 2000);
     }
 }
Exemplo n.º 24
0
 function addCredit($action)
 {
     global $credit, $onlineip;
     require_once R_P . 'require/credit.php';
     $logdata = array('uid' => $this->post->uid, 'username' => $this->post->username, 'ip' => $onlineip, 'fname' => $this->forum->name, 'cbtype' => $credit->cType[$this->data['cbtype']], 'cbval' => $this->data['cbval'], 'catype' => $credit->cType[$this->data['catype']], 'caval' => $this->data['caval']);
     if ($this->data['cbtype'] == $this->data['catype']) {
         $reduce = $this->data['cbval'] * 2 + $this->data['caval'];
         $credit->get($this->post->uid, $this->data['cbtype']) < $reduce && Showmsg('reward_credit_limit');
         $credit->addLog('reward_' . $action, array($this->data['cbtype'] => -$reduce), $logdata);
         $credit->set($this->post->uid, $this->data['cbtype'], -$reduce, false);
     } else {
         foreach (array('cb', 'ca') as $key => $val) {
             $ctype = $this->data[$val . 'type'];
             $cval = $this->data[$val . 'val'];
             $reduce = $cval * ($val == 'cb' ? 2 : 1);
             $credit->get($this->post->uid, $ctype) < $reduce && Showmsg('reward_credit_limit');
             $credit->addLog('reward_' . $action, array($ctype => -$reduce), $logdata);
             $credit->set($this->post->uid, $ctype, -$reduce, false);
         }
     }
 }
Exemplo n.º 25
0
function CheckUserTool($uid, $tooldb)
{
    global $db, $groupid, $credit;
    if (!$tooldb['state']) {
        Showmsg('tool_close');
    }
    $condition = unserialize($tooldb['conditions']);
    if ($condition['group'] && strpos($condition['group'], ",{$groupid},") === false) {
        Showmsg('tool_grouplimit');
    }
    $userdb = $db->get_one("SELECT postnum,digests,rvrc,money,credit FROM pw_memberdata WHERE uid=" . pwEscape($uid));
    require_once R_P . 'require/credit.php';
    $creditdb = $credit->get($uid, 'CUSTOM');
    foreach ($condition['credit'] as $key => $value) {
        if ($value) {
            if (is_numeric($key)) {
                $creditdb[$key] < $value && Showmsg('tool_creditlimit');
            } elseif ($userdb[$key] < $value) {
                Showmsg('tool_creditlimit');
            }
        }
    }
}
Exemplo n.º 26
0
 function _setData()
 {
     global $timestamp;
     $endtime = S::escapeChar(S::getGP('endtime'));
     $obtitle = S::escapeChar(S::getGP('obtitle'));
     $retitle = S::escapeChar(S::getGP('retitle'));
     $umpire = S::escapeChar(S::getGP('umpire'));
     $endtime = PwStrtoTime($endtime);
     $endtime < $timestamp && Showmsg('debate_time');
     if (empty($obtitle) || empty($retitle)) {
         Showmsg('debate_notitle');
     } elseif (strlen($obtitle) > 255 || strlen($retitle) > 255) {
         Showmsg('debate_titlelen');
     }
     if ($umpire) {
         $umpireuid = $this->db->get_value("SELECT uid FROM pw_members WHERE username=" . S::sqlEscape($umpire));
         empty($umpireuid) && Showmsg('debate_noumpire');
     }
     $this->data['endtime'] = $endtime;
     $this->data['obtitle'] = $obtitle;
     $this->data['retitle'] = $retitle;
     $this->data['umpire'] = $umpire;
     $this->data['postdate'] = $timestamp;
 }
Exemplo n.º 27
0
 if ($postCate) {
     //团购初始化
     $postCate->initData();
     $postdata->setData('special', 20 + $postCate->pcid);
 }
 if ($postActForBbs) {
     //活动初始化
     $postActForBbs->initData();
     $postdata->setData('special', 8);
 }
 if ($buildIfcheck) {
     //抢楼
     $robbuildService = L::loadClass("robbuild", 'forum');
     $fieldsdata = array('authorid' => $winduid, 'starttime' => $robstarttime, 'endtime' => $robendtime, 'endbuild' => $robendbuild, 'awardbuilds' => $robawardbuilds, 'postdate' => $timestamp);
     if ($message = $robbuildService->checkAddData($foruminfo['allowrob'], $fieldsdata)) {
         Showmsg($message);
     }
     $robbuildService->initData($fieldsdata);
     $postdata->setStatus('2');
     $postdata->setStatus('7');
 }
 L::loadClass('attupload', 'upload', false);
 /*上传错误检查
 	$return = PwUpload::checkUpload();
 	$return !== true && Showmsg($return);
 	end*/
 if (PwUpload::getUploadNum() || $flashatt) {
     S::gp(array('savetoalbum', 'albumid'), 'P', 2);
     $postdata->att = new AttUpload($winduid, $flashatt, $savetoalbum, $albumid);
     $postdata->att->check();
 }
Exemplo n.º 28
0
    $messageServer->markMessage($winduid, $message['rid']);
    $message['content'] = messageReplace($message['content']);
    $notReadCount = (int) $messageServer->countNoticesNotRead($winduid);
} elseif ($action == 'next') {
    if (!($message = $messageServer->getDownNotice($winduid, $rid, $smstype))) {
        Showmsg("已经是最后一条" . $chineseName[$smstype]);
    }
    $messageServer->markMessage($winduid, $message['rid']);
    $message['content'] = messageReplace($message['content']);
    $notReadCount = (int) $messageServer->countNoticesNotRead($winduid);
} elseif ($action == 'info') {
    if (!$messageServer->getRelation($winduid, $rid)) {
        Showmsg("该条消息你无权查看");
    }
    if (!($message = $messageServer->getMessage($mid))) {
        Showmsg("该条消息不存在");
    }
    $message['rid'] = $rid;
    //改写通知是否已读状态
    $messageServer->markMessage($winduid, $rid);
    $message['content'] = messageReplace($message['content']);
    $notReadCount = (int) $messageServer->countNoticesNotRead($winduid);
}
if ($smstype && in_array($action, array('info', 'next', 'previous'))) {
    $navtype = $messageServer->getReverseConst($smstype);
    $navtype = explode('_', $navtype);
    $nav[$navtype[1]] = 'class = current';
}
if (empty($action) || in_array($action, array('unread', 'system', 'postcate', 'active', 'apps', 'comment', 'guestbook'))) {
    if ($action != 'unread') {
        $notReadCount = (int) $messageServer->countNoticesNotRead($winduid);
Exemplo n.º 29
0
    $msg_guide = $pwforum->headguide($guidename);
    require_once PrintEot('post');
    footer();
} elseif ($_POST['step'] == 1) {
    if (!$pwpost->isGM) {
        if ($winduid != $atcdb['authorid'] && !pwRights($pwpost->isBM, 'modother')) {
            Showmsg('modify_del_right');
        } elseif ($_G['allowdelatc'] == 0) {
            Showmsg('modify_group_right');
        }
    }
    $pw_posts = GetPtable('N', $tid);
    $rt = $db->get_one("SELECT COUNT(*) AS count FROM {$pw_posts} WHERE tid=" . pwEscape($tid) . " AND ifcheck='1'");
    $count = $rt['count'] + 1;
    if ($article == 0 && !$admincheck && $count > 1) {
        Showmsg('modify_replied');
    }
    $rs = $db->get_one("SELECT replies,topped,tpcstatus FROM pw_threads WHERE tid=" . pwEscape($tid));
    $thread_tpcstatus = $rs['tpcstatus'];
    if ($rs['replies'] != $rt['count']) {
        $db->update("UPDATE pw_threads SET replies=" . pwEscape($rt['count']) . "WHERE tid=" . pwEscape($tid));
    }
    require_once R_P . 'require/credit.php';
    $creditset = $credit->creditset($creditset, $db_creditset);
    if ($atcdb['aid']) {
        require_once R_P . 'require/updateforum.php';
        delete_att($atcdb['aid']);
        pwFtpClose($ftp);
    }
    if ($article == 0) {
        $deltype = 'deltpc';
Exemplo n.º 30
0
    ajax_footer();
} elseif ($a == 'createajax') {
    define('AJAX', 1);
    define('F_M', true);
    banUser();
    InitGP(array('job'));
    require_once PrintEot('m_ajax');
    ajax_footer();
} elseif ($a == 'getallowflash') {
    define('AJAX', 1);
    define('F_M', true);
    InitGP(array('aid'));
    $aid = (int) $aid;
    if ($aid) {
        $photonums = $db->get_value("SELECT photonum FROM pw_cnalbum WHERE atype='0' AND aid=" . pwEscape($aid));
        $o_maxphotonum && $photonums >= $o_maxphotonum && Showmsg('colony_photofull');
        if ($o_maxphotonum) {
            $allowmutinum = $o_maxphotonum - $photonums;
        } else {
            $allowmutinum = 'infinite';
        }
    }
    echo "ok\t{$allowmutinum}";
    ajax_footer();
}
//require_once(M_P.'require/header.php');
if ($space == 1 && defined('F_M')) {
    //$basename .= "space=1&u=$u&";
    $spaceurl = $baseUrl;
    require_once R_P . 'require/credit.php';
    list($userdb, $ismyfriend, $friendcheck, $usericon, $usercredit, $totalcredit, $appcount, $p_list) = getAppleftinfo($u);