function getRegisterScripts($complement = 1)
    {
        $registerFields = $this->customerField->getFieldsByComplement($complement);
        if (!S::isArray($registerFields)) {
            return false;
        }
        $scripts = '';
        $keep = 20;
        foreach ($registerFields as $v) {
            $required = $v['required'] == 1 ? '1' : '0';
            $tips = '本选项填写有误';
            if (S::inArray($v['type'], array($this->customerField->typeMap['input'], $this->customerField->typeMap['textarea']))) {
                !$v['maxlen'] && ($v['maxlen'] = 255);
                $tips = "最大长度为{$v['maxlen']}字节";
            }
            $scripts .= <<<EOT
\t\t\tregInfo[{$keep}] \t= new Array(
\t\t\t\t\t\t" ",
\t\t\t\t\t\t"本选项填写有误",
\t\t\t\t\t\t"格式不正确",
\t\t\t\t\t\t"{$tips}",
\t\t\t\t\t\t"{$v['descrip']}"
\t\t\t\t\t);
\t\t\t
EOT;
            if ($v['type'] == $this->customerField->typeMap['area']) {
                //$scripts .= "var $v[fieldname] = new Element('area_$v[fieldname]',regInfo[$keep],'$v[fieldname]'+'_info',null,$required);";
                $scripts .= "extracheck.push(getObj('area_{$v['fieldname']}'));";
                $scripts .= "var area_{$v['fieldname']} = new Element('area_{$v['fieldname']}',regInfo[{$keep}],'area_{$v['fieldname']}'+'_info',null,{$required});";
            } else {
                switch ($v['fieldname']) {
                    case 'education':
                        $scripts .= <<<EOT
\t\t\t\t\t\tif(typeof(schoolids) != 'undefined') {
\t\t\t\t\t\t\tfor(i=0; i<schoolids.length;i++){
\t\t\t\t\t\t\t\twindow['schoolname_'+schoolids[i]] = new Element("schoolname_"+schoolids[i],regInfo[{$keep}],"schoolname_"+schoolids[i]+'_info',null,{$required});
\t\t\t\t\t\t\t}
\t\t\t\t\t\t}
EOT;
                        break;
                    case 'career':
                        $scripts .= <<<EOT
\t\t\t\t\t\tif(typeof(companyids) != 'undefined') {
\t\t\t\t\t\t\tfor(i=0; i<companyids.length;i++){
\t\t\t\t\t\t\t\twindow['companyname_'+companyids[i]] = new Element("companyname_"+companyids[i],regInfo[{$keep}],"companyname_"+companyids[i]+'_info',null,{$required});
\t\t\t\t\t\t\t}
\t\t\t\t\t\t}
EOT;
                        break;
                    default:
                        $scripts .= "var {$v['fieldname']} = new Element('{$v['fieldname']}',regInfo[{$keep}],'{$v['fieldname']}'+'_info',null,{$required});";
                        $v['type'] == $this->customerField->typeMap['checkbox'] && ($scripts .= "checkboxArray.push('{$v['fieldname']}');");
                        $v['type'] == $this->customerField->typeMap['radio'] && ($scripts .= "radioArray.push('{$v['fieldname']}');");
                }
                $keep++;
            }
        }
        return $scripts;
    }
Example #2
0
 /**
  * 设置音频格式
  * @param $audioFormat	音频格式
  * @return bool			true-成功, false-失败
  */
 function setAudioFormat($audioFormat)
 {
     if (!S::inArray($audioFormat, array('wav', 'mp3'))) {
         return false;
     }
     $this->_audioFormat = $audioFormat;
     return true;
 }
Example #3
0
 /**
  * 
  * 根据资料首次填写区域获取字段列表
  * @param int $complement
  * @return array
  */
 function getFieldsByComplement($complement)
 {
     $complement = (int) $complement;
     if (!S::inArray($complement, array(0, 1, 2))) {
         return array();
     }
     $query = $this->_db->query('SELECT * FROM ' . $this->_tableName . ' WHERE complement = ' . S::sqlEscape($complement) . ' AND state = 1 ORDER BY vieworder ASC');
     return $this->_getAllResultFromQuery($query, $this->_primaryKey);
 }
 function checkFields($fieldsData)
 {
     if (!S::isArray($fieldsData)) {
         return array();
     }
     $fielsdMap = $this->fieldsMap();
     $data = array();
     foreach ($fieldsData as $k => $v) {
         if (!S::inArray($k, $fielsdMap)) {
             continue;
         }
         $data[$k] = $v;
     }
     return $data;
 }
 function getReadRight($user)
 {
     global $isGM, $isBM, $admincheck, $pwPostHide, $pwSellHide, $pwEncodeHide, $manager, $groupid, $windid;
     $pwSystem = array();
     if ($user->groupid != 'guest') {
         $isGM = S::inArray($windid, $manager);
         if (!$isGM) {
             $pwSystem = pwRights();
             $pwPostHide = $pwSystem['posthide'];
             $pwSellHide = $pwSystem['sellhide'];
             $pwEncodeHide = $pwSystem['encodehide'];
         } else {
             $pwPostHide = $pwSellHide = $pwEncodeHide = 1;
         }
     }
 }
