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

Revision 1328, 2.2 KB checked in by naka, 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//¶¦ÄÌÉôÉÊ¤ÎÆÉ¤ß¹þ¤ß
3require_once("../require.php");
4
5class LC_Page{
6    function LC_Page(){
7        $this->tpl_mainpage = "rss/index.tpl";
8        $this->encode = "UTF-8";
9        $this->description = "¿·Ãå¾ðÊó";
10    }
11}
12
13$objQuery = new SC_Query();
14$objPage = new LC_Page();
15$objView = new SC_SiteView();
16
17//¿·Ãå¾ðÊó¤ò¼èÆÀ
18$arrNews = lfGetNews($objQuery);
19
20//¥­¥ã¥Ã¥·¥å¤·¤Ê¤¤(ǰ¤Î¤¿¤á)
21header("Paragrama: no-cache");
22
23//XML¥Æ¥­¥¹¥È(¤³¤ì¤¬¤Ê¤¤¤ÈÀµ¾ï¤ËRSS¤È¤·¤ÆÇ§¼±¤·¤Æ¤¯¤ì¤Ê¤¤¥Ä¡¼¥ë¤¬¤¢¤ë¤¿¤á)
24header("Content-type: application/xml");
25
26//¿·Ãå¾ðÊó¤ò¥»¥Ã¥È
27$objPage->arrNews = $arrNews;       
28
29//Ź̾¤ò¥»¥Ã¥È
30$objPage->site_title = $arrNews[0]['shop_name'];
31
32//ÂåɽEmail¥¢¥É¥ì¥¹¤ò¥»¥Ã¥È
33$objPage->email = $arrNews[0]['email'];
34
35//DESCRIPTION¤ò¥»¥Ã¥È
36$objPage->description = $objPage->description;
37
38//XML¥Õ¥¡¥¤¥ë¤Î¥¨¥ó¥³¡¼¥É¤ò¥»¥Ã¥È
39$objPage->encode = $objPage->encode;
40
41//¥»¥Ã¥È¤·¤¿¥Ç¡¼¥¿¤ò¥Æ¥ó¥×¥ì¡¼¥È¥Õ¥¡¥¤¥ë¤Ë½ÐÎÏ
42$objView->assignobj($objPage);
43
44//²èÌÌɽ¼¨
45$objView->display($objPage->tpl_mainpage);
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 = "delete = '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.