]> bicyclesonthemoon.info Git - ott/ong1/blob - posted.awk
Update from src directory as of 26.11.2016
[ott/ong1] / posted.awk
1 #// posted.awk\r
2 #// Display one entry in the post list\r
3 #// 05.10.2014\r
4 #// \r
5 #// Copyright (C) 2014  Balthasar SzczepaƄski\r
6 #// \r
7 #// This program is free software: you can redistribute it and/or modify\r
8 #// it under the terms of the GNU Affero General Public License as\r
9 #// published by the Free Software Foundation, either version 3 of the\r
10 #// License, or (at your option) any later version.\r
11 #// \r
12 #// This program is distributed in the hope that it will be useful,\r
13 #// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14 #// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15 #// GNU Affero General Public License for more details.\r
16 #// \r
17 #// You should have received a copy of the GNU Affero General Public License\r
18 #// along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
19 \r
20 BEGIN{\r
21         FS="="\r
22 };\r
23 {\r
24         gsub(/[\r\n]/,"",$0)\r
25         eq=index($0,"=")\r
26         argtab[substr($0,1,eq-1)]=substr($0,eq+1)\r
27 };\r
28 END{\r
29         if(cat=="wt" && argtab["hidden"]!="" && fff=="")\r
30                 exit 1\r
31         if (r2==0)\r
32                 class="plw"\r
33         else\r
34                 class="plv"\r
35         \r
36         # print "<tr class=\""class"\"><td class=\"plk\">"argtab["timetext"]"</td><td class=\"plk\">"argtab["d"]"."argtab["m"]"."argtab["y"]"</td><td class=\"plk\">"argtab["username_h"]"</td><td class=\"plk\">"argtab["subject_h"]"</td><td class=\"plk\"><form method=\"post\" action=\"/ct-if-r\"><a href=\"/ct-if-v?v="cat argtab["timenumber"](fff!=""?"&amp;fff=fff":"")"\">view</a> <a href=\"/ct-if-p?q="cat argtab["timenumber"](fff!=""?"&amp;fff=fff":"")"\">quote</a> <input type=\"hidden\" name=\"r\" value=\""cat argtab["timenumber"]"\"><input type=\"submit\" value=\"remove\" class=\"hl\"></form></td></tr>"\r
37         print "<tr class=\""class"\"><td class=\"plk\">"argtab["timetext"]"</td><td class=\"plk\">"argtab["d"]"."argtab["m"]"."argtab["y"]"</td><td class=\"plk\">"argtab["username_h"]"</td><td class=\"plk\">"argtab["subject_h"]"</td><td class=\"plk\"><a href=\"/ct-if-v?v="cat argtab["timenumber"](fff!=""?"&amp;fff=fff":"")"\">view</a> <a href=\"/ct-if-p?q="cat argtab["timenumber"](fff!=""?"&amp;fff=fff":"")"\">quote</a> <a href=\"/ct-if-r?r="cat argtab["timenumber"](fff!=""?"&amp;fff=fff":"")"\">remove</a></td></tr>"\r
38 }