예제 #1
0
 function setActCache()
 {
     //* include pwCache::getPath(D_P.'data/bbscache/activity_config.php');
     extract(pwCache::getData(D_P . 'data/bbscache/activity_config.php', false));
     $this->activitycatedb = $activity_catedb;
     $this->activitymodeldb = $activity_modeldb;
 }
예제 #2
0
 function getTopicCache()
 {
     //* @include pwCache::getPath(D_P.'data/bbscache/topic_config.php');
     extract(pwCache::getData(D_P . 'data/bbscache/topic_config.php', false));
     $this->topiccatedb =& $topiccatedb;
     $this->topicmodeldb =& $topicmodeldb;
 }
예제 #3
0
/**
 * 组装小名片数据
 *
 * @param int $uid 用户ID
 * @param int $winduid 当前用户id
 * @param bool $username 用户名
 * @return array
 */
function getCardData($uid, $winduid, $username)
{
    extract(pwCache::getData(R_P . "data/bbscache/level.php", false));
    if ($uid < 1 && !trim($username) || $username == '游客' || $username == '匿名') {
        return array('username' => '游客', 'memtitle' => $ltitle[2]);
    }
    $userService = L::loadClass('UserService', 'user');
    if ($uid) {
        $userInfo = $userService->get($uid, true, true);
    } elseif ($username) {
        $userInfo = $userService->getByUserName($username, true, true);
    }
    if (!S::isArray($userInfo)) {
        return array();
    }
    require_once R_P . 'require/showimg.php';
    list($faceimage) = showfacedesign($userInfo['icon'], 1, 's');
    $userInfo['groupid'] == '-1' && ($userInfo['groupid'] = $userInfo['memberid']);
    !array_key_exists($userInfo['groupid'], (array) $lpic) && ($userInfo['groupid'] = 8);
    $online = checkOnline($userInfo['thisvisit']);
    $onlineRead = $online ? getOnlineViewing($userInfo['uid'], $userInfo['username']) : array();
    $user = array('mine' => $userInfo['uid'] == $winduid || !$winduid ? 0 : 1, 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'icon' => $faceimage, 'memtitle' => $ltitle[$userInfo['groupid']], 'genderClass' => $userInfo['gender'], 'viewTid' => isset($onlineRead['tid']) && $onlineRead['tid'] ? $onlineRead['tid'] : '', 'viewFid' => isset($onlineRead['fid']) && $onlineRead['fid'] ? $onlineRead['fid'] : '', 'online' => $online ? 1 : 0);
    $user['medals'] = getMedalsByUid($userInfo['uid']);
    // 勋章
    $memberTagsService = L::loadClass('memberTagsService', 'user');
    $user['memberTags'] = $memberTagsService->makeClassTags($memberTagsService->getMemberTagsByUid($userInfo['uid']));
    //标签
    $attentionSerivce = L::loadClass('Attention', 'friend');
    /* @var $attentionSerivce PW_Attention */
    $user['attention'] = $attentionSerivce->isFollow($winduid, $userInfo['uid']) ? 1 : 0;
    //关注
    return $user;
}
function includefile($file)
{
    list($windVersion) = explode(',', WIND_VERSION);
    if ($windVersion && $windVersion < '8.5') {
        include_once $file;
    } else {
        pwCache::getData($file);
    }
}
예제 #5
0
 function getGroupsCreditset($type)
 {
     global $o_groups_creditset;
     //* include_once pwCache::getPath(D_P.'data/bbscache/o_config.php');
     extract(pwCache::getData(D_P . 'data/bbscache/o_config.php', false));
     $creditset = array_filter($creditset[$type], "group_filter");
     $creditset = is_array($creditset) ? $creditset : array();
     return $creditset;
 }
예제 #6
0
 /**
  * 
  * 获取查询结果
  * @param unknown $query 查询结果
  * @return array
  */
 function _cookData($query)
 {
     //* include pwCache::getPath(D_P . 'data/bbscache/topic_config.php');
     extract(pwCache::getData(D_P . 'data/bbscache/topic_config.php', false));
     while ($row = $this->_db->fetch_array($query)) {
         $row['modelname'] = $topicmodeldb[$row['modelid']]['name'];
         $posts[] = $row;
     }
     return $posts;
 }
예제 #7
0
 function loadWords()
 {
     if (!is_array($this->fbwords)) {
         //* include pwCache::getPath(D_P."data/bbscache/wordsfb.php");
         extract(pwCache::getData(D_P . "data/bbscache/wordsfb.php", false));
         $this->fbwords = (array) $wordsfb;
         $this->replace = (array) $replace;
         $this->alarm = (array) $alarm;
     }
 }
예제 #8
0
 function _getCreditAdd($type)
 {
     if ($type != 'credit') {
         return '';
     }
     //* include pwCache::getPath(D_P . 'data/bbscache/o_config.php');
     extract(pwCache::getData(D_P . 'data/bbscache/o_config.php', false));
     $tnum = $o_groups_upgrade['tnum'] ? $o_groups_upgrade['tnum'] : 0;
     $pnum = $o_groups_upgrade['pnum'] ? $o_groups_upgrade['pnum'] : 0;
     $members = $o_groups_upgrade['members'] ? $o_groups_upgrade['members'] : 0;
     $albumnum = $o_groups_upgrade['albumnum'] ? $o_groups_upgrade['albumnum'] : 0;
     $photonum = $o_groups_upgrade['photonum'] ? $o_groups_upgrade['photonum'] : 0;
     $writenum = $o_groups_upgrade['writenum'] ? $o_groups_upgrade['writenum'] : 0;
     $activitynum = $o_groups_upgrade['activitynum'] ? $o_groups_upgrade['activitynum'] : 0;
     return ",(tnum*{$tnum}+pnum*{$pnum}-tnum*{$pnum}+members*{$members}+albumnum*{$albumnum}+photonum*{$photonum}+writenum*{$writenum}+activitynum*{$activitynum}) AS credit";
 }