Example #6
0
 function forumcheck($user, $groupid)
 {
     if ($this->foruminfo['f_type'] == 'former' && $groupid == 'guest' && $_COOKIE) {
         Showmsg('forum_former');
     }
     $pwdcheck = GetCookie('pwdcheck');
     if ($this->foruminfo['password'] != '' && ($groupid == 'guest' || $pwdcheck[$this->fid] != $this->foruminfo['password'] && !S::inArray($user['username'], $GLOBALS['manager']))) {
         require_once R_P . 'require/forumpassword.php';
     }
     if (!$this->allowvisit($user, $groupid)) {
         Showmsg('forum_jiami');
     }
     if (!$this->foruminfo['cms'] && $this->foruminfo['f_type'] == 'hidden' && !$this->foruminfo['allowvisit']) {
         Showmsg('forum_hidden');
     }
 }
Example #7
0
 function check()
 {
     global $db_allowupload, $winddb, $groupid, $_G, $windid, $winduid, $manager;
     if (empty($this->attach)) {
         return 'job_attach_error';
     }
     if (!$db_allowupload) {
         return 'upload_close';
     } elseif (!$this->forum->allowupload($winddb, $groupid)) {
         return 'upload_forum_right';
     } elseif (!$this->forum->foruminfo['allowupload'] && $_G['allowupload'] == 0) {
         return 'upload_group_right';
     }
     if (!($winduid == $this->attach['uid'] || S::inArray($windid, $manager) || pwRights($this->forum->isBM($windid), 'deltpcs', $this->forum->fid))) {
         return 'modify_noper';
     }
     return true;
 }
Example #8
0
 function PwPost(&$forum)
 {
     global $db, $winddb, $groupid, $_time, $_G, $manager, $windid, $winduid;
     $this->db =& $db;
     $this->user =& $winddb;
     $this->groupid =& $groupid;
     $this->hours =& $_time['hours'];
     $this->forum =& $forum;
     $this->uid =& $winduid;
     $this->username =& $windid;
     $this->_G =& $_G;
     $this->isGM = S::inArray($this->username, $manager);
     $this->isBM = $this->forum->isBM($this->username);
     $this->admincheck = $this->isGM || $this->isBM;
     $this->allowhide = $this->forum->foruminfo['allowhide'] && $this->_G['allowhidden'];
     $this->allowsell = $this->forum->foruminfo['allowsell'] && $this->_G['allowsell'];
     $this->allowencode = $this->forum->forumset['allowencode'] && $this->_G['allowencode'];
 }
Example #9
0
function wind_forumcheck($forum)
{
    global $windid, $groupid, $tid, $fid, $skin, $winddb, $manager;
    if ($forum['f_type'] == 'former' && $groupid == 'guest' && $_COOKIE) {
        Showmsg('forum_former');
    }
    if (!empty($forum['style']) && file_exists(D_P . "data/style/{$forum['style']}.php")) {
        $skin = $forum['style'];
    }
    $pwdcheck = GetCookie('pwdcheck');
    if ($forum['password'] != '' && ($groupid == 'guest' || $pwdcheck[$fid] != $forum['password'] && !S::inArray($windid, $manager))) {
        require_once R_P . 'require/forumpw.php';
    }
    if ($forum['allowvisit'] && !allowcheck($forum['allowvisit'], $groupid, $winddb['groups'], $fid, $winddb['visit'])) {
        Showmsg('forum_jiami');
    }
    if (!$forum['cms'] && $forum['f_type'] == 'hidden' && !$forum['allowvisit']) {
        Showmsg('forum_hidden');
    }
}
Example #10
0
/**
 * 检查用户是否有管理文章权限
 * @param unknown_type $name
 * @param unknown_type $cid
 * @return string|string|string|boolean
 */
