プロジェクト

全般

プロフィール

Enhancement(機能追加・改善) #2578

Yuya Watanabe12年以上前に更新

h3. 概要

コミュニティ数が著しく多い場合にインフォメーションボックスを表示しやすくする.
例えばコミュニティ数が10000ほどあった場合にphp.iniのmax_execution_timeで設定されている時間を超えて表示できない場合がある. 例えばコミュニティ数が10000ほどあった場合にメモリが不十分で表示できない場合がある.
これをOpenPNE側で対応する.

h3. 修正案

下記部分でコミュニティIDのみを取得するようにする.

<pre><code class="diff">
diff --git a/lib/model/doctrine/CommunityMemberTable.class.php b/lib/model/doctrine/CommunityMemberTable.class.php
index 28e378b..067ed94 100644
--- a/lib/model/doctrine/CommunityMemberTable.class.php
+++ b/lib/model/doctrine/CommunityMemberTable.class.php
@@ -105,12 +105,16 @@ class CommunityMemberTable extends opAccessControlDoctrineTable

public function getCommunityIdsOfAdminByMemberId($memberId)
{
- $objects = Doctrine::getTable('CommunityMemberPosition')->findByMemberIdAndName($memberId, 'admin');
+ $objects = Doctrine::getTable('CommunityMemberPosition')->createQuery()
+ ->select('community_id')
+ ->where('member_id = ?', $memberId)
+ ->andWhere('name = ?', 'admin')
+ ->execute(array(), Doctrine_Core::HYDRATE_NONE);

$results = array();
foreach ($objects as $obj)
{
- $results[] = $obj->getCommunityId();
+ $results[] = $obj[0];
}
return $results;
}
</code></pre>

戻る