コード例 #1
0
ファイル: portal_service.php プロジェクト: samuel072/PHP
 public function get_portal_content()
 {
     $chmod = new ChannelModule();
     $channels = array();
     foreach ($this->ch_ids as $cid) {
         $channel = $chmod->get_by_id($cid);
         switch ($channel->type) {
             case ChannelModel::channel_type_adv:
                 $advmod = new AdvModule();
                 $channel->content = $advmod->get_by_channel($cid, 0, 10);
                 break;
             case ChannelModel::channel_type_talk:
             case ChannelModel::channel_type_activity:
                 $actmod = new ActivityModule();
                 $channel->content = $actmod->get_by_channel($cid, 0, 10);
                 break;
             case ChannelModel::channel_type_talker:
                 $talkermod = new TalkerModule();
                 $channel->content = $talkermod->get_by_channel($cid, 0, 10);
                 break;
         }
         $channels[] = $channel;
     }
     return $channels;
 }
コード例 #2
0
ファイル: activity_service.php プロジェクト: samuel072/PHP
 public function update_channel($count)
 {
     $mod = new ActivityModule();
     $cha = new ChannelModule();
     $talks = $mod->get_ended_activity(RECENT_TALK_CHANNEL, $count);
     foreach ($talks as $act) {
         $cha->remove_activity(RECENT_TALK_CHANNEL, $act->id);
     }
     $acts = $mod->get_ended_activity(RECENT_ACTIVITY_CHANNEL, $count);
     foreach ($acts as $act) {
         $cha->remove_activity(RECENT_ACTIVITY_CHANNEL, $act->id);
     }
     return !(count($talks) <= 0 && count($acts) <= 0);
 }