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

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