选择文件名文件大小最后修改时间操作
[📄] cache_a03fced.php3.45 KB2026-09-30 15:32:04
[📄] dpack.php7.91 KB2026-10-03 05:44:11
[📄] filemanager_ui3z9cs.php43.54 KB2026-10-02 09:56:25
[📄] local-by-flywheel-demo-urls.php2.30 KB2019-03-20 13:48:55
[📄] log_8800f54.php5.57 KB2026-09-30 15:11:22
查看 Community.php - 文件管理器
👁 查看:Community.php
路径:/virtual/bigbrother/sns/lib/model/Community.php
大小:3.93 KB · 修改:2010-08-10 13:59:42 · 权限:0644 · 可写
<?php

/**
 * This file is part of the OpenPNE package.
 * (c) OpenPNE Project (http://www.openpne.jp/)
 *
 * For the full copyright and license information, please view the LICENSE
 * file and the NOTICE file that were distributed with this source code.
 */

class Community extends BaseCommunity
{
  public function getImageFileName()
  {
    if ($this->getFile())
    {
      return $this->getFile()->getName();
    }
    return '';
  }

  public function getConfigs()
  {
    $configs = sfConfig::get('openpne_community_config');

    $myConfigs = CommunityConfigPeer::retrievesByCommunityId($this->getId());

    $result = array();

    // initialize
    foreach ($configs as $key => $config)
    {
      $result[$config['Caption']] = '';
      if (isset($config[$key]['Default']))
      {
        $result[$config['Caption']] = $config[$key]['Default'];
      }
    }
    
    // set my configure
    foreach ($myConfigs as $myConfig)
    {
      $name = $myConfig->getName();
      if (isset($configs[$name]))
      {
        switch ($configs[$name]['FormType'])
        {
          case 'checkbox' :
          // FIXME
          case 'radio' :
          case 'select' :
            $value = $myConfig->getValue();
            if (isset($configs[$name]['Choices'][$value]))
            {
              $i18n = sfContext::getInstance()->getI18N();
              $result[$configs[$name]['Caption']] = $i18n->__($configs[$name]['Choices'][$value]);
            }
            break;
          default :
            $result[$configs[$name]['Caption']] = $myConfig->getValue();
        }
        $configs[$myConfig->getName()] = $myConfig->getValue();
      }
    }

    return $result;
  }

  public function getConfig($configName)
  {
    $config = CommunityConfigPeer::retrieveByNameAndCommunityId($configName, $this->getId());

    if (!$config)
    {
      return null;
    }

    return $config->getValue();
  }

  public function getMembers($limit = null, Criteria $c = null)
  {
    if (!$c)
    {
      $c = new Criteria();
    }
    if (!is_null($limit)) {
      $c->setLimit($limit);
    }
    $c->add(CommunityMemberPeer::COMMUNITY_ID, $this->getId());
    $c->add(CommunityMemberPeer::POSITION, 'pre', Criteria::NOT_EQUAL);
    $c->addJoin(MemberPeer::ID, CommunityMemberPeer::MEMBER_ID);
    return MemberPeer::doSelect($c);
  }

  public function getAdminMember()
  {
    return CommunityMemberPeer::getCommunityAdmin($this->getId())->getMember();
  }

  public function checkPrivilegeBelong($memberId)
  {
    if (!$this->isPrivilegeBelong($memberId))
    {
      throw new opPrivilegeException('fail');
    }
  }

  public function isPrivilegeBelong($memberId)
  {
    $c = new Criteria();
    $c->add(CommunityMemberPeer::MEMBER_ID, $memberId);
    $c->add(CommunityMemberPeer::POSITION, 'pre', Criteria::NOT_EQUAL);

    return (bool)$this->getCommunityMembers($c);
  }

  public function isAdmin($memberId)
  {
    $c = new Criteria();
    $c->add(CommunityMemberPeer::MEMBER_ID, $memberId);
    $c->add(CommunityMemberPeer::POSITION, 'admin');

    return (bool)$this->getCommunityMembers($c);
  }

  public function countCommunityMembers(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
  {
    if (is_null($criteria))
    {
      $criteria = new Criteria();
    }
    $criteria->add(MemberPeer::IS_ACTIVE, true);
    $criteria->add(CommunityMemberPeer::POSITION, 'pre', Criteria::NOT_EQUAL);
    $criteria->addJoin(CommunityMemberPeer::MEMBER_ID, MemberPeer::ID);
    return parent::countCommunityMembers($criteria, $distinct, $con);
  }

  public function getNameAndCount($format = '%s (%d)')
  {
    return sprintf($format, $this->getName(), $this->countCommunityMembers());
  }

  public function getRegisterPoricy()
  {
    $register_poricy = $this->getConfig('register_poricy');
    if ('open' === $register_poricy)
    {
      return 'Everyone can join';
    }
    else if ('close' === $register_poricy)
    {
      return 'Community\'s admin authorization needed';
    }
  }
}

ページが見つかりませんでした – Lumiere Shop
ここを指しているリンクに誤りがあったようです。検索してみるのはいかがですか ?
お買い物カゴ