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

Revision 6467, 2.4 KB checked in by kakinaka, 20 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
35sfprintr($arrNews);
36
37//Ź̾¤ò¥»¥Ã¥È
38$objPage->site_title = $arrNews[0]['shop_name'];
39
40//ÂåɽEmail¥¢¥É¥ì¥¹¤ò¥»¥Ã¥È
41$objPage->email = $arrNews[0]['email'];
42
43//DESCRIPTION¤ò¥»¥Ã¥È
44$objPage->description = $objPage->description;
45
46//XML¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥³¡¼¥É¤ò¥»¥Ã¥È
47$objPage->encode = $objPage->encode;
48
49//¥»¥Ã¥È¤·¤¿¥Ç¡¼¥¿¤ò¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Ë½ÐÎÏ
50$objView->assignobj($objPage);
51
52//²èÌÌɽ¼¨
53$objView->display($objPage->tpl_mainpage, true);
54
55//******************************************************************************************/
56/*
57 * ´Ø¿ô̾:lfGetNews
58 * ÀâÌÀ¡¡:¿·Ãå¾ðÊó¤ò¼èÆÀ¤¹¤ë
59 * °ú¿ô£±:$objQuery     DBÁàºî¥¯¥é¥¹
60 * Ìá¤êÃÍ:$arrNews      ¼èÆÀ·ë²Ì¤òÇÛÎó¤ÇÊÖ¤¹
61 */
62function lfGetNews($objQuery){
63    $col = "";
64    $col .= "     news_id ";                                //¿·Ãå¾ðÊóID
65    $col .= "     ,news_title ";                            //¿·Ãå¾ðÊ󥿥¤¥È¥ë
66    $col .= "     ,news_comment ";                          //¿·Ãå¾ðÊóËÜʸ
67    $col .= "     ,to_char(news_date, 'YYYY') AS YEAR ";    //ÆüÉÕ(ǯ)
68    $col .= "     ,to_char(news_date, 'MM') AS MONTH ";     //ÆüÉÕ(·î)
69    $col .= "     ,to_char(news_date, 'DD') AS DAY ";       //ÆüÉÕ(Æü)
70    $col .= "     ,to_char(news_date, 'HH24') AS HOUR ";    //ÆüÉÕ(»þ´Ö)
71    $col .= "     ,to_char(news_date, 'MI') AS MINUTE ";    //ÆüÉÕ(ʬ)
72    $col .= "     ,to_char(news_date, 'SS') AS SECOND ";    //ÆüÉÕ(ÉÃ)
73    $col .= "     ,news_url ";                              //¿·Ãå¾ðÊóURL
74    $col .= "     ,news_select ";                           //¿·Ãå¾ðÊó¤Î¶èʬ(1:URL¡¢2:ËÜʸ)
75    $col .= "     ,(SELECT shop_name FROM dtb_baseinfo limit 1) AS shop_name  ";    //Ź̾
76    $col .= "     ,(SELECT email04 FROM dtb_baseinfo limit 1) AS email ";           //ÂåɽEmail¥¢¥É¥ì¥¹
77    $col .= "     ,(SELECT company_name FROM dtb_baseinfo limit 1) AS company_name ";       //²ñ¼Ò̾
78    $from = "dtb_news";
79    $where = "del_flg = '0'";
80    $order = "rank DESC";
81    $objQuery->setorder($order);
82    $arrNews = $objQuery->select($col,$from,$where);
83    return $arrNews;
84}
85   
86?>
Note: See TracBrowser for help on using the repository browser.