Пример #1
0
/**
 * 默认添加数据
 */
if ($action == 'custom') {
    if (!file_exists(D_P . 'data/sql_config.php')) {
        Promptmsg('config_noexists', 'database');
    } else {
        $db = pwNewDBForInstall();
    }
    require R_P . 'lang/step/updatead.php';
    require R_P . 'lang/step/topic.php';
    require R_P . 'lang/step/pcfield.php';
    require R_P . 'lang/step/nav.php';
    require R_P . 'lang/step/pw_areas.php';
    require R_P . 'lang/step/pw_school.php';
    $areaService = L::LoadClass('areasservice', 'utility');
    $areaService->setAreaCache();
    list($prev, $next) = getStepto($action);
    pwHeader("{$basename}?action={$next}");
    exit;
}
/**
 * 生成站点各种信息,添加默认风格,更新缓存
 */
if ($action == 'other') {
    if (!file_exists(D_P . 'data/sql_config.php')) {
        Promptmsg('config_noexists', 'database');
    } else {
        $db = pwNewDBForInstall();
    }
    $writeinto = str_pad('<?php die;?>', 96) . "\r\n";
Пример #2
0
 /**
  * 添加话题
  * @param array $topics 新鲜事中包含的话题
  * @param int mid 新鲜事id
  * @return int
  * @access public
  */
 function addTopics($topics, $mid)
 {
     if (!$topics || !is_array($topics) || !$mid) {
         return false;
     }
     $topicService = L::LoadClass('topic', 'sns');
     /* @var $topicService PW_Topic */
     $array = $topicService->addTopic($topics);
     if ($array) {
         //添加topic 与weibo 关系
         foreach ($array as $v) {
             $topicService->addTopicRelations($v, $mid);
         }
     }
 }
Пример #3
0
$weiboCount = $weiboService->getUserAttentionWeibosCount($winduid, array());
$weiboCount > WEIBO_RELATION_NUM && $weiboService->deleteAttentionRelation($winduid, $weiboCount);
$o_weibopost == '0' && ($weiboLiveList = $weiboService->getWeiboLives(21));
//新鲜事直播
$weiboCount > WEIBO_RELATION_NUM && ($weiboCount = WEIBO_RELATION_NUM);
$pages = numofpage($weiboCount, 1, ceil($weiboCount / 20), 'apps.php?q=weibo&do=attention&', 10, 'weiboList.filterWeibo');
if (!$db_toolbar) {
    $pwForumList = array();
    //* include_once pwCache::getPath(D_P.'data/bbscache/forumlist_cache.php');
    pwCache::getData(D_P . 'data/bbscache/forumlist_cache.php');
    if ($pwForumAllList && $GLOBALS['groupid'] == 3) {
        $pwForumList = array_merge($pwForumList, $pwForumAllList);
    }
}
//热门话题
$topicService = L::LoadClass('topic', 'sns');
/* @var $topicService PW_Topic */
$weiboHotTopics = $topicService->getWeiboHotTopics();
$topicHot = array();
$n = 0;
foreach ($weiboHotTopics as $key => $topic) {
    if (++$n > 6) {
        break;
    }
    $topic['urlTopic'] = urlencode($topic['topicname']);
    $topicHot[$key] = $topic;
}
(empty($winddb['honor']) || !$_G['allowhonor']) && ($winddb['honor'] = getLangInfo('other', 'whattosay'));
//任务
if ($db_job_isopen) {
    $isApplyJob = false;
Пример #4
0
<?php

!defined('P_W') && exit('Forbidden');
define('AJAX', '1');
S::gp(array('type', 'areaid'), 2);
S::gp(array('job', 'sid'));
if (empty($job)) {
    $jsFile = D_P . 'data/bbscache/areadata.js';
    if (!file_exists($jsFile)) {
        $areaService = L::LoadClass('areasservice', 'utility');
        $areaService->setAreaCache();
    }
    require_once PrintEot('ajax');
    footer();
} elseif ($job == 'getschools') {
    $schoolService = L::LoadClass('schoolservice', 'user');
    $schools = $schoolService->getByAreaAndType($areaid, $type);
    echo pwJsonEncode($schools);
    ajax_footer();
} elseif ($job == 'deleducation') {
    S::gp(array('educationid'));
    $educationid = (int) $educationid;
    if ($educationid < 1) {
        echo "error\t数据错误";
        ajax_footer();
        exit;
    }
    $educationService = L::loadClass('EducationService', 'user');
    $educationItemInfo = $educationService->getEducationById($educationid);
    if (!S::isArray($educationItemInfo) || $educationItemInfo['uid'] != $winduid) {
        echo "error\t非法操作";
    function buildArea()
    {
        static $areaService;
        !$areaService && ($areaService = L::LoadClass('AreasService', 'utility'));
        //$id = md5(microtime());
        $id = $this->fieldInfo['fieldname'];
        if (!S::isArray($this->defaultValue)) {
            $basicValue = !S::isArray($this->fieldInfo['options']) ? array(array('parentid' => 0, 'selectid' => 'province_' . $id, 'defaultid' => '', 'hasfirst' => 1), array('parentid' => -1, 'selectid' => 'city_' . $id, 'defaultid' => '', 'hasfirst' => 1), array('parentid' => -1, 'selectid' => 'area_' . $id, 'defaultid' => '', 'hasfirst' => 1)) : array(array('parentid' => 0, 'selectid' => 'province_' . $id, 'defaultid' => intval($this->fieldInfo['options']['province']), 'hasfirst' => 1), array('parentid' => intval($this->fieldInfo['options']['province']), 'selectid' => 'city_' . $id, 'defaultid' => intval($this->fieldInfo['options']['city']), 'hasfirst' => 1), array('parentid' => intval($this->fieldInfo['options']['city']), 'selectid' => 'area_' . $id, 'defaultid' => intval($this->fieldInfo['options']['area']), 'hasfirst' => 1));
        } else {
            $basicValue = array(array('parentid' => 0, 'selectid' => 'province_' . $id, 'defaultid' => intval($this->defaultValue['province']), 'hasfirst' => 1), array('parentid' => $this->defaultValue['province'], 'selectid' => 'city_' . $id, 'defaultid' => intval($this->defaultValue['city']), 'hasfirst' => 1), array('parentid' => $this->defaultValue['city'], 'selectid' => 'area_' . $id, 'defaultid' => intval($this->defaultValue['area']), 'hasfirst' => 1));
        }
        $this->fieldInfo['html_areascripts'] = $areaService->buildAllAreasLists($basicValue);
        if (!$this->loadedScripts['area']) {
            $this->fieldInfo['html_areascripts'] .= <<<EOT
\t<script src="js/pw_areas.js"></script>
EOT;
            $this->loadedScripts['area'] = true;
        }
        $this->fieldInfo['html_areaprovince'] = <<<EOT
\t\t\t<select id="province_{$id}" {$this->disabledHtml} onchange="changeSubArea(this.value, 'city_{$id}',0,true);" class="w" style="width:70px;"></select>
EOT;
        $this->fieldInfo['html_areacity'] = <<<EOT
\t\t\t<select id="city_{$id}" {$this->disabledHtml} onchange="changeSubArea(this.value, 'area_{$id}',0,true);" class="w" style="width:70px;">
\t\t\t</select>
EOT;
        $this->fieldInfo['html_areaarea'] = <<<EOT
\t\t\t<select id="area_{$id}" {$this->disabledHtml} name="{$this->fieldInfo[fieldname]}" class="w" style="width:70px;">
\t\t\t</select>
EOT;
    }