function checkEditPurview($name, $cid = '')
{
    if (isGM($name)) {
        return true;
    }
    if (!$name) {
        return false;
    }
    $cms_editadmin = L::config('cms_editadmin', 'cms_config');
    if (!S::isArray($cms_editadmin)) {
        return false;
    }
    if (empty($cid)) {
        $_keys = array_keys($cms_editadmin);
        foreach ($_keys as $key) {
            if (S::inArray($name, $cms_editadmin[$key])) {
                return true;
            }
        }
        return false;
    }
    return S::inArray($name, $cms_editadmin[$cid]);
}
 function getAllForum()
 {
     $user = $this->getCurrentUser(array('visit', 'post'));
     $user->initRight();
     $query = $GLOBALS['db']->query("SELECT f.fid,f.name,f.fup,f.type,f.ifsub,f.childid,f.allowvisit,fdata.tpost FROM pw_forums f LEFT JOIN pw_forumdata fdata ON f.fid = fdata.fid  WHERE f.ifcms!=2 AND f.cms!='1' ORDER BY f.vieworder,f.fid");
     $cates = $forums = $subForums = $secondSubForums = $filerFids = array();
     $count = 0;
     while ($rt = $GLOBALS['db']->fetch_array($query)) {
         $rt['name'] = strip_tags($rt['name']);
         if ($rt['type'] == 'category') {
             $cates[$rt['fid']] = array('fid' => $rt['fid'], 'forumname' => strip_tags($rt['name']), 'childid' => $rt['childid'], 'type' => $rt['type'], 'todaypost' => '');
         } elseif ($rt['type'] == 'forum') {
             if (!$user->allowcheck($rt['allowvisit'], $rt['fid'], 'visit')) {
                 $filerFids[] = $rt['fid'];
                 continue;
             }
             $forums[$rt['fup']][$rt['fid']] = array('fid' => $rt['fid'], 'forumname' => strip_tags($rt['name']), 'childid' => $rt['childid'], 'type' => $rt['type'], 'todaypost' => $rt['tpost']);
         } elseif ($rt['type'] == 'sub') {
             if (S::inArray($rt['fup'], $filerFids)) {
                 continue;
             }
             $subForums[$rt['fup']][$rt['fid']] = array('fid' => $rt['fid'], 'forumname' => strip_tags($rt['name']), 'childid' => $rt['childid'], 'type' => $rt['type'], 'todaypost' => '');
         } elseif ($rt['type'] == 'sub2') {
             if (S::inArray($rt['fup'], $filerFids)) {
                 continue;
             }
             $secondSubForums[$rt['fup']][$rt['fid']] = array('fid' => $rt['fid'], 'forumname' => strip_tags($rt['name']), 'childid' => $rt['childid'], 'type' => $rt['type'], 'todaypost' => '');
         }
         $count++;
     }
     $result = array();
     foreach ($cates as $cateId => $cateInfo) {
         $cateInfo['child'] = isset($forums[$cateId]) && $forums[$cateId] ? $this->organizeForums($forums[$cateId], $subForums, $secondSubForums) : array();
         $result[] = $cateInfo;
     }
     return $this->buildResponse(0, array('count' => $count, 'forums' => $result));
 }
Example #12
0
    }
    foreach ($fidcommend as $key => $value) {
        //用于add|update
        $vieworder = (int) $order[$key];
        if (!S::inArray($key, $fids)) {
            $addSQL[$key]['fid'] = $key;
            $addSQL[$key]['vieworder'] = $vieworder;
        } else {
            if ($vieworder !== $forumDB[$key]['vieworder']) {
                $updateArr[$key]['vieworder'] = $vieworder;
            }
        }
    }
    foreach ($order as $key => $value) {
        //用于delect
        if (S::inArray($key, $fids)) {
            !$fidcommend[$key] && ($delSQL[$key] = $key);
        }
    }
    $addSQL && $db->update("REPLACE INTO pw_searchforum (fid,vieworder) VALUES " . pwSqlMulti($addSQL));
    if ($updateArr) {
        foreach ($updateArr as $key => $value) {
            $value && $db->update("UPDATE pw_searchforum SET " . pwSqlSingle($value) . " WHERE fid=" . pwEscape($key, false));
        }
    }
    $delSQL && $db->update("DELETE FROM pw_searchforum WHERE fid IN(" . pwImplode($delSQL) . ")");
    //if ($addSQL || $updateArr || $delSQL) {
    updatecache_search();
    //}
    adminmsg('operate_success', "{$basename}&action=forum");
} elseif ($action == 'statistic') {
 function checkEducation($subject)
 {
     global $timestamp;
     if (!S::isArray($subject)) {
         return false;
     }
     if ($subject['educationlevel'] < 1 || $subject['educationlevel'] > 8) {
         return false;
     }
     $year = get_date($timestamp, 'year');
     if ($subject['educationyear'] < $year - 100 || $subject['educationyear'] > $year) {
         return false;
     }
     $schoolService = L::loadClass('SchoolService', 'user');
     $schoolInfo = $schoolService->getBySchoolId($subject['schoolid']);
     if (!S::isArray($schoolInfo)) {
         return false;
     }
     switch ($schoolInfo['type']) {
         case 1:
             if ($subject['educationlevel'] > 1) {
                 return false;
             }
             break;
         case 2:
             if (!S::inArray($subject['educationlevel'], array(2, 3))) {
                 return false;
             }
             break;
         case 3:
             if (!S::inArray($subject['educationlevel'], array(4, 5, 6, 7, 8))) {
                 return false;
             }
             break;
     }
     return true;
 }
Example #14
0
<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('tid'));
$robbuildService = L::loadClass('RobBuild', 'forum');
$robbuild = $robbuildService->getByTid($tid);
(!S::inArray($windid, $manager) && $robbuild['authorid'] != $winduid || $robbuild['status']) && Showmsg('undefined_action');
$robbuildService->update(array('status' => 2), $tid);
refreshto("read.php?tid={$tid}", 'operate_success');
Example #15
0
        $onlineService = L::loadClass('OnlineService', 'user');
        $userinbbs = $onlineService->countOnlineUser();
        $guestinbbs = $onlineService->countOnlineGuest();
        Cookie('online_info', $timestamp . "\t" . $userinbbs . "\t" . $guestinbbs);
    }
}
if ($last_statistictime == 0 || get_date($timestamp, 'G') - get_date($last_statistictime, 'G') > 1 || $timestamp - $last_statistictime > 3600) {
    $stasticsService = L::loadClass('Statistics', 'datanalyse');
    $stasticsService->updateOnlineInfo();
}
$usertotal = $guestinbbs + $userinbbs;
if ($db_indexonline) {
    S::gp(array('online'));
    empty($online) && ($online = GetCookie('online'));
    if ($online == 'yes') {
        if ($usertotal > 2000 && !S::inArray($windid, $manager)) {
            //$online = 'no';
            Cookie('online', 'no');
        } else {
            $index_whosonline = '';
            $db_online = intval($db_online);
            Cookie('online', $online);
            include_once S::escapePath(R_P . "require/online_{$db_online}.php");
        }
    }
    if ($online == 'no') {
        Cookie('online', 'no');
    }
}
$showgroup = $db_showgroup ? explode(',', $db_showgroup) : array();
// Share union
 function buildFriendList($uid, $data, $filterIds)
 {
     $attentionService = L::loadClass('Attention', 'friend');
     $ids = $this->getUids($data);
     $result = array();
     foreach ($ids as $id) {
         $result[] = array('uid' => $id, 'username' => $data[$id]['username'], 'icon' => $data[$id]['face'], 'isfollowed' => S::inArray($id, $filterIds) ? 1 : 0);
     }
     return $result;
 }
