Permalink
Browse files

Rewrite of news.php.net:

* Fixes dozens of encoding errors and attachment viewing issues
* Entire site have been restructured
* Incoporates the following commits by Marco Schuster from PR #1:
  - b77495c
  - 75fe8ff
* Interface have preferences to make it easier to subscribe to lists
* Interface supports internationalization with the following languages included:
  - English
  - Danish
* For now the codebase uses a minized templating system which probably should be reverted, but lets keep it for now

Signed-off-by: Kalle Sommer Nielsen <kalle@php.net>
  • Loading branch information...
1 parent d7f43ee commit 354b0d0e354db82bf07c1696105ccacef261e4a4 @KalleZ KalleZ committed Feb 27, 2013
Showing with 2,879 additions and 1,101 deletions.
  1. +31 −0 .htaccess
  2. +0 −49 README
  3. +208 −279 article.php
  4. +145 −0 attachment.php
  5. +0 −165 common.inc
  6. +0 −141 getpart.php
  7. +75 −150 group.php
  8. BIN i/g.gif
  9. BIN i/l.gif
  10. BIN i/udm.gif
  11. BIN images/empty_flag.gif
  12. BIN images/flag_ar.png
  13. BIN images/flag_bg.png
  14. BIN images/flag_ca.png
  15. BIN images/flag_cs.png
  16. BIN images/flag_da.png
  17. BIN images/flag_de.png
  18. BIN images/flag_el.png
  19. BIN images/flag_en.png
  20. BIN images/flag_es.png
  21. BIN images/flag_fa.png
  22. BIN images/flag_fi.png
  23. BIN images/flag_fr.png
  24. BIN images/flag_he.png
  25. BIN images/flag_hk.png
  26. BIN images/flag_hu.png
  27. BIN images/flag_id.png
  28. BIN images/flag_it.png
  29. BIN images/flag_ja.png
  30. BIN images/flag_kr.png
  31. BIN images/flag_lt.png
  32. BIN images/flag_nl.png
  33. BIN images/flag_no.png
  34. BIN images/flag_pl.png
  35. BIN images/flag_pt-br.png
  36. BIN images/flag_pt.png
  37. BIN images/flag_ro.png
  38. BIN images/flag_ru.png
  39. BIN images/flag_se.png
  40. BIN images/flag_sk.png
  41. BIN images/flag_sl.png
  42. BIN images/flag_sv.png
  43. BIN images/flag_tr.png
  44. BIN images/flag_tw.png
  45. BIN images/flag_zh.png
  46. BIN images/icon_rdf.png
  47. BIN images/icon_rdf_big.png
  48. BIN images/icon_rss.png
  49. BIN images/icon_rss_big.png
  50. BIN images/sprites.png
  51. +41 −0 include/common.inc
  52. +225 −0 include/functions.inc
  53. +51 −0 include/ip-to-country.inc
  54. +86 −0 include/language.inc
  55. +121 −0 include/languages/da.inc
  56. +121 −0 include/languages/en.inc
  57. +87 −0 include/nntp.inc
  58. +79 −0 include/posttohost.inc
  59. +87 −0 include/preferences.inc
  60. +66 −0 include/template.inc
  61. +38 −65 index.php
  62. +0 −23 nntp.inc
  63. +37 −0 preferences.php
  64. +1 −1 robots.txt
  65. +0 −108 search.php
  66. +0 −120 style.css
  67. +146 −0 styles/home.css
  68. +156 −0 styles/news.css
  69. +43 −0 styles/reset.css
  70. +500 −0 styles/theme.css
  71. +77 −0 subscribe.php
  72. +73 −0 templates/article.tpl
  73. +3 −0 templates/article_attachmentbit.tpl
  74. +6 −0 templates/error.tpl
  75. +14 −0 templates/footer.tpl
  76. +17 −0 templates/frontpage.tpl
  77. +20 −0 templates/frontpage_groupbit.tpl
  78. +47 −0 templates/groupview.tpl
  79. +7 −0 templates/groupview_bit.tpl
  80. +7 −0 templates/groupview_bit_rdf.tpl
  81. +7 −0 templates/groupview_bit_rss.tpl
  82. +19 −0 templates/groupview_navigation.tpl
  83. +11 −0 templates/groupview_rdf.tpl
  84. +12 −0 templates/groupview_rss.tpl
  85. +109 −0 templates/header.tpl
  86. +89 −0 templates/preferences.tpl
  87. +17 −0 templates/redirect.tpl