예제 #9
0
 /**
  * 以某个用户的身份给另一个用户发送短消息
  * @param int $userId 发送者uid
  * @param string $receiver 接受者用户名
  * @param string $subject 标题
  * @param string $content 内容
  * return bool
  */
 function sendMessage($userId, $receiver, $subject, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $_G, $SYSTEM;
     $userService = $this->_getUserService();
     $winddb = $userService->get($userId, true, true);
     $winduid = $winddb['uid'];
     $groupid = $winddb['groupid'];
     $windid = $winddb['username'];
     $groupid == '-1' && ($groupid = $winddb['memberid']);
     if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) {
         extract(pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php", false)));
     } else {
         extract(pwCache::getData(D_P . 'data/groupdb/group_1.php', false));
     }
     M::sendMessage($userId, array($receiver), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => S::escapeChar(stripslashes($subject)), 'content' => S::escapeChar(stripslashes($content))));
     return new ApiResponse(true);
 }
예제 #10
0
 function PW_Appclient()
 {
     global $db_siteappkey, $timestamp, $db_sitehash, $db_siteownerid, $db_siteid, $db_charset, $db_appifopen, $pwServer, $db_server_url, $db_bbsname;
     $db_bbsurl = S::escapeChar("http://" . $pwServer['HTTP_HOST'] . substr($pwServer['PHP_SELF'], 0, strrpos($pwServer['PHP_SELF'], '/')));
     if (!file_exists(D_P . "data/bbscache/forum_appinfo.php")) {
         require_once R_P . "admin/cache.php";
         updatecache_f();
     }
     //* @include_once pwCache::getPath(D_P . "data/bbscache/forum_appinfo.php");
     extract(pwCache::getData(D_P . "data/bbscache/forum_appinfo.php", false));
     $this->_db = $GLOBALS['db'];
     $this->appkey = $db_siteappkey;
     $this->timestamp = $timestamp;
     $this->siteid = $db_siteid;
     $this->siteownerid = $db_siteownerid;
     $this->sitehash = $db_sitehash;
     $this->bbsname = $db_bbsname;
     $this->bbsurl = $db_bbsurl;
     $this->charset = $db_charset;
     $this->appifopen = $db_appifopen;
     $this->server_url = $db_server_url;
     $this->appinfo = $forum_appinfo;
 }