Example #17
0
 /**
  * @static
  */
 function checkName($regname)
 {
     if (!PW_Register::checkNameLen(strlen($regname))) {
         Showmsg('reg_username_limit');
     }
     if (str_replace($this->illegalChar, '', $regname) != $regname) {
         Showmsg('illegal_username');
     }
     if (!L::reg('rg_rglower') && !PW_Register::checkRglower($regname)) {
         Showmsg('username_limit');
     }
     if (S::inArray(strtolower($regname), array('guest', 'system'))) {
         Showmsg('illegal_username');
     }
     $banname = explode(',', L::reg('rg_banname'));
     foreach ($banname as $key => $value) {
         if ($value !== '' && strpos($regname, $value) !== false) {
             Showmsg('illegal_username');
         }
     }
     require_once R_P . 'require/functions.php';
     if ($regname !== Sql_cv($regname)) {
         Showmsg('illegal_username');
     }
 }
Example #18
0
<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('aid'), 'GP', 2);
empty($aid) && Showmsg('job_attach_error');
$attachService = L::loadClass('attachs', 'forum');
$attachInfo = $attachService->getByAid($aid);
if (!S::isArray($attachInfo) || $attachInfo['type'] != 'img' || !$attachInfo['tid']) {
    Showmsg('job_attach_error');
}
$isGM = S::inArray($windid, $manager);
!$isGM && $groupid == 3 && ($isGM = 1);
$adminCheck = $attachInfo['uid'] == $winduid || $isGM ? 1 : 0;
if (!$adminCheck) {
    Showmsg('没有权限设置封面!');
}
$tucoolService = L::loadClass('tucool', 'forum');
if ($tucoolService->setCover($attachInfo['tid'], $attachInfo['attachurl'], $attachInfo['ifthumb'])) {
    echo "success";
    ajax_footer();
}
Showmsg('undefined_action');
Example #19
0
    }
    $commentReply = L::loadClass('CommentReplyService', 'stopic');
    $replyList = $commentReply->getCommentsByCommentid($commentid);
    require_once PrintEot('stopic_comment');
    ajax_footer();
}
if ($type == 'delreply') {
    S::gp(array('replyid', 'commentid'));
    $replyid = intval($replyid);
    $commentid = intval($commentid);
    if ($replyid < 1 || $commentid < 1) {
        Showmsg('undefined_action');
    }
    $commentReply = L::loadClass('CommentReplyService', 'stopic');
    $result = $commentReply->getByReplyid($replyid);
    if (!$result || $result['uid'] != $winduid || !S::inArray($windid, $manager)) {
        Showmsg('undefined_action');
    }
    if ($commentReply->deleteByReplyid($replyid)) {
        $comment = L::loadClass('commentservice', 'stopic');
        $comment->updateReplynumByCommentid('-1', $commentid);
        echo "success";
    }
    ajax_footer();
}
if ($type == 'stopiclogin') {
    S::gp(array('requesturl'));
    $jumpurl = $requesturl;
    $descript = 'ÇëÏȵǼ£¬ÔÙ¼ÌÐø²Ù×÷';
    require_once PrintEot('poplogin');
    ajax_footer();
Example #20
0
    $tucoolAttachs = buildTucoolAttachs($tucoolAttachs);
    $contentAids = $attachShow->findPicAids($read['content']);
    $read['content'] = convert($read['content'], $db_windpost);
    if (strrpos($read['content'], 'attachment') !== false) {
        $haveAids = $attachShow->findPicAids($read['content']);
    }
}
$tmpKeyArray = array_diff(array_keys($tucoolAttachs), (array) $contentAids);
$tmpArray = array();
foreach ((array) $tmpKeyArray as $v) {
    $tmpArray[$v] = $tucoolAttachs[$v];
}
$contentAttachs = array();
if (S::isArray($haveAids)) {
    foreach ($tucoolAttachs as $k => $v) {
        if (S::inArray($k, $haveAids)) {
            $contentAttachs[$k] = $tucoolAttachs[$k];
        }
    }
}
$tucoolAttachs = array_merge($contentAttachs, (array) $tmpArray);
!$tucoolAttachs && refreshto("read.php?tid={$tid}&ds=1", '您暂无权限查看此帖的图片!');
// 编辑图片信息权限
$editAttachRight = $admincheck || $read['authorid'] == $winduid ? 1 : 0;
// 回复数
if ($openIndex) {
    #高楼帖子索引
    $replyCount = 1 + $db->get_value("SELECT max(floor) FROM pw_postsfloor WHERE tid =" . S::sqlEscape($tid));
} else {
    $replyCount = $read['replies'] + 1;
}
Example #21
0
 function checkJobCondition($userId, $groupid, $job)
 {
     //用户组条件限制
     if (isset($job['usergroup']) && $job['usergroup'] != '') {
         $usergroups = explode(",", $job['usergroup']);
         if (!in_array($groupid, $usergroups)) {
             return false;
         }
     }
     //申请人数条件限制
     if (isset($job['number']) && $job['number'] > 0) {
         $number = $this->countJoberByJobId($job['id']);
         if ($number >= $job['number']) {
             return false;
         }
     }
     //前置任务
     if (isset($job['prepose']) && $job['prepose'] > 0) {
         $prepose = $this->getJob($job['prepose']);
         if ($prepose) {
             $jober = $this->getJoberByJobId($userId, $prepose['id']);
             if (!$jober) {
                 return false;
                 /*前置任务没完成*/
             }
             if ($jober['status'] != 3) {
                 return false;
             }
         }
     }
     //实名认证
     if (S::inArray($job['job'], array('doAuthAlipay', 'doAuthMobile'))) {
         global $db_authstate;
         if (!$db_authstate) {
             return false;
         }
         $userService = $this->_getUserService();
         $userdb = $userService->get($userId, true, false, false);
         if ($job['job'] == 'doAuthAlipay' && getstatus($userdb['userstatus'], PW_USERSTATUS_AUTHALIPAY)) {
             return false;
         }
         if ($job['job'] == 'doAuthMobile' && getstatus($userdb['userstatus'], PW_USERSTATUS_AUTHMOBILE)) {
             return false;
         }
     }
     return true;
 }
