OSDN Git Service

add ACS webapp, sql, htdocs
[acs/acs.git] / webapp / modules / Community / actions / PressReleaseAllRSSAction.class.php
diff --git a/webapp/modules/Community/actions/PressReleaseAllRSSAction.class.php b/webapp/modules/Community/actions/PressReleaseAllRSSAction.class.php
new file mode 100644 (file)
index 0000000..c1abfdb
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/**
+ * ¥Ñ¥Ö¥ê¥Ã¥¯¥ê¥ê¡¼¥¹µ¡Ç½¡¡Action¥¯¥é¥¹
+ * 
+ * PressReleaseAllRSSAction.class.php
+ * @package  acs/webapp/modules/Community/action
+ * @author   acs
+ * @since    PHP 5.0
+ * @version  $Revision: 1.20 $ $Date: 2009/06/19 10:00:00 $
+ */
+class PressReleaseAllRSSAction extends BaseAction
+{
+       // GET¡¡É¸½à½ÐÎÏ
+       function getDefaultView() {
+       }
+
+       // POST É¸½à½ÐÎϤΤß
+       function execute() {
+
+               $context = $this->getContext();
+               $controller = $context->getController();
+               $request =  $context->getRequest();
+               $user = $context->getUser();
+
+               // ¥³¥ß¥å¥Ë¥Æ¥£¾ðÊó
+               // RSS¤Ëɽ¼¨¤¹¤ëÁ´¥³¥ß¥å¥Ë¥Æ¥£¡¡¤Î¥³¥ß¥å¥Ë¥Æ¥£ID»ØÄêÄê¿ô
+               // ÂоݤȤʤé¤Ê¤¤¥³¥ß¥å¥Ë¥Æ¥£ID¤ò¼èÆÀ
+               $except_community_id = $request->getParameter('except_community_id');
+
+               // BBSµ­»ö°ìÍ÷
+               $bbs_row_array = ACSBBS::get_bbs_rss_row_array($except_community_id,0);
+
+               // ¥·¥¹¥Æ¥à¾ðÊó¤ÎÀßÄê
+               $system_config_keyword_value['SYSTEM_NAME'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group','D01'), 'SYSTEM_NAME');
+               $system_config_keyword_value['SYSTEM_OUTLINE'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group','D01'), 'SYSTEM_OUTLINE');
+               $system_config_keyword_value['SYSTEM_BASE_URL'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group','D01'), 'SYSTEM_BASE_URL');
+               $system_config_keyword_value['SYSTEM_MAIL_ADDR'] = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group','D01'), 'SYSTEM_MAIL_ADDR');
+       //      $system_config_keyword_value['SYSTEM_IMAGE'] = ACSSystemConfig::get_keyword_value('¥·¥¹¥Æ¥à', 'SYSTEM_IMAGE');          // 3/13¸½ºß²èÁü¤Ï̵¤¤¡¡¼¡¹Ô¡¡»ÃÄê½èÍý
+               $system_config_keyword_value['SYSTEM_IMAGE']['title'] = ACSMsg::get_msg('Community', 'PressReleaseAllRSSAction.class.php', 'M001');
+               $system_config_keyword_value['SYSTEM_IMAGE']['url'] = ACSMsg::get_msg('Community', 'PressReleaseAllRSSAction.class.php', 'M002');
+               $system_config_keyword_value['SYSTEM_IMAGE']['link'] = ACSMsg::get_msg('Community', 'PressReleaseAllRSSAction.class.php', 'M003');
+               $system_config_keyword_value['SYSTEM_IMAGE']['description'] = ACSMsg::get_msg('Community', 'PressReleaseAllRSSAction.class.php', 'M004');
+
+               $rss_syndicationURL .= $system_config_keyword_value['SYSTEM_BASE_URL'] . $this->getControllerPath('Community', 'PressReleaseAllRSS');
+
+               // ·ÇºÜ½ªÎ»Æü¤¬ËÜÆü¤ò±Û¤¨¤Æ¤¤¤Ê¤¤¤â¤Î¤Î¤ß¤Ë¤¹¤ë
+               // ËÜÆü¤ò¼èÆÀ
+               $today = date("Y/m/d");
+               $bbs_rss_array = array();
+
+               foreach ($bbs_row_array as $index => $bbs_row) {
+                       //ÂоݤȤʤ뵭»ö¤Î¤ß¤òÃê½Ð
+                       $bbs_date = ACSLib::convert_pg_date_to_str($bbs_row['expire_date'],false,false,false);
+                       if($bbs_date >= $today || $bbs_date == null){
+                       //µ­»öÇÛÎó¤òºî¤êÊѤ¨
+                               $bbs_rss_array[$index] = $bbs_row;
+                       //ÁêÂФ¹¤ëCommunity̾¤òºî¤ë
+                       $community_row = ACSCommunity::get_community_row($bbs_row['community_id']);
+                               $bbs_rss_array[$index]['community_id_name'] = $community_row['community_name'];
+                       //µ­»ö¤Î¥ê¥ó¥¯Àè¤òºî¤ë
+                               $bbs_rss_array[$index]['bbs_url']=$this->getControllerPath('Community', 'BBSRes') . '&community_id=' . $bbs_row['community_id'] . '&bbs_id=' . $bbs_row['bbs_id'];
+                       //²èÁü¤Î¥ê¥ó¥¯Àè¤òºî¤ë
+                               $bbs_rss_array[$index]['file_link']="";
+                               if($bbs_row['file_id'] != ""){
+                                       $bbs_rss_array[$index]['file_url'] = $system_config_keyword_value['SYSTEM_BASE_URL'] . ACSBBSFile::get_image_url($bbs_row['bbs_id'],'rss');             //RSSɽ¼¨ÍÑ
+                               }
+                       }
+               }
+
+               $user->setAttribute('bbs_rss_array',$bbs_rss_array);
+
+               // RSSÂоݤÎBBSµ­»ö°ìÍ÷
+               $bbs_rss_array = $user->getAttribute('bbs_rss_array');
+               // RSSÂоݤΥ¢¥É¥ì¥¹³«»ÏÃÍ
+               $system_top_address = ACSSystemConfig::get_keyword_value(ACSMsg::get_mst('system_config_group','D01'), 'SYSTEM_BASE_URL');
+
+               // set
+               $request->setAttribute('system_config_keyword_value', $system_config_keyword_value);
+               $request->setAttribute('rss_syndicationURL', $rss_syndicationURL);
+               $request->setAttribute('bbs_rss_array', $bbs_rss_array);
+               $request->setAttribute('system_top_address', $system_top_address);
+               
+               require "PressReleaseAllRSS.php";
+
+       }
+
+       function isSecure () {
+               return false;
+       }
+
+}
+?>