예제 #11
0
파일: wap_mod.php 프로젝트: jechiy/PHPWind
function wap_footer()
{
    global $wind_version, $db_obstart, $windid, $db_charset, $db_wapcharset, $chs, $timestamp, $db_online, $db, $db_wapregist, $rg_allowregister, $online_info, $db_bbsurl;
    Update_ol();
    $userinbbs = $guestinbbs = 0;
    if (empty($db_online)) {
        extract(pwCache::getData(D_P . 'data/bbscache/olcache.php', false));
    } else {
        if (count($online_info = explode("\t", GetCookie('online_info'))) == 3 && $timestamp - $online_info[0] < 60) {
            list(, $userinbbs, $guestinbbs) = $online_info;
        } else {
            $onlineService = L::loadClass('OnlineService', 'user');
            $userinbbs = $onlineService->countOnlineUser();
            $guestinbbs = $onlineService->countOnlineGuest();
            Cookie('online_info', $timestamp . "\t" . $userinbbs . "\t" . $guestinbbs);
        }
    }
    $usertotal = $guestinbbs + $userinbbs;
    $ft_time = get_date($timestamp);
    require_once PrintWAP('footer');
    $output = ob_get_contents();
    ob_end_clean();
    $db_obstart && function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
    if ($db_charset != 'utf8') {
        L::loadClass('Chinese', 'utility/lang', false);
        $chs = new Chinese();
        $output = $chs->Convert($output, $db_charset, $db_wapcharset ? 'UTF8' : 'UNICODE');
    }
    $output = str_replace(array('<!--<!---->', '<!---->-->', '<!---->', "\r\n\r\n"), '', $output);
    $wap_view = S::getGP('wap_view');
    if ($wap_view) {
        $output = preg_replace('/<a[^>]*>([^<]+|.*?)?<\\/a>/i', "\\1", $output);
    }
    echo $output;
    ob_flush();
    exit;
}
예제 #12
0
function updatecache_i_i($fid, $aidin = null)
{
    global $db, $db_windpost, $timestamp, $forum;
    require_once R_P . 'require/bbscode.php';
    //* include pwCache::getPath(D_P.'data/bbscache/forum_cache.php');
    extract(pwCache::getData(D_P . 'data/bbscache/forum_cache.php', false));
    $sql_where = empty($aidin) ? "fid=" . S::sqlEscape($fid) : "aid IN ({$aidin})";
    $F_ffid = false;
    $aid = $aidcache = 0;
    $aids = '';
    $query = $db->query("SELECT aid,startdate,enddate,content FROM pw_announce WHERE {$sql_where} AND ifopen='1' AND (enddate=0 OR enddate>=" . S::sqlEscape($timestamp) . ") ORDER BY vieworder,startdate DESC");
    while ($rt = $db->fetch_array($query)) {
        if ($rt['startdate'] <= $timestamp) {
            if ($F_ffid) {
                continue;
            } elseif (!$rt['enddate']) {
                $F_ffid = true;
            }
        }
        if (!$aid && $rt['startdate'] <= $timestamp && (!$rt['enddate'] || $rt['enddate'] >= $timestamp)) {
            $aid = $rt['aid'];
            if ($rt['content'] != convert($rt['content'], $db_windpost, 2)) {
                //* $db->update("UPDATE pw_announce SET ifconvert='1' WHERE aid=".S::sqlEscape($aid));
                pwQuery::update('pw_announce', 'aid=:aid', array($aid), array('ifconvert' => 1));
            }
        } else {
            $aids .= ",{$rt['aid']}";
        }
    }
    if ($aids) {
        $aids = substr($aids, 1);
        $aidcache = $timestamp;
    }
    //* $db->update("UPDATE pw_forumdata SET ".S::sqlSingle(array('aid'=>$aid,'aids'=>$aids,'aidcache'=>$aidcache))."WHERE fid=".S::sqlEscape($fid));
    pwQuery::update('pw_forumdata', 'fid=:fid', array($fid), array('aid' => $aid, 'aids' => $aids, 'aidcache' => $aidcache));
}
예제 #13
0
 /** 添加帮助信息
  * 
  * @param int $hup 上级项目
  * @param array/string $title 标题(数组时,则为批量添加),例如array('忘记密码','选择风格') 或者 '忘记密码'
  * @param array/string $content 内容,如果是数组的话,必须和标题键值一一对应,例如array('忘记密码','选择风格')或者 '忘记密码'
  * @param string $url 外链URL
  * @param int $hid 编辑或者删除时的帮助项ID
  * @param string $action 选择操作add,edit,delete
  * @return int/string 例如:25 或者 25,26
  */
 function insertHelp($hup = 0, $title, $content, $url = '', $hid = 0, $action = 'add')
 {
     //* @include_once pwCache::getPath(D_P.'data/bbscache/help_cache.php');
     extract(pwCache::getData(D_P . 'data/bbscache/help_cache.php', false));
     require_once R_P . 'admin/cache.php';
     $hup = (int) $hup;
     $hid = (int) $hid;
     if ($action == 'add' || $action == 'edit') {
         $url = trim($url);
         if (is_array($title) && $action == 'add') {
             $titledb = $title;
             unset($title);
             $hids = '';
             foreach ($titledb as $key => $title) {
                 $title = trim($title);
                 if (empty($title)) {
                     return new ApiResponse('help_title_empty');
                 }
                 $desc = '';
                 if (is_array($content)) {
                     $desc = $content[$key];
                 } else {
                     $desc = $content;
                 }
                 $desc = str_replace(array("\t", "\r", '  '), array('&nbsp; &nbsp; ', '', '&nbsp; '), trim($desc));
                 $lv = 0;
                 $fathers = '';
                 foreach ($_HELP as $key => $value) {
                     if (strtolower($title) == strtolower($value['title'])) {
                         return new ApiResponse('help_title_exist');
                     }
                     if ($key == $hup) {
                         $lv = $value['lv'] + 1;
                         $fathers = ($value['fathers'] ? "{$value['fathers']}," : '') . $hup;
                         !$value['ifchild'] && $this->db->update("UPDATE pw_help SET ifchild='1' WHERE hid=" . S::sqlEscape($hup));
                     }
                 }
                 $this->db->update("INSERT INTO pw_help" . " SET " . S::sqlSingle(array('hup' => $hup, 'lv' => $lv, 'fathers' => $fathers, 'title' => $title, 'url' => $url, 'content' => $desc, 'vieworder' => 0)));
                 $hid = $this->db->insert_id();
                 $hids .= $hids ? ',' . $hid : $hid;
             }
         } elseif (!is_array($title)) {
             $title = trim($title);
             if (empty($title)) {
                 return new ApiResponse('help_title_empty');
             }
             $content = str_replace(array("\t", "\r", '  '), array('&nbsp; &nbsp; ', '', '&nbsp; '), trim($content));
             $lv = 0;
             $fathers = '';
             if ($action == 'add') {
                 foreach ($_HELP as $key => $value) {
                     if (strtolower($title) == strtolower($value['title'])) {
                         return new ApiResponse('help_title_exist');
                     }
                     if ($key == $hup) {
                         $lv = $value['lv'] + 1;
                         $fathers = ($value['fathers'] ? "{$value['fathers']}," : '') . $hup;
                         !$value['ifchild'] && $this->db->update("UPDATE pw_help SET ifchild='1' WHERE hid=" . S::sqlEscape($hup));
                     }
                 }
                 $this->db->update("INSERT INTO pw_help" . " SET " . S::sqlSingle(array('hup' => $hup, 'lv' => $lv, 'fathers' => $fathers, 'title' => $title, 'url' => $url, 'content' => $content, 'vieworder' => 0)));
                 $hids = $this->db->insert_id();
             } elseif ($action == 'edit') {
                 if ($hid == $hup) {
                     return new ApiResponse('hup_error1');
                 }
                 if ($_HELP[$hid]['hup'] != $hup && strpos(",{$_HELP[$hup][fathers]},", ",{$hid},") !== false) {
                     return new ApiResponse('hup_error2');
                 }
                 foreach ($_HELP as $key => $value) {
                     if ($key != $hid && strtolower($title) == strtolower($value['title'])) {
                         return new ApiResponse('help_title_exist');
                     }
                 }
                 $this->db->update("UPDATE pw_help" . " SET " . S::sqlSingle(array('hup' => $hup, 'title' => $title, 'url' => $url, 'content' => $content, 'vieworder' => 0)) . " WHERE hid=" . S::sqlEscape($hid));
                 $hids = $hid;
             }
         } else {
             return new ApiResponse('help_title_error');
         }
         updatecache_help();
         return new ApiResponse($hids);
     } elseif ($action == 'delete' && $hid > 0) {
         $this->db->update("DELETE FROM pw_help WHERE hid=" . S::sqlEscape($hid) . 'OR hup=' . S::sqlEscape($hid));
         updatecache_help();
         return new ApiResponse(true);
     } else {
         return new ApiResponse('API_OPERATE_ERROR');
     }
 }
