Merge branch 'master' of /users/www/www/

This commit is contained in:
Michael Spang 2007-07-16 09:11:31 -04:00
commit 65bb780a49
51 changed files with 350 additions and 4141 deletions

View File

@ -16,7 +16,7 @@ recurse-cow:
members.xml:
echo '<?xml version='\''1.0'\''?>' > $@
echo '<memberlist>' >> $@
ceoquery memberlist | awk -F \| '{ id = $$1; name = $$2; program = $$3; gsub(/&/, "\\&amp;", name); gsub(/&/, "\\&amp;", program); gsub(/"/, "\\&quot;", name); gsub(/"/, "\\&quot;", program); print "<member id=\"" id "\" name=\"" name "\" program=\"" program "\" />"; }' >> $@
ceoquery memberlist | sort | awk -F \| '{ name = $$1; program = $$2; userid = $$3; gsub(/&/, "\\&amp;", name); gsub(/&/, "\\&amp;", program); gsub(/"/, "\\&quot;", name); gsub(/"/, "\\&quot;", program); print "<member name=\"" name "\" program=\"" program "\" userid=\"" userid "\" />"; }' >> $@
echo '</memberlist>' >> $@
books.xml:

View File

@ -56,9 +56,9 @@
Each term the CSC holds elections to determine the executive
council. To find out when and where the next elections will be
held, check the <a href="../index.html">homepage</a> and the <a
href="nntp://uw.csc">uw.csc newsgroup</a>. For details on the
href="http://csclub.uwaterloo.ca/newsgroup/thread.php?group=uw.csc">uw.csc newsgroup</a>. For details on the
election rules, see the <a
href="/docs/constitution.html">constitution</a>.
href="../docs/constitution.html">constitution</a>.
</p>
</section>
<footer/>

View File

