Jetzt kostenlos Anmelden!

Icemanmic

ist gerade angekommen

1

Samstag, 19. Juli 2008, 15:56

rss feeds

Hallo, gibt es die Möglichkeiten für 1.6.4 rss feeds einzubinden und wenn ja wie macht man das?

Danke im voraus, icemanmic ;(
  • Zum Seitenanfang
  • Zum Seitenende

KiLLiNGFREZZi

ist gerade angekommen

Beiträge: 48

PHPKIT Version: 1.6.03

2

Sonntag, 20. Juli 2008, 19:27

teste mal ob die rss.php bei dir dunktioniert.

Denk dran anpassungsarbeiten vornehemn

PHP-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?php
/*****************************************************/
/*   script stammt von rEd1Z1_2l | bw@project6.net   */
/*****************************************************/

/* phpkit code (aus der include.php) BEGIN */
define('pkTIME',time());
define('pkTIMETODAY',mktime(0,0,0,date('m',pkTIME),date('d',pkTIME),date('Y',pkTIME)));

define('pkEXT','.php');                                        // standard file extension

// define serval needed directories-paths
define('pkDIRROOT',dirname(__FILE__).'/');                    // root-directory for internal use (f.e. include)
define('pkDIRINC',pkDIRROOT.'inc/');                        // base source directory
define('pkDIRADMIN',pkDIRINC.'admin/');                        // source directory - admin scripts
define('pkDIRCLASS',pkDIRINC.'class/');                        // source directory - classes
define('pkDIRFUNC',pkDIRINC.'func/');                        // source directory - functions
define('pkDIRLANG',pkDIRINC.'lang/');                        // source directory - language packs
define('pkDIRPUBLIC',pkDIRINC.'public/');                    // source directory - public scripts

// includen der drei datein die benötigt werden für diesen feed    
require_once(pkDIRROOT.'admin/config/inc.sql.php');
require_once(pkDIRROOT.'admin/config/inc.dbtabs.php');
require_once(pkDIRFUNC.'default'.pkEXT);
require_once(pkDIRROOT.'admin/lib/lib_access'.pkEXT);


pkLoadClass($SQL,'sql');
$DB = &$SQL;
$SQL->connect();

$config=$DB->fetch_assoc($DB->query("SELECT * FROM ".$db_tab['config']." WHERE profil_active=1 LIMIT 1"));
/* phpkit code (aus der include.php) END */


header('Content-type: text/xml; charset: ISO-8859-1'); // document header als xml ausgeben und charset definieren

$lines 20//Anzahl anzuzeigender Datensätze
$max_lines 100// wieviel rows dürfen User Maximal selber bestimmen
$rss_language 'de-de'// welche sprache ihr habt bzw. welche dass rss feed angeben soll
/* http://www.digitalcode.org/diverses/sprachenkuerzel.htm */

if(intval($_GET['rows']) > && intval($_GET['rows']) < $max_lines$lines intval($_GET['rows']);
else $lines $lines;

//Erzeugen des RSS-Inhaltes
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n";
echo "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\" xmlns:image=\"http://purl.org/rss/1.0/modules/image/\">\n";
echo "<channel>\n";
echo "<docs>http://blogs.law.harvard.edu/tech/rss</docs>\n";
echo "<title><![CDATA[".$config['site_name']."]]></title>\n";
echo "<link>".$config['site_url']."</link>\n";
echo "<language>".$rss_language."</language>\n";
echo "<description><![CDATA[".$config['site_title']."]]></description>\n";
echo "<managingEditor>".$config['site_email']."</managingEditor>\n";
echo "<webMaster>".$config['site_email']."</webMaster>\n";
echo "<lastBuildDate>".date("D, d M Y H:i:s",time())."</lastBuildDate>\n";

// die neuesten board einträge
if($_GET['section'] == 'board' OR empty($_GET['section'])) {
$result $DB->query("SELECT forumthread_id, forumthread_title, forumthread_lastreply_time,forumthread_lastreply_autor FROM ".$db_tab['forumthread']." WHERE forumthread_catid='19' ORDER by forumthread_lastreply_time DESC LIMIT ".$lines."");

    while($row $DB->fetch_array($result)){
        $itemtitle $row['forumthread_title'];
        $itemLink $config['site_url']."/include.php?path=forum/showthread.php&amp;threadid=".$row['forumthread_id'];
    
        $itemtime date("D, d M Y H:i"$row['forumthread_lastreply_time']);

        echo "<item>\n";
        echo "<title><![CDATA[".$itemtitle."]]></title>\n";
        echo "<link>".$itemLink."</link>\n";
        echo "<pubDate>".$itemtime."</pubDate>\n";
        echo "<author><![CDATA[".$row['forumthread_lastreply_autor']."]]></author>\n";
        echo "</item>\n";
        
    }
}
// die neuesten news
else if($_GET['section'] == 'news') {
$result $DB->query("SELECT ".$db_tab['content'].".content_id, ".$db_tab['content'].".content_title, ".$db_tab['content'].".content_time, ".$db_tab['content'].".content_autor, ".$db_tab['content'].".content_text FROM ".$db_tab['content']." LEFT JOIN ".$db_tab['contentcat']." ON ".$db_tab['contentcat'].".contentcat_id=".$db_tab['content'].".content_cat WHERE ".$db_tab['content'].".content_option=2 AND ".$db_tab['content'].".content_status=1 AND (".$db_tab['content'].".content_expire>'".time()."' OR ".$db_tab['content'].".content_expire='0') AND ".$db_tab['content'].".content_time<'".time()."' AND ".sqlrights($db_tab['contentcat'].'.contentcat_rights')." ORDER by ".$db_tab['content'].".content_time DESC LIMIT ".$lines."");
    while($row $DB->fetch_array($result)){
        $itemtitle $row['content_title'];

        $itemLink $config['site_url']."/include.php?path=content/news.php&amp;contentid=".$row['content_id'];
    
        $itemtime date("D, d M Y H:i"$row['content_time']);
        
        $itemtext str_replace(']','&gt;',$row['content_text']);
        $itemtext str_replace('[','&lt;',$itemtext);        
        $text_lenght strlen($itemtext);
        $itemtext substr($itemtext0500);        
        if($text_lenght 500$itemtext $itemtext;
        else $itemtext $itemtext."... <a target=_blank href=".$itemLink."><b><u>mehr lesen</u></b></a>";
        
        echo "<item>\n";
        echo "<title><![CDATA[".$itemtitle."]]></title>\n";
        echo "<link>".$itemLink."</link>\n";
        echo "<content:encoded><![CDATA[".$itemtext."]]></content:encoded>\n";
        echo "<pubDate>".$itemtime."</pubDate>\n";
        echo "<author><![CDATA[".$row['content_autor']."]]></author>\n";
        echo "</item>\n";
    }
}

// die neuesten article
else if($_GET['section'] == 'article') {
$result $DB->query("SELECT ".$db_tab['content'].".content_id, ".$db_tab['content'].".content_title, ".$db_tab['content'].".content_time, ".$db_tab['content'].".content_autor, ".$db_tab['content'].".content_text FROM ".$db_tab['content']." LEFT JOIN ".$db_tab['contentcat']." ON ".$db_tab['contentcat'].".contentcat_id=".$db_tab['content'].".content_cat WHERE ".$db_tab['content'].".content_option='1' AND ".$db_tab['content'].".content_status='1' AND (".$db_tab['content'].".content_expire>'".time()."' OR ".$db_tab['content'].".content_expire=0) AND ".$db_tab['content'].".content_time<'".time()."' AND ".sqlrights("".$db_tab['contentcat'].".contentcat_rights")." ORDER by ".$db_tab['content'].".content_time DESC LIMIT ".$lines."");
    while($row $DB->fetch_array($result)){
        $itemtitle $row['content_title'];
        $itemLink $config['site_url']."/include.php?path=content/articles.php&amp;contentid=".$row['content_id'];
    
        $itemtime date("D, d M Y H:i"$row['content_time']);
        
        $itemtext str_replace(']','&gt;',$row['content_text']);
        $itemtext str_replace('[','&lt;',$itemtext);        
        $text_lenght strlen($itemtext);
        $itemtext substr($itemtext0500);        
        if($text_lenght 500$itemtext $itemtext;
        else $itemtext $itemtext."... <a target=_blank href=".$itemLink."><b><u>mehr lesen</u></b></a>";
        
        echo "<item>\n";
        echo "<title><![CDATA[".$itemtitle."]]></title>\n";
        echo "<link>".$itemLink."</link>\n";
        echo "<content:encoded><![CDATA[".$itemtext."]]></content:encoded>\n";
        echo "<pubDate>".$itemtime."</pubDate>\n";
        echo "<author><![CDATA[".$row['content_autor']."]]></author>\n";
        echo "</item>\n";
    }
}

// die neuesten downloads
else if($_GET['section'] == 'downloads') {
$result $DB->query("SELECT ".$db_tab['content'].".content_id, ".$db_tab['content'].".content_title, ".$db_tab['content'].".content_time, ".$db_tab['content'].".content_autor, ".$db_tab['content'].".content_text FROM ".$db_tab['content']." LEFT JOIN ".$db_tab['contentcat']." ON ".$db_tab['contentcat'].".contentcat_id=".$db_tab['content'].".content_cat WHERE ".$db_tab['content'].".content_option=4 AND ".$db_tab['content'].".content_status=1 AND (".$db_tab['content'].".content_expire>'".time()."' OR ".$db_tab['content'].".content_expire='0') AND ".$db_tab['content'].".content_time<'".time()."' AND ".sqlrights($db_tab['contentcat'].'.contentcat_rights')." ORDER by ".$db_tab['content'].".content_time DESC LIMIT ".$lines."");
    while($row $DB->fetch_array($result)){
        $itemtitle $row['content_title'];
        $itemLink $config['site_url']."/include.php?path=content/downloads.php&amp;contentid=".$row['content_id'];
    
        $itemtime date("D, d M Y H:i"$row['content_time']);
        
        $itemtext str_replace(']','&gt;',$row['content_text']);
        $itemtext str_replace('[','&lt;',$itemtext);        
        $text_lenght strlen($itemtext);
        $itemtext substr($itemtext0500);        
        if($text_lenght 500$itemtext $itemtext;
        else $itemtext $itemtext."... <a target=_blank href=".$itemLink."><b><u>mehr lesen</u></b></a>";
        
        echo "<item>\n";
        echo "<title><![CDATA[".$itemtitle."]]></title>\n";
        echo "<link>".$itemLink."</link>\n";
        echo "<content:encoded><![CDATA[".$itemtext."]]></content:encoded>\n";
        echo "<pubDate>".$itemtime."</pubDate>\n";
        echo "<author><![CDATA[".$row['content_autor']."]]></author>\n";
        echo "</item>\n";
    }
}

echo "</channel>\n";
echo "</rss>";
?>
  • Zum Seitenanfang
  • Zum Seitenende