View
@@ -0,0 +1,31 @@
+# +----------------------------------------------------------------------+
+# | PHP.net Website Systems |
+# +----------------------------------------------------------------------+
+# | Copyright (c) 2011 The PHP Group |
+# +----------------------------------------------------------------------+
+# | This source file is subject to version 3.01 of the PHP license, |
+# | that is bundled with this package in the file LICENSE, and is |
+# | available through the world-wide-web at the following url: |
+# | http://www.php.net/license/3_01.txt |
+# | If you did not receive a copy of the PHP license and are unable to |
+# | obtain it through the world-wide-web, please send a note to |
+# | license@php.net so we can mail you a copy immediately. |
+# +----------------------------------------------------------------------+
+# | Author: |
+# | Jim Winstead <jimw@php.net> |
+# | Kalle Sommer Nielsen <kalle@php.net> |
+# | Felipe Pena <felipe@php.net> |
+# +----------------------------------------------------------------------+
+
+RewriteEngine on
+
+RewriteRule ^((?:php|ug|svn).+)/start/([0-9]+) group.php?group=$1&start=$2 [L]
+RewriteRule ^((?:php|ug|svn).+)/([0-9]+) article.php?group=$1&id=$2 [L]
+RewriteRule ^((?:php|ug|svn)[^/]+)(/)?$ group.php?group=$1 [L]
+RewriteRule ^subscribe/((?:php|ug|svn).+)(/)?$ subscribe.php?group=$1 [L]
+RewriteRule ^attachment/((?:php|ug|svn).+)/([0-9]+)/([0-9]+)(/)?$ attachment.php?group=$1&article=$2&id=$3 [L]
+RewriteRule ^preferences(/)?$ preferences.php [L]
+RewriteRule ^rss/((?:php|ug|svn)[^/]+)(/)?$ group.php?group=$1&format=rss [L]
+RewriteRule ^rss/((?:php|ug|svn).+)/start/([0-9]+) group.php?group=$1&start=$2&format=rss [L]
+RewriteRule ^rdf/((?:php|ug|svn)[^/]+)(/)?$ group.php?group=$1&format=rdf [L]
+RewriteRule ^rdf/((?:php|ug|svn).+)/start/([0-9]+) group.php?group=$1&start=$2&format=rdf [L]
View
49 README
@@ -1,49 +0,0 @@
-this is all very ugly. just proof-of-concept, really.
-
-the biggest thing to do would be to do something smart with
-mime-encoded messages. but keeping the current property of <b>not</b>
-slurping the whole damn message into memory just to do so.
-
-another thing to do would be to support posting. to avoid
-completely anonymous posting, this could require confirming the
-email address before allowing posts. to do this without actually
-having to maintain a database of users, we could send an email
-containing md5(md5("email:timestamp").$secret) (where $secret is
-some value that is kept secret. duh.) and then let the user "log
-in" by supplying their email address and this code, and storing
-that in a cookie. depends on a secret for 'security', but like i
-said, it avoids having to maintain any sort of state on the server
-side. blocking email addresses for posting will be easy enough
-if anyone ever abuses the system.
-
-should also probably protect email addresses from harvesters.
-then again, anyone who wanted to harvest email addresses could just
-crawl the nntp server directly. or they can crawl any of the other
-mail archives that don't protect the addresses.
-
-keeping track of a .newsrc-like state for users would be cool,
-too. too bad there's no Set::IntSpan for php.
-
-perhaps chasing up the references: chain to display the
-thread when displaying an article would be interesting. i
-have a feeling that building some sort of index is going
-to be desirable at some point. should use jwz's threading
-algorithm. http://www.jwz.org/doc/threading.html
-
-ftp://ftp.isi.edu/in-notes/rfc2047.txt explains how to decode encoded
-header fields. handling utf-8 and iso-8859-1 should be pretty easy.
-could use the gnu recode functions to do this in a general way,
-i think.
-
-oh, and this uses direct socket functions instead of the php imap
-extension because nntp is a drop-dead-easy protocol, and i'm allergic
-to the c-client code.
-
----
-SC.2004.09.03:
-Here are the appropriate Rewrite rules for apache:
- RewriteEngine on
- RewriteRule ^/(php.+)/start/([0-9]+) /group.php?group=$1&i=$2 [L]
- RewriteRule ^/(php.+)/([0-9]+) /article.php?group=$1&article=$2 [L]
- RewriteRule ^/(php[^/]+)(/)?$ /group.php?group=$1 [L]
-
Oops, something went wrong.

0 comments on commit 354b0d0

Please sign in to comment.