Example #22
0
 if (empty($_POST['step'])) {
     if (is_numeric($seltid)) {
         $rt = $db->get_one('SELECT fid,locked FROM pw_threads WHERE tid=' . S::sqlEscape($seltid));
         if ($fid != $rt['fid']) {
             Showmsg('admin_forum_right');
         }
         $rt['locked'] %= 3;
         ${'lock_' . $rt['locked']} = 'checked';
     }
     require_once PrintEot($template);
     footer();
 } else {
     PostCheck();
     S::gp(array('ifmsg'), 'P', 2);
     S::gp(array('locked'), 'P');
     (!is_string($locked) || !S::inArray($locked, array('0', '1', '2'))) && Showmsg('请选择锁定操作管理选项');
     $locked = intval($locked);
     count($tidarray) > 500 && Showmsg('mawhole_count');
     $tids = $selids = $ttable_a = $threadIds = array();
     if (is_array($tidarray)) {
         foreach ($tidarray as $k => $v) {
             if (is_numeric($v)) {
                 $tids[] = $v;
                 $threadIds[] = $v;
                 $ttable_a[GetTtable($v)][] = $v;
             }
         }
     }
     !$tids && Showmsg('mawhole_nodata');
     $selids = S::sqlImplode($tids);
     $msgdb = $logdb = array();
Example #23
0
 function sendPost($tid, $uid, $title, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $fid, $timestamp, $pwforum, $pwpost, $_G, $db_uploadfiletype, $uploadcredit, $uploadmoney, $manager, $isBM, $_time;
     $timestamp = time();
     $_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
     list($uid, $tid, $title, $content) = array(intval($uid), intval($tid), trim($title), trim($content));
     if ($uid < 1 || $tid < 1 || !$content) {
         return $this->buildResponse(THREAD_INVALID_PARAMS);
     }
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
     $user = $this->getCurrentUser();
     if (!$user->isLogin()) {
         return $this->buildResponse(USER_NOT_LOGIN);
     }
     if ($user->groupid == 6 || getstatus($user->info['userstatus'], PW_USERSTATUS_BANUSER)) {
         return $this->buildResponse(THREAD_USER_NOT_RIGHT);
     }
     $user->initRight();
     $winduid = $user->uid;
     $groupid = $user->groupid;
     $windid = $user->username;
     $winddb = $user->info;
     $_G = $user->_G;
     if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
         return $this->buildResponse(POST_GP_LIMIT);
     }
     $tpcarray = $GLOBALS['db']->get_one("SELECT t.tid,t.fid,t.locked,t.ifcheck,t.author,t.authorid,t.postdate,t.lastpost,t.ifmail,t.special,t.subject,t.type,t.ifshield,t.anonymous,t.ptable,t.replies,t.tpcstatus FROM pw_threads t WHERE t.tid=" . pwEscape($tid));
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($tpcarray['fid']);
     if (!$pwforum->isForum()) {
         return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
     }
     $fid = $tpcarray['fid'];
     $isBM = $pwforum->isBM($windid);
     $isGM = S::inArray($windid, $manager);
     if (!$isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($isBM, 'replylock')) {
         return $this->buildResponse(THREAD_LOCKED);
     }
     L::loadClass('post', 'forum', false);
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.bbscode.php';
     $pwpost = new PwPost($pwforum);
     $pwpost->errMode = true;
     $pwpost->forumcheck();
     $pwpost->postcheck();
     L::loadClass('replypost', 'forum', false);
     $replypost = new replyPost($pwpost);
     $replypost->setTpc($tpcarray);
     $replypost->check();
     $pw_posts = GetPtable($replypost->tpcArr['ptable']);
     $postdata = new replyPostData($pwpost);
     $postdata->setTitle($title);
     $postdata->setContent($content);
     $postdata->conentCheck();
     if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
         return $this->buildResponse(THREAD_SYSTEM_ERROR, $msg);
     }
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.attupload.php';
     if (PwUpload::getUploadNum()) {
         $_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
         $db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
         $postdata->att = new AttUpload($user->uid);
         $return = $postdata->att->check();
         if ($return) {
             $msginfo = getLangInfo('msg', $return);
             return $this->errMessage(THREAD_USER_NOT_RIGHT, $msginfo);
         }
         list($windVersion) = explode(',', WIND_VERSION);
         if ($windVersion && $windVersion < '8.5') {
             $postdata->att->transfer();
             PwUpload::upload($postdata->att);
         }
     }
     $replypost->execute($postdata);
     $pid = $replypost->getNewId();
     return $this->buildResponse(0, array('pid' => $pid));
 }
