diff --git a/README.md b/README.md index 7e3c456..0bc7952 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ What there is: elsewhere by telnet or RLogin, and the door networks BBSLink and DoorParty - [chat](https://github.com/Neo-Desktop/bbs-sec/wiki/Chat-and-Paging): rooms, messages to a node, paging the sysop - [finger and gopher](https://github.com/Neo-Desktop/bbs-sec/wiki/Finger-and-Gopher): who is on, and chosen areas in gopherspace -- [a web forum](https://github.com/Neo-Desktop/bbs-sec/wiki/Web-Forum): the message areas as a bulletin board in the browser, in the manner of Invision Power Board 3, or of IPB 2 or 1, or Ikonboard (themes) +- [a web forum](https://github.com/Neo-Desktop/bbs-sec/wiki/Web-Forum): the message areas as a bulletin board in the browser, in the manner of Invision Power Board 3, or of IPB 2 or 1, Ikonboard or phpBB 1 (themes) - [a web terminal](https://github.com/Neo-Desktop/bbs-sec/wiki/HTTP-API#the-web-terminal): the BBS in a browser (xterm.js, built in) - [an HTTP API](https://github.com/Neo-Desktop/bbs-sec/wiki/HTTP-API): REST, server-sent events, and WebSockets (JSON or protobuf) where web clients chat with terminal callers; Prometheus metrics - [customization](https://github.com/Neo-Desktop/bbs-sec/wiki/Customization): ANSI art and 3270 screens, menus of the sysop's, @-codes, the prompts' words diff --git a/bbs.conf.sample b/bbs.conf.sample index a16f352..b96a817 100644 --- a/bbs.conf.sample +++ b/bbs.conf.sample @@ -213,7 +213,8 @@ address = 127.0.0.1:2513 ;forum_guests = yes ; the forum's theme until a caller chooses (at the foot of each page): ; ipb3 (in the manner of Invision Power Board 3), ipb2 (classic, as IPB 2) -; ipb1 (retro, as IPB 1) or ikon (grey, as Ikonboard 2) +; ipb1 (retro, as IPB 1), ikon (grey, as Ikonboard 2) or phpbb1 (dark, +; as phpBB 1) ;forum_theme = ipb3 ; Access levels: a user's level (0-255) gets what the [level] at or diff --git a/docs/wiki/HTTP-API.md b/docs/wiki/HTTP-API.md index 2dfe1e0..fa151b7 100644 --- a/docs/wiki/HTTP-API.md +++ b/docs/wiki/HTTP-API.md @@ -26,7 +26,7 @@ key_file = /etc/bbs/tls/key.pem | `rate`, `burst` | `10`, `20` | requests a second per token (per address without one), and how many may come at once | | `session_hours` | `24` | how long a login's token lasts | | `terminal` | `yes` | the web terminal page (below) | -| `forum`, `forum_guests`, `forum_theme` | `yes`, `yes`, `ipb3` | the [web forum](Web-Forum), guests reading it, and its theme (`ipb3`, `ipb2`, `ipb1` or `ikon`) | +| `forum`, `forum_guests`, `forum_theme` | `yes`, `yes`, `ipb3` | the [web forum](Web-Forum), guests reading it, and its theme (`ipb3`, `ipb2`, `ipb1`, `ikon` or `phpbb1`) | The OpenAPI 3.1 description is at `/api/v1/openapi.json`. diff --git a/docs/wiki/Home.md b/docs/wiki/Home.md index e38090b..41a91a1 100644 --- a/docs/wiki/Home.md +++ b/docs/wiki/Home.md @@ -83,7 +83,7 @@ What there is: [IRC](IRC) channels too, for IRC clients, and [MRC](MRC)'s rooms join the BBSes' Multi Relay Chat - [finger and gopher](Finger-and-Gopher): who is on, and chosen areas in gopherspace -- [a web forum](Web-Forum): the message areas as a bulletin board in the browser, in the manner of Invision Power Board 3, or of IPB 2 or 1, or Ikonboard (themes) +- [a web forum](Web-Forum): the message areas as a bulletin board in the browser, in the manner of Invision Power Board 3, or of IPB 2 or 1, Ikonboard or phpBB 1 (themes) - [a web terminal](HTTP-API#the-web-terminal): the BBS in a browser (xterm.js, built in) - [an HTTP API](HTTP-API): REST, server-sent events, and WebSockets (JSON or protobuf) where web clients chat with terminal callers; Prometheus metrics - [customization](Customization): ANSI art and 3270 screens, menus of the sysop's, @-codes, the prompts' words diff --git a/docs/wiki/Web-Forum.md b/docs/wiki/Web-Forum.md index 5e78a33..67dd740 100644 --- a/docs/wiki/Web-Forum.md +++ b/docs/wiki/Web-Forum.md @@ -74,6 +74,7 @@ On a post: | theme | | |---|---| | `ipb3` | the default: a board of the early 2010s in the manner of Invision Power Board 3: a dark user bar, a navy header with tabs, rounded blue category bars, posts with their author's column on the left | +| `phpbb1` | dark: a PHP board of 2001 in the manner of phpBB 1: a black page with white text and teal links, a glowing italic logo, glowing *New Topic* and *Reply* buttons, [bracketed] menu links, the *-N-* statistics block, near-black table lines with cells in alternating grey and navy, small folder icons, posts between rules with little labelled links beneath | | `ikon` | grey: a Perl board of 2001 in the manner of Ikonboard 2: a narrow centered page, grey tables with one-pixel lines between cells, a title box with a menu row and a *Welcome* box, a brushed-metal logo beside a folder tree of where you are, dark red links, grey bevelled buttons, folder badges and gem icons, posts with *Total Posts, Joined, Posted on* beneath | | `ipb1` | retro: a board of the early 2000s in the manner of Invision Power Board 1: tables outlined in slate blue with white lines between their cells, bright title bars, a flat menu box, round forum badges and envelope topic icons, rounded glossy buttons, *Posted on* and a post links bar | | `ipb2` | classic: a board of the mid-2000s in the manner of Invision Power Board 2: a white page, boxes outlined in navy, blue gradient title bars, pale blue rows, small Verdana; *Logged in as* and *Welcome Guest* bars, *Last Post Info*, *Fast Reply*, big blue buttons | diff --git a/internal/forum/format.go b/internal/forum/format.go index 7931729..e24b6d1 100644 --- a/internal/forum/format.go +++ b/internal/forum/format.go @@ -24,6 +24,8 @@ var funcs = template.FuncMap{ "odd": func(n int) bool { return n%2 == 1 }, "shortdate": func(t time.Time) string { return t.Format("Jan. 02, 2006") }, "clock": func(t time.Time) string { return t.Format("03:04 PM") }, + "stamp": func(t time.Time) string { return t.Format("2006-01-02 15:04") }, + "monthyear": func(t time.Time) string { return t.Format("Jan 2006") }, "initial": initial, "avatar": avatarClass, "group": groupTitle, diff --git a/internal/forum/forum.go b/internal/forum/forum.go index 87cc44e..1056b74 100644 --- a/internal/forum/forum.go +++ b/internal/forum/forum.go @@ -52,6 +52,7 @@ var Themes = []Theme{ {"ipb2", "Classic (IPB 2 style)"}, {"ipb1", "Retro (IPB 1 style)"}, {"ikon", "Grey (Ikonboard style)"}, + {"phpbb1", "Dark (phpBB 1 style)"}, } // KnownTheme says whether there is a theme of the name. @@ -264,6 +265,7 @@ type page struct { Theme string // the theme in use Themes []Theme // to choose from Path string // this page's, to come back to + Page string // which page it is (its template's name), for layouts that differ by page Body any // the page's own } @@ -275,7 +277,7 @@ type crumb struct { func (q *req) render(status int, name, title string, crumbs []crumb, body any) { p := page{Title: title, BBS: q.s.B.Name, User: q.user, CSRF: q.csrf(), Crumbs: crumbs, Terminal: q.s.Terminal, Register: q.user == nil && q.s.B.NewUsers, Now: time.Now(), Body: body, Notice: q.r.URL.Query().Get("notice"), - Theme: q.theme(), Themes: Themes, Path: q.r.URL.RequestURI()} + Theme: q.theme(), Themes: Themes, Path: q.r.URL.RequestURI(), Page: name} switch { case strings.HasPrefix(name, "online"): p.Tab = "online" diff --git a/internal/forum/forum_test.go b/internal/forum/forum_test.go index 9e8c916..3cf7989 100644 --- a/internal/forum/forum_test.go +++ b/internal/forum/forum_test.go @@ -414,10 +414,11 @@ func TestThemes(t *testing.T) { has(t, th.Name+" topic", body, "Remember these?", "I do.", `class="quote"`, `name="answer"`) // each laid out its own way own := map[string][2][]string{ - "ipb3": {{"Signed in as", "Reply to this topic"}, {"Board Statistics", "Create Account"}}, - "ipb2": {{"Logged in as:", "Fast Reply", "Member No.:", `class="postsep"`}, {"Welcome Guest", "Last Post Info", `id="gfooter"`}}, - "ipb1": {{"Logged in as:", "Posted on", `class="postlinksbar"`, `class="activeuserstrip"`}, {"Welcome Guest", "Last Post Info", `class="pformstrip"`}}, - "ikon": {{"Log out", "Total Posts:", "Post a reply", `class="bottomline"`}, {"Guest: ", "Forum Info", "welcomes its newest member", "You must be logged in to view the post markers"}}, + "ipb3": {{"Signed in as", "Reply to this topic"}, {"Board Statistics", "Create Account"}}, + "ipb2": {{"Logged in as:", "Fast Reply", "Member No.:", `class="postsep"`}, {"Welcome Guest", "Last Post Info", `id="gfooter"`}}, + "ipb1": {{"Logged in as:", "Posted on", `class="postlinksbar"`, `class="activeuserstrip"`}, {"Welcome Guest", "Last Post Info", `class="pformstrip"`}}, + "phpbb1": {{"Author", "Posted:", "Reply to:", "Logout]"}, {"Our users have posted a total of", "You are not logged in.", "= New Posts since your last visit."}}, + "ikon": {{"Log out", "Total Posts:", "Post a reply", `class="bottomline"`}, {"Guest: ", "Forum Info", "welcomes its newest member", "You must be logged in to view the post markers"}}, }[th.Name] has(t, th.Name+" own topic", body, own[0]...) _, _, body = guest.get("/forum/") diff --git a/internal/forum/static/phpbb1.css b/internal/forum/static/phpbb1.css new file mode 100644 index 0000000..d682914 --- /dev/null +++ b/internal/forum/static/phpbb1.css @@ -0,0 +1,215 @@ +/* + * The forum's dark theme: laid out in the manner of the PHP boards of + * 2001 (phpBB 1's default look and its kind): a black page, white + * sans-serif text and teal links, a glowing italic logo, bracketed + * menu links, tables with near-black lines and cells in alternating + * grey and navy, small folder icons, posts between rules with little + * labelled links beneath. Written for this BBS; it takes no code or + * images from any board. + */ + +:root { + --bg: #000000; + --text: #ffffff; + --color1: #6c706d; + --color2: #2e4460; + --line: #001100; + --link: #11c6bd; +} + +body { + margin: 0; + padding: 8px 0 16px; + background: var(--bg); + color: var(--text); + font: 13px Arial, Helvetica, sans-serif; +} +a:link, a:visited, a:active { color: var(--link); } +a:hover { color: #7ff0ea; } +p { margin: 0; } +form { margin: 0; } +hr { border: 0; border-top: 1px solid #a8a8a8; border-bottom: 1px solid #3a3a3a; margin: 6px 0; } +.small { font-size: 10px; } +.desc { font-size: 11px; } +.center { text-align: center; } + +#wrap { width: 95%; margin: 0 auto; } + +.inline-form { display: inline; } +.linkish { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; } + +/* --- the header: a glowing logo, the title or the big buttons, the menu */ + +.header { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4px 10px; padding: 5px 0; } +.logo { + display: flex; flex-direction: column; align-items: flex-start; justify-self: center; + padding: 16px 30px 12px 18px; + background: radial-gradient(ellipse 60% 26% at 45% 46%, rgba(255,255,255,0.55), rgba(255,255,255,0.12) 55%, transparent 75%); + text-decoration: none !important; +} +.logo-name { color: #fff; font: italic 40px/1 "Times New Roman", Georgia, serif; text-shadow: 0 0 6px rgba(255,255,255,0.6); white-space: nowrap; } +.logo-sub { margin: 6px 0 0 26px; color: #fff; font: bold 13px "Courier New", monospace; letter-spacing: 1px; } +.headright { text-align: center; } +.headtop { margin-bottom: 8px; } +.sitename { font-size: 22px; } +.posting { font-weight: bold; font-size: 14px; } +.menu { font-size: 11px; line-height: 1.6; } + +/* the big buttons: bold condensed white on a soft glow */ +.glow:link, .glow:visited { + display: inline-block; margin: 0 6px; padding: 8px 26px; + background: radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255,255,255,0.35), rgba(255,255,255,0.08) 60%, transparent 80%); + color: #fff; font: 26px/1 Impact, "Arial Narrow", "Helvetica Condensed", sans-serif; letter-spacing: 0; text-decoration: none; + text-shadow: 0 0 4px rgba(255,255,255,0.5); +} +.glow:hover { color: #e8fffe; text-shadow: 0 0 8px rgba(17,198,189,0.9); } + +.statsblock { margin: 0 0 8px; text-align: right; font-size: 11px; line-height: 1.4; } +.crumbs { margin: 4px 0 8px; font-size: 11px; } +.crumbs .fname { font-size: 13px; } +.notice { margin: 6px 0; font-size: 12px; text-align: center; font-weight: bold; } +.pagebar { margin: 4px 0 6px; font-size: 14px; } +.gotopage { font-size: 13px; } + +/* --- tables with near-black lines */ + +.tbl { margin: 0 0 6px; background: var(--line); padding: 1px; } +.tbl table { width: 100%; border-collapse: separate; border-spacing: 1px; } +.tbl td { padding: 3px; vertical-align: top; } +td.c1, tr.c1row > td { background: var(--color1); } +td.c2, tr.c2row > td { background: var(--color2); } +tr.head td { font-size: 11px; font-weight: bold; vertical-align: middle; } +td.cat { font-size: 13px; } +td.icon { width: 3%; text-align: center; vertical-align: middle; } +td.num { width: 7%; text-align: center; vertical-align: middle; } +td.last { width: 17%; text-align: center; vertical-align: middle; } +.narrowtbl { max-width: 560px; margin-left: auto; margin-right: auto; } +td.key { width: 30%; font-weight: bold; } + +/* a folder: yellow, pink when new, with dots when hot */ +.folder { + display: inline-block; position: relative; width: 11px; height: 9px; margin-top: 4px; vertical-align: middle; + border: 1px solid #5a4700; border-radius: 0 1px 1px 1px; + background: linear-gradient(#ffe680, #d9a600); +} +.folder::before { content: ""; position: absolute; left: -1px; top: -4px; width: 5px; height: 3px; border: 1px solid #5a4700; border-bottom: 0; background: #ffe680; } +.folder.new { border-color: #6b1010; background: linear-gradient(#ffb0b0, #e04848); } +.folder.new::before { border-color: #6b1010; background: #ffb0b0; } +.folder.hot::after { content: ""; position: absolute; left: 2px; top: 3px; width: 2px; height: 2px; background: #000; box-shadow: 3px 0 0 #000, 6px 0 0 #000; } + +.legend { font-size: 11px; line-height: 1.8; } +.legendrow { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; } +.legendrow .right { text-align: right; font-size: 13px; } + +/* --- a topic's posts */ + +td.author { width: 20%; } +td.said { min-width: 0; } +.posticon { display: inline-block; width: 12px; height: 9px; margin-right: 4px; vertical-align: -1px; border: 1px solid #ccc; background: linear-gradient(#fff, #9ab); } +.postbody { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; } +.likes { margin-top: 6px; } +.pbtns { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; } +.pbtn:link, .pbtn:visited, button.pbtn { + display: inline-flex; align-items: center; gap: 3px; + background: none; border: 0; padding: 0; cursor: pointer; + color: #fff; font: 10px Verdana, Arial, sans-serif; text-decoration: none; +} +.pbtn:hover { color: var(--link); } +.ico { display: inline-block; width: 12px; height: 11px; border: 1px solid #ddd; background: #fff; } +.ico.profile { background: linear-gradient(to bottom, #2a4fa8 0 3px, #fff 3px); } +.ico.like { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 15%, #f07a7a 45%, #b01010); border-color: #b01010; } +.ico.edit { background: linear-gradient(45deg, transparent 40%, #e8b400 40% 60%, transparent 60%), #fff; } +.ico.quote { background: linear-gradient(to bottom, #ffd34a, #c79300); border-color: #fff; } +.pbtns .div { display: inline-block; width: 1px; height: 14px; background: #fff; } + +/* quotes, as boards of the day showed them: "quote:" and a rule above and below */ +.citation { margin: 6px 0 0 20px; font-size: 11px; } +.citation::before { content: "quote: "; } +blockquote.quote { margin: 2px 20px 8px; padding: 3px 0; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; font-size: 12px; } +blockquote.quote:not(.citation + blockquote.quote)::before { content: "quote:"; display: block; font-size: 11px; margin-bottom: 2px; } + +/* polls */ +td.poll { padding: 8px !important; } +.pollresults { border-collapse: collapse; margin: 0 0 6px; } +.pollresults td { padding: 2px 8px 2px 0 !important; background: none !important; } +.pollresults td.bar { width: 200px; } +meter { width: 100%; height: 10px; } +meter::-webkit-meter-bar { background: #000; border: 1px solid #ccc; border-radius: 0; } +meter::-webkit-meter-optimum-value { background: linear-gradient(#7ff0ea, #0b8a84); } +meter::-moz-meter-bar { background: linear-gradient(#7ff0ea, #0b8a84); } +.poll-form { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; } + +/* --- forms */ + +input[type=text], input[type=password], input[type=search], textarea, select { + font: 13px Arial, sans-serif; color: #000; background: #fff; border: 2px inset #ddd; padding: 2px; +} +textarea { width: 100%; box-sizing: border-box; } +.button, button.button, a.button:link, a.button:visited { + display: inline-block; padding: 2px 8px; margin: 4px 2px; + font: 13px Arial, sans-serif; color: #000; text-decoration: none; cursor: pointer; + background: #d4d0c8; border: 2px outset #eee; +} +.button:active { border-style: inset; } +.button.important { font-weight: bold; } +.button.danger { color: #900; } + +/* the default theme's pages that this one shows as they are */ +.box { margin: 0 0 8px; background: var(--line); padding: 1px; } +.box > h2.maintitle { margin: 0 0 1px; padding: 3px; background: var(--color1); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; } +.box .count { margin-left: auto; font-weight: normal; font-size: 11px; } +.box-body { padding: 8px; background: var(--color2); } +.box.narrow { max-width: 480px; margin-left: auto; margin-right: auto; } +.field { display: grid; grid-template-columns: 35% 1fr; align-items: center; gap: 6px; padding: 3px 0; font-weight: bold; } +.field input, .field textarea { font-weight: normal; } +.editor .field { grid-template-columns: 1fr; } +.editor-foot { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; } +.signin .desc { margin-bottom: 6px; } +.poll-maker { margin: 8px 0; } +.poll-maker summary { cursor: pointer; color: var(--link); } +.searchform { display: flex; gap: 6px; } +.searchform input { flex: 1; } +.message { margin: 0 0 8px; padding: 4px; text-align: center; font-weight: bold; } +.message.error { color: #ff7070; } +table.board { width: 100%; border-collapse: separate; border-spacing: 1px; } +table.board th { padding: 3px; background: var(--color1); font-size: 11px; text-align: left; } +table.board td { padding: 3px; background: var(--color2); vertical-align: top; } +table.board tr:nth-child(even) td { background: var(--color1); } +table.board h3 { margin: 0; font-size: 13px; } +.snippet { font-size: 11px; } +td.none { text-align: center; } + +/* letter pictures for those without one */ +.avatar { + display: inline-flex; align-items: center; justify-content: center; + color: #fff; font: bold 14px Arial, sans-serif; + border: 1px solid #fff; + vertical-align: middle; +} +.avatar.tiny { width: 16px; height: 16px; font-size: 10px; } +.avatar.mini { width: 22px; height: 22px; font-size: 12px; } +.avatar.large { width: 50px; height: 50px; font-size: 26px; } +.avatar.huge { width: 80px; height: 80px; font-size: 40px; } +.av0 { background: #4f7bb0; } .av1 { background: #b0574f; } .av2 { background: #4f9a6b; } +.av3 { background: #8a5fb0; } .av4 { background: #c0862d; } .av5 { background: #3e8f9e; } +.av6 { background: #a24f86; } .av7 { background: #6b7a3c; } .av8 { background: #c06a3e; } +.av9 { background: #546478; } .av10 { background: #2f7f5f; } .av11 { background: #9b4545; } + +/* --- the foot */ + +.footbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px; font-size: 11px; } +.themepicker, .quicksearch { display: flex; align-items: center; gap: 4px; } +.themepicker select, .quicksearch input { font-size: 11px; } +.themepicker .button, .quicksearch .button { margin: 0; font-size: 11px; } +.tail { text-align: center; font-size: 13px; line-height: 1.5; } + +/* --- narrow screens */ + +@media (max-width: 760px) { + .header { grid-template-columns: 1fr; } + .logo-name { font-size: 30px; } + .glow:link, .glow:visited { font-size: 20px; padding: 6px 12px; } + .statsblock { text-align: left; } + td.last, td.num:nth-child(3) { display: none; } + td.author { width: 26%; } +} diff --git a/internal/forum/themes/phpbb1/area.html b/internal/forum/themes/phpbb1/area.html new file mode 100644 index 0000000..1d8826e --- /dev/null +++ b/internal/forum/themes/phpbb1/area.html @@ -0,0 +1,25 @@ +{{define "area.html"}}{{template "head" .}} +{{$b := .Body}} +{{if gt $b.Pages.Total 1}}
{{template "pages" $b.Pages}}
{{end}} +
+ + {{range $b.Topics}} + + + + + + + + {{else}} + + {{end}} +
  TopicReplies PosterDate
 {{.Root.Subject}}{{if gt .Pages 1}} (Goto page: {{$root := .Root.ID}}{{range (seq .Pages)}}{{.}} {{end}}){{end}}{{num .Replies}}{{.Root.From}}{{stamp .Last.Created}}
by {{.Last.From}}
There are no topics for this forum. {{if $b.CanPost}}You can post one here.{{end}}
+
+
+ = New Posts since your last visit ( = More than 15 posts)
+ = No New Posts since your last visit ( = More than 15 posts) +
+
{{template "pages" $b.Pages}}{{if .User}}
{{end}}
+
+{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/phpbb1/index.html b/internal/forum/themes/phpbb1/index.html new file mode 100644 index 0000000..2da301f --- /dev/null +++ b/internal/forum/themes/phpbb1/index.html @@ -0,0 +1,31 @@ +{{define "index.html"}}{{template "head" .}} +{{$st := .Body.Stats}} +
+ Our users have posted a total of -{{num $st.Posts}}- messages.
+ We have -{{num $st.Members}}- Registered Users.
+ {{with $st.Newest}}The newest Registered User is -{{.Name}}-.
{{end}} + -{{len .Body.Online}}- {{if eq (len .Body.Online) 1}}user is{{else}}users are{{end}} currently browsing the BBS.
+ {{if .User}}You are logged in as {{.User.Name}}.
{{else}}You are not logged in. Login.{{end}}
+
+
+ + {{range .Body.Categories}} + + {{range $f := .Forums}} + + + + + + + + {{end}} + {{else}} + + {{end}} +
 ForumTopicsPostsLast Post
{{.Name}}
{{$f.Area.Name}}{{if $f.Area.Description}}
{{$f.Area.Description}}{{end}}
{{num $f.Topics}}{{num $f.Area.Messages}}{{with $f.Last}}{{stamp .Created}}
by {{.From}}{{else}}No Posts{{end}}
There are no forums open to you yet.{{if not .User}} Login to see more.{{end}}
+
+ = New Posts since your last visit.
+ = No New Posts since your last visit. +
+{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/phpbb1/layout.html b/internal/forum/themes/phpbb1/layout.html new file mode 100644 index 0000000..017a2b8 --- /dev/null +++ b/internal/forum/themes/phpbb1/layout.html @@ -0,0 +1,41 @@ +{{define "head"}} + + + + +{{.BBS}} Forums - {{.Title}} + + + +
+
+ +
+
+ {{if eq .Page "area.html"}}{{if .Body.CanPost}}New Topic{{else}}{{.Body.Area.Name}}{{end}} + {{else if eq .Page "topic.html"}}{{if .Body.CanPost}}New Topic Reply{{else}}{{.Body.Root.Subject}}{{end}} + {{else if eq .Page "post.html"}}Post New Topic in:
{{.Body.Area.Name}}
+ {{else}}{{.BBS}} Forums{{end}} +
+ +
+
+{{if eq .Notice "welcome"}}

Welcome! Your account is made, and you are logged in.

{{end}} +{{if .Crumbs}}
{{if eq .Page "area.html"}}{{.Body.Area.Name}}
{{if .Body.Area.Description}}{{.Body.Area.Description}}
{{end}}{{end}}{{.BBS}} Forum Index{{range .Crumbs}} » {{if .URL}}{{.Name}}{{else}}{{.Name}}{{end}}{{end}}
{{end}} +{{end}} + +{{define "foot"}} +
+ {{template "themepicker" .}} +
+
+
{{.BBS}} Forums · Powered by bbs-sec
{{longdate .Now}}
+
+ + +{{end}} + +{{define "pages"}}{{if gt .Total 1}}Goto page ( {{if gt .Cur 1}} {{end}}{{$cur := .Cur}}{{$p := .}}{{range .Shown}}{{if eq . 0}}… {{else if eq . $cur}}{{.}} {{else}}{{.}} {{end}}{{end}}{{if .Next}} {{end}}){{end}}{{end}} diff --git a/internal/forum/themes/phpbb1/profile.html b/internal/forum/themes/phpbb1/profile.html new file mode 100644 index 0000000..06e3196 --- /dev/null +++ b/internal/forum/themes/phpbb1/profile.html @@ -0,0 +1,21 @@ +{{define "profile.html"}}{{template "head" .}} +{{$u := .Body.U}} +
+ + + + + + + + + + +
{{$u.Name}}'s Profile
User Name:{{template "avatar" (av $u.Name "mini")}} {{$u.Name}}
Rank:{{if $u.Sysop}}Administrator{{else}}{{group $u}}{{end}}
Joined:{{monthyear $u.Created}}
Last visit:{{stamp $u.LastLogin}}
Posts:{{num $u.Posts}}
Calls:{{num $u.Logins}}
Location:{{$u.Location}}
Interests:{{$u.About}}
Online:{{range .Body.On}}Node {{.Num}} by {{.Via}}: {{.Activity}}
{{else}}No{{end}}
+
+ + {{range .Body.Recent}} + + {{else}}{{end}} +
TopicDate
{{.Subject}}
{{snippet .Body 140}}
{{stamp .Created}}
No posts to show.
+{{template "foot" .}}{{end}} diff --git a/internal/forum/themes/phpbb1/topic.html b/internal/forum/themes/phpbb1/topic.html new file mode 100644 index 0000000..543f349 --- /dev/null +++ b/internal/forum/themes/phpbb1/topic.html @@ -0,0 +1,68 @@ +{{define "topic.html"}}{{template "head" .}} +{{$b := .Body}}{{$csrf := .CSRF}}{{$me := .User}} +{{if gt $b.Pages.Total 1}}
{{template "pages" $b.Pages}}
{{end}} +
+ + {{with $b.Poll}} + + {{end}} + {{range $b.Posts}} + + + + + {{end}} +
Author{{$b.Root.Subject}}
+ Poll +
+ {{if or .Voted (not $me)}} + {{range .Answers}}{{end}}
{{.Text}}{{if .Mine}} *{{end}}{{.Pct}}% [ {{.Count}} ]
+

Total Votes: {{.Total}}{{if not $me}} · Login to vote{{end}}

+ {{end}} + {{if $me}} +
+ + {{range .Answers}}{{end}} +
+
+ {{end}} +
+ {{.M.From}} + {{if .Author}}
{{if .Author.Sysop}}Administrator{{else}}{{group .Author}}{{end}} +

Joined: {{monthyear .Author.Created}}
Posts: {{num .Author.Posts}}{{if .Author.Location}}
From: {{.Author.Location}}{{end}}
+ {{else if .Where}}
From: {{.Where}}{{end}} +
+ Posted: {{stamp .M.Created}}{{if and .M.To (ne .M.To "All")}}   To: {{.M.To}}{{end}}   #{{.Num}} +
+
{{body .M.Body}}
+ {{if .Likes}}{{end}} +
+
+ {{if .Author}}profile{{end}} + {{if .CanLike}}
{{end}} + + {{if .CanDelete}}
{{end}} + {{if $b.CanPost}}quote{{end}} +
+
+
+
{{if $b.CanPost}}New Topic Reply{{end}}
+
{{template "pages" $b.Pages}}
+
+ +{{if $b.CanPost}} +
+ + + +
Reply to: {{$b.Root.Subject}}
Message Body:

Quote with > at the start of a line.
Links are made links.
+ + {{if $b.QuoteID}}{{end}} + + {{if $b.Aliases}}
{{end}} +
+
+{{else if not .User}} +

You must be logged in to reply. Login{{if .Register}} or Register{{end}}.

+{{end}} +{{template "foot" .}}{{end}}