@ -19,28 +19,25 @@
</xsl:choose>
</xsl:variable>
<xsl:output method="html" />
<xsl:output method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
<xsl:template match="cscpage">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]>
</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title><xsl:value-of select="@title"/></title>
<link rel="stylesheet" href="{$pre}default.css" type="text/css" />
<style type="text/css">
<![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style>
</head>
<body bgcolor="#ffffff">
<a name="pagetop"></a>
<body>
<div>
<a name="pagetop" id="pagetop" />
<xsl:apply-templates select="biglogo"/>
<xsl:apply-templates select="header">
<xsl:with-param name="title" select="@title"/>
</xsl:apply-templates>
<xsl:apply-templates select="section|menu"/>
<xsl:apply-templates select="footer"/>
</div>
</body>
</html>
</xsl:template>
@ -53,17 +50,17 @@
<xsl:template match="biglogo" name="biglogo">
<div class="biglogo">
<table cellspacing="0" cellpadding="0" border="0" align="left">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="109"><a href="http://www.uwaterloo.ca/"><img
<td><a href="http://www.uwaterloo.ca/"><img
src="{$pre}logos/uw_logo_100_68.gif" alt="University of Waterloo"
width="100" height="68" align="center" border="0" /></a></td>
width="100" height="68" /></a></td>
<!--<td width="174"><a href="{$pre}"><img src="{$pre}logos/csc_160_70.png"
alt="Computer Science Club" width="165" height="75" align="center"
border="0" /></a></td>-->
<td width="91"><a href="http://www.acm.org"><img width="82"
<td><a href="http://www.acm.org"><img width="82"
height="103" src="{$pre}logos/acm_logo.gif" alt="A Student Chapter of
the ACM" align="center" border="0" /></a></td>
the ACM" /></a></td>
</tr>
</table>
</div>
@ -84,48 +81,44 @@
s1.addParam("allowfullscreen","true");
s1.addVariable("file","http://csclub.uwaterloo.ca/files/<xsl:value-of select="@file" />");
<xsl:if test="@preview">
s1.addVariable("image","<xsl:value-of select="@preview" />");
s1.addVariable("image","http://csclub.uwaterloo.ca/files/<xsl:value-of select="@preview" />");
</xsl:if>
s1.write("player1");
</script>
</xsl:template>
<xsl:template match="mediaitem">
<xsl:document method="html"
<xsl:document method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
href="{translate(concat($root, '/media/', @title , '.html'), ' ', ' ')}">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]>
</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title><xsl:value-of select="@title"/></title>
<style type="text/css">
<![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style>
<link rel="stylesheet" href="{$pre}default.css" type="text/css" />
</head>
<body bgcolor="#ffffff">
<body>
<div>
<xsl:call-template name="header">
<xsl:with-param name="title" select="@title"/>
</xsl:call-template>
<xsl:if test="abstract">
<h2>Abstract</h2>
<p>
<xsl:apply-templates select="abstract"/>
</p>
<div>
<xsl:apply-templates select="abstract/node()"/>
</div>
</xsl:if>
<xsl:if test="flvfile">
<h2>View</h2>
<p>
<div>
<xsl:apply-templates select="flvfile">
</xsl:apply-templates>
</p>
</div>
</xsl:if>
<xsl:if test="mediafile">
<h2>Download</h2>
<p><strong>
<div><strong>
HTTP (web browser):
<xsl:apply-templates select="mediafile">
<xsl:with-param name="ext"></xsl:with-param>
@ -135,42 +128,46 @@
<xsl:apply-templates select="mediafile" >
<xsl:with-param name="ext">.torrent</xsl:with-param>
</xsl:apply-templates>
</strong></p>
</strong></div>
</xsl:if>
<br/>
<!-- Slashdot It link -->
<!-- <a
href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)"> <img src="http://images.slashdot.org/favicon.gif" alt="Slashdot" border="0" height="16" width="16"></img></a>
<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
<a href="javascript:location.href='http://slashdot.org/bookmark.pl?url='+encodeURIComponent(location.href)">Slashdot It!</a> -->
<!-- AddThis Bookmark Button -->
<script type="text/javascript">
addthis_url = location.href;
addthis_title = document.title;
addthis_pub = 'calumt';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<!-- AddThis Bookmark Button -->
<script type="text/javascript">
addthis_url = location.href;
addthis_title = document.title;
addthis_pub = 'calumt';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<xsl:if test="@buttons">
<!-- digg button -->
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
<script language="javascript" src="http://reddit.com/button.js?t=3"></script>
<!--
<script type="text/javascript">
google_ad_client = "pub-5235744946475097";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-03-21: mcc
google_ad_channel = "1106187834";
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
-->
<br/><br/>
<!-- digg button -->
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
<!-- reddit button -->
<script type="text/javascript" src="http://reddit.com/button.js?t=3"></script>
</xsl:if>
<!-- google ads -->
<!--
<script type="text/javascript">
google_ad_client = "pub-5235744946475097";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
//2007-03-21: mcc
google_ad_channel = "1106187834";
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
-->
<xsl:call-template name="footer"/>
</div>
</body>
</html>
</xsl:document>
@ -185,8 +182,8 @@ google_ad_channel = "1106187834";
</xsl:choose>
</xsl:variable>
<td align="center" class="menuitem">
<a href="{$pre2}{@href}"><img border="0" src="{$pre}buttons/{@icon}.png"
<td class="menuitem">
<a href="{$pre2}{@href}"><img src="{$pre}buttons/{@icon}.png"
width="40" height="40" alt="{@title}" /><!--</a>--><br />
<!--<a href="{$pre2}{@href}">--><xsl:value-of select="@title"/></a>
</td>
@ -194,7 +191,7 @@ google_ad_channel = "1106187834";
<xsl:template match="menudefs">
<div class="menuspace">
<table cellspacing="0" cellpadding="0" border="0" align="center" class="menubar">
<table cellspacing="0" cellpadding="0" border="0" class="menubar">
<tr>
<xsl:apply-templates select="menuitem"/>
</tr>
@ -207,11 +204,10 @@ google_ad_channel = "1106187834";
</xsl:template>
<xsl:template match="header" name="header">
<a name="pagetop"></a>
<div id="vfeed"></div>
<div class="webtitle"><div class="webtitle-inner">
<table cellpadding="0" cellspacing="0" border="0" align="left"><tr>
<td width="90">
<table cellpadding="0" cellspacing="0" border="0"><tr>
<td>
<a href="{$pre}"><img src="{$pre}logos/csc_80_35_white.png" alt="CSC Logo" /></a>
</td><td>
<a href="{$pre}"><img src="{$pre}logos/csc_title.png" alt="CSC Title" /></a>
@ -257,12 +253,23 @@ google_ad_channel = "1106187834";
</p>
<p class="infobox">
The overall layout is designed specially for Mozilla-based browsers.
It is also printer-friendly version. Please report any difficulty you
may find, including the version of your browser and your operating system.
It is also printer-friendly. Please report any difficulty you may find,
including the version of your browser and your operating system.
to the <a href="mailto:www@csclub.uwaterloo.ca">Webmaster</a>.
</p>
<p>
<a href="{$pre}"><img src="{$pre}logos/csc_80_35.png" alt="CSC" align="right"/></a>
<a href="http://validator.w3.org/check?uri=referer">
<img src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" />
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
src="http://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!" />
</a>
</p>
<div class="footerlogo"><a href="{$pre}"><img src="{$pre}logos/csc_80_35.png" alt="CSC"/></a></div>
<p>
Copyright
<xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
2002<xsl:text disable-output-escaping="yes">&amp;ndash;</xsl:text>2007
@ -290,24 +297,23 @@ google_ad_channel = "1106187834";
<xsl:template match="newsitem">
<tr>
<td class="newsdate" bgcolor="#eeeeff"><xsl:value-of select="@date"/></td>
<td rowspan="2" valign="top" class="newsitem" bgcolor="white"><xsl:apply-templates/></td>
<td class="newsdate"><xsl:value-of select="@date"/></td>
<td rowspan="2" valign="top" class="newsitem"><xsl:apply-templates/></td>
</tr>
<tr>
<td class="newsauthor" bgcolor="#eeeeff"><xsl:value-of select="@author"/></td>
<td class="newsauthor"><xsl:value-of select="@author"/></td>
</tr>
</xsl:template>
<!-- TODO: methinks this is borked -->
<xsl:template match="news" name="news">
<tr>
<th colspan="2" class="news" bgcolor="#aaaaff">
<th colspan="2" class="news">
News
</th>
</tr>
<xsl:apply-templates select="document('news.xml')/newsdefs"/>
<tr>
<td class="newsitem" bgcolor="white" colspan="2">
<td class="newsitem" colspan="2">
<a href="news/">Older news items</a> are available. Make sure you
check out the <a href="/newsgroup/thread.php?group=uw.csc">uw.csc</a> newsgroup and our
announcement boards on the second and third floor of MC for more
@ -318,7 +324,7 @@ google_ad_channel = "1106187834";
<xsl:template match="events" name="events">
<tr>
<th colspan="2" class="news" bgcolor="#aaaaff">
<th colspan="2" class="news">
Upcoming Events <a href="events.ics">ical</a>
</th>
</tr>
@ -328,8 +334,8 @@ google_ad_channel = "1106187834";
data-type="number"/>
<xsl:if test="translate(@date, '-', '') &gt;= translate($date, '-', '')">
<tr>
<td class="eventdate" bgcolor="#eeffee"><xsl:value-of select="@date"/></td>
<td rowspan="2" valign="top" class="eventitem" bgcolor="white">
<td class="eventdate"><xsl:value-of select="@date"/></td>
<td rowspan="2" valign="top" class="eventitem">
<a href="{translate(concat('/events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}">
<xsl:value-of select="@title"/>
</a>.
@ -337,13 +343,13 @@ google_ad_channel = "1106187834";
</td>
</tr>
<tr>
<td class="eventroom" bgcolor="#eeffee"><xsl:value-of select="@time"/>,
<td class="eventroom"><xsl:value-of select="@time"/>,
<xsl:value-of select="@room"/></td>
</tr>
</xsl:if>
</xsl:for-each>
<tr>
<td class="eventitem" bgcolor="white" colspan="2"><a href="events/">Past
<td class="eventitem" colspan="2"><a href="events/">Past
events</a> are available.</td>
</tr>
</xsl:template>
@ -353,35 +359,33 @@ google_ad_channel = "1106187834";
</xsl:template>
<xsl:template match="eventitem">
<xsl:document method="html"
<xsl:document method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
href="{translate(concat($root, '/events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]>
</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title><xsl:value-of select="@title"/></title>
<style type="text/css">
<![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style>
<link rel="stylesheet" href="{$pre}default.css" type="text/css" />
</head>
<body bgcolor="#ffffff">
<body>
<div>
<xsl:call-template name="header">
<xsl:with-param name="title" select="@title"/>
</xsl:call-template>
<p>
<div>
Held in <xsl:value-of select="@room"/> at
<xsl:value-of select="@date"/>, <xsl:value-of select="@time"/>.
</p>
</div>
<h2>Abstract</h2>
<xsl:apply-templates select="abstract"/>
<xsl:apply-templates select="abstract/node()"/>
<xsl:call-template name="footer"/>
</div>
</body>
</html>
</xsl:document>
</xsl:template>
<xsl:template match="news-and-events">
<table cellspacing="1" cellpadding="2" bgcolor="black">
<table cellspacing="1" cellpadding="2" class="newsandevents">
<xsl:call-template name="events"/>
<xsl:call-template name="news"/>
</table>
@ -428,18 +432,21 @@ google_ad_channel = "1106187834";
select="count(document('members.xml')/memberlist/member)"/> members.</p>
<table>
<tr>
<th>Member ID</th>
<th>Name</th>
<th>Program</th>
<th>Userid</th>
</tr>
<xsl:for-each select="document('members.xml')/memberlist/member">
<tr>
<xsl:if test="position() mod 2 = 0">
<xsl:attribute name="bgcolor">#cee6ff</xsl:attribute>
</xsl:if>
<td><xsl:value-of select="@id"/></td>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="@program"/></td>
<xsl:variable name="class">
<xsl:choose>
<xsl:when test="position() mod 2 = 0">members1</xsl:when>
<xsl:otherwise>members2</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr class="{$class}">
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="@program"/></td>
<td><xsl:value-of select="@userid"/></td>
</tr>
</xsl:for-each>
</table>
@ -465,17 +472,15 @@ google_ad_channel = "1106187834";
</a></td>
<td><xsl:value-of select="@author"/></td>
</tr>
<xsl:document method="html" href="{translate(concat($root, '/office/books/', @isbn, '.html'), ' ', '_')}">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]>
</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml">
<xsl:document method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
href="{translate(concat($root, '/office/books/', @isbn, '.html'), ' ', '_')}">
<html>
<head>
<title>Book: <xsl:value-of select="@title"/></title>
<style type="text/css">
<![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style>
<link rel="stylesheet" href="{$pre}default.css" type="text/css" />
</head>
<body bgcolor="#ffffff">
<body>
<div>
<xsl:call-template name="header">
<xsl:with-param name="title" select="@title"/>
<!-- TODO -->
@ -489,6 +494,7 @@ google_ad_channel = "1106187834";
<b>Published: </b> <xsl:value-of select="@published"/><br />
</p>
<xsl:call-template name="footer"/>
</div>
</body>
</html>
</xsl:document>
@ -518,17 +524,15 @@ google_ad_channel = "1106187834";
csc:term(@date), '.html'), ' ', '_')}">
<xsl:value-of
select="csc:term(@date)"/></a></p>
<xsl:document method="html" href="{translate(concat($root, '/events/old-', csc:term(@date), '.html'), ' ', '_')}">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]>
</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml">
<xsl:document method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
href="{translate(concat($root, '/events/old-', csc:term(@date), '.html'), ' ', '_')}">
<html>
<head>
<title>Events for <xsl:value-of select="csc:term(@date)"/></title>
<style type="text/css">
<![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style>
<link rel="stylesheet" href="{$pre}default.css" type="text/css" />
</head>
<body bgcolor="#ffffff">
<body>
<div>
<xsl:call-template name="header">
<xsl:with-param name="title" select="concat('Events for ', csc:term(@date))"/>
</xsl:call-template>
@ -536,6 +540,7 @@ google_ad_channel = "1106187834";
<xsl:with-param name="date" select="@date"/>
</xsl:call-template>
<xsl:call-template name="footer"/>
</div>
</body>
</html>
</xsl:document>
@ -561,17 +566,17 @@ google_ad_channel = "1106187834";
csc:term(@date), '.html'), ' ', '_')}">
<xsl:value-of
select="csc:term(@date)"/></a></p>
<xsl:document method="html" href="{translate(concat($root, '/news/old-', csc:term(@date), '.html'), ' ', '_')}">
<xsl:document method="xml" encoding="ISO-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
href="{translate(concat($root, '/news/old-', csc:term(@date), '.html'), ' ', '_')}">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]>
</xsl:text>
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>News for <xsl:value-of select="csc:term(@date)"/></title>
<style type="text/css">
<![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style>
<link rel="stylesheet" href="{$pre}default.css" type="text/css" />
</head>
<body bgcolor="#ffffff">
<body>
<div>
<xsl:call-template name="header">
<xsl:with-param name="title" select="concat('News for ', csc:term(@date))"/>
</xsl:call-template>
@ -579,6 +584,7 @@ google_ad_channel = "1106187834";
<xsl:with-param name="date" select="@date"/>
</xsl:call-template>
<xsl:call-template name="footer"/>
</div>
</body>
</html>
</xsl:document>

View File

@ -1,58 +1,138 @@
body {background: white; color: black; font-family:serif;}
h1 {font-size: x-large; }
h2 {font-size: large; color: #000055; }
h3 {font-size: medium; color: #0055aa; }
a:visited {background: transparent; color: #8888aa; text-decoration: none; }
a:link {background: transparent; color: #0000aa; text-decoration: none; }
a:active {/*background: #ffcc00;*/ color: #0000cc; }
td.button { background: #eeeeee; text-align: center; }
td.newsdate { background: #eeeeff; font-family: sans-serif; font-size: x-small; text-align: center; font-weight: bold;}
td.newsitem { background: white; text-align: left;}
td.newsauthor { background: #eeeeff; font-family: sans-serif; font-size: x-small; text-align: center;}
td.eventdate { background: #eeffee; font-family: sans-serif; font-size: x-small; text-align: center; font-weight: bold;}
td.eventitem { background: white; text-align: left;}
td.eventroom { background: #eeffee; font-family: sans-serif; font-size: x-small; text-align: center;}
th.news { background: #222255; color: white; font-family: sans-serif; font-size: x-small; text-align: left; }
td.pagetitle { font-size: large; font-weight: bold; }
th { background: #002288; color: white; }
/* CSS 2 (especially for Mozilla) and CSS 3 (according to the developmental spec) */
body, .web-framework {
body {
background: white;
color: black;
font-family:serif;
font-size:12px;
width:760px;
margin:0 auto;
padding:0 20px;
font-size:12px;
}
h1 {
font-size: x-large;
}
h2 {
font-size: large;
font-family:'Lucida Grande', Sans, Sans-serif;
text-transform: uppercase;
border-left:10px solid #ff9900;
padding-left:10px;
color: #000055;
}
h3 {
font-size: medium;
color: #0055aa;
}
a:visited {
background: transparent;
color: #8888aa;
text-decoration: none;
}
a:link {
background: transparent;
color: #0000aa;
text-decoration: none;
}
a:active {
color: #0000cc;
}
table.newsandevents { background: black; }
td.button {
background: #eeeeee;
text-align: center;
}
td.newsdate {
background: #eeeeff;
font-family: sans-serif;
font-size: x-small;
text-align: center;
font-weight: bold;
}
td.newsitem {
background: white;
text-align: left;
}
td.newsauthor {
background: #eeeeff;
font-family: sans-serif;
font-size: x-small;
text-align: center;
}
td.eventdate {
background: #eeffee;
font-family: sans-serif;
font-size: x-small;
text-align: center;
font-weight: bold;
}
td.eventitem {
background: white;
text-align: left;
}
td.eventroom {
background: #eeffee;
font-family: sans-serif;
font-size: x-small;
text-align: center;
}
th.news {
background: #222255;
color: white;
font-family: sans-serif;
font-size: x-small;
text-align: left;
}
td.pagetitle {
font-size: large;
font-weight: bold;
}
th {
background: #002288;
color: white;
}
tr.members1 {
background: white;
}
tr.members2 {
background: #cee6ff;
}
img {
border-width:0;
}
h2 {
border-left:10px solid #ff9900;
font-family:'Lucida Grande', Sans, Sans-serif;
text-transform:uppercase;
padding-left:10px;
div.footerlogo {
float: right;
padding-left: 5px;
}
p {
font-family:'Lucida Grande', Sans, Sans-serif;
}
.biglogo {
background:url(/csc_welcome.jpg) -20px 25px transparent no-repeat;
div.webcam {
text-align: center;
}
div.biglogo {
background:url(./csc_welcome.jpg) -20px 25px transparent no-repeat;
height:340px;
} .biglogo table {
}
div.biglogo table {
float:left;
}
.template-header {
table.template-header {
border-bottom:1px solid #ccc;
/*background-color:#cee6ff;*/
/*padding-top:65px;*/
}
.webtitle {
div.webtitle {
/*position:absolute;
top:0;
left:0;*/
@ -60,30 +140,35 @@ p {
width:760px;
background-color:#215498;
border-bottom:4px solid #104387;
} .webtitle .webtitle-inner {
}
div.webtitle div.webtitle-inner {
width:760px;
padding:0 10px;
}
.menuspace {
div.menuspace {
background:white;
}
.menuspace .menubar {
background-color:transparent;
div.menuspace table.menubar {
background-color: transparent;
padding:0;
margin:0 auto;
text-align:center;
text-align: center;
height:90px;
vertical-align:center;
vertical-align: middle;
font-size:11px;
text-transform:uppercase;
text-transform: uppercase;
}
.menuspace .menuitem {
div.menuspace td.menuitem {
margin:0;
padding:0;
} .menuspace .menuitem a {
text-align: center;
}
div.menuspace td.menuitem a {
display:block;
text-align:center;
padding:5px;
@ -91,36 +176,36 @@ p {
text-decoration:none;
font-weight:400;
font-family:'Lucida Grande', Sans, Sans-serif;
} .menuspace .menuitem a:hover {
}
div.menuspace td.menuitem a:hover {
font-weight:700;
color:black;
background-color:#eee;
border:1px solid #ccc;
} .menuspace .menuitem a:hover img {
}
div.menuspace div.menuitem a:hover img {
width:60px;
height:60px;
}
.diritem,
.diritem:link,
.diritem:visited,
.diritem:active {
a.diritem, a.diritem:link, a.diritem:visited, a.diritem:active {
font-family:'Lucida Grande', Sans, Sans-serif;
border-left:4px solid #ccc;
padding:0 15px 0 5px;
color:blue;
} .diritem:hover {
}
a.diritem:hover {
border-left:4px solid green;
}
.headdir {
a.headdir {
font-weight:700;
}
.pagetop,
.pagetop:link,
.pagetop:visited,
.pagetop:hover {
a.pagetop, a.pagetop:link, a.pagetop:visited, a.pagetop:hover {
font-family:'Lucida Grande',sans, sans-serif;
display:block;
padding:0 10px 10px 10px;
@ -133,7 +218,7 @@ p {
text-transform:uppercase;
}
.footer {
div.footer {
/*margin-top:10px;*/
padding-top:10px;
border-top:1px solid #ccc;
@ -142,7 +227,7 @@ p {
/*background:url('/logos/csc_80_35.png') right bottom no-repeat transparent;*/
}
.infobox {
p.infobox {
border:1px solid #ccc;
padding:5px 10px;
}

View File

@ -12,13 +12,13 @@ of the University of Waterloo''.</li>
</ol>
</section>
<section title="2. Purpose">
<ol><li><a name="purpose">The Club</a> is organized and will be operated exclusively for educational
<ol><li><a id="purpose">The Club</a> is organized and will be operated exclusively for educational
and scientific purposes in furtherance of:</li>
<ul>
<li>a) promoting an increased knowledge of computer science and its applications.</li>
<li>b) promoting a greater interest in computer science and
its applications; and</li>
<li>c) <a name="comm">providing a means of communication between persons
<li>c) <a id="comm">providing a means of communication between persons
having interest in computer science.</a></li>
</ul>
@ -230,7 +230,7 @@ Club as set forth in Section <a href="#purpose">2</a>.</li>
council.</li>
</ol>
<h3><a name="sysduties">2. Systems Committee</a></h3>
<h3><a id="sysduties">2. Systems Committee</a></h3>
<ol><li> The Systems Committee will be a standing committee, chaired by the
Systems Administrator.</li>
@ -375,4 +375,4 @@ course, responsible to the person granting permission.</li>
</section>
<footer/>
</cscpage>
</cscpage>

View File

@ -12,13 +12,13 @@ of the University of Waterloo''.</li>
</ol>
</section>
<section title="2. Purpose">
<ol><li><a name="purpose">The Club</a> is organized and will be operated exclusively for educational
<ol><li><a id="purpose">The Club</a> is organized and will be operated exclusively for educational
and scientific purposes in furtherance of:</li>
<ul>
<li>a) promoting an increased knowledge of computer science and its applications.</li>
<li>b) promoting a greater interest in computer science and
its applications; and</li>
<li>c) <a name="comm">providing a means of communication between persons
<li>c) <a id="comm">providing a means of communication between persons
having interest in computer science.</a></li>
</ul>
@ -217,7 +217,7 @@ Club as set forth in Section <a href="#purpose">2</a>.</li>
council.</li>
</ol>
<h3><a name="sysduties">2. Systems Committee</a></h3>
<h3><a id="sysduties">2. Systems Committee</a></h3>
<ol><li> The Systems Committee will be a standing committee, chaired by the
Systems Administrator.</li>
@ -362,4 +362,4 @@ course, responsible to the person granting permission.</li>
</section>
<footer/>
</cscpage>
</cscpage>

View File

@ -12,15 +12,16 @@ of the University of Waterloo".</li>
</ol>
</section>
<section title="2. Purpose">
<ol><li><a name="purpose">The Club</a> is organized and will be operated exclusively for educational
and scientific purposes in furtherance of:</li>
<ol><li><a id="purpose">The Club</a> is organized and will be operated exclusively for educational
and scientific purposes in furtherance of:
<ul>
<li>a) promoting an increased knowledge of computer science and its applications.</li>
<li>b) promoting a greater interest in computer science and
its applications; and</li>
<li>c) <a name="comm">providing a means of communication between persons
<li>c) <a id="comm">providing a means of communication between persons
having interest in computer science.</a></li>
</ul>
</li>
<li> the above purposes will be fulfilled by the organization of
discussions and lectures with professionals and academics in the field
@ -59,13 +60,13 @@ The membership fee is set from time to time by the Executive.</li>
</section>
<section title="4. Officers">
<ol><li> The officers of the Club shall be:</li>
<ol><li> The officers of the Club shall be:
<ol><li> President</li>
<li> Vice-President</li>
<li> Secretary</li>
<li> Treasurer</li>
<li> System Administrator</li>
</ol>
</ol></li>
<li> The faculty advisor shall be an ex-officio member of the
Club.</li>
@ -80,7 +81,7 @@ lectures in the Winter and Spring terms, and as the beginning of
Orientation Week in the Fall term.</li>
<li> The election of officers shall be accomplished by the following
procedure:</li>
procedure:
<ol>
@ -120,6 +121,7 @@ may be held at a later date, in accordance with the election
procedures. The membership decides whether or not to hold extra
elections.</li>
</ol>
</li>
<li> Following the elections, it is the responsibility of the new executive
to select a System Administrator. The selection of System Administrator must
@ -146,7 +148,7 @@ Such elections would be for all offices which are vacant.</li>
<section title="5. Duties of Officers">
<ol>
<li> The duties of the President shall be:</li>
<li> The duties of the President shall be:
<ol>
<li> to call and preside at all general, special, and executive
@ -160,34 +162,39 @@ and</li>
records of the club at the end of each academic term.</li>
</ol>
</li>
<li> The duties of the Vice-President shall be:</li>
<li> The duties of the Vice-President shall be:
<ol><li> to assume the duties of the President
in the event of the President's absence;</li>
<li> to act as chairman of the programmes committee; and</li>
<li> to assume those duties of the President
that are delegated to him by the President.</li>
</ol>
</li>
<li> The duties of the Secretary shall be:</li>
<li> The duties of the Secretary shall be:
<ol><li> to keep minutes of all Club meetings;</li>
<li> to prepare the annual Club report for
approval by the executive council;</li>
<li> to care for all Club correspondence;</li>
</ol>
</li>
<li> The duties of the Treasurer shall be:</li>
<li> The duties of the Treasurer shall be:
<ol>
<li> to collect dues and maintain all financial and membership records;</li>
<li> to produce a financial or membership statement when requested;</li>
</ol>
</li>
<li> The duties of the System Administrator shall be:</li>
<li> The duties of the System Administrator shall be:
<ol>
<li> to chair the Systems Committee</li>
<li> to perform in conjunction with the Systems Committee, the duties listed
in <a href="#sysduties">7.2</a>.</li>
</ol>
</li>
</ol>
</section>
<section title="6. Executive Council">
@ -217,21 +224,21 @@ Club as set forth in Section <a href="#purpose">2</a>.</li>
council.</li>
</ol>
<h3><a name="sysduties">2. Systems Committee</a></h3>
<h3><a id="sysduties">2. Systems Committee</a></h3>
<ol><li> The Systems Committee will be a standing committee, chaired by the
Systems Administrator.</li>
<li> The Executive Council shall appoint members to the Systems Committee.
Such members should show interest and ability in Systems Administration.</li>
<li> The Systems Committee will collectively, under the leadership of the
Systems Administrator,</li>
Systems Administrator,
<ol><li> to operate any and all equipment in the possession of the Club.</li>
<li> to maintain and upgrade the software on equipment that is operated by
the Club.</li>
<li> to facilitate the use of equipment that is operated by the
Club.</li>
</ol></ol>
</ol></li></ol>
<h3>3. Library Committee</h3>
@ -240,13 +247,13 @@ Librarian of the Computer Science Club.</li>
<li> The Librarian shall be selected by the Executive Council.</li>
<li> Either the Executive Council or the Librarian may appoint members to
the library committee.</li>
<li> The library committee will be responsible for</li>
<li> The library committee will be responsible for
<ol><li> purchasing new materials to be added to the Computer Science Club
library, with a target amount of money to spend indicated by the Treasurer;</li>
<li> keeping the library in some semblance of order;</li>
<li> in conjunction with the Systems Committee, maintaining an up-to-date,
online record of the materials in the library.</li>
</ol></ol>
</ol></li></ol>
<h3>4. Other Committees</h3>
@ -297,15 +304,15 @@ that the financial records are complete and accurate.</li>
<section title="10. Amendments and Procedures">
<ol><li> Amendments to the constitution shall be made in the following
manner:</li>
manner:
<ol><li> the proposed amendment shall be announced to all members via
one or more of</li>
one or more of
<ol><li> a general meeting</li>
<li> electronic mail</li>
<li> Usenet</li>
</ol>
</ol></li>
<li> the proposed amendment shall be made available for viewing by all
members in the Computer Science Club office;</li>
<li> A business meeting shall be held
@ -314,7 +321,7 @@ at least seven (7) days after the announcement and no more than thirty (30) days
the amendment shall be read again and voted upon.
Two thirds of those present
and voting shall be required to carry the amendment;</li>
</ol>
</ol></li>
<li> A quorum necessary for the conduct of business
is defined as fifteen (15) members

View File

@ -1,6 +1,6 @@
<?xml version='1.0'?>
<!DOCTYPE cscpage SYSTEM "../../csc.dtd">
<cscpage title="Operating Systems the CSC distributes">
<cscpage title="Operating Systems the CSC distributes" pre="../../">
<header/>
<footer/>
</cscpage>

View File

@ -1,6 +1,6 @@
<?xml version='1.0'?>
<!DOCTYPE cscpage SYSTEM "../../csc.dtd">
<cscpage title="Operating Systems the CSC distributes">
<cscpage title="Operating Systems the CSC distributes" pre="../../">
<header/>
<footer/>
</cscpage>

View File

@ -1,6 +1,6 @@
<?xml version='1.0'?>
<!DOCTYPE cscpage SYSTEM "../../csc.dtd">
<cscpage title="Operating Systems the CSC distributes">
<cscpage title="Operating Systems the CSC distributes" pre="../../">
<header/>
<section title="List of operating systems">
<ul>

View File

@ -35,7 +35,7 @@ Note that in the following sections, the term &quot;user&quot; implies a user of
CSC machine, unless otherwise specified.
</p>
<h3><a name="usageaccept">Acceptable and Unacceptable Use</a></h3>
<h3><a id="usageaccept">Acceptable and Unacceptable Use</a></h3>
<p>
The CSC machines are intended for research, personal projects,
@ -49,7 +49,7 @@ by the CSC Systems Committee.
Users must adhere to the CSC's policies concerning machine usage.
</p>
<h3><a name="usagerespons">User Responsibilities</a></h3>
<h3><a id="usagerespons">User Responsibilities</a></h3>
<p>
Users must be responsible for their behaviour.
Users, and not the CSC, will be held accountable for any of their illegal,
@ -71,7 +71,7 @@ that they connect to.
</p>
<h3><a name="usagesecurity">Security</a></h3>
<h3><a id="usagesecurity">Security</a></h3>
<p>
Users may not attempt to gain access to accounts
other than those which they have been permitted to use.
@ -99,7 +99,7 @@ in the event that a security problem is found. Naturally, the problem
should neither be exploited nor made public until it can be corrected.
</p>
<h3><a name="usagerights">Rights of the Systems Committee and the CSC Executive</a></h3>
<h3><a id="usagerights">Rights of the Systems Committee and the CSC Executive</a></h3>
<p>
The Systems Committee may examine any files or programs believed to be out of
control or in violation of the usage policies for the CSC network.
@ -134,7 +134,7 @@ with reasonable notice.
<li><a href="#clubrespons">Responsibility and Accountability</a></li>
</ol>
<h3><a name="clubaccess">Access Control</a></h3>
<h3><a id="clubaccess">Access Control</a></h3>
<p>
Note: For the given section, any mention of the club, except in direct
reference to the Computer Science Club, will refer an club other than the
@ -172,7 +172,7 @@ The club members with access to the club account shall not grant
</li>
</ol>
<h3><a name="clubrespons">Responsibility and Accountable</a></h3>
<h3><a id="clubrespons">Responsibility and Accountable</a></h3>
<p>
The account is the responsibility of the members who have access. If the
resources owned by the club account are found to be in violation of any
@ -213,7 +213,7 @@ Computer, terminal or other piece of hardware. Non-CSC machines
An appointed body responsible for the operation of the CSC network
and the software that runs on it.
A complete description is available in the
<a HREf="constitution.shtml">CSC Constitution</a>.
<a href="constitution.shtml">CSC Constitution</a>.
</dd>
<dt>Network Bandwidth</dt>

View File

@ -9,7 +9,7 @@
Policies for group accounts and administrative accounts are not yet
available (this section will contain links to them when they do become
available). This is a brief (instead of legalese) version of the
<a HREF="machine_usage.html">usage policy</a>.
<a href="machine_usage.html">usage policy</a>.
Everyone who receives an account on one of the CSC machines must sign
the agreement based on the usage policy, and this summary lists the
things that the users will agree to.

View File

@ -3306,7 +3306,7 @@ Remember: Monday, January 13, 6:00 PM, MC3001/Comfy Lounge.</p>
<dd>$0.00</dd>
<dt>Pre-registration</dt>
<dd>Recommended</dd>
<dd><a HREF="http://infranet.uwaterloo.ca:81/infranet/semform.htm">http://infranet.uwaterloo.ca:81/infranet/semform.htm</a></dd>
<dd><a href="http://infranet.uwaterloo.ca:81/infranet/semform.htm">http://infranet.uwaterloo.ca:81/infranet/semform.htm</a></dd>
<dd>(519) 888-4004</dd>
</dl>
@ -3343,7 +3343,7 @@ Shirley Fenton<br />
The infraNET Project<br />
University of Waterloo<br />
519-888-4567 ext. 5611<br />
<a HREF="http://infranet.uwaterloo.ca/">http://infranet.uwaterloo.ca/</a>
<a href="http://infranet.uwaterloo.ca/">http://infranet.uwaterloo.ca/</a>
</address>
</abstract>
</eventitem>
@ -3418,7 +3418,7 @@ University of Waterloo<br />
</dd>
</dl>
<p>Any <a HREF="nntp://news.math.uwaterloo.ca/uw.csc/8305">comments</a> from <a HREF="news:uw.csc">the newsgroup</a> are welcome.</p>
<p>Any <a href="nntp://news.math.uwaterloo.ca/uw.csc/8305">comments</a> from <a href="news:uw.csc">the newsgroup</a> are welcome.</p>
</abstract>
</eventitem>
@ -3431,7 +3431,7 @@ University of Waterloo<br />
hours. Solutions are written in Pascal, C or C++. Seven years in a row,
Waterloo's teams have been in the top ten at the world finals.
For more information, see
<a HREF="http://plg.uwaterloo.ca/~acm00/">the contest web page</a>.</p>
<a href="http://plg.uwaterloo.ca/~acm00/">the contest web page</a>.</p>
<h3>Easy Question:</h3>
<p>A palindrome is a sequence of letters that reads the same backwards and
@ -3494,7 +3494,7 @@ stop
hours. Solutions are written in Pascal, C or C++. Seven years in a row,
Waterloo's teams have been in the top ten at the world finals.
For more information, see
<a HREF="http://plg.uwaterloo.ca/~acm00/">the contest web page</a>.</p>
<a href="http://plg.uwaterloo.ca/~acm00/">the contest web page</a>.</p>
<h3>Easy Question:</h3>
<p>A palindrome is a sequence of letters that reads the same backwards and

View File

@ -15,14 +15,6 @@
</p>
</section>
<section title="Site Updated!">
<p>
The design is now finalized. It is compatible with any browsers, especially
ones that recognize HTML 4.1, XML/XHTML 1.1 and CSS 3.0 (Stable
Specification).
</p>
</section>
<section title="News and Upcoming Events">
<news-and-events />
</section>

View File

@ -19,19 +19,20 @@
<flvfile file="pmc-sasms-spring-2007.flv" />
</mediaitem>
<mediaitem title="Copyright vs Community in the Age of Computer Networks">
<abstract>
Copyright developed in the age of the printing press, and was designed to
fit with the system of centralized copying imposed by the printing press.
But the copyright system does not fit well with computer networks, and
only draconian punishments can enforce it.
<mediaitem title="Copyright vs Community in the Age of Computer Networks" buttons="true">
<abstract><p>
Copyright developed in the age of the printing press, and was designed
to fit with the system of centralized copying imposed by the printing
press. But the copyright system does not fit well with computer networks,
and only draconian punishments can enforce it.
</p><p>
The global corporations that profit from copyright are lobbying for
draconian punishments, and to increase their copyright powers, while
suppressing public access to technology. But if we seriously hope to serve
the only legitimate purpose of copyright -- to promote progress, for the
benefit of the public -- then we must make changes in the other direction.
</abstract>
benefit of the public -- then we must make changes in the other
direction.
</p></abstract>
</mediaitem>
<mediaitem title="Usability in the Wild">
@ -53,7 +54,7 @@
<mediafile file="mterry2.ogg" type="OGG/Theora" size="535M" />
<mediafile file="mterry2.mp4" type="MP4" size="509M" />
<mediafile file="mterry2.mpg" type="MPG" size="520M" />
<flvfile file="mterry2.flv" />
<flvfile file="mterry2.flv" preview="mterry2.png" />
</mediaitem>
<mediaitem title="Ralph Stanton 40th Anniversary of Math Faculty Talk">
@ -155,6 +156,7 @@
<mediafile file="sdt-xvid.avi" type="XviD" size="406M" />
<mediafile file="sdt.mpg" type="MPG" size="405M" />
<mediafile file="sdt.ogg" type="OGG/Theora" size="411M" />
<flvfile file="sdt.flv" />
</mediaitem>
<mediaitem title="ReactOS - An Open Source OS Platform for Learning">
@ -198,6 +200,7 @@
<mediafile file="alex-ionescu-xvid.avi" type="XviD" size="451M" />
<mediafile file="alex-ionescu.mpg" type="MPG" size="450M" />
<mediafile file="alex-ionescu.ogg" type="OGG/Theora" size="461M" />
<flvfile file="alex-ionescu.flv" />
</mediaitem>
<mediaitem title="1989 Bill Gates Talk on Microsoft">
@ -357,9 +360,11 @@
Particularly illuminating are his responses to advocates of
free/open-source software.
</abstract>
<mediafile file="Rico-Mariani-exctd-divx-320-240.avi" size="689M" type="DivX" />
<mediafile file="Rico-Mariani-exctd-quicktime.mov" size="504M" type="Quick Time" />
<mediafile file="Rico-Mariani-exctd-wmv.wmv" size="157M" type="Windows Media" />
<mediafile file="rico.avi" type="XviD" size="534M" />
<mediafile file="rico.ogg" type="OGG/Theora" size="528M" />
<mediafile file="rico.mp4" type="MP4" size="507M" />
<mediafile file="rico.mpg" type="MPG" size="532M" />
<flvfile file="rico.flv" />
</mediaitem>
</ul>

View File

@ -12,8 +12,8 @@
<menuitem title="Media" icon="package_multimedia" href="media/"/>
<menuitem title="Library" icon="koha" absolute="true" href="http://koha.csclub.uwaterloo.ca"/>
<menuitem title="Wiki" icon="sunflower" absolute="true" href="http://wiki.csclub.uwaterloo.ca"/>
<menuitem title="Webmail" icon="horde" href="horde"/>
<menuitem title="Mailman" icon="mm-icon" absolute="true" href="/cgi-bin/mailman/listinfo"/>
<menuitem title="Webmail" icon="horde" absolute="true" href="https://mail.csclub.uwaterloo.ca/"/>
<menuitem title="Mailman" icon="mm-icon" absolute="true" href="http://mailman.csclub.uwaterloo.ca"/>
<menuitem title="gopher" icon="gopher" absolute="true" href="gopher://csclub.uwaterloo.ca"/>
<menuitem title="gitweb" icon="gitweb" absolute="true" href="http://gitweb.csclub.uwaterloo.ca"/>
</menudefs>

View File

@ -1,6 +0,0 @@
AuthPAM_Enabled on
<Files post.php>
AuthType Basic
AuthName "CSC Login Required"
require group daemon
</Files>

View File

@ -1,85 +0,0 @@
<?
header("Expires: ".gmdate("D, d M Y H:i:s",time()+(3600*24))." GMT");
// register parameters
$id=$_REQUEST["id"];
$group=$_REQUEST["group"];
include "config.inc.php";
/*
$thread_show["replies"]=true;
$thread_show["lastdate"]=false;
$thread_show["threadsize"]=false;
*/
include "auth.inc";
include "$file_newsportal";
$message=message_read($id,0,$group);
if (!$message) {
header ("HTTP/1.0 404 Not Found");
$subject=$title;
$title.=' - Article not found';
if($ns!=false)
nntp_close($ns);
} else {
$subject=htmlspecialchars($message->header->subject);
header("Last-Modified: ".date("r", $message->header->date));
$title.= ' - '.$subject;
}
include "head.inc";
// has the user read-rights on this article?
if((function_exists("npreg_group_has_read_access") &&
!npreg_group_has_read_access($group)) ||
(function_exists("npreg_group_is_visible") &&
!npreg_group_is_visible($group))) {
die("access denied");
}
?>
<h1 class="np_article_headline"><?=htmlspecialchars($subject) ?></h1>
<table cellpadding="0" cellspacing="0" width="100%" class="np_buttonbar"><tr>
<?
echo '<td class="np_button"><a class="np_button" href="'.
$file_index.'">'.$text_thread["button_grouplist"].'</a></td>';
echo '<td class="np_button"><a class="np_button" href="'.
$file_thread.'?group='.urlencode($group).'">'.$text_article["back_to_group"].'</a></td>';
if ((!$readonly) && ($message) &&
(!function_exists("npreg_group_has_write_access") ||
npreg_group_has_write_access($group)))
echo '<td class="np_button"> <a class="np_button" href="'.
$file_post.'?type=reply&id='.urlencode($id).
'&group='.urlencode($group).'">'.$text_article["button_answer"].
'</a></td>';
if(function_exists(npreg_user_is_moderator) && npreg_user_is_moderator($group)) {
echo '<td class="np_button"><a class="np_button" href="'.$file_cancel.'?type=reply&id='.urlencode($id).
'&group='.urlencode($group).'">'.$text_article["button_cancel"].'</a></td>';
}
?>
<td width="100%">&nbsp;</td></tr></table>
<?
if (!$message)
// article not found
echo $text_error["article_not_found"];
else {
if($article_showthread)
$thread=thread_cache_load($group);
//echo "<br>";
message_show($group,$id,0,$message);
if($article_showthread)
message_thread($message->header->id,$group,$thread);
}
include "tail.inc";
?>

View File

@ -1,23 +0,0 @@
<?
header("Expires: ".gmdate("D, d M Y H:i:s",time()+(3600*24))." GMT");
$group=$_REQUEST["group"];
$id=$_REQUEST["id"];
$attachment=$_REQUEST["attachment"];
include "config.inc.php";
include "auth.inc";
require("$file_newsportal");
if (!isset($attachment))
$attachment=0;
$message=message_read($id,$attachment,$group);
//print_r($message->header);
if (!$message) {
header ("HTTP/1.0 404 Not Found");
echo "The Attachment doesn't exists";
} else {
header("Content-Disposition: attachment; filename=".
$message->header->content_type_name[$attachment]);
header("Content-type: ".$message->header->content_type[$attachment]);
message_show("",$id,$attachment,$message);
}
?>

View File

View File

@ -1,170 +0,0 @@
<?
/*
* directories and files
*/
$spooldir="spool";
$imgdir="img";
$file_newsportal="newsportal.php";
$file_index="index.php";
$file_thread="thread.php";
$file_article="article.php";
// $file_article_full="article.php";
$file_attachment="attachment.php";
$file_post="post.php";
$file_cancel="cancel.php";
$file_language="lang/english.lang";
$file_footer="/users/www/www/footer.html";
$file_groups="groups.txt";
/*
* newsserver setup
*/
$server="news";
$port=119;
// $post_server="";
// $post_port=119;
$maxfetch=0; // depricated
$initialfetch=0; // depricated
//$server_auth_http=true;
/*
* Grouplist Layout
*/
$gl_age=true;
/*
* Thread layout
*/
$thread_treestyle=7;
$thread_show["date"]=true;
$thread_show["subject"]=true;
$thread_show["author"]=true;
$thread_show["authorlink"]=false;
$thread_show["replies"]=true;
$thread_show["lastdate"]=false; // makes only sense with $thread_show["replies"]=false
$thread_show["threadsize"]=false;
$thread_maxSubject=50;
$maxarticles=400;
$maxarticles_extra=100;
$age_count=3;
$age_time[1]=86400; //24 hours
$age_color[1]="red";
$age_time[2]=259200; //3 days
$age_color[2]="#999900";
$age_time[3]=604800; //7 days
$age_color[3]="#00bb00";
$thread_sort_order=-1;
$thread_sort_type="thread";
$articles_per_page=50;
$startpage="first";
/*
* Frames
*/
// for frames-support: read README in the frames-directory
//$frame_article="article";
//$frame_thread="thread";
//$frame_groups="_top";
//$frame_post="_top";
//$frame_threadframeset="_top";
$frame_externallink="_blank";
/*
* article layout
*/
$article_show["Subject"]=true;
$article_show["From"]=true;
$article_show["Newsgroups"]=true;
$article_show["Followup"]=true;
$article_show["Organization"]=true;
$article_show["Date"]=true;
$article_show["Message-ID"]=false;
$article_show["User-Agent"]=false;
$article_show["References"]=false;
$article_show["From_link"]=true;
//$article_show["From_rewrite"]=array('@',' (at) ');
$article_showthread=true;
$article_graphicquotes=true;
/*
* settings for the article flat view, if used
*/
$articleflat_articles_per_page=20;
$articleflat_chars_per_articles=5000;
/*
* Message posting
*/
$send_poster_host=false;
$readonly=false;
$testgroup=false;
$validate_email=1;
$organization="University of Waterloo Computer Science Club";
$setcookies=false;
// $anonym_address="set_this@to_something_valid";
$msgid_generate="md5";
$msgid_fqdn=$_SERVER["HTTP_HOST"];
$post_autoquote=false;
/*
* Attachments
*/
$attachment_show=true;
$attachment_delete_alternative=true; // delete non-text mutipart/alternative
$attachment_uudecode=false; // experimental!
/*
* Security settings
*/
$block_xnoarchive=false;
/*
* Cache
*/
$cache_articles=false; // article cache, experimental!
$cache_index=3600; // cache the group index for one hour before reloading
$cache_thread=60; // cache the thread for one minute reloading
/*
* Misc
*/
$title="CSC Newsportal";
$cutsignature=true;
$compress_spoolfiles=false;
// website charset, "koi8-r" for example
$www_charset = "iso-8859-15";
// Use the iconv extension for improved charset conversions
$iconv_enable=true;
// timezone relative to GMT, +1 for CET
$timezone=-5;
/*
* Group specific config
*/
//$group_config=array(
// '^de\.alt\.fan\.aldi$' => "aldi.inc",
// '^de\.' => "german.inc"
//);
/*
* Do not edit anything below this line
*/
// Load group specifig config files
if((isset($group)) && (isset($group_config))) {
foreach ($group_config as $key => $value) {
if (ereg($key,$group)) {
include $value;
break;
}
}
}
// check the settings
include "lib/check.php";
// load the english language definitions first because some of the other
// definitions are incomplete
include("lang/english.lang");
include($file_language);
?>

View File

@ -1,4 +0,0 @@
:Computer Science Club
uw.csc
uw.csc.hardware
uw.csc.software

View File

@ -1,7 +0,0 @@
<html>
<head>
<title><? echo htmlspecialchars($title); ?></title>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=<?=$www_charset?>">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body textcolor="black" bgcolor="white">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 B

View File

@ -1,18 +0,0 @@
<? header("Expires: ".gmdate("D, d M Y H:i:s",time()+7200)." GMT");
include "config.inc.php";
include "auth.inc";
include "head.inc"; ?>
<h1 class="np_index_headline"><? echo htmlspecialchars($title); ?></h1>
<?
include("$file_newsportal");
flush();
$newsgroups=groups_read($server,$port);
echo '<div class="np_index_groups">';
groups_show($newsgroups);
echo '</div>';
?>
<? include "tail.inc"; ?>

View File

@ -1,66 +0,0 @@
<?
$text_header["from"]="<b>From:</b> ";
$text_header["subject"]="<b>Subject:</b> ";
$text_header["newsgroups"]="<b>Newsgroups:</b> ";
$text_header["followup"]="<b>Followup:</b> ";
$text_header["organization"]="<b>Organization:</b> ";
$text_header["date"]="<b>Date:</b> ";
$text_header["message-id"]="<b>Message-ID:</b> ";
$text_header["references"]="<b>References:</b> ";
$text_header["user-agent"]="<b>User-Agent:</b> ";
$text_header["date_format"]="M d Y H:i:s";
$text_header["attachments"]="<b>Attachments:</b> ";
$text_thread["no_articles"]="<p><b>No articles available</b></p>";
$text_thread["button_write"]="Write";
$text_thread["button_grouplist"]="Newsgroups";
$text_thread["button_top"]="Back to Top";
$text_thread["date"]="<b>Date</b>";
$text_thread["subject"]="<b>Subject</b>";
$text_thread["threadsize"]="<b>#</b>";
$text_thread["author"]="<b>Author</b>";
$text_thread["no_such_group"]="No such Group.";
$text_thread["pages"]="Pages:";
$text_groups["newsgroup"]="<b>Newsgroup</b>";
$text_groups["description"]="<b>Description</b>";
$text_article["button_answer"]="Answer";
$text_article["button_cancel"]="Delete";
$text_article["block-xnoarchive"]="This system is not an archive, but the
administrator of this system decided to block postings, where the author
doesn't want archivation.";
$text_article["full_article"]="Click here to read the complete article";
$text_post["name"]="Your Name:";
$text_post["email"]="Your E-Mail:";
$text_post["missing_message"]="You must include a message to post.";
$text_post["missing_email"]="You must include an email address.";
$text_post["missing_name"]="You must include a name or at least an alias.";
$text_post["missing_subject"]="You must include a subject.";
$text_post["button_post"]="Post";
$text_post["remember"]="Remember name and email address";
$text_post["message"]="Message";
$text_post["group_head"]="Compose article for ";
$text_post["group_tail"]="";
$text_post["followup_not_allowed"]="You aren't allowed to post to the groups:";
$text_post["message_posted"]="Message posted";
$text_post["message_posted2"]="The message was successfully posted.";
$text_post["button_back"]="Back";
$text_post["button_back2"]="to";
$text_post["error_newsserver"]="The newsserver does not accept the message:";
$text_post["error_readonly"]="The group is write protected";
$text_post["error_wrong_email"]="The email adress is wrong";
$text_post["wrote_prefix"]="";
$text_post["wrote_suffix"]=" wrote:";
$text_post["quote"]="Quote";
$text_error["error:"]='<font color="red">Error:</font>';
$text_error["connection_failed"]="The connection to the Newsserver failed";
$text_error["article_not_found"]="<p>The article doesn't exist.</p>";
$text_error["read_access_denied"]="<p>No permission to read!</p>";
$text_error["post_failed"]="Connection failed. Try to reload later.";
$text_error["auth_error"]="Authentifikation at the Newsserver failed.";
$text_error["spool_error"]="Error in spoolfile. Please reload.";
?>

View File

@ -1,6 +0,0 @@
<?
if(($iconv_enable==true) &&
(!function_exists("iconv")))
die('There is no iconv-extension in PHP. set <tt>$iconv_enable=false</tt>
in config.inc.php to disable automatic charset recoding.');
?>

View File

@ -1,539 +0,0 @@
<?
/*
* NewsPortal: Functions for handling single messages
*
* Copyright (C) 2002-2004 Florian Amrhein
* E-Mail: newsportal@florian-amrhein.de
* Web: http://florian-amrhein.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
function message_parse($rawmessage) {
global $attachment_delete_alternative,$attachment_uudecode,$www_charset;
global $iconv_enable;
// Read the header of the message:
$count_rawmessage=count($rawmessage);
$message = new messageType;
$rawheader=array();
$i=0;
while ($rawmessage[$i] != "") {
$rawheader[]=$rawmessage[$i];
$i++;
}
// Parse the Header:
$message->header=parse_header($rawheader);
// Now we know if the message is a mime-multipart message:
$content_type=split("/",$message->header->content_type[0]);
if ($content_type[0]=="multipart") {
$message->header->content_type=array();
// We have multible bodies, so we split the message into its parts
$boundary="--".$message->header->content_type_boundary;
// lets find the first part
while($rawmessage[$i] != $boundary)
$i++;
$i++;
$part=array();
while($i<=$count_rawmessage) {
if (($rawmessage[$i]==$boundary) || ($i==$count_rawmessage-1) ||
($rawmessage[$i]==$boundary.'--')) {
$partmessage=message_parse($part);
// merge the content-types of the message with those of the part
for ($o=0; $o<count($partmessage->header->content_type); $o++) {
$message->header->content_type[]=
$partmessage->header->content_type[$o];
$message->header->content_type_charset[]=
$partmessage->header->content_type_charset[$o];
$message->header->content_type_name[]=
$partmessage->header->content_type_name[$o];
$message->header->content_type_format[]=
$partmessage->header->content_type_format[$o];
$message->body[]=$partmessage->body[$o];
}
$part=array();
} else {
if ($i<$count_rawmessage)
$part[]=$rawmessage[$i];
}
if ($rawmessage[$i]==$boundary.'--') break;
$i++;
}
// Is this a multipart/alternative multipart-message? Do we have to
// delete all non plain/text parts?
if (($attachment_delete_alternative) &&
($content_type[1]=="alternative")) {
$plaintext=false;
for ($o=0; $o<count($message->header->content_type); $o++) {
if ($message->header->content_type[$o]=="text/plain")
$plaintext=true; // we found at least one text/plain
}
if ($plaintext) { // now we can delete the other parts
for ($o=0; $o<count($message->header->content_type); $o++) {
if ($message->header->content_type[$o]!="text/plain") {
unset($message->header->content_type[$o]);
unset($message->header->content_type_name[$o]);
unset($message->header->content_type_charset[$o]);
unset($message->header->content_type_format[$o]);
unset($message->body[$o]);
}
}
}
}
} else {
// No mime-attachments in the message:
$body="";
$uueatt=0; // as default we have no uuencoded attachments
for($i++;$i<$count_rawmessage; $i++) {
// do we have an inlay uuencoded file?
if ((strtolower(substr($rawmessage[$i],0,5))!="begin") ||
($attachment_uudecode==false)) {
$body.=$rawmessage[$i]."\n";
// yes, it seems, we have!
} else {
$old_i=$i;
$uue_infoline_raw=$rawmessage[$i];
$uue_infoline=explode(" ",$uue_infoline_raw);
$uue_data="";
$i++;
while($rawmessage[$i]!="end") {
if (strlen(trim($rawmessage[$i])) > 2)
$uue_data.=$rawmessage[$i]."\n";
$i++;
}
// now write the data in an attachment
$uueatt++;
$message->body[$uueatt]=uudecode($uue_data);
$message->header->content_type_name[$uueatt]="";
for ($o=2; $o<count($uue_infoline); $o++)
$message->header->content_type_name[$uueatt].=$uue_infoline[$o];
$message->header->content_type[$uueatt]=
get_mimetype_by_filename($message->header->content_type_name[$uueatt]);
}
}
//if ($message->header->content_type[0]=="text/plain") {
$body=decode_body($body,$message->header->content_transfer_encoding);
$body=recode_charset($body,
$message->header->content_type_charset[0],
$www_charset);
if ($body=="") $body=" ";
//}
$message->body[0]=$body;
}
if (!isset($message->header->content_type_charset))
$message->header->content_type_charset=array($www_charset);
if (!isset($message->header->content_type_name))
$message->header->content_type_name=array("unnamed");
if (!isset($message->header->content_type_format))
$message->header->content_type_format=array("fixed");
for ($o=0; $o<count($message->body); $o++) {
if (!isset($message->header->content_type_charset[$o]))
$message->header->content_type_charset[$o]=$www_charset;
if (!isset($message->header->content_type_name[$o]))
$message->header->content_type_name[$o]="unnamed";
if (!isset($message->header->content_type_format[$o]))
$message->header->content_type_format[$o]="fixed";
}
return $message;
}
/*
* read an article from the newsserver or the spool-directory
*
* $id: the Message-ID of an article
* $bodynum: the number of the attachment:
* -1: return only the header without any bodies or attachments.
* 0: the body
* 1: the first attachment...
*
* The function returns an article as an messageType or false if the article
* doesn't exists on the newsserver or doesn't contain the given
* attachment.
*/
function message_read($id,$bodynum=0,$group="") {
global $cache_articles,$spooldir,$text_error,$ns;
if (!testGroup($group)) {
echo $text_error["read_access_denied"];
return;
}
$message = new messageType;
if ((isset($cache_articles)) && ($cache_articles == true)) {
// Try to load a cached article
if ((ereg('^[0-9]+$',$id)) && ($group != ''))
$filename=$group.'_'.$id;
else
$filename=base64_encode($id);
$cachefilename_header=$spooldir."/".$filename.'.header';
$cachefilename_body=$spooldir."/".$filename.'.body';
if (file_exists($cachefilename_header)) {
$cachefile=fopen($cachefilename_header,"r");
$message->header=unserialize(fread($cachefile,filesize($cachefilename_header)));
fclose($cachefile);
} else {
unset($message->header);
}
// Is a non-existing attachment of an article requested?
if ((isset($message->header)) &&
($bodynum!= -1) &&
(!isset($message->header->content_type[$bodynum])))
return false;
if ((file_exists($cachefilename_body.$bodynum)) &&
($bodynum != -1)) {
$cachefile=fopen($cachefilename_body.$bodynum,"r");
$message->body[$bodynum]=
fread($cachefile,filesize($cachefilename_body.$bodynum));
fclose($cachefile);
}
}
if ((!isset($message->header)) ||
((!isset($message->body[$bodynum])) &&
($bodynum != -1))) {
if (!isset($ns)) {
$ns=nntp_open();
}
if ($group != "") {
fputs($ns,"GROUP ".$group."\r\n");
$line=line_read($ns);
}
fputs($ns,'ARTICLE '.$id."\r\n");
$line=line_read($ns);
if (substr($line,0,3) != "220") {
// requested article doesn't exist on the newsserver. Now we
// should check, if the thread stored in the spool-directory
// also doesnt't contain that article...
thread_cache_removearticle($group,$id);
return false;
}
$rawmessage=array();
$line=line_read($ns);
while(strcmp($line,".") != 0) {
$rawmessage[]=$line;
$line=line_read($ns);
}
$message=message_parse($rawmessage);
if (ereg('^[0-9]+$',$id)) $message->header->number=$id;
// write header, body and attachments to the cache
if ((isset($cache_articles)) && ($cache_articles == true)) {
$cachefile=fopen($cachefilename_header,"w");
if ($cachefile) {
fputs($cachefile,serialize($message->header));
}
fclose($cachefile);
for ($i=0; $i<count($message->header->content_type); $i++) {
if (isset($message->body[$i])) {
$cachefile=fopen($cachefilename_body.$i,"w");
fwrite($cachefile,$message->body[$i]);
fclose($cachefile);
}
}
}
}
return $message;
}
function textwrap($text, $wrap=80, $break="\n",$maxlen=false){
$len = strlen($text);
if ($len > $wrap) {
$h = ''; // massaged text
$lastWhite = 0; // position of last whitespace char
$lastChar = 0; // position of last char
$lastBreak = 0; // position of last break
// while there is text to process
while ($lastChar < $len && (($maxlen==false) || (strlen($h)<$maxlen))) {
$char = substr($text, $lastChar, 1); // get the next character
// if we are beyond the wrap boundry and there is a place to break
if (($lastChar - $lastBreak > $wrap) && ($lastWhite > $lastBreak)) {
$h .= substr($text, $lastBreak, ($lastWhite - $lastBreak)) . $break;
$lastChar = $lastWhite + 1;
$lastBreak = $lastChar;
}
// You may wish to include other characters as valid whitespace...
if ($char == ' ' || $char == chr(13) || $char == chr(10)) {
$lastWhite = $lastChar; // note the position of the last whitespace
}
$lastChar = $lastChar + 1; // advance the last character position by one
}
$h .= substr($text, $lastBreak); // build line
} else {
$h = $text; // in this case everything can fit on one line
}
return $h;
}
/*
* Displays a (Sub)-Thread. Is used in article.php
*
* $id: Message-ID (not number!) of an article in the thread
* $group: name of the newsgroup
*/
function message_thread($id,$group,$thread,$highlightids=false) {
$current=$id;
// set the highlightid, if not set
if(!$highlightids)
$highlightids=array($current);
flush();
// find the first article in the subthread of $id
while(isset($thread[$id]->references)) {
foreach($thread[$id]->references as $reference) {
if((trim($reference)!='') && (isset($thread[$reference]))) {
$id=$reference;
continue 2;
}
}
break;
}
$liste=array();
$liste[]=$id;
$tmp=0;
thread_show_head();
echo thread_show_recursive($thread,$liste,1,"",$group,0,100,$tmp,$highlightids);
thread_show_tail();
}
/*
* Print the header of a message to the webpage
*
* $head: the header of the message as an headerType
* $group: the name of the newsgroup, is needed for the links to post.php3
* and the header.
*/
function show_header($head,$group) {
global $article_show,$text_header,$file_article,$attachment_show;
global $file_attachment,$anonym_address;
echo '<div class="np_article_header">';
if ($article_show["Subject"]) echo $text_header["subject"].htmlspecialchars($head->subject)."<br>";
if ($article_show["From"]) {
echo $text_header["from"];
if($head->from==$anonym_address) {
// this is the anonymous address, so only show the name
echo htmlspecialchars($head->name);
} else {
if($article_show["From_link"])
echo '<a href="mailto:'.htmlspecialchars($head->from).'">';
if(isset($article_show["From_rewrite"]))
echo eregi_replace($article_show["From_rewrite"][0],
$article_show["From_rewrite"][1],
htmlspecialchars($head->from));
else
echo htmlspecialchars($head->from);
if($article_show["From_link"])
echo '</a>';
if ($head->name != "") echo ' ('.htmlspecialchars($head->name).')';
}
echo "<br>";
}
if ($article_show["Newsgroups"])
echo $text_header["newsgroups"].htmlspecialchars(str_replace(',',', ',$head->newsgroups))."<br>\n";
if (isset($head->followup) && ($article_show["Followup"]) && ($head->followup != ""))
echo $text_header["followup"].htmlspecialchars($head->followup)."<br>\n";
if ((isset($head->organization)) && ($article_show["Organization"]) &&
($head->organization != ""))
echo $text_header["organization"].
html_parse(htmlspecialchars($head->organization))."<br>\n";
if ($article_show["Date"])
echo $text_header["date"].date($text_header["date_format"],$head->date)."<br>\n";
if ($article_show["Message-ID"])
echo $text_header["message-id"].htmlspecialchars($head->id)."<br>\n";
if (($article_show["References"]) && (isset($head->references[0]))) {
echo $text_header["references"];
for ($i=0; $i<=count($head->references)-1; $i++) {
$ref=$head->references[$i];
echo ' '.'<a href="'.$file_article.'?group='.urlencode($group).
'&id='.urlencode($ref).'">'.($i+1).'</a>';
}
echo "<br>";
}
if (isset($head->user_agent)) {
if ((isset($article_show["User-Agent"])) &&
($article_show["User-Agent"])) {
echo $text_header["user-agent"].htmlspecialchars($head->user_agent)."<br>\n";
} else {
echo "<!-- User-Agent: ".htmlspecialchars($head->user_agent)." -->\n";
}
}
if ((isset($attachment_show)) && ($attachment_show==true) &&
(isset($head->content_type[1]))) {
echo $text_header["attachments"];
for ($i=1; $i<count($head->content_type); $i++) {
echo '<a href="'.$file_attachment.'?group='.urlencode($group).'&'.
'id='.urlencode($head->number).'&'.
'attachment='.$i.'">'.
$head->content_type_name[$i].'</a> ('.
$head->content_type[$i].')';
if ($i<count($head->content_type)-1) echo ', ';
}
}
echo '</div>';
}
/*
* decodes a body. Splits the content of $body into an array of several
* lines, respecting the special decoding issues of format=flowed
* articles. Each returned line consists of two fields: text and
* the quote depth (depth)
*/
function decode_textbody($body,$format="fixed") {
$body=split("\n",$body);
$nbody=array();
$depth=0;
$paragraph=""; // empty paragraph
$lastline="";
for($i=0; $i<count($body)+1; $i++) {
// calculate the quote depth of the actual line
$ndepth=0;
$tdepth=0;
for($j=0; $j<=strlen($body[$i]); $j++) {
$tdepth=$j;
if($body[$i][$j]=='>') {
$ndepth++;
} else {
if(($body[$i][$j]!=' ') || ($body[$i][$j-1]==' ') || ($j==0)) {
break;
}
}
}
// generate a new paragraph?
if(($i>0) && (($ndepth!=$depth) || $format!="flowed" ||
($paragraph[strlen($paragraph)-1]!=' ')) || ($i==count($body))) {
$tmp->text=$lastline=$paragraph;
$tmp->depth=$depth;
$paragraph="";
if(phpversion()>=5)
$nbody[]=clone($tmp);
else
$nbody[]=$tmp;
}
if($body[$i]=="-- " && $format=="flowed") $body[$i]="--";
$paragraph.=substr($body[$i],$tdepth);
$depth=$ndepth;
}
return $nbody;
}
/*
* replaces multiple spaces in texts by &nbsp;es and convert special-chars
* to their entities
*/
function text2html($text) {
return eregi_replace("^ ","&nbsp;",
str_replace(" ","&nbsp; ",
str_replace(" ","&nbsp; ",
str_replace("\n","<br>",
htmlspecialchars($text)))));
}
/*
* print an article to the webpage
*
* $group: The name of the newsgroup
* $id: the ID of the article inside the group or the message-id
* $attachment: The number of the attachment of the article.
* 0 means the normal textbody.
*/
function message_show($group,$id,$attachment=0,$article_data=false,$maxlen=false) {
global $file_article,$file_article_full;
global $text_header,$text_article,$article_showthread;
global $block_xnoarchive,$article_graphicquotes;
if ($article_data == false)
$article_data=message_read($id,$attachment,$group);
$head=$article_data->header;
$body=$article_data->body[$attachment];
if ($head) {
if (($block_xnoarchive) && (isset($head->xnoarchive)) &&
($head->xnoarchive=="yes")) {
echo $text_article["block-xnoarchive"];
} else
if (($head->content_type[$attachment]=="text/plain") &&
($attachment==0)) {
show_header($head,$group);
$body=decode_textbody($body,
$article_data->header->content_type_format[$attachment]);
$depth=0;
echo '<div class="np_article_body">';
$currentlen=0; // needed if $maxlen is set
for ($i=0; $i<=count($body) &&
(($currentlen<$maxlen) || ($maxlen==false)); $i++) {
// HTMLized Quotings instead of boring > ?
if($article_graphicquotes) {
// HTMLized Quotings
for($j=$depth; $j<$body[$i]->depth; $j++)
echo '<blockquote class="np_article_quote">';
for($j=$body[$i]->depth; $j<$depth; $j++)
echo '</blockquote>';
$t=html_parse(text2html($body[$i]->text)).'<br>';
echo $t;
$currentlen+=strlen($t);
echo "\n";
$depth=$body[$i]->depth;
} else {
// Boring old Quotings with >
if($body[$i]->depth==0) {
if(trim($body[$i]->text)=='')
$t="<br>\n";
else
$t=html_parse(text2html($body[$i]->text))."<br>\n";
} else {
$t='<i>'.str_repeat('&gt;',$body[$i]->depth).' '.
html_parse(text2html(
textwrap($body[$i]->text,72-$body[$i]->depth,
"\n".str_repeat('>',$body[$i]->depth).' '))).
"</i><br>\n";
}
echo $t;
$currentlen+=strlen($t);
}
}
echo '</div>';
if($maxlen!=false && $currentlen>=$maxlen) {
echo '<br><a href="'.$file_article_full.'?id='.$id.'&group='.
$group.'">'.$text_article["full_article"].'</a>';
}
} else {
echo $body;
}
}
}
/*
* Shows the little menu on article-flat.php where you can select the
* different pages with the articles on it
*/
function articleflat_pageselect($group,$id,$article_count,$first) {
global $articleflat_articles_per_page,$file_article,$file_framethread,$name;
global $text_thread,$thread_show;
$pages=ceil($article_count / $articleflat_articles_per_page);
$return="";
if ($article_count > $articleflat_articles_per_page)
$return.= $text_thread["pages"];
for ($i = 0; $i < $pages; $i++) {
if ($first != $i*$articleflat_articles_per_page+1)
$return.= '<a class="np_pages_unselected" href="'.
$file_article.'?group='.$group.
'&amp;id='.urlencode($id).
'&amp;first='.($i*$articleflat_articles_per_page+1).'&amp;last='.
($i+1)*$articleflat_articles_per_page.'">';
else
$return.= '<span class="np_pages_selected">';
$return.= $i+1;
if ($i == $pages-1) {
// $return.= $article_count;
}
if ($first != $i*$articleflat_articles_per_page+1)
$return.= '</a>';
else
$return.= '</span>';
}
return $return;
}

View File

@ -1,195 +0,0 @@
<?
/*
* NewsPortal: Functions for posting articles to a newsgroup
*
* Copyright (C) 2002-2004 Florian Amrhein
* E-Mail: newsportal@florian-amrhein.de
* Web: http://florian-amrhein.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* Encode lines with 8bit-characters to quote-printable
*
* $line: the to be encoded line
*
* the function returns a sting containing the quoted-printable encoded
* $line
*/
function quoted_printable_encode($line) {
global $www_charset;
$qp_table=array(
'=00', '=01', '=02', '=03', '=04', '=05',
'=06', '=07', '=08', '=09', '=0A', '=0B',
'=0C', '=0D', '=0E', '=0F', '=10', '=11',
'=12', '=13', '=14', '=15', '=16', '=17',
'=18', '=19', '=1A', '=1B', '=1C', '=1D',
'=1E', '=1F', '_', '!', '"', '#',
'$', '%', '&', "'", '(', ')',
'*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', ':', ';',
'<', '=3D', '>', '=3F', '@', 'A',
'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y',
'Z', '[', '\\', ']', '^', '=5F',
'', 'a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j', 'k',
'l', 'm', 'n', 'o', 'p', 'q',
'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}',
'~', '=7F', '=80', '=81', '=82', '=83',
'=84', '=85', '=86', '=87', '=88', '=89',
'=8A', '=8B', '=8C', '=8D', '=8E', '=8F',
'=90', '=91', '=92', '=93', '=94', '=95',
'=96', '=97', '=98', '=99', '=9A', '=9B',
'=9C', '=9D', '=9E', '=9F', '=A0', '=A1',
'=A2', '=A3', '=A4', '=A5', '=A6', '=A7',
'=A8', '=A9', '=AA', '=AB', '=AC', '=AD',
'=AE', '=AF', '=B0', '=B1', '=B2', '=B3',
'=B4', '=B5', '=B6', '=B7', '=B8', '=B9',
'=BA', '=BB', '=BC', '=BD', '=BE', '=BF',
'=C0', '=C1', '=C2', '=C3', '=C4', '=C5',
'=C6', '=C7', '=C8', '=C9', '=CA', '=CB',
'=CC', '=CD', '=CE', '=CF', '=D0', '=D1',
'=D2', '=D3', '=D4', '=D5', '=D6', '=D7',
'=D8', '=D9', '=DA', '=DB', '=DC', '=DD',
'=DE', '=DF', '=E0', '=E1', '=E2', '=E3',
'=E4', '=E5', '=E6', '=E7', '=E8', '=E9',
'=EA', '=EB', '=EC', '=ED', '=EE', '=EF',
'=F0', '=F1', '=F2', '=F3', '=F4', '=F5',
'=F6', '=F7', '=F8', '=F9', '=FA', '=FB',
'=FC', '=FD', '=FE', '=FF');
// are there "forbidden" characters in the string?
for($i=0; $i<strlen($line) && ord($line[$i])<=127 ; $i++);
if ($i<strlen($line)) { // yes, there are. So lets encode them!
$from=$i;
for($to=strlen($line)-1; ord($line[$to])<=127; $to--);
// lets scan for the start and the end of the to be encoded _words_
for(;$from>0 && $line[$from] != ' '; $from--);
if($from>0) $from++;
for(;$to<strlen($line) && $line[$to] != ' '; $to++);
// split the string into the to be encoded middle and the rest
$begin=substr($line,0,$from);
$middle=substr($line,$from,$to-$from);
$end=substr($line,$to);
// ok, now lets encode $middle...
$newmiddle="";
for($i=0; $i<strlen($middle); $i++)
$newmiddle .= $qp_table[ord($middle[$i])];
// now we glue the parts together...
$line=$begin.'=?'.$www_charset.'?Q?'.$newmiddle.'?='.$end;
}
return $line;
}
/*
* generate a message-id for posting.
* $identity: a string containing informations about the article, to
* make a md5-hash out of it.
*
* returns: a complete message-id
*/
function generate_msgid($identity) {
global $msgid_generate,$msgid_fqdn;
switch($msgid_generate) {
case "no":
// no, we don't want to generate a message-id.
return false;
break;
case "md5":
return '<'.md5($identity).'$1@'.$msgid_fqdn.'>';
break;
default:
return false;
break;
}
}
/*
* Post an article to a newsgroup
*
* $subject: The Subject of the article
* $from: The authors name and email of the article
* $newsgroups: The groups to post to
* $ref: The references of the article
* $body: The article itself
*/
function message_post($subject,$from,$newsgroups,$ref,$body) {
global $server,$port,$send_poster_host,$organization,$text_error;
global $file_footer,$www_charset,$spooldir;
global $msgid_generate,$msgid_fqdn;
flush();
$ns=nntp_open($server,$port);
if ($ns != false) {
fputs($ns,"POST\r\n");
$weg=line_read($ns);
fputs($ns,'Subject: '.quoted_printable_encode($subject)."\r\n");
fputs($ns,'From: '.$from."\r\n");
fputs($ns,'Newsgroups: '.$newsgroups."\r\n");
fputs($ns,"Mime-Version: 1.0\r\n");
fputs($ns,"Content-Type: text/plain; charset=".$www_charset."; format=flowed\r\n");
fputs($ns,"Content-Transfer-Encoding: 8bit\r\n");
fputs($ns,"User-Agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)\r\n");
if ($send_poster_host)
@fputs($ns,'X-HTTP-Posting-Host: '.gethostbyaddr(getenv("REMOTE_ADDR"))."\r\n");
if (($ref!=false) && (count($ref)>0)) {
// strip references
if(strlen(implode(" ",$ref))>900) {
$ref_first=array_shift($ref);
do {
$ref=array_slice($ref,1);
} while(strlen(implode(" ",$ref))>800);
array_unshift($ref,$ref_first);
}
fputs($ns,'References: '.implode(" ",$ref)."\r\n");
}
if (isset($organization))
fputs($ns,'Organization: '.quoted_printable_encode($organization)."\r\n");
if ((isset($file_footer)) && ($file_footer!="")) {
$footerfile=fopen($file_footer,"r");
$body.="\n".fread($footerfile,filesize($file_footer));
fclose($footerfile);
}
if($msgid=generate_msgid(
$subject.",".$from.",".$newsgroups.",".$ref.",".$body))
fputs($ns,'Message-ID: '.$msgid."\r\n");
$body=str_replace("\n.\r","\n..\r",$body);
$body=str_replace("\r",'',$body);
$b=split("\n",$body);
$body="";
for ($i=0; $i<count($b); $i++) {
if ((strpos(substr($b[$i],0,strpos($b[$i]," ")),">") != false) | (strcmp(substr($b[$i],0,1),">") == 0)) {
$body .= textwrap(stripSlashes($b[$i]),78," \r\n")."\r\n";
} else {
$body .= textwrap(stripSlashes($b[$i]),74," \r\n")."\r\n";
}
}
fputs($ns,"\r\n".$body."\r\n.\r\n");
$message=line_read($ns);
nntp_close($ns);
} else {
$message=$text_error["post_failed"];
}
// let thread.php ignore the cache for this group, so this new
// article will be visible instantly
$cachefile=$spooldir.'/'.$newsgroups.'-cache.txt';
@unlink($cachefile);
return $message;
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -1,79 +0,0 @@
<?
/*
* NewsPortal: Data type declarations
*
* Copyright (C) 2002-2004 Florian Amrhein
* E-Mail: newsportal@florian-amrhein.de
* Web: http://florian-amrhein.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* the name and the description of a newsgroup
*/
class newsgroupType {
var $name;
var $description;
var $count;
var $text;
}
/*
* Stores a complete article:
* - The parsed Header as an headerType
* - The bodies and attachments as an array of array of lines
*/
class messageType {
var $header;
var $body;
}
/*
* Stores the Header of an article
*/
class headerType {
var $number; // the Number of an article inside a group
var $id; // Message-ID
var $from; // eMail of the author
var $name; // Name of the author
var $subject; // the subject
var $newsgroups; // the Newsgroups where the article belongs to
var $followup;
var $date; // timestamp of the article
var $date_thread; // timestamp of the newest article in the thread
var $organization;
var $xnoarchive;
var $references; // all references to the article
var $bestreference; // nearest reference found
var $content_transfer_encoding;
var $mime_version;
var $content_type; // array, Content-Type of the Body (Index=0) and the
// Attachments (Index>0)
var $content_type_charset; // like content_type
var $content_type_name; // array of the names of the attachments
var $content_type_boundary; // The boundary of an multipart-article.
var $content_type_format; // array, is the body in flowed format?
var $answers; // which articles are followups of this article?
var $isAnswer; // is the article an answer to an other article?
var $username;
var $user_agent;
var $isReply; // has this article "Re: " at the beginning of the subject?
var $threadsize; // number of articles in this thread
}
?>

View File

@ -1,243 +0,0 @@
<?
/*
* Validator
*
* Validierung von Formulareingaben
*
* Autor: Florian Amrhein
*/
class formvalidate {
var $fields=array();
/*
* Überprüft ein komplettes Formular auf korrekte Eingaben, und liefert
* false, falls irgendwo ein Fehler vorhanden ist.
* Setzt intern die entsprechenden Daten, die show_error und
* is_error zum Abfragen der Daten benötigen.
*/
function validate() {
$errors=false;
foreach($this->fields as $field) {
switch($field->typ) {
case "text":
case "textarea":
case "checkbox":
case "radiobutton":
// Basteln wegen scheiss PHP
$valtmp=$field->validator;
// feld_leer*feld_darf_leer +
// nicht_feld_leer*(testfkt.ex.*testfkt +
// nicht_testfkt.ex)
if(
(
(
(!isset($_REQUEST[$field->name])) ||
(trim($_REQUEST[$field->name])=="")
) &&
(isset($field->empty)) &&
($field->empty==true)
) || (
(isset($_REQUEST[$field->name])) &&
(trim($_REQUEST[$field->name])!="") &&
(
($field->validator==false) ||
($field->validator!=false) &&
(($errmsg=$valtmp($_REQUEST[$field->name]))===true)
)
)
) {
// Feld leer und darf leer sein, oder
// feld voll und (testfunktion existiert und testfkt.=true
// oder testfunktion existiert nicht)
$this->fields[$field->name]->error=false;
} else {
// Feld leer und darf nicht leer sein, oder
// Feld voll und testfkt.ex und testfunktion=false
$errors=true;
$this->fields[$field->name]->error=true;
if(isset($errmsg)) {
$this->fields[$field->name]->errormessage=$errmsg;
unset($errmsg);
}
}
break;
case "pulldown":
case "check-text":
case "radio-text":
if((isset($field->empty)) && (!$field->empty) &&
((!isset($_REQUEST[$field->name])) ||
(trim($_REQUEST[$field->name])=="") ||
(($_REQUEST[$field->name]=="_frei") &&
((!isset($_REQUEST[$field->name."_frei"])) ||
(trim($_REQUEST[$field->name."_frei"])=="")
)
)
)
) {
$errors=true;
$this->fields[$field->name]->error=true;
} else {
$this->fields[$field->name]->error=false;
}
break;
}
// echo '<p>eval: '.$field->name.': '.$_REQUEST[$field->name].'</p>';
}
return !$errors;
}
/*
* liefert true, falls $name fehlerhaft ausgefüllt wurde
*/
function is_error($name) {
return $this->fields[$name]->error;
}
/*
* Liefert die individuelle Fehlermeldung, falls $name fehlerhaft
* ausgefüllt wurde. Falls keine Meldung vorliegt, wird false
* geliefert.
*/
function geterrormessage($name) {
if(isset($this->fields[$name]->errormessage))
return $this->fields[$name]->errormessage;
else
return false;
}
/*
* Zeigt gegebenenfalls eine Fehlermeldung an, falls $name nicht
* korrekt ausgefüllt wurde
*/
function show_error($name) {
if($this->is_error($name)) {
echo "<p>fehler</p>";
}
}
/*
* Zeigt den Titel zu einem Feld an. Ist das zugehörige Feld fehlerhaft
* ausgefüllt worden, wird es (z.B. farblich) markiert.
*
* $name: Name des Feldes
* $text: auszugebener Text
*/
function show_title($name,$text) {
if($this->is_error($name))
echo '<font color="red"><b>'.$text.'</b></font>';
else
echo $text;
}
/*
* Zeigt die Daten an, die der Benutzer in das Formular, ob richtig oder
* falsch ist egal, eingegeben hatte.
*/
function show_value($name) {
echo stripslashes($_REQUEST[$name]);
}
/*
* Liefert Variablenwerte ohne vorherige Umkodierung/Zusammenfassung
* zurück
*/
function value($name) {
if(is_array($_REQUEST[$name])) {
$a=$_REQUEST[$name];
return $a;
}
return stripslashes($_REQUEST[$name]);
}
/* Liefert Variablenwerte mit vorheriger Umkodierung/Zusammenfassung
* zurück. Vor allem wichtig bei Typ check-text und radio-text, wo
* der eigentliche Inhalt über mehrere Variablen verteilt ist, bzw.
* teilweise gar nicht zum Zuge kommt (freies Textfeld ausgefüllt,
* aber nicht angeklickt)
*/
function get_value($name) {
if(is_array($_REQUEST[$name])) {
$a=$_REQUEST[$name];
// Freies Textfeld?
if(in_array("_frei",$a)) {
if((isset($_REQUEST[$name.'_frei'])) &&
($_REQUEST[$name.'_frei']!=""))
$a[]=$_REQUEST[$name.'_frei'];
unset($a[$name.'_frei']);
}
return $a;
} else if(($_REQUEST[$name]=='_frei') &&
($this->fields[$name]->typ=='radio-text')) {
return stripslashes($_REQUEST[$name.'_frei']);
} else
return stripslashes($_REQUEST[$name]);
}
/*
* gibt einfach nur " checked" aus, wenn $name den wert $value enthält.
* Nötig für das Vorselektieren von Knöpfen
*/
function show_checked($name,$value) {
global $fields;
if(($this->fields[$name]->typ!="checkbox") &&
($this->fields[$name]->typ!="check-text")) {
if($this->value($name)==$value) {
if($this->fields[$name]->typ=="pulldown")
echo ' selected';
else
echo ' checked';
}
} else {
if(in_array($value,$this->value($name)))
echo ' checked';
}
}
function show_selected($name,$value) {
global $fields;
if(($this->fields[$name]->typ!="checkbox") &&
($this->fields[$name]->typ!="check-text")) {
if($this->value($name)==$value) {
echo ' selected';
}
}
}
/*
* Registriert eine Variable als zum Formular gehörend
*
* $name: Name der Variablen
* $typ: Art der Eingabe:
* - text: Textfeld mit einfacher freier Eingabe
* - textarea: Mehrzeiliger Text mit freier Eingabe
* - checkbox: Ankreuzfelder, mehrere gleichzeitig
* - radiobutton: Ankreuzfelder, nur eins gleichzeitig
* - pulldown: Pulldown-Menu, nut eins gleichzeitig
* - check-text: Ankreuzfelder+Textfeld, mehrere gleichzeitig
* - radio-text: Ankreuzfelder+Textfeld, maximal eins
* $empty: Darf das entsprechende Feld leer gelassen werden?
* bzw. mindestens kein angekreuzt bzw. ausgefüllt?
* $validator: Information, wie der Inhalt auf Korrektheit geprüft
* werden soll
* $errmsg: Fehlermeldung, die bei erkanntem Fehler ausgegeben
* werden soll
*/
function register($name,$typ,$empty=true,$validator=false,$errmsg=false) {
$var->name=$name;
$var->typ=$typ;
$var->empty=$empty;
$var->validator=$validator;
$var->errmsg=$errmsg;
$this->fields[$name]=$var;
}
/*
* der Konstruktor
*/
function formvalidate() {
}
}
?>

Binary file not shown.

View File

@ -1,811 +0,0 @@
<?
/* Newsportal NNTP<->HTTP Gateway
* Version: 0.36
* Download: http://florian-amrhein.de/newsportal
*
* Copyright (C) 2002-2004 Florian Amrhein
* E-Mail: newsportal@florian-amrhein.de
* Web: http://florian-amrhein.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
include "lib/types.inc.php";
include "lib/thread.inc.php";
include "lib/message.inc.php";
include "lib/post.inc.php";
//include "lib/validator.inc.php";
/*
* opens the connection to the NNTP-Server
*
* $server: adress of the NNTP-Server
* $port: port of the server
*/
function nntp_open($nserver=0,$nport=0) {
global $text_error,$server_auth_user,$server_auth_pass,$readonly;
global $server,$port;
// echo "<br>NNTP OPEN<br>";
$authorize=((isset($server_auth_user)) && (isset($server_auth_pass)) &&
($server_auth_user != ""));
if ($nserver==0) $nserver=$server;
if ($nport==0) $nport=$port;
$ns=@fsockopen($nserver,$nport);
$weg=line_read($ns); // kill the first line
if (substr($weg,0,2) != "20") {
echo "<p>".$text_error["error:"].$weg."</p>";
fclose($ns);
$ns=false;
} else {
if ($ns != false) {
fputs($ns,"MODE reader\r\n");
$weg=line_read($ns); // and once more
if ((substr($weg,0,2) != "20") &&
((!$authorize) || ((substr($weg,0,3) != "480") && ($authorize)))) {
echo "<p>".$text_error["error:"].$weg."</p>";
fclose($ns);
$ns=false;
}
}
if ((isset($server_auth_user)) && (isset($server_auth_pass)) &&
($server_auth_user != "")) {
fputs($ns,"AUTHINFO USER $server_auth_user\r\n");
$weg=line_read($ns);
fputs($ns,"AUTHINFO PASS $server_auth_pass\r\n");
$weg=line_read($ns);
if (substr($weg,0,3) != "281") {
echo "<p>".$text_error["error:"]."</p>";
echo "<p>".$text_error["auth_error"]."</p>";
}
}
}
if ($ns==false) echo "<p>".$text_error["connection_failed"]."</p>";
return $ns;
}
/*
* Close a NNTP connection
*
* $ns: the handle of the connection
*/
function nntp_close(&$ns) {
if ($ns != false) {
fputs($ns,"QUIT\r\n");
fclose($ns);
}
}
/*
* Validates an email adress
*
* $address: a string containing the email-address to be validated
*
* returns true if the address passes the tests, false otherwise.
*/
function validate_email($address)
{
global $validate_email;
$return=true;
if (($validate_email >= 1) && ($return == true))
$return = (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_A-z{|}~]+'.'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_A-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_A-z{|}~]+$',$address));
if (($validate_email >= 2) && ($return == true)) {
$addressarray=address_decode($address,"garantiertungueltig");
$return=checkdnsrr($addressarray[0]["host"],"MX");
if (!$return) $return=checkdnsrr($addressarray[0]["host"],"A");
}
return($return);
}
/*
* decodes a block of 7bit-data in uuencoded format to it's original
* 8bit format.
* The headerline containing filename and permissions doesn't have to
* be included.
*
* $data: The uuencoded data as a string
*
* returns the 8bit data as a string
*
* Note: this function is very slow and doesn't recognize incorrect code.
*/
function uudecode_line($line) {
$data=substr($line,1);
$length=ord($line[0])-32;
$decoded="";
for ($i=0; $i<(strlen($data)>>2); $i++) {
$pack=substr($data,$i<<2,4);
$upack="";
$bitmaske=0;
for ($o=0; $o<4; $o++) {
$g=((ord($pack[3-$o])-32));
if ($g==64) $g=0;
$bitmaske=$bitmaske | ($g << (6*$o));
}
$schablone=255;
for ($o=0; $o<3; $o++) {
$c=($bitmaske & $schablone) >> ($o << 3);
$schablone=($schablone << 8);
$upack=chr($c).$upack;
}
$decoded.=$upack;
}
$decoded=substr($decoded,0,$length);
return $decoded;
}
/*
* decodes uuencoded Attachments.
*
* $data: the encoded data
*
* returns the decoded data
*/
function uudecode($data) {
$d=explode("\n",$data);
$u="";
for ($i=0; $i<count($d)-1; $i++)
$u.=uudecode_line($d[$i]);
return $u;
}
/*
* returns the mimetype of an filename
*
* $name: the complete filename of a file
*
* returns a string containing the mimetype
*/
function get_mimetype_by_filename($name) {
$ending=strtolower(strrchr($name,"."));
switch($ending) {
case ".jpg":
case ".jpeg":
$type="image/jpeg";
break;
case ".gif":
$type="image/gif";
break;
case ".png":
$type="image/png";
break;
case ".bmp":
$type="image/bmp";
break;
default:
$type="text/plain";
}
return $type;
}
/*
* Test, if the access to a group is allowed. This is true, if $testgroup is
* false or the groupname is in groups.txt
*
* $groupname: name of the group to be checked
*
* returns true, if access is allowed
*/
function testGroup($groupname) {
global $testgroup,$file_groups;
if ($testgroup) {
$gf=fopen($file_groups,"r");
while (!feof($gf)) {
$read=trim(line_read($gf));
$pos=strpos($read," ");
if ($pos != false) {
if (substr($read,0,$pos)==trim($groupname)) return true;
} else {
if ($read == trim($groupname)) return true;
}
}
fclose($gf);
return false;
} else {
return true;
}
}
function testGroups($newsgroups) {
$groups=explode(",",$newsgroups);
$count=count($groups);
$return="";
$o=0;
for ($i=0; $i<$count; $i++) {
if (testgroup($groups[$i]) &&
(!function_exists("npreg_group_has_write_access") ||
npreg_group_has_write_access($groups[$i]))) {
if ($o>0) $return.=",";
$o++;
$return.=$groups[$i];
}
}
return($return);
}
/*
* read one line from the NNTP-server
*/
function line_read(&$ns) {
if ($ns != false) {
$t=str_replace("\n","",str_replace("\r","",fgets($ns,1200)));
return $t;
}
}
/*
* Split an internet-address string into its parts. An address string could
* be for example:
* - user@host.domain (Realname)
* - "Realname" <user@host.domain>
* - user@host.domain
*
* The address will be split into user, host (incl. domain) and realname
*
* $adrstring: The string containing the address in internet format
* $defaulthost: The name of the host which should be returned if the
* address-string doesn't contain a hostname.
*
* returns an hash containing the fields "mailbox", "host" and "personal"
*/
function address_decode($adrstring,$defaulthost) {
$parsestring=trim($adrstring);
$len=strlen($parsestring);
$at_pos=strpos($parsestring,'@'); // find @
$ka_pos=strpos($parsestring,"("); // find (
$kz_pos=strpos($parsestring,')'); // find )
$ha_pos=strpos($parsestring,'<'); // find <
$hz_pos=strpos($parsestring,'>'); // find >
$space_pos=strpos($parsestring,')'); // find ' '
$email="";
$mailbox="";
$host="";
$personal="";
if ($space_pos != false) {
if (($ka_pos != false) && ($kz_pos != false)) {
$personal=substr($parsestring,$ka_pos+1,$kz_pos-$ka_pos-1);
$email=trim(substr($parsestring,0,$ka_pos-1));
}
} else {
$email=$adrstring;
}
if (($ha_pos != false) && ($hz_pos != false)) {
$email=trim(substr($parsestring,$ha_pos+1,$hz_pos-$ha_pos-1));
$personal=substr($parsestring,0,$ha_pos-1);
}
if ($at_pos != false) {
$mailbox=substr($email,0,strpos($email,'@'));
$host=substr($email,strpos($email,'@')+1);
} else {
$mailbox=$email;
$host=$defaulthost;
}
$personal=trim($personal);
if (substr($personal,0,1) == '"') $personal=substr($personal,1);
if (substr($personal,strlen($personal)-1,1) == '"')
$personal=substr($personal,0,strlen($personal)-1);
$result["mailbox"]=trim($mailbox);
$result["host"]=trim($host);
if ($personal!="") $result["personal"]=$personal;
$complete[]=$result;
return ($complete);
}
/*
* Read the groupnames from groups.txt, and get additional informations
* of the groups from the newsserver
*/
function groups_read($server,$port) {
global $gl_age,$file_groups,$spooldir,$cache_index;
// is there a cached version, and is it actual enough?
$cachefile=$spooldir.'/groups.dat';
if((file_exists($cachefile)) && (filemtime($cachefile)+$cache_index>time())) {
// cached file exists and is new enough. so lets read it out.
$file=fopen($cachefile,"r");
$data="";
while(!feof($file)) {
$data.=fgets($file,1000);
}
fclose($file);
$newsgroups=unserialize($data);
} else {
$ns=nntp_open($server,$port);
if ($ns == false) return false;
$gf=fopen($file_groups,"r");
// if we want to mark groups with new articles with colors, wie will later
// need the format of the overview
$overviewformat=thread_overview_read($ns);
while (!feof($gf)) {
$gruppe=new newsgroupType;
$tmp=trim(line_read($gf));
if(substr($tmp,0,1)==":") {
$gruppe->text=substr($tmp,1);
$newsgroups[]=$gruppe;
} elseif(strlen(trim($tmp))>0) {
// is there a description in groups.txt?
$pos=strpos($tmp," ");
if ($pos != false) {
// yes.
$gruppe->name=substr($tmp,0,$pos);
$desc=substr($tmp,$pos);
} else {
// no, get it from the newsserver.
$gruppe->name=$tmp;
fputs($ns,"XGTITLE $gruppe->name\r\n");
$response=line_read($ns);
if (strcmp(substr($response,0,3),"282") == 0) {
$neu=line_read($ns);
do {
$response=$neu;
if ($neu != ".") $neu=line_read($ns);
} while ($neu != ".");
$desc=strrchr($response,"\t");
if (strcmp($response,".") == 0) {
$desc="-";
}
} else {
$desc=$response;
}
if (strcmp(substr($response,0,3),"500") == 0)
$desc="-";
}
if (strcmp($desc,"") == 0) $desc="-";
$gruppe->description=$desc;
fputs($ns,"GROUP ".$gruppe->name."\r\n");
$t=explode(" ",line_read($ns));
$gruppe->count=$t[1];
// mark group with new articles with colors
if($gl_age) {
fputs($ns,'XOVER '.$t[3]."\r\n");
$tmp=explode(" ",line_read($ns));
if($tmp[0]=="224") {
$tmp=line_read($ns);
if($tmp!=".") {
$head=thread_overview_interpret($tmp,$overviewformat,$gruppe->name);
$tmp=line_read($ns);
$gruppe->age=$head->date;
}
}
}
if ((strcmp(trim($gruppe->name),"") != 0) &&
(substr($gruppe->name,0,1) != "#"))
$newsgroups[]=$gruppe;
}
}
fclose($gf);
nntp_close($ns);
// write the data to the cachefile
$file=fopen($cachefile,"w");
fputs($file,serialize($newsgroups));
fclose($file);
}
return $newsgroups;
}
/*
* print the group names from an array to the webpage
*/
function groups_show($gruppen) {
global $gl_age;
if ($gruppen == false) return;
global $file_thread,$text_groups;
$c = count($gruppen);
echo '<div class="np_index_groupblock">';
$acttype="keins";
for($i = 0 ; $i < $c ; $i++) {
$g = $gruppen[$i];
if(isset($g->text)) {
if($acttype!="text") {
$acttype="text";
if($i>0)
echo '</div>';
echo '<div class="np_index_grouphead">';
}
echo $g->text;
} else {
if($acttype!="group") {
$acttype="group";
if($i>0)
echo '</div>';
echo '<div class="np_index_groupblock">';
}
echo '<div class="np_index_group">';
echo '<a ';
if ((isset($frame_threadframeset)) && ($frame_threadframeset != ""))
echo 'target="'.$frame_threadframeset.'" ';
echo 'href="'.$file_thread.'?group='.urlencode($g->name).'">'.$g->name."</a>\n";
if($gl_age)
$datecolor=thread_format_date_color($g->age);
echo '<small>(';
if($datecolor!="")
echo '<font color="'.$datecolor.'">'.$g->count.'</font>';
else
echo $g->count;
echo ')</small>';
if($g->description!="-")
echo '<br><small>'.$g->description.'</small>';
echo '</div>';
}
echo "\n";
flush();
}
echo "</div></div>\n";
}
/*
* gets a list of aviable articles in the group $groupname
*/
/*
function getArticleList(&$ns,$groupname) {
fputs($ns,"LISTGROUP $groupname \r\n");
$line=line_read($ns);
$line=line_read($ns);
while(strcmp($line,".") != 0) {
$articleList[] = trim($line);
$line=line_read($ns);
}
if (!isset($articleList)) $articleList="-";
return $articleList;
}
*/
/*
* Decode quoted-printable or base64 encoded headerlines
*
* $value: The to be decoded line
*
* returns the decoded line
*/
function headerDecode($value) {
if (eregi('=\?.*\?.\?.*\?=',$value)) { // is there anything encoded?
if (eregi('=\?.*\?Q\?.*\?=',$value)) { // quoted-printable decoding
$charset=eregi_replace('(.*)=\?(.*)\?Q\?(.*)\?=(.*)','\2',$value);
$result1=eregi_replace('(.*)=\?.*\?Q\?(.*)\?=(.*)','\1',$value);
$result2=eregi_replace('(.*)=\?.*\?Q\?(.*)\?=(.*)','\2',$value);
$result3=eregi_replace('(.*)=\?.*\?Q\?(.*)\?=(.*)','\3',$value);
$result2=str_replace("_"," ",quoted_printable_decode($result2));
$newvalue=$result1.recode_charset($result2,$charset).$result3;
}
if (eregi('=\?.*\?B\?.*\?=',$value)) { // base64 decoding
$result1=eregi_replace('(.*)=\?.*\?B\?(.*)\?=(.*)','\1',$value);
$result2=eregi_replace('(.*)=\?.*\?B\?(.*)\?=(.*)','\2',$value);
$result3=eregi_replace('(.*)=\?.*\?B\?(.*)\?=(.*)','\3',$value);
$result2=base64_decode($result2);
$newvalue=$result1.$result2.$result3;
}
if (!isset($newvalue)) // nothing of the above, must be an unknown encoding...
$newvalue=$value;
else
$newvalue=headerDecode($newvalue); // maybe there are more encoded
return($newvalue); // parts
} else { // there wasn't anything encoded, return the original string
return($value);
}
}
/*
* calculates an Unix timestamp out of a Date-Header in an article
*
* $value: Value of the Date: header
*
* returns an Unix timestamp
*/
function getTimestamp($value) {
global $timezone;
$months=array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12);
$value=str_replace(" "," ",$value);
$d=split(" ",$value,6);
if (strcmp(substr($d[0],strlen($d[0])-1,1),",") == 0) {
$date[0]=$d[1]; // day
$date[1]=$d[2]; // month
$date[2]=$d[3]; // year
$date[3]=$d[4]; // hours:minutes:seconds
$gmt=$d[5]; // timezone
} else {
$date[0]=$d[0]; // day
$date[1]=$d[1]; // month
$date[2]=$d[2]; // year
$date[3]=$d[3]; // hours:minutes:seconds
$gmt=$d[4]; // timezone
}
$time=split(":",$date[3]);
// timezone handling
$msgtimezone=0;
if ($gmt[0]=='-') {
$msgtimezone=-substr($gmt,1,2);
$msgminzone=-substr($gmt,3,2);
} else if ($gmt[0]=='+') {
$msgtimezone=+substr($gmt,1,2);
$msgminzone=+substr($gmt,3,2);
}
$time[0]=$time[0]-$msgtimezone+$timezone;
$time[1]=$time[1]-$msgminzone+$minzone;
$timestamp=mktime($time[0],$time[1],$time[2],$months[$date[1]],$date[0],$date[2]);
return $timestamp;
}
function parse_header($hdr,$number="") {
for ($i=count($hdr)-1; $i>0; $i--)
if (preg_match("/^(\x09|\x20)/",$hdr[$i]))
$hdr[$i-1]=$hdr[$i-1]." ".ltrim($hdr[$i]);
$header = new headerType;
$header->isAnswer=false;
for ($count=0;$count<count($hdr);$count++) {
$variable=substr($hdr[$count],0,strpos($hdr[$count]," "));
$value=trim(substr($hdr[$count],strpos($hdr[$count]," ")+1));
switch (strtolower($variable)) {
case "from:":
$fromline=address_decode(headerDecode($value),"nirgendwo");
if (!isset($fromline[0]["host"])) $fromline[0]["host"]="";
$header->from=$fromline[0]["mailbox"]."@".$fromline[0]["host"];
$header->username=$fromline[0]["mailbox"];
if (!isset($fromline[0]["personal"])) {
$header->name="";
} else {
$header->name=$fromline[0]["personal"];
}
break;
case "message-id:":
$header->id=$value;
break;
case "subject:":
$header->subject=headerDecode($value);
break;
case "newsgroups:":
$header->newsgroups=$value;
break;
case "organization:":
$header->organization=headerDecode($value);
break;
case "content-transfer-encoding:":
$header->content_transfer_encoding=trim(strtolower($value));
break;
case "content-type:":
$header->content_type=array();
$subheader=split(";",$value);
$header->content_type[0]=strtolower(trim($subheader[0]));
for ($i=1; $i<count($subheader); $i++) {
$gleichpos=strpos($subheader[$i],"=");
if ($gleichpos) {
$subvariable=trim(substr($subheader[$i],0,$gleichpos));
$subvalue=trim(substr($subheader[$i],$gleichpos+1));
if (($subvalue[0]=='"') &&
($subvalue[strlen($subvalue)-1]=='"'))
$subvalue=substr($subvalue,1,strlen($subvalue)-2);
switch($subvariable) {
case "charset":
$header->content_type_charset=array(strtolower($subvalue));
break;
case "name":
$header->content_type_name=array($subvalue);
break;
case "boundary":
$header->content_type_boundary=$subvalue;
break;
case "format":
$header->content_type_format=array($subvalue);
}
}
}
break;
case "references:":
$ref=trim($value);
while (strpos($ref,"> <") != false) {
$header->references[]=substr($ref,0,strpos($ref," "));
$ref=substr($ref,strpos($ref,"> <")+2);
}
$header->references[]=trim($ref);
break;
case "date:":
$header->date=getTimestamp(trim($value));
break;
case "followup-to:":
$header->followup=trim($value);
break;
case "x-newsreader:":
case "x-mailer:":
case "user-agent:":
$header->user_agent=trim($value);
break;
case "x-face:": // not ready
// echo "<p>-".base64_decode($value)."-</p>";
break;
case "x-no-archive:":
$header->xnoarchive=strtolower(trim($value));
}
}
if (!isset($header->content_type[0]))
$header->content_type[0]="text/plain";
if (!isset($header->content_transfer_encoding))
$header->content_transfer_encoding="8bit";
if ($number != "") $header->number=$number;
return $header;
}
/*
* convert the charset of a text
*/
function recode_charset($text,$source=false,$dest=false) {
global $iconv_enable,$www_charset;
if($dest==false)
$dest=$www_charset;
if(($iconv_enable) && ($source!=false)) {
$return=iconv($source,
$dest."//TRANSLIT",$text);
if($return!="")
return $return;
else
return $text;
} else {
return $text;
}
}
function decode_body($body,$encoding) {
$bodyzeile="";
switch ($encoding) {
case "base64":
$body=base64_decode($body);
break;
case "quoted-printable":
$body=Quoted_printable_decode($body);
$body=str_replace("=\n","",$body);
// default:
// $body=str_replace("\n..\n","\n.\n",$body);
}
return $body;
}
/*
* makes URLs clickable
*
* $text: A text-line probably containing links.
*
* the function returns the text-line with HTML-Links to the links or
* email-adresses.
*/
function html_parse($text) {
global $frame_externallink;
if ((isset($frame_externallink)) && ($frame_externallink != "")) {
$target=' TARGET="'.$frame_externallink.'" ';
} else {
$target=' ';
}
// regular expressions that will be applied to every word in the text
$regexp_replace=array(
'http://((\.*([-a-z0-9_/~@?=%#;+]|&amp;)+)+)' =>
'<a'.$target.'href="http://\1">http://\1</a>',
'(www\.[-a-z]+\.(de|pl|cz|sk|tk|tv|cc|cx|biz|us|uk|info|int|eu|dk|org|net|at|ch|com))' =>
'<a'.$target.'href="http://\1">\1</a>',
'https://([-a-z0-9_./~@?=%#&;\n]+)' =>
'<a'.$target.'href="https://\1">https://\1</a>',
'gopher://([-a-z0-9_./~@?=%\n]+)' =>
'<a'.$target.'href="gopher://\1">gopher://\1</a>',
'news://([-a-z0-9_./~@?=%\n]+)' =>
'<a'.$target.'href="news://\1">news://\1</a>',
'ftp://([-a-z0-9_./~@?=%\n]+)' =>
'<a'.$target.'href="ftp://\1">ftp://\1</a>',
//'([-a-z0-9_./n]+)@([-a-z0-9_.]+)' =>
// $_SESSION["loggedin"]!==true ? '(e-Mail)' :
// '<a href="mailto:\1@\2">\1@\2</a>'
);
$ntext="";
// split every line into it's words
$words=explode(" ",$text);
$n=count($words);
for($i=0; $i<$n; $i++) {
$word=$words[$i];
// test, if we need the slow walk through all the regular expressions
if(eregi('www|\:|@',$word)) {
// apply the regular expressions to the word until a matching
// expression is found
foreach ($regexp_replace as $key => $value) {
$nword=eregi_replace($key,$value,$word);
if($nword!=$word) {
$word=$nword;
break;
}
}
}
// add the spaces between the words
if($i>0)
$ntext.=" ";
$ntext.=$word;
}
return($ntext);
}
/*
* read the header of an article in plaintext into an array
* $articleNumber can be the number of an article or its message-id.
*/
function readPlainHeader(&$ns,$group,$articleNumber) {
fputs($ns,"GROUP $group\r\n");
$line=line_read($ns);
fputs($ns,"HEAD $articleNumber\r\n");
$line=line_read($ns);
if (substr($line,0,3) != "221") {
echo $text_error["article_not_found"];
$header=false;
} else {
$line=line_read($ns);
$body="";
while(strcmp(trim($line),".") != 0) {
$body .= $line."\n";
$line=line_read($ns);
}
return split("\n",str_replace("\r\n","\n",$body));
}
}
/*
* cancel an article on the newsserver
*
* DO NOT USE THIS FUNCTION, IF YOU DON'T KNOW WHAT YOU ARE DOING!
*
* $ns: The handler of the NNTP-Connection
* $group: The group of the article
* $id: the Number of the article inside the group or the message-id
*/
function message_cancel($subject,$from,$newsgroups,$ref,$body,$id) {
global $server,$port,$send_poster_host,$organization,$text_error;
global $file_footer,$www_charset;
flush();
$ns=nntp_open($server,$port);
if ($ns != false) {
fputs($ns,"POST\r\n");
$weg=line_read($ns);
fputs($ns,'Subject: '.quoted_printable_encode($subject)."\r\n");
fputs($ns,'From: '.$from."\r\n");
fputs($ns,'Newsgroups: '.$newsgroups."\r\n");
fputs($ns,"Mime-Version: 1.0\r\n");
fputs($ns,"Content-Type: text/plain; charset=".$www_charset."\r\n");
fputs($ns,"Content-Transfer-Encoding: 8bit\r\n");
if ($send_poster_host)
fputs($ns,'X-HTTP-Posting-Host: '.gethostbyaddr(getenv("REMOTE_ADDR"))."\r\n");
if ($ref!=false) fputs($ns,'References: '.$ref."\r\n");
if (isset($organization))
fputs($ns,'Organization: '.quoted_printable_encode($organization)."\r\n");
fputs($ns,"Control: cancel ".$id."\r\n");
if ((isset($file_footer)) && ($file_footer!="")) {
$footerfile=fopen($file_footer,"r");
$body.="\n".fread($footerfile,filesize($file_footer));
fclose($footerfile);
}
$body=str_replace("\n.\r","\n..\r",$body);
$body=str_replace("\r",'',$body);
$b=split("\n",$body);
$body="";
for ($i=0; $i<count($b); $i++) {
if ((strpos(substr($b[$i],0,strpos($b[$i]," ")),">") != false ) | (strcmp(substr($b[$i],0,1),">") == 0)) {
$body .= textwrap(stripSlashes($b[$i]),78,"\r\n")."\r\n";
} else {
$body .= textwrap(stripSlashes($b[$i]),74,"\r\n")."\r\n";
}
}
fputs($ns,"\r\n".$body."\r\n.\r\n");
$message=line_read($ns);
nntp_close($ns);
} else {
$message=$text_error["post_failed"];
}
return $message;
}
?>

View File

@ -1,315 +0,0 @@
<?
/* Newsportal NNTP<->HTTP Gateway
* Download: http://florian-amrhein.de/newsportal
*
* Copyright (C) 2002-2004 Florian Amrhein
* E-Mail: florian.amrhein@gmx.de
* Web: http://florian-amrhein.de
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@$newsgroups=$_REQUEST["newsgroups"];
@$group=$_REQUEST["group"];
@$type=$_REQUEST["type"];
@$subject=stripslashes($_REQUEST["subject"]);
@$name=$_REQUEST["name"];
@$email=$_REQUEST["email"];
@$body=stripslashes($_REQUEST["body"]);
@$abspeichern=$_REQUEST["abspeichern"];
@$references=$_REQUEST["references"];
@$id=$_REQUEST["id"];
if (!isset($group)) $group=$newsgroups;
include "config.inc.php";
include "auth.inc";
// Save name and email in cookies
if (($setcookies==true) && (isset($abspeichern)) && ($abspeichern=="ja")) {
setcookie("cookie_name",stripslashes($name),time()+(3600*24*90));
setcookie("cookie_email",$email,time()+(3600*24*90));
}
if ((isset($post_server)) && ($post_server!=""))
$server=$post_server;
if ((isset($post_port)) && ($post_port!=""))
$port=$post_port;
include "head.inc";
include $file_newsportal;
?>
<?
// has the user write-rights on the newsgroups?
if((function_exists("npreg_group_has_read_access") &&
!npreg_group_has_read_access($group)) ||
(function_exists("npreg_group_is_visible") &&
!npreg_group_is_visible($group)) ||
(function_exists("npreg_group_has_write_access") &&
!npreg_group_has_write_access($group))) {
die("access denied");
}
// Load name and email from cookies
if ($setcookies) {
if ((isset($_COOKIE["cookie_name"])) && (!isset($name)))
$name=$_COOKIE["cookie_name"];
if ((isset($_COOKIE["cookie_email"])) && (!isset($email)))
$email=$_COOKIE["cookie_email"];
}
// Load name and email from the registration system, if available
if(function_exists("npreg_get_firstname")) {
$name=npreg_get_firstname();
$form_noname=true;
if(function_exists("npreg_get_lastname"))
$name.=" ".npreg_get_lastname();
}
if(function_exists("npreg_get_email")) {
$email=npreg_get_email();
$form_noemail=true;
}
if((!isset($references)) || ($references=="")) {
$references=false;
}
if (!isset($type)) {
$type="new";
}
if ($type=="new") {
$subject="";
$bodyzeile="";
$show=1;
}
// Is there a new article to be bost to the newsserver?
if ($type=="post") {
$show=0;
// error handling
if (trim($body)=="") {
$type="retry";
$error=$text_post["missing_message"];
}
if ((trim($email)=="") && (!isset($anonym_address))) {
$type="retry";
$error=$text_post["missing_email"];
}
if (($email) && (!validate_email(trim($email)))) {
$type="retry";
$error=$text_post["error_wrong_email"];
}
if (trim($name)=="") {
$type="retry";
$error=$text_post["missing_name"];
}
if (trim($subject)=="") {
$type="retry";
$error=$text_post["missing_subject"];
}
if ($type=="post") {
if (!$readonly) {
// post article to the newsserver
if($references)
$references_array=explode(" ",$references);
else
$references_array=false;
if(($email=="") && (isset($anonym_address)))
$nemail=$anonym_address;
else
$nemail=$email;
$message=message_post(quoted_printable_encode($subject),
$nemail." (".quoted_printable_encode($name).")",
$newsgroups,$references_array,addslashes($body));
// Article sent without errors, or duplicate?
if ((substr($message,0,3)=="240") ||
(substr($message,0,7)=="441 435")) {
?>
<h1 class="np_post_headline"><? echo $text_post["message_posted"];?></h1>
<p><? echo $text_post["message_posted2"];?></p>
<p><a href="<? echo $file_thread.'?group='.urlencode($group).'">'.$text_post["button_back"].'</a> '
.$text_post["button_back2"].' '.urlencode($group) ?></p>
<?
} else {
// article not accepted by the newsserver
$type="retry";
$error=$text_post["error_newsserver"]."<br><pre>$message</pre>";
}
} else {
echo $text_post["error_readonly"];
}
}
}
// A reply of an other article.
if ($type=="reply") {
$message=message_read($id,0,$group);
$head=$message->header;
$body=explode("\n",$message->body[0]);
nntp_close($ns);
if ($head->name != "") {
$bodyzeile=$head->name;
} else {
$bodyzeile=$head->from;
}
$bodyzeile=$text_post["wrote_prefix"].$bodyzeile.
$text_post["wrote_suffix"]."\n\n";
for ($i=0; $i<=count($body)-1; $i++) {
if((isset($cutsignature)) && ($cutsignature==true) &&
($body[$i]=='-- '))
break;
if (trim($body[$i])!="") {
if($body[$i][0]=='>')
$bodyzeile.=">".$body[$i]."\n";
else
$bodyzeile.="> ".$body[$i]."\n";
} else {
$bodyzeile.="\n";
}
}
$subject=$head->subject;
if (isset($head->followup) && ($head->followup != "")) {
$newsgroups=$head->followup;
} else {
$newsgroups=$head->newsgroups;
}
splitSubject($subject);
$subject="Re: ".$subject;
// Cut off old parts of a subject
// for example: 'foo (was: bar)' becomes 'foo'.
$subject=eregi_replace('(\(wa[sr]: .*\))$','',$subject);
$show=1;
$references=false;
if (isset($head->references[0])) {
for ($i=0; $i<=count($head->references)-1; $i++) {
$references .= $head->references[$i]." ";
}
}
$references .= $head->id;
}
if ($type=="retry") {
$show=1;
$bodyzeile=$body;
}
if ($show==1) {
if ($testgroup) {
$testnewsgroups=testgroups($newsgroups);
} else {
$testnewsgroups=$newsgroups;
}
if ($testnewsgroups == "") {
echo $text_post["followup_not_allowed"];
echo " ".$newsgroups;
} else {
$newsgroups=$testnewsgroups;
echo '<h1 class="np_post_headline">'.$text_post["group_head"].$newsgroups
.$text_post["group_tail"].'</h1>';
if (isset($error)) echo "<p>$error</p>"; ?>
<form action="<? echo $file_post?>" method="post" name="postform">
<div class="np_post_header">
<table>
<tr><td align="right"><b><? echo $text_header["subject"] ?></b></td>
<td><input type="text" name="subject" value="<?
echo htmlspecialchars($subject);?>" size="40" maxlength="80"></td></tr>
<tr><td align="right"><b><?=$text_post["name"]?></b></td>
<td align="left">
<?
if($form_noname===true) {
echo htmlspecialchars($name);
} else {
echo '<input type="text" name="name"';
if (isset($name)) echo 'value="'.
htmlspecialchars(stripslashes($name)).'"';
echo 'size="40" maxlength="40">';
}
?>
</td></tr>
<tr><td align="right"><b><?=$text_post["email"]?></b></td>
<td align="left">
<?
if($form_noemail===true) {
echo htmlspecialchars($email);
} else {
echo '<input type="text" name="email"';
if (isset($email)) echo 'value="'.htmlspecialchars(stripslashes($email)).'"';
echo 'size="40" maxlength="40">';
}
?>
</td></tr>
</table>
</div>
<div class="np_post_body">
<table>
<tr><td><b><? echo $text_post["message"];?></b><br>
<textarea id="postbody" name="body" rows="20" cols="79" wrap="virtual"><?
if ((isset($bodyzeile)) && ($post_autoquote))
echo htmlspecialchars($bodyzeile); ?>
</textarea></td></tr>
<tr><td>
<? if(!$post_autoquote) { ?>
<input type="hidden" id="hidebody" value="<?
if (isset($bodyzeile)) echo htmlspecialchars(stripslashes($bodyzeile)); ?>">
<script language="JavaScript">
<!--
function quoten() {
document.getElementById("postbody").value=document.getElementById("hidebody").value;
document.getElementById("hidebody").value="";
}
//-->
</script>
<input tabindex="100" type="Button" name="quote" value="<?=$text_post["quote"]?>" onclick="quoten()">
<? } ?>
<input type="submit" value="<? echo $text_post["button_post"];?>">
<? if ($setcookies==true) { ?>
<input type="checkbox" name="abspeichern" value="ja">
<? echo $text_post["remember"];?>
<? } ?>
</td>
</tr>
</table>
</div>
<input type="hidden" name="type" value="post">
<input type="hidden" name="newsgroups" value="<?=htmlspecialchars($newsgroups); ?>">
<input type="hidden" name="references" value="<?=htmlentities($references); ?>">
<input type="hidden" name="group" value="<?=htmlspecialchars($group); ?>">
</form>
<? } } ?>
<? include "tail.inc"; ?>

View File

@ -1 +0,0 @@
a:4:{i:0;O:13:"newsgroupType":4:{s:4:"name";N;s:11:"description";N;s:5:"count";N;s:4:"text";s:21:"Computer Science Club";}i:1;O:13:"newsgroupType":5:{s:4:"name";s:6:"uw.csc";s:11:"description";s:22:" Computer Science Club";s:5:"count";s:3:"115";s:4:"text";N;s:3:"age";i:1181337436;}i:2;O:13:"newsgroupType":4:{s:4:"name";s:15:"uw.csc.hardware";s:11:"description";s:16:" No description.";s:5:"count";s:1:"0";s:4:"text";N;}i:3;O:13:"newsgroupType":5:{s:4:"name";s:15:"uw.csc.software";s:11:"description";s:16:" No description.";s:5:"count";s:1:"3";s:4:"text";N;s:3:"age";i:1180792889;}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
0.36,news,,400,100,0,0,iso-8859-15,1,1
10826 10942 115

View File

@ -1 +0,0 @@
O:8:"stdClass":3:{s:4:"from";s:27:"gdcosta@csclub.uwaterloo.ca";s:4:"date";i:1181337436;s:4:"name";s:14:"Gaelan D'Costa";}

View File

@ -1,185 +0,0 @@
/* =========== Page Layout ================ */
BODY {
color: black;
background: white;
}
/* =========== Index Layout ============== */
/* headline */
h1.np_index_headline {
font-size: large;
}
/* border around all groups */
.np_index_groups {
background: #eeeeee;
padding: 0px;
border: solid 1px #26598f;
}
/* a block of groups */
.np_index_groupblock {
margin-bottom: 20px;
}
/* headline of a group of blocks */
.np_index_grouphead {
border: solid 1px #26598f;
background: #26598f;
color: white;
}
/* a single group */
.np_index_group {
margin-left: 10px;
margin-bottom: 5px;
}
/* =========== Thread Layout ============== */
/* Headline */
h1.np_thread_headline {
font-size: large;
}
/* Table around the thread */
table.np_thread_table {
width: 100%;
border: solid 1px #26598f;
border-spacing: 0px;
margin: 0px;
padding: 0px;
}
/* Head of the table */
tr.np_thread_head,td.np_thread_head {
color: white;
background: #26598f;
margin: 0px;
}
/* Even line numbers in the thread */
tr.np_thread_line1,td.np_thread_line1 {
padding-left: 3px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
background: #f9f9f9;
margin: 0px;
}
/* Odd line numbers in the thread */
tr.np_thread_line2,td.np_thread_line2 {
padding-left: 3px;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
background: #eeeeee;
margin: 0px;
}
/* Text inside a Line */
span.np_thread_line_text {
font-size: small;
}
/* The small images, a thread consists of */
img.thread_image {
vertical-align: bottom;
}
/* =========== Article Layout ============= */
/* headline */
h1.np_article_headline {
font-size: large;
}
/* Head of an article */
div.np_article_header {
background: #eeeeee;
padding: 3px;
border: solid 1px #26598f;
}
/* Layout of the Text-Body */
div.np_article_body {
margin-top: 20px;
font-family: "Lucida Console", "Courier New", Courier, "Andale Mono", monospace;
}
/* Layout of quoted text / graphic layout */
blockquote.np_article_quote {
border-left: #002255 solid 1px;
padding-left: 5px;
color: #002277;
margin: 0px;
}
/* =========== Post layout =========== */
/* headline */
h1.np_post_headline {
font-size: large;
}
/* Head with the input fields for subject, name and email */
.np_post_header {
background: #eeeeee;
padding: 3px;
border: solid 1px #26598f;
}
/* Body with the message-field and the post-button in it */
.np_post_body {
background: #eeeeee;
padding: 3px;
border: solid 1px #26598f;
margin-top: 10px;
}
/* =========== navigation buttons on top of every page =========== */
.np_buttonbar {
background: #26598f;
padding: 1px;
margin-bottom: 10px;
color: black;
}
td.np_button {
padding-left: 5px;
padding-right: 5px;
border-right: solid white 1px;
color: white;
white-space: nowrap;
}
a.np_button {
color: white;
text-decoration: underline;
}
.np_pages {
color: white;
}
.np_pages_selected {
color: white:
text-weight: bold;
margin-left: 5px;
}
.np_pages_unselected {
color: white;
text-decoration: underline;
margin-left: 5px;
}

View File

@ -1,6 +0,0 @@
<p align="right"><small>
"<a href="http://florian-amrhein.de/newsportal/">News-Portal</a>"
was written by <a href="http://florian-amrhein.de">Florian Amrhein</a>.
</small></p>
</body></html>

View File

@ -1,82 +0,0 @@
<? header("Expires: ".gmdate("D, d M Y H:i:s",time()+7200)." GMT");
// register parameters
$group=$_REQUEST["group"];
if(isset($_REQUEST["first"]))
$first=intval($_REQUEST["first"]);
if(isset($_REQUEST["last"]))
$last=intval($_REQUEST["last"]);
include "config.inc.php";
include("$file_newsportal");
include "auth.inc";
$title.= ' - '.$group;
include "head.inc";
if((!function_exists("npreg_group_has_read_access") ||
npreg_group_has_read_access($group)) &&
(!function_exists("npreg_group_is_visible") ||
npreg_group_is_visible($group))) {
?>
<a name="top"></a>
<h1 class="np_thread_headline"><?=htmlspecialchars($group); ?></h1>
<?
echo '<table cellpadding="0" cellspacing="0" width="100%" class="np_buttonbar"><tr>';
echo '<td class="np_button"><a class="np_button" href="'.
$file_index.'">'.$text_thread["button_grouplist"].'</td></a>';
if (!$readonly &&
(!function_exists("npreg_group_has_write_access") ||
npreg_group_has_write_access($group)))
echo '<td class="np_button"><a class="np_button" href="'.
$file_post.'?newsgroups='.urlencode($group).'&amp;type=new">'.
$text_thread["button_write"]."</a></td>";
// $ns=nntp_open($server,$port);
flush();
$headers = thread_load($group);
$article_count=count($headers);
if ($articles_per_page != 0) {
if ((!isset($first)) || (!isset($last))) {
if ($startpage=="first") {
$first=1;
$last=$articles_per_page;
} else {
$first=$article_count - (($article_count -1) % $articles_per_page);
$last=$article_count;
}
}
echo '<td class="np_pages" width="100%" align="right">';
// Show the replies to an article in the thread view?
if($thread_show["replies"]) {
// yes, so the counting of the shown articles is very easy
$pagecount=count($headers);
} else {
// oh no, the replies will not be shown, this makes life hard...
$pagecount=0;
if(count($headers>0) && is_array($headers)) {
foreach($headers as $h) {
if($h->isAnswer==false)
$pagecount++;
}
}
}
thread_pageselect($group,$pagecount,$first);
echo '</td>';
} else {
$first=0;
$last=$article_count;
}
echo '</tr></table>';
thread_show($headers,$group,$first,$last);
} else {
echo $text_register["no_access_group"];
}
?>
<p align="right"><a href="#top"><? echo $text_thread["button_top"];?></a></p>
<? include "tail.inc"; ?>

View File

@ -8,16 +8,11 @@
<p>Spy on the office, see whether it's open or who is passing by the door!</p>
<center>
<img src="http://glucose-fructose.csclub.uwaterloo.ca:8080/" width="640" height="480" />
</center><br/>
<center>
<img src="http://phosphoric-acid.csclub.uwaterloo.ca:8080/" width="640" height="480" />
<center>
</center><br/>
<!-- <img src="http://phosphoric-acid.csclub.uwaterloo.ca:9090/" width="320" height="240" /> -->
<!-- <img src="http://caramel-colour.csclub.uwaterloo.ca:8080/" width="320" height="240" /> -->
</center>
<div class="webcam">
<img src="http://glucose-fructose.csclub.uwaterloo.ca:8080/" width="640" height="480" alt="Sugar's Webcam"/>
<br/><br/>
<img src="http://phosphoric-acid.csclub.uwaterloo.ca:8080/" width="640" height="480" alt="Phosphoric-acid's Webcam"/>
</div>
<p>Tired of streaming? Try the <a href="webcam.html">regular version</a>.</p>

View File

@ -8,16 +8,11 @@
<p>Spy on the office, see whether it's open or who is passing by the door!</p>
<center>
<img src="http://glucose-fructose.csclub.uwaterloo.ca:8080/singleframe" width="640" height="480" />
</center><br/>
<center>
<img src="http://phosphoric-acid.csclub.uwaterloo.ca:8080/singleframe" width="640" height="480" />
</center><br/>
<!-- <img src="http://phosphoric-acid.csclub.uwaterloo.ca:9090/singleframe" width="320" height="240" /> -->
<center>
<!-- <img src="http://caramel-colour.csclub.uwaterloo.ca:8080/singleframe" width="320" height="240" /> -->
</center>
<div class="webcam">
<img src="http://glucose-fructose.csclub.uwaterloo.ca:8080/singleframe" width="640" height="480" alt="Sugar's Webcam"/>
<br/><br/>
<img src="http://phosphoric-acid.csclub.uwaterloo.ca:8080/singleframe" width="640" height="480" alt="Phosphoric-acid's Webcam"/>
</div>
<p>Try the <a href="webcam-streaming.html">streaming version</a> for
streamy goodness.</p>