/[clonezilla-sysresccd]/trunk/www/working/.news.php
ViewVC logotype

Contents of /trunk/www/working/.news.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 133 - (show annotations)
Wed Sep 22 14:44:59 2010 UTC (13 years, 6 months ago) by sng
File size: 2565 byte(s)
fixing news presentation in printable.php
fixing news.php

1
2
3
4
5
6
7 <!-- note -->
8 <div align="center" style="margin-bottom: 0"><table style="margin-bottom: 0" class="note" border="0" cellpadding="20"><tr><td valign="top"><img src="images/info.png"></td><td>
9 This section has been created by converting<br>
10 the site's <a href="http://clonezilla-sysresccd.hellug.gr/clonezilla-sysresccd.rss">RSS news feed</a> to HTML
11 </td></tr></table></div>
12 <!--insertnews-->
13
14
15
16
17 <?php
18 error_reporting(E_ALL);
19 // error_reporting(E_ERROR);
20 ini_set('display_errors', '1');
21
22 $file = file_get_contents ('./clonezilla-sysresccd.rss');
23 $eReg = "#<title>[^<]*<#";
24 $tReg = '<a name=\0"></a>\0';
25 $file = preg_replace($eReg,$tReg,$file);
26
27 $file = str_replace('<">','">',$file);
28 $file = str_replace("<a name=<H2>","<a name=\"",$file);
29
30 $file = str_replace("=<title>","=\"",$file);
31 $file = str_replace("<title>","<H2>",$file);
32 $file = str_replace("</title>"," <span class=\"hideprint\">[<a href=\"#news-top\" title=\"go to top of the page\">^</a>]</span></H2>",$file);
33
34 $file = str_replace("<pubDate>","<p><b>Date: </b>",$file);
35 $file = str_replace("</pubDate>","<br><br>",$file);
36 $file = str_replace("<description><![CDATA[","",$file);
37 $file = str_replace("]]></description>","</p>",$file);
38 $file = str_replace("<item>","",$file);
39 $file = str_replace("</item>","",$file);
40 //$file = str_replace("<rss>","",$file);
41 $file = str_replace("</rss>","",$file);
42 //$file = str_replace("<channel>","",$file);
43 $file = str_replace("</channel>","",$file);
44
45 $eReg = "#^" . ".*" . "<" . "/image" . ">#";
46 $file = preg_replace($eReg,"",$file);
47
48
49 $eReg = "#<" . "guid" . "[^<]*" . "<" . "/guid" . ">#";
50 $file = preg_replace($eReg,"",$file);
51
52
53 $eReg = "#<" . "link" . "[^<]*" . "<" . "/link" . ">#";
54 $file = preg_replace($eReg,"",$file);
55
56
57
58 $eReg = "#<\?xml version=\"1.0\" encoding=\"UTF-8\"\?>.*</image>#is";
59 $file = preg_replace($eReg,"",$file);
60
61
62
63 // Get top navigation div
64 $eReg = "#<div id=\"docline-top\">.*#";
65 $numMatch = preg_match($eReg,$file,$matches);
66 if($numMatch > 0)
67 $topNav = $matches[0];
68 // echo $topNav;
69
70 // Get bottom navigation div
71 $eReg = "#<div id=\"docline-bottom\">.*#";
72 $numMatch = preg_match($eReg,$file,$matches);
73 if($numMatch > 0)
74 $bottomNav = $matches[0];
75 // echo $bottomNav;
76
77 // Remove text starting from line 1 to
78 // line containing <body> tag
79 $eReg="#<html.*</head>#is";
80 $file = preg_replace($eReg,"",$file);
81 $eReg = "#<!DOCTYPE HTML PUBLIC.*#i";
82 $file = preg_replace($eReg,"",$file);
83 $eReg = "#<body.*#i";
84 $file = preg_replace($eReg,"",$file);
85
86
87 //$file = ereg_replace();
88
89 echo $file;
90 echo "<p></p>
91
92 </div>";
93 ?>
94
95
96
97
98

Properties

Name Value
svn:executable *

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26