예제 #1
0
 function PwSpace($uid)
 {
     global $db, $winduid, $db_phopen, $db_dopen, $db_groups_open;
     $this->_db =& $db;
     $this->uid = $uid;
     $userService = L::loadClass('UserService', 'user');
     if ($winduid && $winduid == $uid) {
         $this->info = $GLOBALS['winddb'];
         $this->info['isMe'] = 1;
     } elseif ($userdb = $userService->get($this->uid, true, true, true)) {
         //$userdb['rvrc'] /= 10;
         $this->info = $userdb;
     }
     if ($this->info) {
         if (perf::checkMemcache()) {
             $_cacheService = Perf::gatherCache('pw_space');
             $space = $_cacheService->getSpaceByUid($this->uid);
         } else {
             $space = $this->_db->get_one("SELECT * FROM pw_space WHERE uid=" . S::sqlEscape($this->uid));
         }
         if ($space) {
             $this->info = array_merge($this->info, $space);
             if ($this->info['banner']) {
                 list($this->info['banner_s']) = geturl($this->info['banner'], 'lf');
             }
         } else {
             $this->default = true;
         }
         $spaceGroupid = $this->info['groupid'] == -1 ? $this->info['memberid'] : $this->info['groupid'];
         include pwCache::getPath(D_P . "data/groupdb/group_{$spaceGroupid}.php");
         $this->info['generalRight'] = $_G;
         !$this->info['name'] && ($this->info['name'] = $this->info['username'] . '的个人主页');
         !$this->info['skin'] && ($this->info['skin'] = 'default85');
         $GLOBALS['uskin'] =& $this->info['skin'];
     }
     if ($db_dopen) {
         $this->models[] = 'diary';
     }
     if ($db_phopen) {
         $this->models[] = 'photos';
     }
     if ($db_groups_open) {
         $this->models[] = 'colony';
     }
 }
예제 #2
0
파일: sort.php 프로젝트: jechiy/PHPWind
        uasort($admindb, "cmp");
        $sort_a[$type] = "class='link_down'";
    }
    require PrintEot('sort');
    footer();
} elseif ($action == 'delsort') {
    PostCheck();
    S::gp(array('month'));
    (!$month || !is_numeric($month) || $groupid != '3') && Showmsg('undefined_action');
    if (file_exists(D_P . 'data/bbscache/admin_sort_' . $month . '.php')) {
        //* P_unlink(D_P.'data/bbscache/admin_sort_'.$month.'.php');
        pwCache::deleteData(D_P . 'data/bbscache/admin_sort_' . $month . '.php');
    }
    refreshto("sort.php?action=admin", 'operate_success');
} elseif ($action == 'favor') {
    $cachetime = pwFilemtime(D_P . "data/bbscache/favor_sort.php");
    if (!$per || !file_exists(D_P . "data/bbscache/favor_sort.php") || $timestamp - $cachetime > $per * 3600) {
        $element = L::loadClass('element');
        $element->setDefaultNum(50);
        $_sort = array();
        $_SORTDB = $element->hotFavorsort();
        pwCache::writeover(D_P . 'data/bbscache/favor_sort.php', "<?php\r\n\$_FAVORS=" . pw_var_export($_SORTDB) . ";\r\n?>");
    } else {
        include pwCache::getPath(D_P . "data/bbscache/favor_sort.php");
        $_SORTDB = $_FAVORS;
        unset($_FAVORS);
    }
    $cachetime = get_date($cachetime + $per * 3600);
    require PrintEot('sort');
    footer();
}