Example #24
0
<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('fid', 'seltid'));
//* @include_once pwCache::getPath(S::escapePath(D_P . 'data/bbscache/mode_push_config.php'));
pwCache::getData(S::escapePath(D_P . 'data/bbscache/mode_push_config.php'));
$pushs = array();
if ($groupid == '3' || $groupid == '4' || S::inArray($windid, $manager)) {
    $pushs = $PUSH;
} elseif ($groupid == '5') {
    foreach ($PUSH as $key => $value) {
        if (in_array($value['scr'], array('thread', 'cate'))) {
            $pushs[] = $value;
        }
    }
}
if (!$pushs) {
    Showmsg('no_aim_to_push');
}
require_once PrintEot('ajax');
ajax_footer();
Example #25
0
 S::gp(array('order'), 'P', 2);
 $errorname = array();
 $forumdb = $db->query("SELECT fid,forumadmin,vieworder FROM pw_forums WHERE cms!='1'");
 while ($foruminfo = $db->fetch_array($forumdb)) {
     $pwSQL = $admin_a = $admin_n = $admin_d = array();
     if ($foruminfo['forumadmin'] != $forumadmin[$foruminfo['fid']] && $foruminfo['forumadmin'] != ',' . $forumadmin[$foruminfo['fid']] . ',') {
         $admin_a = explode(',', $forumadmin[$foruminfo['fid']]);
         if ($admin_a) {
             $userService = L::loadClass('UserService', 'user');
             /* @var $userService PW_UserService */
             $members = $userService->getByUserNames($admin_a);
             foreach ($members as $member) {
                 $admin_d[] = $member['username'];
             }
             foreach ($admin_a as $value) {
                 if (S::inArray($value, $admin_d)) {
                     $admin_n[] = $value;
                 }
             }
         }
         if ($admin_n) {
             $pwSQL['forumadmin'] = ',' . implode(',', $admin_n) . ',';
         } else {
             $pwSQL['forumadmin'] = '';
         }
         $errorname = array_merge($errorname, array_diff($admin_a, $admin_n));
     }
     if ($order[$foruminfo['fid']] != $foruminfo['vieworder']) {
         $pwSQL['vieworder'] = $order[$foruminfo['fid']];
     }
     if ($pwSQL) {
Example #26
0
        }
        @extract($db->get_one('SELECT totalmember,yposts FROM pw_bbsinfo WHERE id=1'));
        @extract($db->get_one('SELECT SUM(topic) AS threads,SUM(article) AS posts FROM pw_forumdata'));
        $hits = $db->get_value('SELECT SUM(hits) FROM pw_threads');
        $cachetime = $timestamp + 60 * 60 * 12;
        /** writeover(D_P.'data/bbscache/admin_cache.php',"<?php die;?>$cachetime|$pw_size|$o_size|$dbversion|$max_upload|$max_ex_time|$sys_mail|$totalmember|$threads|$posts|$hits|$yposts\r\n{$cachetext[1]}"); **/
        pwCache::setData(D_P . 'data/bbscache/admin_cache.php', "<?php die;?>{$cachetime}|{$pw_size}|{$o_size}|{$dbversion}|{$max_upload}|{$max_ex_time}|{$sys_mail}|{$totalmember}|{$threads}|{$posts}|{$hits}|{$yposts}\r\n{$cachetext[1]}");
    }
    $altertime = gmdate('Y-m-d H:i', $timestamp + $db_timedf * 3600);
    $systemtime = $db_cvtime == 0 ? $altertime : gmdate('Y-m-d H:i', time() + $db_timedf * 3600);
    $sysversion = PHP_VERSION;
    $sysos = str_replace('PHP/' . $sysversion, '', S::getServer('SERVER_SOFTWARE'));
    $ifcookie = isset($_COOKIE) ? 'SUCCESS' : 'FAIL';
}
if (!$job || $job == 'desktop') {
    if (S::inArray($admin_name, $manager)) {
        $u = 1;
        if (pwWritable(D_P . 'data/sql_config.php')) {
            $warnid += 1;
        }
        if (is_dir('data')) {
            $warnid += 2;
        }
        if (ini_get('register_globals')) {
            $warnid += 4;
        }
        if (file_exists('admin.php')) {
            $warnid += 8;
        }
        if (!$db_ifsafecv || strpos($db_safegroup, ',3,') === false || strpos($db_safegroup, ',4,') === false || strpos($db_safegroup, ',5,') === false) {
            $warnid += 16;
Example #27
0
 if ($filesize) {
     if ($ifless) {
         $sql .= " AND (size<" . S::sqlEscape($filesize) . ')';
     } else {
         $sql .= " AND (size>" . S::sqlEscape($filesize) . ')';
     }
 }
 if ($postdate1) {
     $uploadtime = PwStrtoTime($postdate1);
     is_numeric($uploadtime) && ($sql .= " AND uploadtime>" . S::sqlEscape($uploadtime));
 }
 if ($postdate2) {
     $uploadtime = PwStrtoTime($postdate2);
     is_numeric($uploadtime) && ($sql .= " AND uploadtime<" . S::sqlEscape($uploadtime));
 }
 if (S::inArray($orderway, array('uploadtime', 'size', 'needrvrc', 'name', 'hits'))) {
     $order = "ORDER BY {$orderway}";
     $asc == 'DESC' && ($order .= ' ' . $asc);
 } else {
     $order = '';
 }
 $pernum = is_numeric($pernum) ? $pernum : 20;
 $page < 1 && ($page = 1);
 $limit = S::sqlLimit(($page - 1) * $pernum, $pernum);
 $rt = $db->get_one("SELECT COUNT(*) AS count FROM pw_attachs WHERE {$sql}");
 $sum = $rt['count'];
 $numofpage = ceil($sum / $pernum);
 $pages = numofpage($sum, $page, $numofpage, "{$basename}&fid={$fid}&uid={$uid}&filename=" . rawurlencode($filename) . "&hits={$hits}&ifmore={$ifmore}&filesize={$filesize}&ifless={$ifless}&orderway={$orderway}&asc={$asc}&postdate1={$postdate1}&postdate2={$postdate2}&pernum={$pernum}&");
 $attachdb = $thread = array();
 $query = $db->query("SELECT * FROM pw_attachs WHERE {$sql} {$order} {$limit}");
 $searchHits = $hits;
Example #28
0
 function _jobAutoFilterHandler($userid, $groupid)
 {
     $jobs = $this->getJobsAuto();
     if (!$jobs) {
         return false;
     }
     $current = $this->_timestamp;
     $jobLists = $jobIds = $periods = $preposes = array();
     foreach ($jobs as $job) {
         if ($job['isopen'] == 0) {
             continue;
         }
         if (isset($job['endtime']) && $job['endtime'] != 0 && $job['endtime'] < $current) {
             continue;
         }
         if (isset($job['starttime']) && $job['starttime'] != 0 && $job['starttime'] > $current) {
             continue;
         }
         if (isset($job['usergroup']) && $job['usergroup'] != '') {
             $usergroups = explode(",", $job['usergroup']);
             if (!in_array($groupid, $usergroups)) {
                 continue;
             }
         }
         if (isset($job['period']) && $job['period'] > 0) {
             $periods[] = $job['id'];
         }
         if (isset($job['prepose']) && $job['prepose'] > 0) {
             $preposes[$job['prepose']] = $job['id'];
         }
         if (isset($job['number']) && $job['number'] != 0) {
             $number = $this->countJoberByJobId($job['id']);
             if ($number >= $job['number']) {
                 continue;
             }
         }
         //实名认证
         if (S::inArray($job['job'], array('doAuthAlipay', 'doAuthMobile'))) {
             if (!$GLOBALS['db_authstate']) {
                 return false;
             }
             $userService = L::loadClass('UserService', 'user');
             if ($job['job'] == 'doAuthAlipay' && $userService->getUserStatus($userid, PW_USERSTATUS_AUTHALIPAY)) {
                 return false;
             }
             if ($job['job'] == 'doAuthMobile' && $userService->getUserStatus($userid, PW_USERSTATUS_AUTHMOBILE)) {
                 return false;
             }
         }
         $jobLists[$job['id']] = $job;
         $jobIds[] = $job['id'];
     }
     if (!$jobLists) {
         return false;
     }
     $joins = $this->getJobersByJobIds($userid, $jobIds);
     if ($joins) {
         foreach ($joins as $join) {
             $t_job = array();
             $t_job = $jobLists[$join['jobid']];
             if (in_array($join['jobid'], $periods)) {
                 if ($join['status'] >= 3 && $join['total'] > 0) {
                     if ($join['next'] < $current) {
                         $this->_jobAutoAgainHandler($userid, $t_job, $current);
                     }
                 }
             }
             unset($t_job);
             unset($jobLists[$join['jobid']]);
         }
     }
     if (!$jobLists) {
         return false;
     }
     if ($preposes) {
         $joins = $this->getJobersByJobIds($userid, array_keys($preposes));
         if ($joins) {
             foreach ($joins as $join) {
                 if ($join['total'] > 0) {
                     unset($preposes[$join['jobid']]);
                 }
             }
         }
         if ($preposes) {
             foreach ($preposes as $jobid) {
                 unset($jobLists[$jobid]);
             }
         }
     }
     return $jobLists;
 }
Example #29
0
         if (strpos($rt['toname'], ',' . $windid . ',') !== false && $rt['msgtype'] == '2' || $groupid == '3' || $groupid == '4' || S::inArray($windid, $manager) || $rt['msgtype'] == '1' || $rt['uid'] == $winduid) {
             if ($rt['uid'] != $winduid && $groupid != '3' && $groupid != '4' && S::inArray($windid, $manager) === false) {
                 $rt['ifuse'] = 'disabled';
             } else {
                 $rt['ifuse'] = '';
             }
             $msgdb[] = $rt;
         }
     }
 }
 $db->free_result($query);
 $userService = L::loadClass('userservice', 'user');
 /* @var $userService PW_UserService */
 $ownerInfo = $userService->getUsersWithMemberDataByUserIds($ownerids);
 foreach ($ownerInfo as $value) {
     if (S::inArray($value['groupid'], array(3, 4, 5)) || S::inArray($value['username'], $manager)) {
         continue;
     }
     $notManager[] = $value['uid'];
 }
 $count = $db->get_value('SELECT COUNT(*) FROM pw_forummsg WHERE fid=' . S::sqlEscape($fid));
 if ($count > $db_perpage) {
     require_once R_P . 'require/forum.php';
     $pages = numofpage($count, $page, ceil($count / $db_perpage), "forumcp.php?action=edit&fid={$fid}&type={$type}&");
 }
 if ($_POST['demsg']) {
     S::gp(array('ids'));
     foreach ($ids as $key => $value) {
         if (is_numeric($value)) {
             $iids[] = $value;
         }
Example #30
0
        while (($emotionimg = @readdir($emotion)) !== false) {
            if ($emotionimg != "." && $emotionimg != ".." && $emotionimg != "" && preg_match("/^(\\d+)\\.(gif|jpg|png|bmp)\$/i", $emotionimg, $emotionMatch)) {
                $icondb[$emotionMatch[1]] = $emotionimg;
            }
        }
        ksort($icondb);
        @closedir($emotion);
    }
    //multiple post types
    if ($foruminfo['allowtype'] && ($foruminfo['allowtype'] & 1 || $foruminfo['allowtype'] & 2 && $_G['allownewvote'] || $foruminfo['allowtype'] & 4 && $_G['allowactive'] || $foruminfo['allowtype'] & 8 && $_G['allowreward'] || $foruminfo['allowtype'] & 16 || $foruminfo['allowtype'] & 32 && $_G['allowdebate'])) {
        $N_allowtypeopen = true;
    } else {
        $N_allowtypeopen = false;
    }
} else {
    if ($db_cloudgdcode && defined('AJAX') && S::inArray($action, array('reply', 'quote'))) {
        $keepCloudCaptchaCode = true;
    }
    PostCheck(1, $db_gdcheck & 4 && (!$db_postgd || $winddb['postnum'] < $db_postgd), $db_ckquestion & 4 && (!$postq || $winddb['postnum'] < $postq) && $db_question);
    !$windid && ($windid = '游客');
    /*
    if ($db_xforwardip && $_POST['_hexie'] != GetVerify($onlineip.$winddb['regdate'].$fid.$tid)) {
    	Showmsg('undefined_action');
    }
    */
}
//默认动漫表情处理
if ($db_windmagic && ($action == 'new' || $action == 'modify' && $pid == 'tpc')) {
    $mDef = '';
    //* @include_once pwCache::getPath(D_P."data/bbscache/myshow_default.php");
    pwCache::getData(D_P . "data/bbscache/myshow_default.php");