예제 #14
0
파일: sendmsg.php 프로젝트: jechiy/PHPWind
         Perf::gatherInfo('changeMembersWithUserIds', array('uid' => $_uids));
     }
     //* 清除pw_members缓存 end
     if ($havesend < $count) {
         $step++;
         $j_url = "{$basename}&action={$action}&step={$step}&sendto=" . implode(',', $sendto) . "&by={$by}&count={$count}";
         adminmsg("sendmsg_step", EncodeUrl($j_url), 1);
     }
     adminmsg('operate_success');
 } elseif ($by == 2) {
     $cache_file = D_P . "data/bbscache/" . substr(md5($admin_pwd), 10, 10) . ".txt";
     if (!$step) {
         pwCache::setData($cache_file, $atc_content);
     } else {
         //* $atc_content = readover($cache_file);
         $atc_content = pwCache::getData($cache_file, false, true);
     }
     if (empty($subject) || empty($atc_content)) {
         adminmsg('sendmsg_empty');
     }
     $subject = S::escapeChar($subject);
     $sendmessage = S::escapeChar($atc_content);
     $percount = 100;
     empty($step) && ($step = 1);
     //
     $userService = L::loadClass('UserService', 'user');
     /* @var $userService PW_UserService */
     $db_onlinetime = $db_onlinetime > 0 ? $db_onlinetime : 1200;
     $onlineuser = array();
     if ($onlineusers = $userService->findOnlineUsers($timestamp - $db_onlinetime)) {
         foreach ($onlineusers as $user) {
예제 #15
0
 function getFileCache()
 {
     if (!$this->_cache) {
         return array();
     }
     //* @include_once pwCache::getPath ( S::escapePath ( $this->getCacheFileName () ), true );
     extract(pwCache::getData(S::escapePath($this->getCacheFileName()), false));
     $jobLists = $jobLists ? $jobLists : $GLOBALS['jobLists'];
     if ($jobLists) {
         return $jobLists;
     }
     return $this->setFileCache();
 }
예제 #16
0
파일: setbwd.php 프로젝트: jechiy/PHPWind
function setScanCache()
{
    global $db, $timestamp, $db_plist;
    # 获取回复表
    if ($db_plist && is_array($db_plist)) {
        foreach ($db_plist as $key => $value) {
            if ($key > 0) {
                $postslist[] = 'pw_posts' . (int) $key;
            } else {
                $postslist[] = 'pw_posts';
            }
        }
    } else {
        $postslist[] = 'pw_posts';
    }
    if (file_exists(D_P . 'data/bbscache/wordsfb_progress.php')) {
        # 读取缓存
        //* require_once pwCache::getPath(D_P.'data/bbscache/wordsfb_progress.php');
        pwCache::getData(D_P . 'data/bbscache/wordsfb_progress.php');
        $temp_threaddb = unserialize($threaddb);
    } else {
        $temp_threaddb = array();
    }
    $forum = $catedb = $forumdb = $subdb1 = $subdb2 = $threaddb = array();
    # 获取版块列表
    $query = $db->query("SELECT fid,name,fup,type FROM pw_forums WHERE cms!='1' ORDER BY vieworder");
    while ($forums = $db->fetch_array($query)) {
        $forums['name'] = Quot_cv(strip_tags($forums['name']));
        if ($forums['type'] == 'category') {
            $catedb[] = $forums;
        } elseif ($forums['type'] == 'forum') {
            $forumdb[] = $forums;
        } elseif ($forums['type'] == 'sub') {
            $subdb1[] = $forums;
        } else {
            $subdb2[] = $forums;
        }
    }
    foreach ($catedb as $cate) {
        $threaddb[$cate['fid']] = array();
        foreach ($forumdb as $key2 => $forumss) {
            if ($forumss['fup'] == $cate['fid']) {
                if (!array_key_exists($forumss['fid'], $temp_threaddb[$cate['fid']])) {
                    # 读取版块帖子总数和表进度
                    $forumss['count'] = 0;
                    $forumss['progress'] = 0;
                    $forumss['result'] = 0;
                    $forumss['table_progress']['pw_threads'] = 0;
                    foreach ($postslist as $pw_posts) {
                        $forumss['table_progress'][$pw_posts] = 0;
                    }
                    $threaddb[$cate['fid']][$forumss['fid']] = $forumss;
                } else {
                    $threaddb[$cate['fid']][$forumss['fid']] = $temp_threaddb[$cate['fid']][$forumss['fid']];
                    unset($threaddb[$cate['fid']][$forumss['fid']]['table_progress']);
                    $threaddb[$cate['fid']][$forumss['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$forumss['fid']]['table_progress']['pw_threads'];
                    foreach ($postslist as $pw_posts) {
                        $threaddb[$cate['fid']][$forumss['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$forumss['fid']]['table_progress'][$pw_posts];
                    }
                }
                unset($forumdb[$key2]);
                foreach ($subdb1 as $key3 => $sub1) {
                    if ($sub1['fup'] == $forumss['fid']) {
                        if (!array_key_exists($sub1['fid'], $temp_threaddb[$cate['fid']])) {
                            # 读取版块帖子总数和表进度
                            $sub1['count'] = 0;
                            $sub1['progress'] = 0;
                            $sub1['result'] = 0;
                            $sub1['table_progress']['pw_threads'] = 0;
                            foreach ($postslist as $pw_posts) {
                                $sub1['table_progress'][$pw_posts] = 0;
                            }
                            $threaddb[$cate['fid']][$sub1['fid']] = $sub1;
                        } else {
                            $threaddb[$cate['fid']][$sub1['fid']] = $temp_threaddb[$cate['fid']][$sub1['fid']];
                            unset($threaddb[$cate['fid']][$sub1['fid']]['table_progress']);
                            $threaddb[$cate['fid']][$sub1['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$sub1['fid']]['table_progress']['pw_threads'];
                            foreach ($postslist as $pw_posts) {
                                $threaddb[$cate['fid']][$sub1['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$sub1['fid']]['table_progress'][$pw_posts];
                            }
                        }
                        unset($subdb1[$key3]);
                        foreach ($subdb2 as $key4 => $sub2) {
                            if ($sub2['fup'] == $sub1['fid']) {
                                if (!array_key_exists($sub2['fid'], $temp_threaddb[$cate['fid']])) {
                                    # 读取版块帖子总数和表进度
                                    $sub2['count'] = 0;
                                    $sub2['progress'] = 0;
                                    $sub2['result'] = 0;
                                    $sub2['table_progress']['pw_threads'] = 0;
                                    foreach ($postslist as $pw_posts) {
                                        $sub2['table_progress'][$pw_posts] = 0;
                                    }
                                    $threaddb[$cate['fid']][$sub2['fid']] = $sub2;
                                } else {
                                    $threaddb[$cate['fid']][$sub2['fid']] = $temp_threaddb[$cate['fid']][$sub2['fid']];
                                    unset($threaddb[$cate['fid']][$sub2['fid']]['table_progress']);
                                    $threaddb[$cate['fid']][$sub2['fid']]['table_progress']['pw_threads'] = $temp_threaddb[$cate['fid']][$sub2['fid']]['table_progress']['pw_threads'];
                                    foreach ($postslist as $pw_posts) {
                                        $threaddb[$cate['fid']][$sub2['fid']]['table_progress'][$pw_posts] = $temp_threaddb[$cate['fid']][$sub2['fid']]['table_progress'][$pw_posts];
                                    }
                                }
                                unset($subdb2[$key4]);
                            }
                        }
                    }
                }
            }
        }
    }
    $catedb = serialize($catedb);
    $threaddb = serialize($threaddb);
    # 写入文件
    $filecontent = "<?php\r\n";
    $filecontent .= "\$catedb=" . pw_var_export($catedb) . ";\r\n";
    $filecontent .= "\$threaddb=" . pw_var_export($threaddb) . ";\r\n";
    $filecontent .= "?>";
    $cahce_file = D_P . 'data/bbscache/wordsfb_progress.php';
    pwCache::setData($cahce_file, $filecontent);
    setConfig('db_wordsfb_cachetime', $timestamp);
    updatecache_c();
    return array('catedb' => $catedb, 'threaddb' => $threaddb);
}
예제 #17
0
파일: addfloor.php 프로젝트: jechiy/PHPWind
function threadrelated($relatedcon)
{
    global $db, $db_iftag, $db_threadrelated, $forumset, $fid, $read, $tid, $db_modes, $db_dopen, $db_phopen, $db_share_open, $db_groups_open, $groupid, $timestamp;
    $relatedb = array();
    if (in_array($relatedcon, array('allpost', 'alldigest', 'allhits', 'allreply', 'forumpost', 'forumdigest', 'forumhits', 'forumreply'))) {
        //require_once(R_P.'require/element.class.php');
        //$element = new Element($forumset['relatednums']);
        $element = L::loadClass('element');
        $element->setDefaultNum($forumset['relatednums']);
        switch ($relatedcon) {
            case 'allpost':
                $relatedb = $element->newSubject();
                break;
            case 'alldigest':
                $relatedb = $element->digestSubject();
                break;
            case 'allhits':
                $relatedb = $element->hitSort();
                break;
            case 'allreply':
                $relatedb = $element->replySort();
                break;
            case 'forumpost':
                $relatedb = $element->newSubject($fid);
                break;
            case 'forumdigest':
                $relatedb = $element->digestSubject($fid);
                break;
            case 'forumhits':
                $relatedb = $element->hitSort($fid);
                break;
            case 'forumreply':
                $relatedb = $element->replySort($fid);
                break;
        }
    } elseif ($relatedcon == 'oinfo') {
        //继续改进
        if ($db_modes['o']['ifopen']) {
            require_once "require/app_core.php";
            $addwhere = '';
            if (!$db_dopen) {
                $addwhere .= " AND type!='diary'";
            }
            if (!$db_phopen) {
                $addwhere .= " AND type!='photo'";
            }
            if (!$db_share_open) {
                $addwhere .= " AND type!='share'";
            }
            if (!$db_groups_open) {
                $addwhere .= " AND type!='colony'";
            }
            $query = $db->query("SELECT type,descrip FROM pw_feed WHERE uid=" . S::sqlEscape($read['authorid']) . $addwhere . " ORDER BY timestamp DESC  " . S::sqlLimit(0, $forumset['relatednums']));
            while ($rt = $db->fetch_array($query)) {
                $rt['title'] = parseFeedRead($rt['descrip']);
                $rt['url'] = USER_URL . "{$read['authorid']}";
                unset($rt['type']);
                $relatedb[] = $rt;
            }
        }
    } elseif (in_array($relatedcon, array('pictags', 'hottags'))) {
        $tagid = $tagdbs = array();
        $endtime = $timestamp - 30 * 24 * 3600;
        $sql = 'WHERE t.ifcheck=1 AND t.tid !=' . S::sqlEscape($tid) . ' AND t.postdate >=' . S::sqlEscape($endtime);
        $fidout = array('0');
        $query = $db->query("SELECT fid,allowvisit,password FROM pw_forums WHERE type<>'category'");
        while ($rt = $db->fetch_array($query)) {
            $allowvisit = !$rt['allowvisit'] || $rt['allowvisit'] != str_replace(",{$groupid},", '', $rt['allowvisit']) ? true : false;
            if ($rt['password'] || !$allowvisit) {
                $fidout[] = $rt['fid'];
            }
        }
        $fidout = S::sqlImplode($fidout);
        $fidout && ($sql .= " AND fid NOT IN ({$fidout})");
        if ($db_iftag) {
            if ($read['tags'] && $relatedcon == 'pictags') {
                list($tagdb, $tpc_tag) = explode("\t", $read['tags']);
                $tagdbs = explode(' ', $tagdb);
            } elseif ($relatedcon == 'hottags') {
                //* @include_once (D_P.'data/bbscache/tagdb.php');
                extract(pwCache::getData(D_P . "data/bbscache/tagdb.php", false));
                $j = 0;
                foreach ($tagdb as $key => $val) {
                    $j++;
                    if ($j > 5) {
                        break;
                    }
                    $tagdbs[] = $key;
                }
                unset($tagdb);
            }
            if ($tagdbs) {
                $query = $db->query("SELECT tagid FROM pw_tags WHERE tagname IN(" . S::sqlImplode($tagdbs) . ')');
                while ($rt = $db->fetch_array($query)) {
                    $tagid[] = $rt['tagid'];
                }
            }
            if ($tagid) {
                $query = $db->query("SELECT t.tid,t.subject FROM pw_tagdata tg LEFT JOIN pw_threads t USING(tid) {$sql} AND tg.tagid IN(" . S::sqlImplode($tagid) . ") GROUP BY tid ORDER BY postdate DESC " . S::sqlLimit(0, $forumset['relatednums']));
                while ($rt = $db->fetch_array($query)) {
                    $rt['title'] = $rt['subject'];
                    $rt['url'] = "read.php?tid=" . $rt['tid'];
                    unset($rt['subject']);
                    unset($rt['tid']);
                    $relatedb[] = $rt;
                }
            }
        }
    } elseif (in_array($relatedcon, array('ownpost', 'owndigest', 'ownhits', 'ownreply'))) {
        $endtime = $timestamp - 15 * 24 * 3600;
        $sql = "WHERE ifcheck=1 AND tid !=" . S::sqlEscape($tid) . "AND postdate >=" . S::sqlEscape($endtime) . " AND authorid=" . S::sqlEscape($read['authorid']) . " AND fid>0 ";
        $orderby = '';
        switch ($relatedcon) {
            case 'ownpost':
                $orderby .= " ORDER BY postdate DESC";
                break;
            case 'owndigest':
                $sql .= " AND digest>0";
                $orderby .= " ORDER BY postdate DESC";
                break;
            case 'ownhits':
                $orderby .= " ORDER BY hits DESC";
                break;
            case 'ownreply':
                $orderby .= " ORDER BY replies DESC";
                break;
        }
        $query = $db->query("SELECT tid,subject FROM pw_threads FORCE INDEX(" . getForceIndex('idx_postdate') . ") {$sql} {$orderby}" . S::sqlLimit(0, $forumset['relatednums']));
        while ($rt = $db->fetch_array($query)) {
            $rt['title'] = $rt['subject'];
            $rt['url'] = "read.php?tid=" . $rt['tid'];
            unset($rt['subject']);
            unset($rt['tid']);
            $relatedb[] = $rt;
        }
    }
    return $relatedb;
}
예제 #18
0
 }
 if ($days < $rt['sright']['selllimit']) {
     Showmsg('special_selllimit');
 }
 $userService = L::loadClass('UserService', 'user');
 /* @var $userService PW_UserService */
 $mb = $userService->get($winduid);
 if ($gid == $groupid || strpos($mb['groups'], ",{$gid},") !== false) {
     Showmsg('specialgroup_noneed');
 }
 if ($buymethod) {
     if ($rt['sright']['rmbprice'] <= 0) {
         Showmsg('undefined_action');
     }
     //* include_once pwCache::getPath(D_P.'data/bbscache/ol_config.php');
     pwCache::getData(D_P . 'data/bbscache/ol_config.php');
     if (!$ol_onlinepay) {
         Showmsg($ol_whycolse);
     }
     $grouptitle = $rt['grouptitle'];
     $order_no = '1' . str_pad($winduid, 10, "0", STR_PAD_LEFT) . get_date($timestamp, 'YmdHis') . num_rand(5);
     $db->update("INSERT INTO pw_clientorder SET " . S::sqlSingle(array('order_no' => $order_no, 'type' => 3, 'uid' => $winduid, 'paycredit' => $gid, 'price' => $rt['sright']['rmbprice'], 'number' => $days, 'date' => $timestamp, 'state' => 0, 'extra_1' => $options)));
     if (!$ol_payto) {
         Showmsg('olpay_alipayerror');
     }
     require_once R_P . 'require/onlinepay.php';
     $olpay = new OnlinePay($ol_payto);
     ObHeader($olpay->alipayurl($order_no, round($rt['sright']['rmbprice'] * $days, 2), 3));
 }
 if (md5($pwpwd) != $mb['password']) {
     Showmsg('password_error');
예제 #19
0
 function checkIsOpenInviteCode()
 {
     $fileName = D_P . 'data/bbscache/dbreg.php';
     if (!is_file($fileName)) {
         return false;
     }
     //* @include pwCache::getPath(S::escapePath($fileName));
     extract(pwCache::getData(S::escapePath($fileName), false));
     if ($rg_allowregister == 2) {
         return true;
     }
     return false;
 }
예제 #20
0
 function _getOpenforums()
 {
     extract(pwCache::getData(D_P . 'data/bbscache/forum_cache_openforum.php', false));
     return $openforum;
 }
예제 #21
0
 function relate($subject, $content)
 {
     //* @include (D_P.'data/bbscache/tagdb.php');
     extract(pwCache::getData(D_P . "data/bbscache/tagdb.php", false));
     $i = 0;
     $tags = '';
     if (!$tagdb) {
         return '';
     }
     foreach ($tagdb as $tag => $num) {
         if (strpos($subject, $tag) !== false || strpos($content, $tag) !== false) {
             $tags .= $tags ? ' ' . $tag : $tag;
             if (++$i > 9) {
                 break;
             }
         }
     }
     return $tags;
 }
예제 #22
0
     !is_numeric($ptable) && ($ptable = $db_ptable);
     foreach ($db_plist as $key => $val) {
         $name = $val ? $val : ($key != 0 ? getLangInfo('other', 'posttable') . $key : getLangInfo('other', 'posttable'));
         $p_table .= "<option value=\"{$key}\">" . $name . "</option>";
     }
     $p_table = str_replace("<option value=\"{$ptable}\">", "<option value=\"{$ptable}\" selected>", $p_table);
     $url_a .= "ptable={$ptable}&";
     $pw_posts = GetPtable($ptable);
 } else {
     $pw_posts = 'pw_posts';
 }
 $rt = $db->get_one("SELECT COUNT(*) AS sum FROM {$pw_posts} WHERE fid=" . S::sqlEscape($fid) . " AND ifcheck='0' {$sql}");
 $pages = numofpage($rt['sum'], $page, ceil($rt['sum'] / $db_perpage), "forumcp.php?action=edit&type={$type}&fid={$fid}&{$url_a}");
 $postdb = $tids = array();
 //* include_once pwCache::getPath(D_P.'data/bbscache/wordsfb.php');
 pwCache::getData(D_P . 'data/bbscache/wordsfb.php');
 $query = $db->query("SELECT pid,tid,subject,author,authorid,postdate,content,aid,ifconvert FROM {$pw_posts} WHERE fid=" . S::sqlEscape($fid) . " AND ifcheck='0' {$sql} {$limit}");
 while ($rt = $db->fetch_array($query)) {
     if ($rt['subject']) {
         $rt['subject'] = substrs($rt['subject'], 35);
     } else {
         $rt['subject'] = substrs($rt['content'], 35);
     }
     $rt['postdate'] = get_date($rt['postdate']);
     $rt['content'] = str_replace("\n", "<br>", $rt['content']);
     $rt['ifconvert'] == 2 && ($rt['content'] = convert($rt['content'], $db_windpost));
     foreach ($alarm as $key => $value) {
         $rt['content'] = str_replace($key, '<span style="background-color:#ffff66">' . $key . '</span>', $rt['content']);
     }
     $postdb[$rt['pid']] = $rt;
     if ($rt['aid']) {
예제 #23
0
         } else {
             $sch['groupselect'] = str_replace("<option value='{$sch['groupid']}'>" . $ltitle[$sch['groupid']] . "</option>", "<option value='{$sch['groupid']}' selected>" . $ltitle[$sch['groupid']] . "</option>", $groupselect);
         }
         $schdb[] = $sch;
     }
     if (empty($schdb) && $schname) {
         $errorname = $schname;
         Showmsg('user_not_exists');
     }
     include PrintEot('usermanage');
     exit;
 } elseif ($action == 'edit') {
     S::gp(array('uid'), 'GP', 2);
     $temUid = $uid;
     //* include_once pwCache::getPath(D_P.'data/bbscache/customfield.php');
     pwCache::getData(D_P . 'data/bbscache/customfield.php');
     require_once R_P . 'require/showimg.php';
     if (empty($_POST['step'])) {
         $userService = L::loadClass('UserService', 'user');
         /* @var $userService PW_UserService */
         @extract($userService->get($uid, true, true, true));
         $messageServer = L::loadClass('message', 'message');
         $config = $messageServer->getMsConfigs($uid);
         $banpm = implode(',', unserialize($config['blacklist']));
         $messageServer = L::loadClass('message', 'message');
         $messageServer->grabMessage($uid, array($groupid == '-1' ? $memberid : $groupid), max($lastgrab, $regdate));
         $rvrc = floor($rvrc / 10);
         if (strpos($onlineip, '|')) {
             $onlineip = substr($onlineip, 0, strpos($onlineip, '|'));
         }
         $onlinetime = floor($onlinetime / 3600);
예제 #24
0
파일: slide.php 프로젝트: jechiy/PHPWind
<?php

define('SCR', 'read');
require_once 'global.php';
L::loadClass('forum', 'forum', false);
require_once R_P . 'require/bbscode.php';
//* include_once pwCache::getPath(D_P.'data/bbscache/cache_read.php',true);
pwCache::getData(D_P . 'data/bbscache/cache_read.php');
S::gp(array('tid'));
if (Perf::checkMemcache()) {
    $_cacheService = Perf::getCacheService();
    $_thread = $_cacheService->get('thread_tid_' . $tid);
    $_thread && ($_tmsg = $_cacheService->get('thread_tmsg_tid_' . $tid));
    $read = $_thread && $_tmsg ? array_merge($_thread, $_tmsg) : false;
    if (!$read) {
        $_cacheService = Perf::gatherCache('pw_threads');
        $read = $page > 1 ? $_cacheService->getThreadByThreadId($tid) : $_cacheService->getThreadAndTmsgByThreadId($tid);
    }
} else {
    $read = $db->get_one("SELECT t.* ,tm.* FROM pw_threads t LEFT JOIN " . S::sqlMetadata(GetTtable($tid)) . " tm ON t.tid=tm.tid WHERE t.tid=" . S::sqlEscape($tid));
}
!$read && Showmsg('illegal_tid');
$postdate = get_date($read['postdate'], 'Y-m-d');
list($fid, $ptable, $ifcheck, $openIndex, $topped_count, $subject, $authorid, $author) = array($read['fid'], $read['ptable'], $read['ifcheck'], getstatus($read['tpcstatus'], 2), $read['topreplays'], $read['subject'], $read['authorid'], $read['author']);
$pw_posts = GetPtable($ptable);
$pwforum = new PwForum($fid);
if (!$pwforum->isForum()) {
    Showmsg('data_error');
}
$foruminfo =& $pwforum->foruminfo;
$forumset =& $pwforum->forumset;
예제 #25
0
<?php

!function_exists('readover') && exit('Forbidden');
//set_time_limit(1000);
//* @include pwCache::getPath(D_P.'data/bbscache/mail_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/mail_config.php', false));
$GLOBALS['M_db'] = new Mailconfig(array('ifopen' => $ml_mailifopen, 'method' => $ml_mailmethod, 'host' => $ml_smtphost, 'port' => $ml_smtpport, 'auth' => $ml_smtpauth, 'from' => $ml_smtpfrom, 'user' => $ml_smtpuser, 'pass' => $ml_smtppass, 'smtphelo' => $ml_smtphelo, 'smtpmxmailname' => $ml_smtpmxmailname, 'mxdns' => $ml_mxdns, 'mxdnsbak' => $ml_mxdnsbak));
class Mailconfig
{
    var $S_method = 1;
    var $smtp;
    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'];
예제 #26
0
<?php

!defined('A_P') && exit('Forbidden');
!$db_dopen && Showmsg('dairy_close');
$USCR = 'user_diary';
//* include pwCache::getPath(R_P. 'data/bbscache/o_config.php');
pwCache::getData(R_P . 'data/bbscache/o_config.php');
//* require_once pwCache::getPath(D_P."data/bbscache/forum_cache.php");
pwCache::getData(D_P . "data/bbscache/forum_cache.php");
require_once R_P . 'require/showimg.php';
if (!($space =& $newSpace->getInfo())) {
    Showmsg('您访问的空间不存在!');
}
$isGM = S::inArray($windid, $manager);
!$isGM && $groupid == 3 && ($isGM = 1);
$indexRight = $newSpace->viewRight('index');
$indexValue = $newSpace->getPrivacyByKey('index');
$diaryRight = $indexRight == true ? $newSpace->viewRight('diary') : false;
$diaryValue = $indexValue != 2 ? $newSpace->getPrivacyByKey('diary') : '2';
if ($db_question && $o_diary_qcheck) {
    $qkey = array_rand($db_question);
}
S::gp(array('a', 'uid', 'username', 'page', 'ajax'));
if ($username && !$uid) {
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $uid = $userService->getUserIdByUserName($username);
}
$uid = intval($uid);
$page = intval($page);
$page < 1 && ($page = 1);
 function countHotTagsNum()
 {
     if (!file_exists($this->_memberTagDbFile)) {
         $this->setTopCache();
     }
     extract(pwCache::getData($this->_memberTagDbFile, false));
     if (!S::isArray($memberTagsData)) {
         return 0;
     }
     return count($memberTagsData);
 }
예제 #28
0
 function _get_RateConfigResultCache($rateConfigs)
 {
     //每一个小时更新一次
     $filePath = $this->_getReteConfigFilePath($this->_typeId);
     if (!file_exists($filePath) || time() - filemtime($filePath) > 3600) {
         $weekHTML = $this->_buildWeekResultHtml($rateConfigs);
         pwCache::setData(s::escapePath($filePath), $weekHTML);
         //write ignore null or not
     } else {
         //* $weekHTML = readover ( $filePath );
         $weekHTML = pwCache::getData(S::escapePath($filePath), false, true);
     }
     return $weekHTML;
 }
예제 #29
0
<?php

!function_exists('adminmsg') && exit('Forbidden');
$basename = "{$admin_file}?adminjob=forumsell";
if (empty($action)) {
    require_once R_P . 'require/credit.php';
    //* include_once pwCache::getPath(D_P.'data/bbscache/forumcache.php');
    pwCache::getData(D_P . 'data/bbscache/forumcache.php');
    S::gp(array('username'));
    S::gp(array('page', 'uid', 'fid'), 'GP', 2);
    $sql = "WHERE 1";
    if ($username) {
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        $userdb = $userService->getByUserName($username);
        if (!$userdb) {
            $errorname = $username;
            adminmsg('user_not_exists');
        }
        $uid = $userdb['uid'];
    }
    if ($uid) {
        $sql .= " AND fs.uid=" . S::sqlEscape($uid);
    }
    if ($fid) {
        $sql .= " AND fs.fid=" . S::sqlEscape($fid);
    }
    $page < 1 && ($page = 1);
    $limit = S::sqlLimit(($page - 1) * $db_perpage, $db_perpage);
    $rt = $db->get_one("SELECT COUNT(*) AS sum FROM pw_forumsell fs {$sql}");
    $pages = numofpage($rt['sum'], $page, ceil($rt['sum'] / $db_perpage), "{$basename}&uid={$uid}&fid={$fid}&");
예제 #30
0
            if (!$email || !isEmail($email)) {
                unset($emails[$key]);
            }
        }
    }
    !$emails && ajaxExport('mail_is_empty');
    $invcodes = explode(',', trim($invcodes, ','));
    $invlink = '';
    foreach ($invcodes as $key => $value) {
        $invlink .= '<a href=\\"' . $db_bbsurl . '/' . $db_registerfile . '?invcode=' . $value . '\\">' . $db_bbsurl . '/' . $db_registerfile . '?invcode=' . $value . '</a><br>';
    }
    $invite->sendInviteCode($emails);
    ajaxExport('success');
} elseif ($step == 'simple') {
    //* require_once pwCache::getPath(D_P . 'data/bbscache/dbreg.php');
    extract(pwCache::getData(D_P . 'data/bbscache/dbreg.php', false));
    $email_content = '';
    if ($rg_allowregister == 1) {
        $email_content .= $inv_linkcontent . "\r\n";
    } elseif ($rg_allowregister == 2) {
        S::gp(array('invcode'), 'GP');
        $invcode = trim($invcode, ',');
        //$invitelink = '<a href="' . $db_bbsurl . '/' . $db_registerfile . '?invcode=' . $invcode . '">' . $db_bbsurl . '/' . $db_registerfile . '?invcode=' . $invcode . '</a><br>';
        $inv_email = str_replace(array('$username', '$sitename', '$invitecode', '$uid'), array($windid, $db_sitename, $invcode, $winduid), $inv_email);
        $email_content .= $inv_email . "\r\n";
    }
} elseif ($step == 'delInvCode') {
    S::gp(array('invcode'), 'GP');
    empty($invcode) && ajaxExport("请选择要删除的邀请码");
    $invcode = explode(',', trim($invcode, ','));
    $db->update("DELETE FROM pw_invitecode WHERE id IN (" . S::sqlImplode($invcode) . ") AND uid=" . S::sqlEscape($winduid));