1 |
wakaba |
1.1 |
<html> |
2 |
|
|
<head> |
3 |
|
|
<title>Newsportal readme</title> |
4 |
|
|
</head> |
5 |
|
|
<body textcolor=black bgcolor=white> |
6 |
|
|
<h1 align=center>News portal</h1> |
7 |
|
|
|
8 |
|
|
<p>Version 0.24pre1</p> |
9 |
|
|
|
10 |
|
|
<h2>Introduction</h2> |
11 |
|
|
|
12 |
|
|
<p>News portal is a PHP based newsreader. It is licensed under the GNU |
13 |
|
|
Public License (see enclosed LICENSE). |
14 |
|
|
</p> |
15 |
|
|
|
16 |
|
|
|
17 |
|
|
<h2>Overview</h2> |
18 |
|
|
|
19 |
|
|
<p>This script collection enables the access to a newsserver (by NNTP) from |
20 |
|
|
a webpage. It allows you to combine web-forums and newsgroups. |
21 |
|
|
The script is also suitable for presentation of announce newsgroups |
22 |
|
|
on web pages, without having the user notice that he is in fact accessing a newsserver. |
23 |
|
|
</p> |
24 |
|
|
|
25 |
|
|
<p>The main functionality of the script is located in the file |
26 |
|
|
<tt>newsportal.php3</tt>, which contains the major part of the implemented php3-functions. |
27 |
|
|
In addition to that there are four more php3-files, which are directly accessed |
28 |
|
|
by the browser. |
29 |
|
|
<UL> |
30 |
|
|
<li><i>index.php3</i> shows the available newsgroups of the newsserver (if |
31 |
|
|
you have added the names to groups.txt) |
32 |
|
|
<li><i>thread.php3 </i>displays the article-overview of a newsgroup. The |
33 |
|
|
articles are displayed in a thread. |
34 |
|
|
|
35 |
|
|
<li><i>article.php3</i> displays an individual article. |
36 |
|
|
<li><i>post.php3</i> posts a message into a newsgroup. WARNING: This script |
37 |
|
|
produces absolutely not RFC conformal messages. Thus 'umlauts' in the Subject |
38 |
|
|
are not mime encoded ! It still works fine though. |
39 |
|
|
<li><i>config.inc </i> contains the configuration. |
40 |
|
|
<li><i>body.inc</i> contains the header and the body-tag of the pages. This way |
41 |
|
|
the layout of the pages (i.e. the background) can easily be adjusted. |
42 |
|
|
<li><i>german.lang </i>: The German language definitions |
43 |
|
|
<li><i>english.lang </i>: The English language definitions |
44 |
|
|
</ul></p> |
45 |
|
|
|
46 |
|
|
<p>Since fetching the article overview of the newsserver takes quite some time, |
47 |
|
|
newsportal caches this data in the directory |
48 |
|
|
<tt>spool/</tt>. Any file can be put in this directory, they will |
49 |
|
|
automatically be regenerated. |
50 |
|
|
</p> |
51 |
|
|
|
52 |
|
|
<h2>Installation:</h2> |
53 |
|
|
|
54 |
|
|
<p><ol> |
55 |
|
|
<li>download the zip or tar.gz archive |
56 |
|
|
<li>unzip it to a directory |
57 |
|
|
|
58 |
|
|
<li>The file<tt>config.inc</tt> |
59 |
|
|
must be edited with your settings (the most important variables are: |
60 |
|
|
<i>$server, $port, $title and $readonly</i>). |
61 |
|
|
|
62 |
|
|
<li>Write the names of all groups newsportal should show into the file <tt>groups.txt</tt>. |
63 |
|
|
Behind the groupname, seperated by a blank, a description of the group can be added. If the description is missing, |
64 |
|
|
newsportal will try to request the description from the newsserver. |
65 |
|
|
|
66 |
|
|
<li>The spool directory has to be created and configured to grant read an write access to the newsserver |
67 |
|
|
("chmod 777 spool" ). |
68 |
|
|
</ol></p> |
69 |
|
|
|
70 |
|
|
<h2>Configuration</h2> |
71 |
|
|
<p>The following adjustments can be made in <tt>config.inc</tt> |
72 |
|
|
</p> |
73 |
|
|
|
74 |
|
|
<p><b>Directories and files:</b> |
75 |
|
|
<UL> |
76 |
|
|
<li><i>$file_newsportal="newsportal.php3":</i>Name of the file containing |
77 |
|
|
the newsportal-functions. |
78 |
|
|
<li><i>$file_groups="index.php3"</i>: The file which shows the list of |
79 |
|
|
available newsgroups. |
80 |
|
|
<li><i>$file_thread="thread.php3"</i>: The file which shows the |
81 |
|
|
article-thread of a selected newsgroup |
82 |
|
|
<li><i>$file_article="article.php3"</i>: Displays an article |
83 |
|
|
<li><i>$file_post="post.php3"</i>: The file which allows you to post an |
84 |
|
|
article to a newsgroup. This file can be removed, if the system is set on |
85 |
|
|
readonly (see below). |
86 |
|
|
<li><i>$file_language="english.lang"</i>: Reference to the language |
87 |
|
|
definition file. |
88 |
|
|
<li><i>$file_footer</i>: Optionally, the name of a file can |
89 |
|
|
be indicated, which will be attached to every article posted to a newsgroup. |
90 |
|
|
</ul></p> |
91 |
|
|
|
92 |
|
|
<p><b>Newsserver setip</b> |
93 |
|
|
<UL> |
94 |
|
|
<li><i>$server </i>: Hostname or IP of the newsserver |
95 |
|
|
<li><i>$port </i>: Port of the newsserver, normally 119 |
96 |
|
|
<li><i>$post_server</i>: Optionally an extra newsserver can be indicated here |
97 |
|
|
which is used by post.php3 for writing articles. |
98 |
|
|
This is useful if two newsservers need to be accessed, a fast read-only server and a slow server |
99 |
|
|
to post articles. Be aware that it might take some time until the posted article will show up on your |
100 |
|
|
main newsserver ($server), which you use to read articles. |
101 |
|
|
<li><i>$post_port </i>: Port of your post-newsserver |
102 |
|
|
<li><i>$server_auth_user</i>: If the newsserver requires authentication by name and password put your username |
103 |
|
|
here. Otherwise just set the variable to "". |
104 |
|
|
<li><i>$server_auth_pass</i>: Put your password here. |
105 |
|
|
</ul></p> |
106 |
|
|
|
107 |
|
|
<p><b>Thread Layout</b> |
108 |
|
|
<ul> |
109 |
|
|
<li><i>$treestyle </i>:The appearance of the message tree: |
110 |
|
|
<ul> |
111 |
|
|
<li>0: Simple listing of the articles</li> |
112 |
|
|
<li>1: Easy listing of the articles, with some more HTML tags</li> |
113 |
|
|
<li>2: Simple listing in a table</li> |
114 |
|
|
<li>3: Threaded with HTML-tags (UL, li)</li> |
115 |
|
|
<li>4: Threaded with text characters</li> |
116 |
|
|
<li>5: Threaded with graphical images</li> |
117 |
|
|
<li>6: Threaded with text characters and table</li> |
118 |
|
|
<li>7: Threaded with graphical images table</li> |
119 |
|
|
</ul></li> |
120 |
|
|
|
121 |
|
|
<li><i>$thread_fontPre</i>: The code given here is put in front of every text fragment in thread.php3, i.e. |
122 |
|
|
font face or size can be set.</li> |
123 |
|
|
<li><i>$thread_fontPost</i>: The same as $thread_fontPre, |
124 |
|
|
only code is appended at the end of the text.</li> |
125 |
|
|
|
126 |
|
|
<li><i>$thread_showDate,<br> |
127 |
|
|
$thread_showSubject,<br> |
128 |
|
|
$thread_showAuthor</i>: |
129 |
|
|
<ul> |
130 |
|
|
<li>true: the date / the subject / the author are displayed in |
131 |
|
|
the thread</li> |
132 |
|
|
<li>false: output is suppressed.</li> |
133 |
|
|
</ul> |
134 |
|
|
|
135 |
|
|
<li><i>$thread_maxSubject </i>: Maximum number of characters of the subject displayed</li> |
136 |
|
|
<li><i>$maxarticles</i>: This number indicates the maximum amount of |
137 |
|
|
overview data of a newsgroup newsportal tries to get from the newsserver. |
138 |
|
|
"0" means no limitation. $maxarticles also indicates the amount of articles |
139 |
|
|
to be stored in the spoolfiles. A lower value means less work for newsportal</li> |
140 |
|
|
<li><i>$maxarticles_extra</i>: The problem with $maxarticles is that all |
141 |
|
|
article data must be completely requested again by the new server, if the |
142 |
|
|
indicated value is exceeded. |
143 |
|
|
$maxarticles_extra can be set to prevent this. |
144 |
|
|
The article-spool will only be restructured if |
145 |
|
|
$maxarticles + $maxarticles_extra articles are present, whereby |
146 |
|
|
$maxarticles many article data are requested. |
147 |
|
|
Only if an exact given number of articles should be displayed on the web page, the value of |
148 |
|
|
this variable schould be set "0".</li> |
149 |
|
|
<li><i>$age_count </i>: Number of different age levels for the |
150 |
|
|
coloured marking of articles</li> |
151 |
|
|
<li><i>$$age_time[n] </i>: maximal age of an article in seconds, |
152 |
|
|
so that the article gets marked with the colour $age_color[n]. |
153 |
|
|
n is a natural number > = 1 and all numbers from 1 to n must be |
154 |
|
|
assigned, gaps are not permitted.</li> |
155 |
|
|
<li><i>$age_color[n]</i>: The colour in which the article is marked</li> |
156 |
|
|
<li><i>$thread_sorting </i>: The sort sequence for the articles: |
157 |
|
|
<ul> |
158 |
|
|
<li>0: No assortment, articles are displayed in the order in which they are polled from |
159 |
|
|
the server. This is nearly like ascending |
160 |
|
|
assortment.</li> |
161 |
|
|
<li> 1: ascending assortment, the oldest articles to the top.</li> |
162 |
|
|
<li> -1: descending assortment, the newest articles to the top.</li> |
163 |
|
|
</ul></li> |
164 |
|
|
<li><i>$articles_per_page</i>: If this value is not 0, the maximum amount of articles is given, which are to be |
165 |
|
|
displayed on one page at the same time. The thread will be split into |
166 |
|
|
individual pages.</li> |
167 |
|
|
<li><i>$startpage</i>: In connection with $$articles_per_page |
168 |
|
|
the variable indicates, which page is to be displayed first: |
169 |
|
|
<ul> |
170 |
|
|
<li>"first": The page with the newest articles</li> |
171 |
|
|
<li>"last": the page with the oldest articles</li> |
172 |
|
|
</ul> |
173 |
|
|
The specification should be co-ordinated with <i>$thread_sorting</i>. |
174 |
|
|
"first" for 0 and 1, and "last" for -1.</li> |
175 |
|
|
</ul></p> |
176 |
|
|
|
177 |
|
|
<p><b>Article layout</b> |
178 |
|
|
<ul> |
179 |
|
|
<li><i>$article_show["Subject"],<br> |
180 |
|
|
$article_show["From"],<br> |
181 |
|
|
$article_show["Newsgroups"],<br> |
182 |
|
|
$article_show["Organization"],<br> |
183 |
|
|
$article_show["Date"],<br> |
184 |
|
|
$article_show["Message-ID"],<br> |
185 |
|
|
$article_show["User-Agent"],<br> |
186 |
|
|
$article_show["References"]</i>: |
187 |
|
|
"true" displays the |
188 |
|
|
respective header line in article.php3, by "false" it |
189 |
|
|
is suppressed.</ul></p> |
190 |
|
|
|
191 |
|
|
<p><b>Frame support</b><br> |
192 |
|
|
Example files for the frame support are located in |
193 |
|
|
<tt>extras/frames/</tt>. In this section the names of the frames can be |
194 |
|
|
defined. If you want to use frames you have to set the variable |
195 |
|
|
$frame_thread to "thread_frameset.php3". |
196 |
|
|
<ul> |
197 |
|
|
<li><i>$frame_articles</i>: Name of the article frame. Must be the same as |
198 |
|
|
defined in <tt> thread_frameset.php3</tt>.</li> |
199 |
|
|
<li>$frame_thread</i>: Name of the thread frame. |
200 |
|
|
<li><i>$frame_groups</i>: Name of the frame for the grouplist, normally set |
201 |
|
|
to "_top" to open a new frameset.</li> |
202 |
|
|
<li><i>$frame_post </i>: Name of the frame for post.php3</li> |
203 |
|
|
<li><i>$frame_threadframeset </i>: Name of the frame, in which the |
204 |
|
|
frameset is to appear, which takes up the article and thread Frames. |
205 |
|
|
Normally set to "_top".</li> |
206 |
|
|
<li><i>$frame_externallink</i>: Target frame for external links within |
207 |
|
|
articles.</li> |
208 |
|
|
</ul> |
209 |
|
|
|
210 |
|
|
<p><b>Safety settings</b> |
211 |
|
|
<ul> |
212 |
|
|
<li><i>$send_poster_host</i>: "true" means that a header-line named "X-HTTP-Posting-Host:" |
213 |
|
|
will be attached to every posted article, set to the hostname of the user who wrote the article.</li> |
214 |
|
|
<li><i>$readonly </i>: if set to "true", the newsportal is read-only. The file post.php3 can be safely removed.</li> |
215 |
|
|
<li><i>$testgroup </i>: if set to "true" newsportal checks if a group is |
216 |
|
|
listed in <tt>groups.txt</tt> when accessed through thread.php3. |
217 |
|
|
Otherwise a group could be seen simply entering the right URL, although |
218 |
|
|
the group is not displayed in the group list.</li> |
219 |
|
|
<li><i>$validate_email </i>: Sets how newsportal checks an |
220 |
|
|
email address in post.php3 for syntax: |
221 |
|
|
<ul> |
222 |
|
|
<li>0: no examination. Not recommended, since the |
223 |
|
|
newsserver will give an error message, if the address is not syntactically |
224 |
|
|
correct.</li> |
225 |
|
|
<li>1: Checks the address on syntactic correctness.</li> |
226 |
|
|
<li>2: Additionally a MX or A record is checked for the domain-name of the e-mail address. |
227 |
|
|
Newsportal performs a hostname lookup.</li> |
228 |
|
|
</ul> |
229 |
|
|
</UL></p> |
230 |
|
|
|
231 |
|
|
<p><b>General setting</b> |
232 |
|
|
<UL> |
233 |
|
|
<li><i>$title</i>: The value of this variable is put in the title-header of |
234 |
|
|
the generated webpages.</li> |
235 |
|
|
<li><i>$organization </i>: Name of your organization. Put after the |
236 |
|
|
"Organization:"-header when posting articles.</li> |
237 |
|
|
<li><i>$setcookies </i>: Permits the user to save his name and his |
238 |
|
|
email-address as cookies in his browser.</li> |
239 |
|
|
<li><i>$compress_spoolfiles</i>: Sets whether the spool files should be compressed or not. |
240 |
|
|
This is recommended under normal conditions, since the size of the spoolfiles shrinks |
241 |
|
|
approximately to about 15% of the original size. Be aware that some PHP-Versions |
242 |
|
|
do not support compressing |
243 |
|
|
</UL></p> |
244 |
|
|
|
245 |
|
|
<h2>Safety notes</h2> |
246 |
|
|
|
247 |
|
|
<p>A few things must be kept in mind to not allow newsportal to open |
248 |
|
|
safety-holes: |
249 |
|
|
<ul> |
250 |
|
|
<li><tt>config.inc</tt> can be requested by every user that knows the filename, |
251 |
|
|
if you do not move it to a protected area of your webserver. |
252 |
|
|
</ul></p> |
253 |
|
|
|
254 |
|
|
<p>This script was originally (and actually still) only meant |
255 |
|
|
for access to local newsgroups. If you use it with UseNet newsgroups, |
256 |
|
|
following problems could show up: |
257 |
|
|
<ul> |
258 |
|
|
<li>Articles could be posted anonymously (i.e. spamming), see $send_poster_host</li> |
259 |
|
|
<li>Newsportal produces 8-bit header lines (i.e. the Subject), |
260 |
|
|
which is not permitted. However there do not seem to be any problems.</li> |
261 |
|
|
<li>There are lists with so-called "open" newsservers in the |
262 |
|
|
internet. Mostly "open" doesn't mean for this server that everyone is |
263 |
|
|
allowed to use this server. Normally it means that the operator of the server |
264 |
|
|
forgot to protect his server adequatly. So before using an "open" newsserver, |
265 |
|
|
you should make sure that the operator permits the use of his |
266 |
|
|
server for newsportal.</li> |
267 |
|
|
<li>Posting articles anonymously is not accepted in most UseNet groups. |
268 |
|
|
Before you give writing access to a newsgroup, you should ask the users in the newsgroup |
269 |
|
|
if they have no objections. <b>Do not give public write access on UseNet newsgroups, |
270 |
|
|
if you do not know exactly, what you are doing!</b></li> |
271 |
|
|
</ul></p> |
272 |
|
|
|
273 |
|
|
<p>The author reserves the right not to be responsible for the topicality, correctness, completeness or quality of the program provided. |
274 |
|
|
Liability claims regarding damage caused by the program provided, will therefore be rejected.<br> |
275 |
|
|
In other words: Use this program at your own risk !</p> |
276 |
|
|
|
277 |
|
|
<h2>Compatibility</h2> |
278 |
|
|
|
279 |
|
|
<p>Newsportal should work with every phpserver with php3 support |
280 |
|
|
and every newsserver. Webserver and newsserver do not need to run on the |
281 |
|
|
same machine.</p> |
282 |
|
|
|
283 |
|
|
<h2>Contact</h2> |
284 |
|
|
|
285 |
|
|
<p>Florian Amrhein<br> |
286 |
|
|
email: <a href="mailto:florian.amrhein@gmx.de">florian.amrhein@gmx.de</a><br> |
287 |
|
|
WWW: |
288 |
|
|
<a href=http://florian-amrhein.de">http://florian-amrhein.de</a> |
289 |
|
|
</p> |
290 |
|
|
</body></html> |