source: temp/trunk/html/rss/index.php @ 7263

Revision 7263, 3.1 KB checked in by kakinaka, 16 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2/*
3 * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8//¶¦ÄÌÉôÉʤÎÆɤ߹þ¤ß
9require_once("../require.php");
10
11class LC_Page{
12    function LC_Page(){
13        $this->tpl_mainpage = "rss/index.tpl";
14        $this->encode = "UTF-8";
15        $this->description = "¿·Ãå¾ðÊó";
16    }
17}
18
19$objQuery = new SC_Query();
20$objPage = new LC_Page();
21$objView = new SC_SiteView();
22
23//¿·Ãå¾ðÊó¤ò¼èÆÀ
24$arrNews = lfGetNews($objQuery);
25
26//¥­¥ã¥Ã¥·¥å¤·¤Ê¤¤(Ç°¤Î¤¿¤á)
27header("Paragrama: no-cache");
28
29//XML¥Æ¥­¥¹¥È(¤³¤ì¤¬¤Ê¤¤¤ÈÀµ¾ï¤ËRSS¤È¤·¤Æǧ¼±¤·¤Æ¤¯¤ì¤Ê¤¤¥Ä¡¼¥ë¤¬¤¢¤ë¤¿¤á)
30header("Content-type: application/xml");
31
32//¿·Ãå¾ðÊó¤ò¥»¥Ã¥È
33$objPage->arrNews = $arrNews;
34$objPage->timestamp = sf_mktime("r", $arrNews[0]['HOUR'], $arrNews[0]['MINUTE'], $arrNews[0]['SECOND'], $arrNews[0]['MONTH'], $arrNews[0]['DAY'], $arrNews[0]['YEAR']);
35
36//Ź̾¤ò¥»¥Ã¥È
37$objPage->site_title = $arrNews[0]['shop_name'];
38
39//ÂåɽEmail¥¢¥É¥ì¥¹¤ò¥»¥Ã¥È
40$objPage->email = $arrNews[0]['email'];
41
42//¥»¥Ã¥È¤·¤¿¥Ç¡¼¥¿¤ò¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Ë½ÐÎÏ
43$objView->assignobj($objPage);
44
45//²èÌÌɽ¼¨
46$objView->display($objPage->tpl_mainpage, true);
47
48//---------------------------------------------------------------------------------------------------------------------
49/***************************************************************************************************************
50 * ´Ø¿ô̾:lfGetNews
51 * ÀâÌÀ¡¡:¿·Ãå¾ðÊó¤ò¼èÆÀ¤¹¤ë
52 * °ú¿ô£±:$objQuery     DBÁàºî¥¯¥é¥¹
53 * Ìá¤êÃÍ:$arrNews      ¼èÆÀ·ë²Ì¤òÇÛÎó¤ÇÊÖ¤¹
54 ***************************************************************************************************************/
55function lfGetNews($objQuery){
56    $col = "";
57    $col .= "     news_id ";                                //¿·Ãå¾ðÊóID
58    $col .= "     ,news_title ";                            //¿·Ãå¾ðÊ󥿥¤¥È¥ë
59    $col .= "     ,news_comment ";                          //¿·Ãå¾ðÊóËÜʸ
60   
61    if (DB_TYPE == "pgsql") {
62        $col .= "     ,to_char(news_date, 'YYYY') AS YEAR ";    //ÆüÉÕ(ǯ)
63        $col .= "     ,to_char(news_date, 'MM') AS MONTH ";     //ÆüÉÕ(·î)
64        $col .= "     ,to_char(news_date, 'DD') AS DAY ";       //ÆüÉÕ(Æü)
65        $col .= "     ,to_char(news_date, 'HH24') AS HOUR ";    //ÆüÉÕ(»þ´Ö)
66        $col .= "     ,to_char(news_date, 'MI') AS MINUTE ";    //ÆüÉÕ(ʬ)
67        $col .= "     ,to_char(news_date, 'SS') AS SECOND ";    //ÆüÉÕ(ÉÃ)
68    }else if (DB_TYPE == "mysql") {
69        $col .= "     ,DATE_FORMAT(news_date, '%Y') AS YEAR ";      //ÆüÉÕ(ǯ)
70        $col .= "     ,DATE_FORMAT(news_date, '%m') AS MONTH ";     //ÆüÉÕ(·î)
71        $col .= "     ,DATE_FORMAT(news_date, '%d') AS DAY ";       //ÆüÉÕ(Æü)
72        $col .= "     ,DATE_FORMAT(news_date, '%H') AS HOUR ";      //ÆüÉÕ(»þ´Ö)
73        $col .= "     ,DATE_FORMAT(news_date, '%i') AS MINUTE ";    //ÆüÉÕ(ʬ)
74        $col .= "     ,DATE_FORMAT(news_date, '%s') AS SECOND ";    //ÆüÉÕ(ÉÃ)
75    }
76    $col .= "     ,news_url ";                              //¿·Ãå¾ðÊóURL
77    $col .= "     ,news_select ";                           //¿·Ãå¾ðÊó¤Î¶èʬ(1:URL¡¢2:ËÜʸ)
78    $col .= "     ,(SELECT shop_name FROM dtb_baseinfo limit 1) AS shop_name  ";    //Ź̾
79    $col .= "     ,(SELECT email04 FROM dtb_baseinfo limit 1) AS email ";           //ÂåɽEmail¥¢¥É¥ì¥¹
80    $from = "dtb_news";
81    $where = "del_flg = '0'";
82    $order = "rank DESC";
83    $objQuery->setorder($order);
84    $arrNews = $objQuery->select($col,$from,$where);
85    return $arrNews;
86}
87
88?>
Note: See TracBrowser for help on using the repository browser.