]> bicyclesonthemoon.info Git - ott/mirror/commitdiff
Posts sent from the mirror are now quotable. v1.2
authorb <b@23ac2ed3-cec8-4626-8109-7118d8ca9799>
Thu, 25 Sep 2014 19:40:03 +0000 (19:40 +0000)
committerb <b@23ac2ed3-cec8-4626-8109-7118d8ca9799>
Thu, 25 Sep 2014 19:40:03 +0000 (19:40 +0000)
v.1 i.2
Posts sent from the mirror are now editable.
Minor changes in the posting mechanism.
Added an interface for viewing (and quoting) recently posted posts.
Added a relinking interface.
Improved related URL relinking

git-svn-id: svn://botcastle1b/ottmirror@3 23ac2ed3-cec8-4626-8109-7118d8ca9799

23 files changed:
index.htm
ott.zip/end
ott.zip/info.htm
ott.zip/np/end
ott.zip/np/top
ott.zip/post.htm
ott.zip/prosilver/imageset/en/icon_post_quote_mustard.gif [new file with mode: 0644]
ott.zip/prosilver/theme/style.php.css
pro.zip/bb2html.awk
pro.zip/bot2.1.awk
pro.zip/makefile
pro.zip/mpview.1.cpp [new file with mode: 0644]
pro.zip/mview.1.cpp
pro.zip/mview.awk
pro.zip/pm.1.awk
pro.zip/post.1.awk
pro.zip/post.1.cpp
pro.zip/posted.1.cpp [new file with mode: 0644]
pro.zip/posted.awk [new file with mode: 0644]
pro.zip/preview.1.awk
pro.zip/re.awk
pro.zip/redirect.cpp [new file with mode: 0644]
pro.zip/verify.awk [new file with mode: 0644]

index e331bed606d3c36fde72fc55baa7350472eb4647..a4227aad08035ea69bf064b9917a95fe9077bd13 100644 (file)
--- a/index.htm
+++ b/index.htm
@@ -12,7 +12,7 @@
 <p>If you want to run your own copy of the <a href="http://1190.bicyclesonthemoon.dnsd.info/ott/">ЯOЯЯIM TTO</a>, you\r
 can, because I made it available. Follow these instructions to download and\r
 setup your own ЯOЯЯIM TTO.</p>\r
-<p>This is about version 1, iteration 1.</p>\r
+<p>This is about version 1, iteration 2.</p>\r
 <h2>Dependencies</h2>\r
 The mirror depends on some things:\r
 <ul>\r
@@ -117,6 +117,9 @@ place their content there.</li>
 <li>"<code>/ott/update</code>" should link to "<code>propath/update</code>".</li>\r
 <li>"<code>/ott/index</code>" should link to "<code>propath/index</code>".</li>\r
 <li>"<code>/ott/post</code>" should link to "<code>propath/post</code>".</li>\r
+<li>"<code>/ott/posted</code>" should link to "<code>propath/posted</code>".</li>\r
+<li>"<code>/ott/redirect</code>" should link to "<code>propath/redirect</code>".</li>\r
+<li>"<code>/ott/mpview</code>" should link to "<code>propath/mpview</code>".</li>\r
 <li>"<code>/ott</code>" should link to "<code>propath/index</code>".</li>\r
 </ul>\r
 <p>That's how I did it in apache2:<br>\r
@@ -134,6 +137,9 @@ ScriptAlias /ott/mview /eizm/pro/ottmirror/mview<br>
 ScriptAlias /ott/update /eizm/pro/ottmirror/update<br>\r
 ScriptAlias /ott/index /eizm/pro/ottmirror/index<br>\r
 ScriptAlias /ott/post /eizm/pro/ottmirror/post<br>\r
+ScriptAlias /ott/posted /eizm/pro/ottmirror/posted<br>\r
+ScriptAlias /ott/redirect /eizm/pro/ottmirror/redirect<br>\r
+ScriptAlias /ott/mpview /eizm/pro/ottmirror/mpview<br>\r
 ScriptAliasMatch ^/ott/?$ /eizm/pro/ottmirror/index<br>\r
 </code>\r
 </p>\r
@@ -256,7 +262,16 @@ in next update.
  -->\r
 <h2>Changes</h2>\r
 <ul>\r
-       <li>v.1, i.1 (12.08.2014):\r
+       <li>v.1, i.2 (25.09.2014):\r
+       <ul>\r
+               <li>Posts sent from the mirror are now quotable.</li>\r
+               <li>Posts sent from the mirror are now editable.</li>\r
+               <li>Minor changes in the posting mechanism.</li>\r
+               <li>Added an interface for viewing (and quoting) recently posted posts.</li>\r
+               <li>Added a relinking interface.</li>\r
+               <li>Improved related URL relinking</li>\r
+       </ul></li>\r
+       <li><a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/1.1">v.1, i.1 (12.08.2014):</a>\r
        <ul>\r
                <li>Added AGPL license.</li>\r
                <li>Added BBcode to HTML translation.</li>\r
@@ -270,11 +285,12 @@ in next update.
 \r
 <h2>Copyright, license, etc.</h2>\r
 <p>The code (in pro.zip) is written by me, Balthasar Szczepański and is released\r
-under the <a href="//http://www.gnu.org/licenses/agpl.html">AGPL 3</a>license\r
-since version 1, iteration 0. v.1, i.0 doesn't have any license defined.</p>\r
+under the <a href="http://www.gnu.org/licenses/agpl.html">AGPL 3</a> license\r
+since version 1, iteration 0.<br>\r
+Version.1, iteration.0 doesn't have any license defined.</p>\r
 <p>The resources in ott.zip contain HTML, CSS, Javascript and images from <a\r
 href="http://www.phpbb.com/">phpBB</a> which is released under the <a\r
-href="http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html">GPL 2</a> license. \r
+href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GPL 2</a> license. \r
 \r
 <h2>Congratulations</h2>\r
 <p>If you managed to do everything described here you should have your own ЯOЯЯIM \r
index 5280732058330ef87bc98496520dfe35fa928198..ea3c80ed157719f3d5385c02ae5f8b3df7c65dd2 100644 (file)
 </div>
 <div class="search-box"> 
 <form method="get" action="/ott/view" >
-go to newpage:
+<div>go to newpage:
 <input class="inputbox tiny np" type="text" name="np" size="6" /> 
 <input class="button2" type="submit" value="goto" /> 
+</div>
 </form>
 </div>
 
@@ -25,95 +26,54 @@ go to newpage:
 
 </div>
 <p></p><p><a href="http://forums.xkcd.com/index.php" class="left-box left" >Return to Board index</a></p>
-<form method="post" id="jumpbox" action="http://forums.xkcd.com/viewforum.php" onsubmit="if(this.f.value == -1){return false;}" >
+<form method="get" id="jumpbox" action="/ott/redirect" onsubmit="if(this.f.value == -1){return false;}" >
 
 <fieldset class="jumpbox" >
 
 <label for="f" accesskey="j" >Jump to:</label>
 <select name="f" id="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }" >
 
-<option value="-1" >Select a forum</option>
-<option value="-1" >------------------</option>
-<option value="26" >The Comic</option>
-
-<option value="7" selected="selected" >&nbsp; &nbsp;Individual XKCD Comic Threads</option>
-
-<option value="60" >&nbsp; &nbsp;What If?</option>
-
-<option value="27" >Sound and Fury</option>
-
-<option value="9" >&nbsp; &nbsp;News &amp; Articles</option>
-
-<option value="8" >&nbsp; &nbsp;Serious Business</option>
-
-<option value="16" >&nbsp; &nbsp;XKCD Meetups</option>
-
-<option value="2" >&nbsp; &nbsp;General</option>
-
-<option value="29" >Numberologics, Alchemy, Linguinomics, and other Academiology</option>
-
-<option value="17" >&nbsp; &nbsp;Mathematics</option>
-
-<option value="18" >&nbsp; &nbsp;Science</option>
-
-<option value="59" >&nbsp; &nbsp;&nbsp; &nbsp;Fictional Science</option>
-
-<option value="25" >&nbsp; &nbsp;Language/Linguistics</option>
-
-<option value="44" >&nbsp; &nbsp;School</option>
-
-<option value="30" >Analytical Engines</option>
-
-<option value="20" >&nbsp; &nbsp;The Help Desk</option>
-
-<option value="11" >&nbsp; &nbsp;Coding</option>
-
-<option value="12" >&nbsp; &nbsp;Computer Science</option>
-
-<option value="36" >&nbsp; &nbsp;Hardware</option>
-
-<option value="40" >&nbsp; &nbsp;Religious Wars</option>
-
-<option value="31" >Enigmas and Diversions</option>
-
-<option value="3" >&nbsp; &nbsp;Logic Puzzles</option>
-
-<option value="14" >&nbsp; &nbsp;Forum Games</option>
-
-<option value="53" >&nbsp; &nbsp;&nbsp; &nbsp;Mafia</option>
-
-<option value="4" >&nbsp; &nbsp;Your art and links</option>
-
-<option value="43" >&nbsp; &nbsp;Fit Club</option>
-
-<option value="32" >High Culture</option>
-
-<option value="21" >&nbsp; &nbsp;Gaming</option>
-
-<option value="22" >&nbsp; &nbsp;Movies and TV Shows</option>
-
-<option value="23" >&nbsp; &nbsp;Music</option>
-
-<option value="24" >&nbsp; &nbsp;Books</option>
-
-<option value="49" >&nbsp; &nbsp;&nbsp; &nbsp;Comics/Graphic Novels</option>
-
-<option value="39" >&nbsp; &nbsp;Food</option>
-
-<option value="33" >Site Administration</option>
-
-<option value="10" >&nbsp; &nbsp;Site/Forum issues</option>
-
-<option value="5" >&nbsp; &nbsp;News</option>
-
-<option value="52" >Duat</option>
-
-<option value="47" >&nbsp; &nbsp;Free as in Destitute</option>
-
-<option value="51" >&nbsp; &nbsp;&nbsp; &nbsp;Jesse is a handsome and intelligent man who smells nice</option>
-
-<option value="55" >&nbsp; &nbsp;&nbsp; &nbsp;Azrael is pretty cool also</option>
-
+<option value="http://chirpingmustard.com" >Chirping Mustard (.com)</option>
+<option value="/ott" >------------------</option>
+<option value="http://xkcd.com/1190" >the OTC</option>
+<option value="http://xkcd.mscha.org">&nbsp; &nbsp;mscha</option>
+<option value="http://geekwagon.net/projects/xkcd1190/" >&nbsp; &nbsp;geekwagon</option>
+<option value="http://xkcd.aubronwood.com" >&nbsp; &nbsp;aubronwood</option>
+<option value="http://mrob.com/time/replay/index.html" >&nbsp; &nbsp;Time replay</option>
+<option value="http://xkcd.modularthought.com/TimeDragsOn" >&nbsp; &nbsp;Time drags on</option>
+<option value="http://xkcdtime.comicsfu.com/" >&nbsp; &nbsp;Time ebook</option>
+<option value="http://xkcd.mscha.org/timeaftertime.html" >time after Time</option>
+<option value="http://xkcd.mscha.org/vieweraftertime/prickly0001" >&nbsp; &nbsp;Prickly, Lucky</option>
+<option value="http://xkcd.mscha.org/vieweraftertime/beany0001" >&nbsp; &nbsp;Beany 1</option>
+<option value="http://xkcd.mscha.org/vieweraftertime/bean2-001" >&nbsp; &nbsp;Beany 2</option>
+<option value="http://xkcd.mscha.org/vieweraftertime/t1i-0000" >&nbsp; &nbsp;t1i</option>
+<option value="http://" >meta time after Time</option>
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ongoing.htm?f=0" >&nbsp; &nbsp;bftf</option>
+<option value="http://forums.xkcd.com/viewtopic.php?f=7&amp;t=101043" >the OTT</option>
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ott">&nbsp; &nbsp;the ЯOЯЯIM TTO</option>
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ott/mview" >&nbsp; &nbsp;&nbsp; &nbsp;the Mustardtime Otherthread</option>
+<option value="http://contingency.chirpingmustard.com">&nbsp; &nbsp;the Raftcastle</option>
+<option value="http://xkcd-time.wikia.com/wiki/Useful_External_Links" >resources</option>
+<option value="http://wiki.chirpingmustard.com" >&nbsp; &nbsp;the Wiki</option>
+<option value="http://db.chirpingmustard.com" >&nbsp; &nbsp;the Database</option>
+<option value="http://mrob.com/time" >&nbsp; &nbsp;the mr*bdex</option>
+<option value="http://xkcd-time.kieryn.com/" >&nbsp; &nbsp;Kieryn's dedication</option>
+<option value="http://edfel.atwebpages.com/Time-Map.php" >&nbsp; &nbsp;the Time map</option>
+<option value="http://ottermap.chirpingmustard.com" >&nbsp; &nbsp;the OTTer map</option>
+<option value="https://github.com/Pikrass/timescripts" >&nbsp; &nbsp;Pirkass' scripts</option>
+<option value="http://mrob.com/time/scripts-beta/index.html" >&nbsp; &nbsp;mrob27's scripts</option>
+<option value="http://xkcd.mscha.org/sciscitor/" >&nbsp; &nbsp;constellations</option>
+<option value="http://xkcd.mscha.org/jjjdavidson/" >&nbsp; &nbsp;graphs and stuff</option>
+<option value="http://calendar.chirpingmustard.com/" >&nbsp; &nbsp;the Ecclesiastical Calendar</option>
+<option value="http://xkcd-time.wikia.com/wiki/Games" >hotdogs</option>
+<option value="http://castle.chirpingmustard.com/" >&nbsp; &nbsp;Sandcastle Builder</option>
+<option value="http://mrob.com/time/Q04B/" >&nbsp; &nbsp;Q04B</option>
+<option value="http://kayzgames.itch.io/pfffth?secret=DuJYQ4KCOiZojPbSLXF7gTxoF9c%3d" >&nbsp; &nbsp;PFFFTH!</option>
+<option value="http://thred.github.io/xkcd-time-catapult/#0fbc" >&nbsp; &nbsp;the Trebuchet game</option>
+<option value="http://mrob.com/time/chirp.html" >&nbsp; &nbsp;Chirpy Raptor</option>
+<option value="http://automome.chirpingmustard.com/" >&nbsp; &nbsp;AUTOMOME (Link)</option>
+<option value="http://mrob.com/time/automome" >&nbsp; &nbsp;AUTOMOME (mrob27)</option>
+<option value="http://xkcd.modularthought.com/ottomeme/" >&nbsp; &nbsp;OTToMeme</option>
 </select>
 <input type="submit" value="Go" class="button2" />
 </fieldset>
@@ -139,14 +99,14 @@ go to newpage:
 Downloaded and archived by <a href="http://1190.bicyclesonthemoon.dnsd.info/bothasar_t/"><b>bot</b>hasar_<b>t</b></a><br/>
 OTT MIRROR by Balthasar Szczepański, 2014 <br/>
 Relaeased under the <a href="http://www.gnu.org/licenses/agpl.html">AGPL3 license</a><br/>
-The sources and instructions are available <a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/">here</a><br>
-Contains HTML, CSS, JavaScript and images from <a href="http://www.phpbb.com/"> phpBB </a> &reg; Forum Software &copy; phpBB Group<br>
+The sources and instructions are available <a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/">here</a><br/>
+Contains HTML, CSS, JavaScript and images from <a href="http://www.phpbb.com/"> phpBB </a> &reg; Forum Software &copy; phpBB Group<br/>
 
 </div>
 &lt;computery stuff&gt;:<br/>
 <div style="margin:20px; margin-top:5px">
        <div class="quotetitle">
-               <b>Spoiler:</b> <input value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" type="button">
+               <b>Spoiler:</b> <input value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" type="button" />
        </div>
        <div class="quotecontent">
                <div style="display: none;">
index 9868cb2bb77bb2bfcfa6d2dbb812e302c4198805..a59dfbc5b9286a4f5eb8e77fb8d806deaa22526c 100644 (file)
 <div class="copyright">
 OTT MIRROR by Balthasar Szczepański, 2014 <br/>
 Relaeased under the <a href="http://www.gnu.org/licenses/agpl.html">AGPL3 license</a><br/>
-The sources and instructions are available <a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/">here</a><br>
-Contains HTML, CSS, JavaScript and images from <a href="http://www.phpbb.com/"> phpBB </a> &reg; Forum Software &copy; phpBB Group<br>
+The sources and instructions are available <a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/">here</a><br/>
+Contains HTML, CSS, JavaScript and images from <a href="http://www.phpbb.com/"> phpBB </a> &reg; Forum Software &copy; phpBB Group<br/>
 
 </div>
 &lt;computery stuff&gt;:<br/>
 <div style="margin:20px; margin-top:5px">
        <div class="quotetitle">
-               <b>Spoiler:</b> <input value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" type="button">
+               <b>Spoiler:</b> <input value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" type="button"/>
        </div>
        <div class="quotecontent">
                <div style="display: none;">
index 490df8832f64d0e11ecc8ef107d474e41639591c..e548c1513f5297bec518fad6350cc9e3789636a0 100644 (file)
@@ -22,56 +22,59 @@ go to newpage:
 ###links\r
 </div>\r
 <p></p><p><a href="http://forums.xkcd.com/viewforum.php?f=7" class="left-box left" >Return to Individual XKCD Comic Threads</a></p>\r
-<form method="post" id="jumpbox" action="http://forums.xkcd.com/viewforum.php" onsubmit="if(this.f.value == -1){return false;}" >\r
+<form method="get" id="jumpbox" action="/ott/redirect" onsubmit="if(this.f.value == -1){return false;}" >\r
+\r
 <fieldset class="jumpbox" >\r
+\r
 <label for="f" accesskey="j" >Jump to:</label>\r
 <select name="f" id="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }" >\r
-<option value="-1" >Select a forum</option>\r
-<option value="-1" >------------------</option>\r
-<option value="26" >The Comic</option>\r
-<option value="7" selected="selected" >&nbsp; &nbsp;Individual XKCD Comic Threads</option>\r
-<option value="60" >&nbsp; &nbsp;What If?</option>\r
-<option value="27" >Sound and Fury</option>\r
-<option value="9" >&nbsp; &nbsp;News &amp; Articles</option>\r
-<option value="8" >&nbsp; &nbsp;Serious Business</option>\r
-<option value="16" >&nbsp; &nbsp;XKCD Meetups</option>\r
-<option value="2" >&nbsp; &nbsp;General</option>\r
-<option value="29" >Numberologics, Alchemy, Linguinomics, and other Academiology</option>\r
-<option value="17" >&nbsp; &nbsp;Mathematics</option>\r
-<option value="18" >&nbsp; &nbsp;Science</option>\r
-<option value="59" >&nbsp; &nbsp;&nbsp; &nbsp;Fictional Science</option>\r
-<option value="25" >&nbsp; &nbsp;Language/Linguistics</option>\r
-<option value="44" >&nbsp; &nbsp;School</option>\r
-<option value="30" >Analytical Engines</option>\r
-<option value="20" >&nbsp; &nbsp;The Help Desk</option>\r
-<option value="11" >&nbsp; &nbsp;Coding</option>\r
-<option value="12" >&nbsp; &nbsp;Computer Science</option>\r
-<option value="36" >&nbsp; &nbsp;Hardware</option>\r
-<option value="40" >&nbsp; &nbsp;Religious Wars</option>\r
-<option value="31" >Enigmas and Diversions</option>\r
-<option value="3" >&nbsp; &nbsp;Logic Puzzles</option>\r
-<option value="14" >&nbsp; &nbsp;Forum Games</option>\r
-<option value="53" >&nbsp; &nbsp;&nbsp; &nbsp;Mafia</option>\r
-<option value="4" >&nbsp; &nbsp;Your art and links</option>\r
-<option value="43" >&nbsp; &nbsp;Fit Club</option>\r
-<option value="32" >High Culture</option>\r
-<option value="21" >&nbsp; &nbsp;Gaming</option>\r
-<option value="22" >&nbsp; &nbsp;Movies and TV Shows</option>\r
-<option value="23" >&nbsp; &nbsp;Music</option>\r
-<option value="24" >&nbsp; &nbsp;Books</option>\r
-<option value="49" >&nbsp; &nbsp;&nbsp; &nbsp;Comics/Graphic Novels</option>\r
-<option value="39" >&nbsp; &nbsp;Food</option>\r
-<option value="33" >Site Administration</option>\r
-<option value="10" >&nbsp; &nbsp;Site/Forum issues</option>\r
-<option value="5" >&nbsp; &nbsp;News</option>\r
-<option value="52" >Duat</option>\r
-<option value="47" >&nbsp; &nbsp;Free as in Destitute</option>\r
-<option value="51" >&nbsp; &nbsp;&nbsp; &nbsp;Jesse is a handsome and intelligent man who smells nice</option>\r
-<option value="55" >&nbsp; &nbsp;&nbsp; &nbsp;Azrael is pretty cool also</option>\r
+\r
+<option value="http://chirpingmustard.com" >Chirping Mustard (.com)</option>\r
+<option value="/ott" >------------------</option>\r
+<option value="http://xkcd.com/1190" >the OTC</option>\r
+<option value="http://xkcd.mscha.org">&nbsp; &nbsp;mscha</option>\r
+<option value="http://geekwagon.net/projects/xkcd1190/" >&nbsp; &nbsp;geekwagon</option>\r
+<option value="http://xkcd.aubronwood.com" >&nbsp; &nbsp;aubronwood</option>\r
+<option value="http://mrob.com/time/replay/index.html" >&nbsp; &nbsp;Time replay</option>\r
+<option value="http://xkcd.modularthought.com/TimeDragsOn" >&nbsp; &nbsp;Time drags on</option>\r
+<option value="http://xkcdtime.comicsfu.com/" >&nbsp; &nbsp;Time ebook</option>\r
+<option value="http://xkcd.mscha.org/timeaftertime.html" >time after Time</option>\r
+<option value="http://xkcd.mscha.org/vieweraftertime/prickly0001" >&nbsp; &nbsp;Prickly, Lucky</option>\r
+<option value="http://xkcd.mscha.org/vieweraftertime/beany0001" >&nbsp; &nbsp;Beany 1</option>\r
+<option value="http://xkcd.mscha.org/vieweraftertime/bean2-001" >&nbsp; &nbsp;Beany 2</option>\r
+<option value="http://xkcd.mscha.org/vieweraftertime/t1i-0000" >&nbsp; &nbsp;t1i</option>\r
+<option value="http://" >meta time after Time</option>\r
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ongoing.htm?f=0" >&nbsp; &nbsp;bftf</option>\r
+<option value="http://forums.xkcd.com/viewtopic.php?f=7&amp;t=101043" >the OTT</option>\r
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ott">&nbsp; &nbsp;the ЯOЯЯIM TTO</option>\r
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ott/mview" >&nbsp; &nbsp;&nbsp; &nbsp;the Mustardtime Otherthread</option>\r
+<option value="http://contingency.chirpingmustard.com">&nbsp; &nbsp;the Raftcastle</option>\r
+<option value="http://xkcd-time.wikia.com/wiki/Useful_External_Links" >resources</option>\r
+<option value="http://wiki.chirpingmustard.com" >&nbsp; &nbsp;the Wiki</option>\r
+<option value="http://db.chirpingmustard.com" >&nbsp; &nbsp;the Database</option>\r
+<option value="http://mrob.com/time" >&nbsp; &nbsp;the mr*bdex</option>\r
+<option value="http://xkcd-time.kieryn.com/" >&nbsp; &nbsp;Kieryn's dedication</option>\r
+<option value="http://edfel.atwebpages.com/Time-Map.php" >&nbsp; &nbsp;the Time map</option>\r
+<option value="http://ottermap.chirpingmustard.com" >&nbsp; &nbsp;the OTTer map</option>\r
+<option value="https://github.com/Pikrass/timescripts" >&nbsp; &nbsp;Pirkass' scripts</option>\r
+<option value="http://mrob.com/time/scripts-beta/index.html" >&nbsp; &nbsp;mrob27's scripts</option>\r
+<option value="http://xkcd.mscha.org/sciscitor/" >&nbsp; &nbsp;constellations</option>\r
+<option value="http://xkcd.mscha.org/jjjdavidson/" >&nbsp; &nbsp;graphs and stuff</option>\r
+<option value="http://calendar.chirpingmustard.com/" >&nbsp; &nbsp;the Ecclesiastical Calendar</option>\r
+<option value="http://xkcd-time.wikia.com/wiki/Games" >hotdogs</option>\r
+<option value="http://castle.chirpingmustard.com/" >&nbsp; &nbsp;Sandcastle Builder</option>\r
+<option value="http://mrob.com/time/Q04B/" >&nbsp; &nbsp;Q04B</option>\r
+<option value="http://kayzgames.itch.io/pfffth?secret=DuJYQ4KCOiZojPbSLXF7gTxoF9c%3d" >&nbsp; &nbsp;PFFFTH!</option>\r
+<option value="http://thred.github.io/xkcd-time-catapult/#0fbc" >&nbsp; &nbsp;the Trebuchet game</option>\r
+<option value="http://mrob.com/time/chirp.html" >&nbsp; &nbsp;Chirpy Raptor</option>\r
+<option value="http://automome.chirpingmustard.com/" >&nbsp; &nbsp;AUTOMOME (Link)</option>\r
+<option value="http://mrob.com/time/automome" >&nbsp; &nbsp;AUTOMOME (mrob27)</option>\r
+<option value="http://xkcd.modularthought.com/ottomeme/" >&nbsp; &nbsp;OTToMeme</option>\r
 </select>\r
 <input type="submit" value="Go" class="button2" />\r
 </fieldset>\r
 </form>\r
+\r
 <h3>Who is online</h3>\r
 <p> Users browsing this forum: NaN registered users and NaN guests</p>\r
 </div>\r
@@ -91,8 +94,8 @@ go to newpage:
 Downloaded and archived by <a href="http://1190.bicyclesonthemoon.dnsd.info/bothasar_t/"><b>bot</b>hasar_<b>t</b></a><br/>\r
 OTT MIRROR by Balthasar Szczepański, 2014 <br/>\r
 Relaeased under the <a href="http://www.gnu.org/licenses/agpl.html">AGPL3 license</a><br/>\r
-The sources and instructions are available <a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/">here</a><br>\r
-Contains HTML, CSS, JavaScript and images from <a href="http://www.phpbb.com/"> phpBB </a> &reg; Forum Software &copy; phpBB Group<br>\r
+The sources and instructions are available <a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/">here</a><br/>\r
+Contains HTML, CSS, JavaScript and images from <a href="http://www.phpbb.com/"> phpBB </a> &reg; Forum Software &copy; phpBB Group<br/>\r
 \r
 </div>\r
 &lt;computery stuff&gt;:<br/>\r
index 2cc6506714133c789ebb37131b7f76f888846eee..413dcc92c01ebbf14d571bb552593bb4b4313b73 100644 (file)
@@ -127,9 +127,10 @@ eval(onunload_functions[i]);
 </div>\r
 <div class="search-box"> \r
 <form method="get" action="/ott/view" >\r
-go to newpage:\r
+<div>go to newpage:\r
 <input class="inputbox tiny np" type="text" name="np" size="6" /> \r
-<input class="button2" type="submit" value="goto" /> \r
+<input class="button2" type="submit" value="goto" />\r
+</div> \r
 </form>\r
 </div>\r
 ###links\r
index 55be61a598a1d34c5f0ad94e006d93db1cfbc5d8..678b6080c107a3afcb7b25b55a544555f1d04007 100644 (file)
        </dl>
        <dl>
                        <dt><label for="password">Password:</label></dt>
-                       <dd><input tabindex="3" id="password" name="password" size="45" class="inputbox autowidth" type="password"></dd>
-                       <dd><b>Warning</b>: The mirror can't verify your username or password.</dd>
+                       <dd><input tabindex="3" id="password" name="password" size="45" class="inputbox autowidth" type="text" /></dd>
+                       <!-- <dd><b>Warning</b>: The mirror can't verify your username or password.</dd>
+                       <dd>Use your xkcd forum username and password.</dd> -->
+               </dl>
+       <dl>
+                       <dt><label for="warning">Warning:</label></dt>
+                       <dd>The mirror can't verify your username or password.</dd>
+                       <dd>Use your xkcd forum username and password.</dd>
                </dl>
        <script type="text/javascript">
 // <![CDATA[
                        
 ###notify
                        
+###forceID
                </fieldset>
        
                <!-- TIME! -->
 Mustardtime ptsting by <a href="http://1190.bicyclesonthemoon.dnsd.info/bothasar_p/"><b>bot</b>hasar_<b>p</b></a><br/>
 OTT MIRROR by Balthasar Szczepański, 2014 <br/>
 Relaeased under the <a href="http://www.gnu.org/licenses/agpl.html">AGPL3 license</a><br/>
-The sources and instructions are available <a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/">here</a><br>
-Contains HTML, CSS, JavaScript and images from <a href="http://www.phpbb.com/"> phpBB </a> &reg; Forum Software &copy; phpBB Group<br>
+The sources and instructions are available <a href="http://1190.bicyclesonthemoon.dnsd.info/ottmirror/">here</a><br/>
+Contains HTML, CSS, JavaScript and images from <a href="http://www.phpbb.com/"> phpBB </a> &reg; Forum Software &copy; phpBB Group<br/>
 
 </div>
 &lt;computery stuff&gt;:<br/>
 <div style="margin:20px; margin-top:5px">
        <div class="quotetitle">
-               <b>Spoiler:</b> <input value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" type="button">
+               <b>Spoiler:</b> <input value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" type="button"/>
        </div>
        <div class="quotecontent">
                <div style="display: none;">
diff --git a/ott.zip/prosilver/imageset/en/icon_post_quote_mustard.gif b/ott.zip/prosilver/imageset/en/icon_post_quote_mustard.gif
new file mode 100644 (file)
index 0000000..dad82bb
Binary files /dev/null and b/ott.zip/prosilver/imageset/en/icon_post_quote_mustard.gif differ
index b95d01020b1e7a989c10ce0a58b5fab010852872..7b737d92173609200f21889dcb62281d7ac6bd55 100644 (file)
@@ -1812,6 +1812,7 @@ ul.profile-icons li a:hover { background: none; }
 .jabber-icon, .jabber-icon a           { background: none top left no-repeat; }
 .pm-icon, .pm-icon a                           { background: none top left no-repeat; }
 .quote-icon, .quote-icon a             { background: none top left no-repeat; }
+.quote-icon-mustard, .quote-icon-mustard a             { background: none top left no-repeat; }
 
 /* Moderator icons */
 .report-icon, .report-icon a           { background: none top left no-repeat; }
@@ -1830,6 +1831,7 @@ ul.profile-icons li.icq-icon      { width: 20px; height: 20px; }
 ul.profile-icons li.jabber-icon        { width: 20px; height: 20px; }
 ul.profile-icons li.pm-icon            { width: 28px; height: 20px; }
 ul.profile-icons li.quote-icon { width: 54px; height: 20px; }
+ul.profile-icons li.quote-icon-mustard { width: 54px; height: 20px; }
 ul.profile-icons li.report-icon        { width: 20px; height: 20px; }
 ul.profile-icons li.edit-icon  { width: 42px; height: 20px; }
 ul.profile-icons li.delete-icon        { width: 20px; height: 20px; }
@@ -1839,6 +1841,7 @@ ul.profile-icons li.warn-icon     { width: 20px; height: 20px; }
 /* Fix profile icon default margins */
 ul.profile-icons li.edit-icon  { margin: 0 0 0 3px; }
 ul.profile-icons li.quote-icon { margin: 0 0 0 10px; }
+ul.profile-icons li.quote-icon-mustard { margin: 0 0 0 10px; }
 ul.profile-icons li.info-icon, ul.profile-icons li.report-icon { margin: 0 3px 0 0; }
 /* Control Panel Styles
 ---------------------------------------- */
@@ -3505,6 +3508,7 @@ a.fontsize {
 .jabber-icon, .jabber-icon a           { background-image: url("/ott/prosilver/imageset/icon_contact_jabber.gif"); }
 .pm-icon, .pm-icon a                           { background-image: url("/ott/prosilver/imageset/en/icon_contact_pm.gif"); }
 .quote-icon, .quote-icon a             { background-image: url("/ott/prosilver/imageset/en/icon_post_quote.gif"); }
+.quote-icon-mustard, .quote-icon-mustard a             { background-image: url("/ott/prosilver/imageset/en/icon_post_quote_mustard.gif"); }
 
 /* Moderator icons */
 .report-icon, .report-icon a           { background-image: url("/ott/prosilver/imageset/icon_post_report.gif"); }
index c03b8c293e5607cf10d9dcbedf8cda70cc7def87..f387c52176296ee05b845b3b348cb9271fdd3e3a 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright (C) 2014 Balthasar Szczepański\r
 # bb2html.awk\r
 # translate BBcode to HTML and add to post file.\r
-# 12.09.2014\r
+# 17.09.2014\r
 \r
 # This file is part of OTT mirror.\r
 #\r
@@ -456,8 +456,14 @@ function bb2html(text,   depth,count,bbtree,html,tag,tagstart,taglength,elm,tagv
                {\r
                        tag=bbtree[ind(count,depth)]\r
                        debug = debug "###nl;text: "tag\r
+                       if(bbtree[indt(count,depth)".t"] == "code")\r
+                       {\r
+                               # gsub(/ ?<br> ?/,"<br>",tag)\r
+                               gsub(/ /,"\\&nbsp;",tag)\r
+                               gsub(/\t/,"\\&nbsp;&nbsp;",tag)\r
+                       }\r
                        if(argtab["disable_magic_url"]==""&& bbtree[indt(count,depth)".t"] !~ /^((code)|(img)|(url))$/)\r
-                               gsub(/https?:\/\/[^\n\r\t ]+/,"<a href=\"&\" class=\"postlink\">&</a>",tag)\r
+                               gsub(/https?:\/\/[^\n\r\t<> ]+/,"<a href=\"&\" class=\"postlink\">&</a>",tag)\r
                        if(argtab["disable_smilies"]=="" && bbtree[indt(count,depth)".t"] !~ /^((code)|(img))$/)\r
                        {\r
                                gsub(/(^|[\n\r\t ]):D($|[\n\r\t ])/," <img title=\"Very Happy\" alt=\":D\" src=\"/ott/prosilver/smilies/icon_biggrin.gif\" /> ",tag)\r
index 2d50ab11598ac75728c4b341544f7bda1397c949..187a70fd9510486a1e293ca38c9861fe94e3cdc0 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright (C) 2014 Balthasar Szczepański
 # bot2.awk (bothasar_t)
 # relinking, archiving avatars, attachments, images.
-# 12.09.2014
+# 17.09.2014
 
 # This file is part of OTT mirror.
 #
@@ -98,9 +98,12 @@ BEGIN {
                                {
                                        np=(arr2[2]/40)+1
                                }
-                               else if(arr2[1]=="p")
+                               else if(arr2[1]=="p"||arr[j]~/p[0-9]+/)
                                {
-                                       p=arr2[2]
+                                       if(arr2[1]=="p")
+                                               p=arr2[2]
+                                       else
+                                               p=substr(arr[j],2)
                                        if((related==0)||(np==0))
                                        {
                                                printf("%s %s > %s\n",findpost_path,p,tempfile)|"sh"
@@ -382,6 +385,7 @@ BEGIN {
        {
                print "<ul class=\"profile-icons\" >" >> outfile
                print "<li class=\"quote-icon\" ><a title=\"Reply with quote\" href=\"###foraaddr;/posting.php?mode=quote&amp;f=7&amp;p=" id "\" ></a></li>" >> outfile
+               print "<li class=\"quote-icon-mustard\" ><a title=\"Reply with quote\" href=\"/ott/post?q=p" id "\" ></a></li>" >> outfile
                print "</ul>" >> outfile
        }
 };
index 073249a3e3674d12fad2a570763dbd39adfe501c..05d4d0d98a338c74becc489ecccb59bf177c1a0f 100644 (file)
@@ -5,7 +5,7 @@ AI=mawk -f
 
 
 
-all: bot2 bot3 findpost image view mview index update post enable
+all: bot2 bot3 findpost image view mview mpview index update post posted redirect enable
 
 bot2: bot2.cpp bot2.awk findlatest.awk list.awk upload.awk index.awk makefile
        $(CC) $(CF) -o bot2 bot2.cpp
@@ -25,17 +25,26 @@ view: view.cpp view.awk makefile
 mview: mview.cpp view.awk mview.awk makefile
        $(CC) $(CF) -o mview mview.cpp $(LF1)
 
+mpview: mpview.cpp view.awk mview.awk makefile
+       $(CC) $(CF) -o mpview mpview.cpp $(LF1)
+
 update: update.cpp bot2 makefile
        $(CC) $(CF) -o update update.cpp $(LF1)
 
 index: index.cpp makefile
        $(CC) $(CF) -o index index.cpp $(LF1)
 
-post: post.cpp preview.awk view.awk bb2html.awk makefile
+post: post.cpp preview.awk view.awk bb2html.awk verify.awk makefile
        $(CC) $(CF) -o post post.cpp $(LF1)
 
-enable: post update view mview
-       chmod u+s post update view mview
+posted: posted.cpp posted.awk makefile
+       $(CC) $(CF) -o posted posted.cpp $(LF1)
+
+redirect: redirect.cpp makefile
+       $(CC) $(CF) -o redirect redirect.cpp $(LF1)
+
+enable: post update view mview posted
+       chmod u+s post update view mview posted
 
 
        
@@ -54,9 +63,15 @@ index.cpp: index.1.cpp re.awk makefile
 mview.cpp: mview.1.cpp re.awk makefile
        $(AI) re.awk mview.1.cpp > mview.cpp
 
+mpview.cpp: mpview.1.cpp re.awk makefile
+       $(AI) re.awk mpview.1.cpp > mpview.cpp
+
 post.cpp: post.1.cpp re.awk makefile
        $(AI) re.awk post.1.cpp > post.cpp
 
+posted.cpp: posted.1.cpp re.awk makefile
+       $(AI) re.awk posted.1.cpp > posted.cpp
+
 update.cpp: update.1.cpp re.awk makefile
        $(AI) re.awk update.1.cpp > update.cpp
 
diff --git a/pro.zip/mpview.1.cpp b/pro.zip/mpview.1.cpp
new file mode 100644 (file)
index 0000000..44858a9
--- /dev/null
@@ -0,0 +1,160 @@
+// OTT mirror
+// Copyright (C) 2014 Balthasar Szczepański
+// mpview.cpp
+// view a post from the mirror.
+// 02.09.2014
+//
+// This file is part of OTT mirror.
+//
+// OTT mirror is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affreo General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+// 
+// OTT mirror 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 Affreo General Public License for more details.
+// 
+// You should have received a copy of the GNU Affreo General Public License
+// along with OTT mirror. If not, see <http://www.gnu.org/licenses/>.
+
+#include <cgi.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+###RM_PATH
+###CAT_PATH
+###MAWK_PATH
+
+###NP_TOP_PATH
+###NP_END_PATH
+###INFO_PATH
+###POST_PATH3
+###OK_PATH3
+###PM_PATH3
+###FAIL_PATH3
+// ###POSTLIST_PATH3
+// ###LAST_PATH3
+
+###AWK_VIEW
+###AWK_MVIEW
+###TEMP_PATHm
+
+int main()
+{
+       s_cgi *cgi;
+       pid_t sub;
+       int r;
+       
+       char line[32];
+       char filename[32];
+       char postpath[256];
+       char cat[8];
+       
+       char *arg;
+       
+       char path2[256];
+       char left[256];
+       char right[256];
+       char links[256];
+       
+       cgi=cgiInit();
+       
+       printf("Content-type: text/html\n\n");
+       
+       arg=cgiGetValue(cgi,"v");
+       sprintf(line,"%s",arg?arg:"???");
+       if(line[0]=='m')
+       {
+               sprintf(filename,"%s",line+1);
+               sprintf(cat,"t=%s","m");
+               sprintf(postpath,"%s%s",POST_PATH,filename);
+       }
+       else if(line[0]=='o' && line[1]=='k')
+       {
+               sprintf(filename,"%s",line+2);
+               sprintf(cat,"cat=%s","ok");
+               sprintf(postpath,"%s%s",OK_PATH,filename);
+       }
+       else if(line[0]=='p' && line[1]=='m')
+       {
+               sprintf(filename,"%s",line+2);
+               sprintf(cat,"cat=%s","pm");
+               sprintf(postpath,"%s%s",PM_PATH,filename);
+       }
+       else if(line[0]=='f' && line[1]=='l')
+       {
+               sprintf(filename,"%s",line+2);
+               sprintf(cat,"cat=%s","fl");
+               sprintf(postpath,"%s%s",FAIL_PATH,filename);
+       }
+       else 
+       {
+               sprintf(filename,"%s","???");
+               sprintf(postpath,"%s","???");
+               sprintf(cat,"cat=%s","???");
+       }
+       
+       
+       sprintf(right,"%s","right=<!-- -->");
+       
+       sprintf(left,"%s","left=<!-- -->");
+       
+       sprintf(path2,"%s%lu",TEMP_PATH,(unsigned long)getpid());
+       sprintf(links,"%s","links=<!-- -->");
+       
+       fflush(stdout);
+       sub=fork();
+       if(sub==0)
+       {
+               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_VIEW,"-v",left,"-v",right,"-v",links,"-v","title=<h2><a href=\"/ott/posted\" >Posted from the ЯOЯЯIM TTO</a></h2>",NP_TOP_PATH,(char *)0);
+               exit(r);
+       }
+       waitpid(sub,&r,0);
+       if(r)
+               printf("<p>Ch*rpin* M*stard</p>");
+       
+       fflush(stdout);
+       sub=fork();
+       if(sub==0)
+       {
+               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_MVIEW,"-v","bg=1","-v",cat,"-v","s=1",postpath,(char *)0);
+               exit(r);
+       }
+       waitpid(sub,&r,0);
+       if(r)
+       {
+               printf("<div id=\"%s\" class=\"post bg1\">\n",line);
+               printf("<div class=\"inner\"><span class=\"corners-top\"><span></span></span>\n");
+               printf("POST NOT FOUND.\n");
+               printf("<span class=\"corners-bottom\"><span></span></span>\n</div></div>\n");
+               printf("<hr class=\"divider\"></hr>\n");
+       }
+       
+       fflush(stdout);
+       sub=fork();
+       if(sub==0)
+       {
+               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_VIEW,"-v",left,"-v",right,"-v",links,NP_END_PATH,(char *)0);
+               exit(r);
+       }
+       waitpid(sub,&r,0);
+       if(r)
+               printf("<p>Ch*rpin* M*stard</p>");
+       
+       fflush(stdout);
+       sub=fork();
+       if(sub==0)
+       {
+               r=execl(RM_PATH,RM_PATH,"-f",path2,(char *)0);
+               exit(r);
+       }
+       waitpid(sub,&r,0);
+       if(r)
+               printf("<p>Ch*rpin* M*stard! file not deleted!</p>");
+       
+       return 0;
+}
index e45f88d2726ef54851ea8a80ad8c4453e7ffc340..e36b050ab62db877843bb1800d99219136994a84 100644 (file)
@@ -113,7 +113,6 @@ int main()
        
        cgi=cgiInit();
        
-       printf("Content-type: text/html\n\n");
        file = fopen(LAST_PATH,"rt");
        if(file!=NULL)
        {
@@ -124,6 +123,7 @@ int main()
        }
        else
        {
+               printf("Content-type: text/html\nStatus: 404 Not Found\n\n");
                sprintf(path,"info=<p>There are no posts in this Otherthread.<br /><br /><a href=\"/ott/\">Return to the ЯOЯЯIM TTO</a></p>");
                
                fflush(stdout);
@@ -139,6 +139,8 @@ int main()
                return 0;
        }
        
+       printf("Content-type: text/html\n\n");
+       
        arg=cgiGetValue(cgi,"np");
        if(arg!=NULL)
                sscanf(arg,"%lu",&np);
@@ -227,7 +229,7 @@ int main()
                        sub=fork();
                        if(sub==0)
                        {
-                               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_MVIEW,"-v",bg,"-v",page,path,(char *)0);
+                               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_MVIEW,"-v",bg,"-v",page,"-v","cat=m",path,(char *)0);
                                exit(r);
                        }
                        waitpid(sub,&r,0);
index 92537ade8ef9edf0485f4290254a81eb7f9b2b9c..6141e1bb246f271181c077dbbd435998f80f49e7 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright (C) 2014 Balthasar Szczepański
 # mview.awk
 # view the contents of posts from the mirror.
-# 12.09.2014
+# 24.09.2014
 
 # This file is part of OTT mirror.
 #
@@ -27,13 +27,17 @@ BEGIN{
        argtab[substr($0,1,eq-1)]=substr($0,eq+1)
 };
 END{
-       printf("<div id=\"m%s\" class=\"post bg%s\">\n",argtab["timenumber"],bg);
-       printf("<div class=\"inner\"><span class=\"corners-top\"><span></span></span>\n");
-       printf("<div class=\"postbody\">\n");
-       printf("<h3><a href=\"#m%s\">%s</a></h3>\n",argtab["timenumber"],argtab["subject_h"])
-       printf("<p class=\"author\"><a href=\"/ott/mview?np=%s&amp;p=%s#m%s\"><img src=\"/ott/prosilver/imageset/icon_post_target.gif\" alt=\"Post\" title=\"Post\" width=\"11\" height=\"9\"></a>by <strong><a href=\"#\">%s</a></strong> » %s </p>\n",np,argtab["timenumber"],argtab["timenumber"],argtab["username_h"],argtab["timetext"])
-       printf("<div class=\"content\">%s</div>\n</div>\n",argtab["HTML"])
-       printf("<dl class=\"postprofile\" id=\"profile%s\"><dt><a href=\"#\">%s</a></dt></dl>\n",argtab["timenumber"],argtab["username_h"])
-       printf("<div class=\"back2top\"><a href=\"#wrap\" class=\"top\" title=\"Top\">Top</a></div>\n<span class=\"corners-bottom\"><span></span></span></div>\n</div>\n")
-       printf("<hr class=\"divider\"></hr>\n")
+       print "<div id=\""cat argtab["timenumber"]"\" class=\"post bg"bg"\">"
+       print "<div class=\"inner\"><span class=\"corners-top\"><span></span></span>"
+       print "<div class=\"postbody\">"
+       print "<ul class=\"profile-icons\">"((s=="")?("<li class=\"edit-icon\"><a href=\"/ott/post?e="cat argtab["timenumber"]"\" title=\"Edit post\"><span>Edit post</span></a></li>"):"")"<li class=\"quote-icon-mustard\"><a href=\"/ott/post?q="cat argtab["timenumber"]"&attach_sig=on\" title=\"Reply with quote\"></a></li></ul>"
+       print "<h3><a href=\""cat argtab["timenumber"]"\">"argtab["subject_h"]"</a></h3>"
+       if(s=="")
+               print "<p class=\"author\"><a href=\"/ott/mview?np="np"&amp;p="argtab["timenumber"]"#"cat argtab["timenumber"]"\"><img src=\"/ott/prosilver/imageset/icon_post_target.gif\" alt=\"Post\" title=\"Post\" width=\"11\" height=\"9\"></a>by <strong><a href=\"#\">"argtab["username_h"]"</a></strong> » "argtab["timetext"]" </p>"
+       else
+               print "<p class=\"author\"><a href=\"/ott/mpview?v="cat argtab["timenumber"]"#"cat argtab["timenumber"]"\"><img src=\"/ott/prosilver/imageset/icon_post_target.gif\" alt=\"Post\" title=\"Post\" width=\"11\" height=\"9\"></a>by <strong><a href=\"#\">"argtab["username_h"]"</a></strong> » "argtab["timetext"]" </p>"
+       print "<div class=\"content\">"((argtab["HTML"]!="")?argtab["HTML"]:argtab["BBHTML"])"</div>\n</div>"
+       print "<dl class=\"postprofile\" id=\"profile"argtab["timenumber"]"\"><dt><a href=\"#\">"argtab["username_h"]"</a></dt></dl>"
+       print "<div class=\"back2top\"><a href=\"#wrap\" class=\"top\" title=\"Top\">Top</a></div>\n<span class=\"corners-bottom\"><span></span></span></div>\n</div>"
+       print "<hr class=\"divider\"></hr>"
 }
index 94b0f0805b1d33ad48cc14a32a062377ecd2de94..cd6dc5a3b3f5c9b6130a70ebeaa2ec8c84a252a5 100644 (file)
@@ -35,7 +35,7 @@ BEGIN{
        argtab[substr($0,1,eq-1)]=substr($0,eq+1)\r
 };\r
 END{\r
-       if(system("wget -q -t 3 --save-cookies=" cookiefile " -U " useragent " -O " tempfile " " fora "/ucp.php?mode=login"))\r
+       if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " -U " useragent " -O " tempfile " " fora "/ucp.php?mode=login"))\r
        {\r
                print "Pre-login fail."\r
                exit MUSTARD\r
@@ -51,7 +51,7 @@ END{
        close(cookiefile)\r
        print "username=" name "&password=" pass "&sid=" SID "&login=Login" > postfile\r
        close(postfile)\r
-       if(system("wget -q -t 3 --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=login\""))\r
+       if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=login\""))\r
        {\r
                print "Login fail."\r
                exit MUSTARD\r
@@ -68,7 +68,7 @@ END{
        }\r
        close(tempfile)\r
        \r
-       if(system("wget -q -t 3 --load-cookies=" cookiefile " --save-cookies=" cookiefile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?i=pm&mode=compose&action=post&username_list=" argtab["username"] "&add_to=Add\""))\r
+       if(system("wget -q -t 3 --connect-timeout=60 --load-cookies=" cookiefile " --save-cookies=" cookiefile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?i=pm&mode=compose&action=post&username_list=" argtab["username"] "&add_to=Add\""))\r
        {\r
                print "NewPM fail."\r
                exit MUSTARD\r
@@ -76,22 +76,26 @@ END{
        \r
        while((getline temp < tempfile)>0)\r
        {\r
-               if(temp ~ /name=.form_token/)\r
+               if(temp ~ /name=\"form_token/)\r
+               #\"#"\r
                {\r
                        split(temp,arr,"(value=\")|(\" ?/>)")\r
                        argtab["form_token"]=arr[2]\r
                }\r
-               if(temp ~ /name=.creation_time/)\r
+               if(temp ~ /name=\"creation_time/)\r
+               #\"#"\r
                {\r
                        split(temp,arr,"(value=\")|(\" ?/>)")\r
                        argtab["creation_time"]=arr[2]\r
                }\r
-               if(temp ~ /name=.address_list/)\r
+               if(temp ~ /name=\"address_list/)\r
+               #\"#"\r
                {\r
                        split(temp,arr,"(address_list\[u\]\[)|(\]\")")\r
                        argtab["address_list"]=arr[2]\r
                }\r
-               if (temp ~ /<p class=.error/)\r
+               if (temp ~ /<p class=\"error/)\r
+               #\"#"\r
                {\r
                        print temp\r
                        print "NOBODY WITH THAT NAME"\r
@@ -115,7 +119,7 @@ END{
        printf ("&form_token=%s",argtab["form_token"])>>postfile\r
        close(postfile)\r
        \r
-       if(system("wget -q -t 3 --load-cookies=" cookiefile " --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \""fora "/ucp.php?i=pm&mode=compose&action=post\""))\r
+       if(system("wget -q -t 3 --connect-timeout=60 --load-cookies=" cookiefile " --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \""fora "/ucp.php?i=pm&mode=compose&action=post\""))\r
        {\r
                print "Submit fail."\r
                exit MUSTARD\r
@@ -152,7 +156,7 @@ END{
                }\r
        }\r
        close(cookiefile)\r
-       if(system("wget -q -t 3 -U " useragent " -O " cookiefile " \"" fora "/ucp.php?mode=logout&sid=" SID"\""))\r
+       if(system("wget -q -t 3 --connect-timeout=60 -U " useragent " -O " cookiefile " \"" fora "/ucp.php?mode=logout&sid=" SID"\""))\r
        {\r
                print "Logout fail."\r
        } \r
index cee3bdbdf117084bc67d8bbf11bde6591a55c6fb..7d064526e9f7c8c638300984b7d6d359bc97d1dd 100644 (file)
@@ -29,7 +29,7 @@ BEGIN{
        argtab[substr($0,1,eq-1)]=substr($0,eq+1)\r
 };\r
 END{\r
-       if(system("wget -q -t 3 --save-cookies=" cookiefile " -U " useragent " -O " tempfile " " fora "/ucp.php?mode=login"))\r
+       if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " -U " useragent " -O " tempfile " " fora "/ucp.php?mode=login"))\r
        {\r
                print "Pre-login fail."\r
                exit 1\r
@@ -45,7 +45,7 @@ END{
        close(cookiefile)\r
        print "username=" argtab["username"] "&password=" argtab["password"] "&sid=" SID "&login=Login" > postfile\r
        close(postfile)\r
-       if(system("wget -q -t 3 --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=login\""))\r
+       if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=login\""))\r
        {\r
                print "Login fail."\r
                exit 1\r
@@ -62,7 +62,7 @@ END{
        }\r
        close(tempfile)\r
        \r
-       if(system("wget -q -t 3 --load-cookies=" cookiefile " --save-cookies=" cookiefile " -U " useragent " -O " tempfile " \"" fora "/posting.php?mode=reply&f=7&t=101043\""))\r
+       if(system("wget -q -t 3 --connect-timeout=60 --load-cookies=" cookiefile " --save-cookies=" cookiefile " -U " useragent " -O " tempfile " \"" fora "/posting.php?mode=reply&f=7&t=101043\""))\r
        {\r
                print "Postreply fail."\r
                exit 1\r
@@ -70,12 +70,14 @@ END{
        \r
        while((getline temp < tempfile)>0)\r
        {\r
-               if(temp ~ /name=.form_token/)\r
+               if(temp ~ /name=\"form_token/)\r
+               #\"#"\r
                {\r
                        split(temp,arr,"(value=\")|(\" ?/>)")\r
                        argtab["form_token"]=arr[2]\r
                }\r
-               if(temp ~ /name=.creation_time/)\r
+               if(temp ~ /name=\"creation_time/)\r
+               #\"#"\r
                {\r
                        split(temp,arr,"(value=\")|(\" ?/>)")\r
                        argtab["creation_time"]=arr[2]\r
@@ -109,7 +111,7 @@ END{
        printf ("&form_token=%s",argtab["form_token"])>>postfile\r
        close(postfile)\r
        \r
-       if(system("wget -q -t 3 --load-cookies=" cookiefile " --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \""fora "/posting.php?mode=reply&f=7&t=101043\""))\r
+       if(system("wget -q -t 3 --connect-timeout=60 --load-cookies=" cookiefile " --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \""fora "/posting.php?mode=reply&f=7&t=101043\""))\r
        {\r
                print "Submit fail."\r
                exit 1\r
@@ -146,7 +148,7 @@ END{
                }\r
        }\r
        close(cookiefile)\r
-       if(system("wget -q -t 3 -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=logout&sid=" SID"\""))\r
+       if(system("wget -q -t 3 --connect-timeout=60 -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=logout&sid=" SID"\""))\r
        {\r
                print "Logout fail."\r
        }\r
index c4e01e6241e74bbfa34a4a46b5d66918b4861514..e43daab8161b42a127ac557f060474b9812feb02 100644 (file)
@@ -2,7 +2,7 @@
 // Copyright (C) 2014 Balthasar Szczepański
 // post.cpp
 // write posts from the mirror.
-// 12.09.2014
+// 24.09.2014
 //
 // This file is part of OTT mirror.
 //
@@ -43,6 +43,7 @@
 ###AWK_VIEW
 ###TEMP_PATHp
 ###AWK_B2H
+###AWK_VERIFY
 
 s_cgi *cgi;
 pid_t sub;
@@ -67,6 +68,9 @@ char *attach_sig = &zero;
 char *notify = &zero;
 char *Preview = &zero;
 char *post =&zero;
+char *addquote =&zero;
+char *edit =&zero;
+char *forceID =&zero;
 char wrong[256];
 
 void submit();
@@ -167,7 +171,7 @@ void writeArgH(FILE *file,const char *name,const char *value, unsigned char br=0
                        }
                case '\n':
                        if(br&0x01)
-                               fprintf(file," <br/> ");
+                               fprintf(file,"<br/>");
                case '\r':
                        if(br&0x01)
                                break;
@@ -215,19 +219,22 @@ void submit()
        char timenumber[32];
        char botinfo[256];
        char arg1[256];
+       char arg2[256];
        
        unsigned long lastpage;
        unsigned short postslast;
        char listpath[256];
        
        posttime=time(NULL);
-       sprintf(timenumber,"%llu",(unsigned long long)posttime);
-       
+       if(forceID[0]!='\0')
+               sprintf(timenumber,"%s",forceID);
+       else
+               sprintf(timenumber,"%llu",(unsigned long long)posttime);
        strftime(timetext,31,"%a %b %d, %Y %I:%M %p %Z",gmtime(&posttime));
        if(*disable_bbcode=='\0')
-               sprintf(botinfo,"[Posted from the Mirror at %s]\r\n",timetext);
+               sprintf(botinfo,"[Posted from the Mirror at %s%s]\r\n",timetext,(forceID[0]!='\0')?", edited":"");
        else
-               sprintf(botinfo,"[size=80][Posted from the Mirror at %s][/size]\r\n",timetext);
+               sprintf(botinfo,"[size=80][Posted from the Mirror at %s%s][/size]\r\n",timetext,(forceID[0]!='\0')?", edited":"");
        sprintf(postpath,"%s%s",MPOST_PATH,timenumber);
        
        tempfile=fopen(temppath,"wt");
@@ -236,7 +243,7 @@ void submit()
        tf=true;
        writeArgH(tempfile,"timenumber",timenumber);
        writeArgH(tempfile,"timetext",timetext);
-       writeArgH(tempfile,"HTML",message,1);
+       writeArgH(tempfile,"BBHTML",message,1);
        writeArgH(tempfile,"BB",message,3);
        writeArgH(tempfile,"username_h",username);
        writeArgH(tempfile,"subject_h",subject);
@@ -258,7 +265,6 @@ void submit()
        fclose(tempfile);
        tf=false;
        
-       printf("Content-type: text/html\n\n");
        sprintf(arg1,"outfile=%s",temppath);
        fflush(stdout);
        sub=fork();
@@ -271,6 +277,18 @@ void submit()
        }
        waitpid(sub,&r,0);
        
+       sprintf(arg1,"name=%s",username);
+       sprintf(arg2,"pass=%s",password);
+       sub=fork();
+       if(sub==0)
+       {
+               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_VERIFY,"-v",arg1,"-v",arg2,"-v","reversed=1",postpath,(char *)0);
+               exit(r);
+       }
+       waitpid(sub,&r,0);
+       if(!r)
+               preview("Can't replace this post. Not yours or wrong password?");
+               
        sub=fork();
        if(sub==0)
        {
@@ -281,72 +299,79 @@ void submit()
        if(r)
                printf("Couldn't add post to queue.");
        
-       tempfile=fopen(MLAST_PATH,"rt");
-       if(tempfile==NULL)
-       {
-               lastpage=1;
-               postslast=1;
-       }
-       else
+       if(forceID[0]=='\0')
        {
-               tf=true;
-               if(fgets(listpath,255,tempfile))
-                       sscanf(listpath,"%lu",&lastpage);
-               if(fgets(listpath,255,tempfile))
-                       sscanf(listpath,"%hu",&postslast);
-               if(postslast>=40)
+               tempfile=fopen(MLAST_PATH,"rt");
+               if(tempfile==NULL)
                {
-                       ++lastpage;
-                       postslast=0;
+                       lastpage=1;
+                       postslast=1;
                }
                else
-                       ++postslast;
+               {
+                       tf=true;
+                       if(fgets(listpath,255,tempfile))
+                               sscanf(listpath,"%lu",&lastpage);
+                       if(fgets(listpath,255,tempfile))
+                               sscanf(listpath,"%hu",&postslast);
+                       if(postslast>=40)
+                       {
+                               ++lastpage;
+                               postslast=0;
+                       }
+                       else
+                               ++postslast;
+                       fclose(tempfile);
+                       tf=false;
+               }
+               tempfile=fopen(MLAST_PATH,"wt");
+               if(tempfile==NULL)
+               {
+                       pf=true;
+                       preview("Couldn't update list.");
+               }
+               fprintf(tempfile,"%lu\n%hu\n%s\n",lastpage,postslast,timenumber);
                fclose(tempfile);
-               tf=false;
-       }
-       tempfile=fopen(MLAST_PATH,"wt");
-       if(tempfile==NULL)
-       {
-               pf=true;
-               preview("Couldn't update list.");
-       }
-       fprintf(tempfile,"%lu\n%hu\n%s\n",lastpage,postslast,timenumber);
-       fclose(tempfile);
-       
-       sprintf(listpath,"%s%lu",MLIST_PATH,lastpage);
-       tempfile=fopen(listpath,"at");
-       if(tempfile==NULL)
-       {
-               pf=true;
-               preview("Couldn't update list.");
-       }
-       fprintf(tempfile,"%s\n",timenumber);
-       
-       tempfile=fopen(MFRONT_PATH,"wt");
-       if(tempfile!=NULL)
-       {
-               fprintf(tempfile,"<li class=\"row bg2\" >\n");
-               fprintf(tempfile,"<dl class=\"icon\" style=\"background-image: url(/ott/prosilver/imageset/topic_mustard.gif); background-repeat: no-repeat;\" >\n");
-               fprintf(tempfile,"<dt title=\"No unread posts\" ><a href=\"/ott/mview\" class=\"topictitle\" >Mustardtime Otherthread</a>\n");
-               fprintf(tempfile,"<br />\nMustardtime posts will be shown here, before they are posted to the OTT.<br />\n");
-               fprintf(tempfile,"<strong class=\"pagination\" ><span>");
-               if(lastpage>5)
-                       fprintf(tempfile,"<a href=\"/ott/mview\" >1</a><span class=\"page-dots\" > ... </span>");
-               for(unsigned long i=((lastpage>5)?(lastpage-2):1);i<lastpage;++i)
-                       fprintf(tempfile,"<a href=\"/ott/mview?np=%lu\" >%lu</a><span class=\"page-sep\" >, </span>",i,i);
-               fprintf(tempfile,"<a href=\"/ott/mview?np=%lu\" >%lu</a>",lastpage,lastpage);
-               fprintf(tempfile,"</span></strong><img src=\"/ott/prosilver/imageset/icon_topic_attach.gif\" width=\"7\" height=\"10\" alt=\"Attachment(s)\" title=\"Attachment(s)\" /> by <a href=\"http://1190.bicyclesonthemoon.dnsd.info/bothasar_p/\" >bothasar_p</a> &raquo; Sat Apr 05, 2014 9:40 pm UTC</dt>\n");
-               fprintf(tempfile,"<dd class=\"posts\" >%lu <dfn>Replies</dfn></dd>\n",(unsigned long)((lastpage-1)*40+postslast));
-               fprintf(tempfile,"<dd class=\"views\" >NaN <dfn>Views</dfn></dd>\n");
-               fprintf(tempfile,"<dd class=\"lastpost\" ><span><dfn>Last post </dfn>by <a href=\"#\" >");
-               writeArgH(tempfile,username);
-               fprintf(tempfile,"</a>\n<a href=\"/ott/mview?np=%lu&amp;p=%s#m%s\" ><img src=\"/ott/prosilver/imageset/icon_topic_latest.gif\" width=\"11\" height=\"9\" alt=\"View the latest post\" title=\"View the latest post\" /></a> <br />%s</span>\n",lastpage,timenumber,timenumber,timetext);
-               fprintf(tempfile,"</dd>\n</dl>\n</li>\n");
+               
+               sprintf(listpath,"%s%lu",MLIST_PATH,lastpage);
+               tempfile=fopen(listpath,"at");
+               if(tempfile==NULL)
+               {
+                       pf=true;
+                       preview("Couldn't update list.");
+               }
+               fprintf(tempfile,"%s\n",timenumber);
+               fclose(tempfile);
+               
+               tempfile=fopen(MFRONT_PATH,"wt");
+               if(tempfile!=NULL)
+               {
+                       fprintf(tempfile,"<li class=\"row bg2\" >\n");
+                       fprintf(tempfile,"<dl class=\"icon\" style=\"background-image: url(/ott/prosilver/imageset/topic_mustard.gif); background-repeat: no-repeat;\" >\n");
+                       fprintf(tempfile,"<dt title=\"No unread posts\" ><a href=\"/ott/mview\" class=\"topictitle\" >Mustardtime Otherthread</a>\n");
+                       fprintf(tempfile,"<br />\nMustardtime posts will be shown here, before they are posted to the OTT.<br />\n");
+                       fprintf(tempfile,"<strong class=\"pagination\" ><span>");
+                       if(lastpage>5)
+                               fprintf(tempfile,"<a href=\"/ott/mview\" >1</a><span class=\"page-dots\" > ... </span>");
+                       for(unsigned long i=((lastpage>5)?(lastpage-2):1);i<lastpage;++i)
+                               fprintf(tempfile,"<a href=\"/ott/mview?np=%lu\" >%lu</a><span class=\"page-sep\" >, </span>",i,i);
+                       fprintf(tempfile,"<a href=\"/ott/mview?np=%lu\" >%lu</a>",lastpage,lastpage);
+                       fprintf(tempfile,"</span></strong><img src=\"/ott/prosilver/imageset/icon_topic_attach.gif\" width=\"7\" height=\"10\" alt=\"Attachment(s)\" title=\"Attachment(s)\" /> by <a href=\"http://1190.bicyclesonthemoon.dnsd.info/bothasar_p/\" >bothasar_p</a> &raquo; Sat Apr 05, 2014 9:40 pm UTC</dt>\n");
+                       fprintf(tempfile,"<dd class=\"posts\" >%lu <dfn>Replies</dfn></dd>\n",(unsigned long)((lastpage-1)*40+postslast));
+                       fprintf(tempfile,"<dd class=\"views\" >NaN <dfn>Views</dfn></dd>\n");
+                       fprintf(tempfile,"<dd class=\"lastpost\" ><span><dfn>Last post </dfn>by <a href=\"#\" >");
+                       writeArgH(tempfile,username);
+                       fprintf(tempfile,"</a>\n<a href=\"/ott/mview?np=%lu&amp;p=%s#m%s\" ><img src=\"/ott/prosilver/imageset/icon_topic_latest.gif\" width=\"11\" height=\"9\" alt=\"View the latest post\" title=\"View the latest post\" /></a> <br />%s</span>\n",lastpage,timenumber,timenumber,timetext);
+                       fprintf(tempfile,"</dd>\n</dl>\n</li>\n");
+               }
+               fclose(tempfile);
+               sprintf(arg1,"info=<p>This message has been posted successfully.<br /><br /><a href=\"/ott/mview?np=%lu&amp;p=%s#m%s\">View your submitted message</a><br /><br /><a href=\"/ott/\">Return to the ЯOЯЯIM TTO</a></p>",lastpage,timenumber,timenumber);
+
        }
-       fclose(tempfile);
-       sprintf(arg1,"info=<p>This message has been posted successfully.<br /><br /><a href=\"/ott/mview?np=%lu&amp;p=%s#m%s\">View your submitted message</a><br /><br /><a href=\"/ott/\">Return to the ЯOЯЯIM TTO</a></p>",lastpage,timenumber,timenumber);
+       else
+               sprintf(arg1,"info=<p>This message has been posted successfully.<br /><br /><a href=\"/ott/mview?p=%s#m%s\">View your submitted message</a><br /><br /><a href=\"/ott/\">Return to the ЯOЯЯIM TTO</a></p>",timenumber,timenumber);
        
-       // printf("Content-type: text/html\n\n");
+       printf("Content-type: text/html\n\n");
        fflush(stdout);
        sub=fork();
        if(sub==0)
@@ -379,6 +404,9 @@ void preview (const char *text)
        writeArgH(tempfile,"disable_magic_url",disable_magic_url);
        writeArgH(tempfile,"attach_sig",attach_sig);
        writeArgH(tempfile,"notify",notify);
+       writeArgH(tempfile,"addquote",addquote);
+       writeArgH(tempfile,"edit",edit);
+       writeArgH(tempfile,"forceID",forceID);
        // writeArgH(tempfile,"Preview",Preview);
        // writeArgH(tempfile,"post",post);
        
@@ -493,6 +521,18 @@ int main()
        if(arg!=NULL)
                post=arg;
        
+       arg=cgiGetValue(cgi,"q");
+       if(arg!=NULL)
+               addquote=arg;
+       
+       arg=cgiGetValue(cgi,"e");
+       if(arg!=NULL)
+               edit=arg;
+       
+       arg=cgiGetValue(cgi,"forceID");
+       if(arg!=NULL)
+               forceID=arg;
+       
        if(strcmp(post,"Submit")==0)
        {
                if(missing)
diff --git a/pro.zip/posted.1.cpp b/pro.zip/posted.1.cpp
new file mode 100644 (file)
index 0000000..f6d2744
--- /dev/null
@@ -0,0 +1,204 @@
+// OTT mirror\r
+// Copyright (C) 2014 Balthasar Szczepański\r
+// posted.cpp\r
+// posts recently sent from the mirror.\r
+//  2.09.2014\r
+//\r
+// This file is part of OTT mirror.\r
+//\r
+// OTT mirror is free software: you can redistribute it and/or modify\r
+// it under the terms of the GNU Affreo General Public License as published by\r
+// the Free Software Foundation, either version 3 of the License, or\r
+// (at your option) any later version.\r
+// \r
+// OTT mirror is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU Affreo General Public License for more details.\r
+// \r
+// You should have received a copy of the GNU Affreo General Public License\r
+// along with OTT mirror. If not, see <http://www.gnu.org/licenses/>.\r
+\r
+#include <cgi.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <unistd.h>\r
+// #include <string.h>\r
+#include <sys/wait.h>\r
+\r
+###TEMP_PATHr\r
+###OK_PATH3\r
+###PM_PATH3\r
+###FAIL_PATH3\r
+###LS_PATH\r
+###RM_PATH\r
+###MAWK_PATH\r
+###AWK_POSTED\r
+\r
+s_cgi *cgi;\r
+pid_t sub;\r
+int r;\r
+\r
+\r
+int main(int argc, char **argv)\r
+{\r
+       char temppath[256]="";\r
+       char line[32];\r
+       char filename[32];\r
+       char postpath[256];\r
+       FILE *tempfile;\r
+       FILE *postfile;\r
+       \r
+       \r
+       // dup2(fileno(stdout),fileno(stderr));\r
+       cgi=cgiInit();\r
+       \r
+       sprintf(temppath,"%s%lu",TEMP_PATH,(unsigned long)getpid());\r
+       \r
+       printf("Content-type: text/html\n\n");\r
+       printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"\">\n");\r
+       printf("<html lang=\"en\"><head>\n");\r
+       printf("<title>Posted &bull; ЯOЯЯIM TTO &bull; Bicycles on the Moon</title>\n");\r
+       printf("<meta http-equiv=\"Content-type\" content=\"text/html; charset=UTF-8\">\n");\r
+       printf("<link rel=\"icon\" type=\"image/png\" href=\"/img/favicon.png\">\n");\r
+       printf("<link rel=\"stylesheet\" href=\"/css/botm.css\">\n");\r
+       printf("</head><body><a href=\"/\"><img src=\"/img/botmlogo2.png\" alt=\"1190.bicyclesonthemoon.dnsd.info\" border=\"0\"></a>\n");\r
+       printf("<h1>Posted from the ЯOЯЯIM TTO</h1>\n");\r
+       \r
+       fflush(stdout);\r
+       sub=fork();\r
+       if(sub==0)\r
+       {\r
+               if(freopen(temppath,"wt",stdout)==NULL)\r
+                       exit(255);\r
+               r=execl(LS_PATH,LS_PATH,"-1","--color=never",FAIL_PATH,(char *)0);\r
+               exit(r);\r
+       }\r
+       waitpid(sub,&r,0);\r
+       if(r)\r
+               printf("No posts in the FAIL category.<br>\n");\r
+       else\r
+       {\r
+               printf("<table class=\"pl\"><tr class=\"pls\"><td colspan=\"4\">FAIL</td></tr>\n");\r
+               printf("<tr class=\"plt\"><td class=\"plk\">time</td><td class=\"plk\">author</td><td class=\"plk\">subject</td><td class=\"plk\">action</td></tr>\n");\r
+               \r
+               tempfile=fopen(temppath,"rt");\r
+               if(tempfile!=NULL)\r
+               {\r
+                       for(unsigned char i=0; fgets(line,31,tempfile)!=NULL; ++i)\r
+                       {\r
+                               sscanf(line,"%s",filename);\r
+                               sprintf(postpath,"%s%s",FAIL_PATH,filename);\r
+                               \r
+                               fflush(stdout);\r
+                               sub=fork();\r
+                               if(!sub)\r
+                               {\r
+                                       r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_POSTED,"-v",i&0x1?"r2=1":"r2=0","-v","cat=fl",postpath,(char *)0);\r
+                                       exit(r);\r
+                               }\r
+                               waitpid(sub,&r,0);\r
+                               \r
+                       }\r
+                       fclose(tempfile);\r
+               }\r
+               \r
+               printf("</table><br>\n");\r
+       }\r
+       \r
+       fflush(stdout);\r
+       sub=fork();\r
+       if(sub==0)\r
+       {\r
+               if(freopen(temppath,"wt",stdout)==NULL)\r
+                       exit(255);\r
+               r=execl(LS_PATH,LS_PATH,"-1","--color=never",PM_PATH,(char *)0);\r
+               exit(r);\r
+       }\r
+       waitpid(sub,&r,0);\r
+       if(r)\r
+               printf("No posts in the PM category.<br>\n");\r
+       else\r
+       {\r
+               printf("<table class=\"pl\"><tr class=\"pls\"><td colspan=\"4\">PM</td></tr>\n");\r
+               printf("<tr class=\"plt\"><td class=\"plk\">time</td><td class=\"plk\">author</td><td class=\"plk\">subject</td><td class=\"plk\">action</td></tr>\n");\r
+               \r
+               tempfile=fopen(temppath,"rt");\r
+               if(tempfile!=NULL)\r
+               {\r
+                       for(unsigned char i=0; fgets(line,31,tempfile)!=NULL; ++i)\r
+                       {\r
+                               sscanf(line,"%s",filename);\r
+                               sprintf(postpath,"%s%s",PM_PATH,filename);\r
+                               \r
+                               fflush(stdout);\r
+                               sub=fork();\r
+                               if(!sub)\r
+                               {\r
+                                       r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_POSTED,"-v",i&0x1?"r2=1":"r2=0","-v","cat=pm",postpath,(char *)0);\r
+                                       exit(r);\r
+                               }\r
+                               waitpid(sub,&r,0);\r
+                               \r
+                       }\r
+                       fclose(tempfile);\r
+               }\r
+               \r
+               printf("</table><br>\n");\r
+       }\r
+       \r
+       fflush(stdout);\r
+       sub=fork();\r
+       if(sub==0)\r
+       {\r
+               if(freopen(temppath,"wt",stdout)==NULL)\r
+                       exit(255);\r
+               r=execl(LS_PATH,LS_PATH,"-1","--color=never",OK_PATH,(char *)0);\r
+               exit(r);\r
+       }\r
+       waitpid(sub,&r,0);\r
+       if(r)\r
+               printf("No posts in the OK category.<br>\n");\r
+       else\r
+       {\r
+               printf("<table class=\"pl\"><tr class=\"pls\"><td colspan=\"4\">OK</td></tr>\n");\r
+               printf("<tr class=\"plt\"><td class=\"plk\">time</td><td class=\"plk\">author</td><td class=\"plk\">subject</td><td class=\"plk\">action</td></tr>\n");\r
+               \r
+               tempfile=fopen(temppath,"rt");\r
+               if(tempfile!=NULL)\r
+               {\r
+                       for(unsigned char i=0; fgets(line,31,tempfile)!=NULL; ++i)\r
+                       {\r
+                               sscanf(line,"%s",filename);\r
+                               sprintf(postpath,"%s%s",OK_PATH,filename);\r
+                               \r
+                               fflush(stdout);\r
+                               sub=fork();\r
+                               if(!sub)\r
+                               {\r
+                                       r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_POSTED,"-v",i&0x1?"r2=1":"r2=0","-v","cat=ok",postpath,(char *)0);\r
+                                       exit(r);\r
+                               }\r
+                               waitpid(sub,&r,0);\r
+                               \r
+                       }\r
+                       fclose(tempfile);\r
+               }\r
+               \r
+               printf("</table><br>\n");\r
+       }\r
+       printf("<a href=\"/ott\">back to the ЯOЯЯIM TTO</a><br><br>\n");\r
+       printf("<a href=\"/\">1190.bicyclesonthemoon.dnsd.info</a></body></html>\n");\r
+       \r
+       fflush(stdout);\r
+       sub=fork();\r
+       if(sub==0)\r
+       {\r
+               r=execl(RM_PATH,RM_PATH,"-f",temppath,(char *)0);\r
+               exit(r);\r
+       }\r
+       waitpid(sub,&r,0);\r
+       \r
+       return 0;\r
+}\r
+\r
diff --git a/pro.zip/posted.awk b/pro.zip/posted.awk
new file mode 100644 (file)
index 0000000..42978d3
--- /dev/null
@@ -0,0 +1,36 @@
+# OTT mirror\r
+# Copyright (C) 2014 Balthasar Szczepañski\r
+# posted.awk\r
+# one post recently sent from the mirror\r
+#  2.08.2014\r
+\r
+# This file is part of OTT mirror.\r
+#\r
+# OTT mirror is free software: you can redistribute it and/or modify\r
+# it under the terms of the GNU General Public License as published by\r
+# the Free Software Foundation, either version 3 of the License, or\r
+# (at your option) any later version.\r
+# \r
+# OTT mirror is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+# GNU General Public License for more details.\r
+# \r
+# You should have received a copy of the GNU General Public License\r
+# along with OTT mirror. If not, see <http://www.gnu.org/licenses/>.\r
+\r
+BEGIN{\r
+       FS="="\r
+};\r
+{\r
+       eq=index($0,"=")\r
+       argtab[substr($0,1,eq-1)]=substr($0,eq+1)\r
+};\r
+END{\r
+       if (r2==0)\r
+               class="plw"\r
+       else\r
+               class="plv"\r
+       \r
+       print "<tr class=\""class"\"><td class=\"plk\">"argtab["timetext"]"</td><td class=\"plk\">"argtab["username_h"]"</td><td class=\"plk\">"argtab["subject_h"]"</td><td class=\"plk\"><a href=\"/ott/mpview?v="cat argtab["timenumber"]"\">view</a> <a href=\"/ott/post?q="cat argtab["timenumber"]"&amp;attach_sig=on\">quote</a></td></tr>"\r
+}
\ No newline at end of file
index 1955f5e7fc1f38f20931a1c5d8cc8fba850267a2..bd01baf9734c9299f12276c2c13199f7cd1806c4 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright (C) 2014 Balthasar Szczepański\r
 # preview.awk\r
 # insert content into the preview page.\r
-# 12.09.2014\r
+# 24.09.2014\r
 \r
 # This file is part of OTT mirror.\r
 #\r
 # along with OTT mirror. If not, see <http://www.gnu.org/licenses/>.\r
 \r
 BEGIN{\r
+###mpostpath\r
+###okpath\r
+###pmpath\r
+###failpath\r
+       \r
        HTML="<div class=\"post bg2\" id=\"preview\">\n<div class=\"inner\"><span class=\"corners-top\"><span></span></span>\n<div class=\"postbody\">\n<h3>Preview: %s</h3><div class=\"content\">%s</div></div><span class=\"corners-bottom\"><span></span></span></div></div>\n"\r
        wrong="<p class=\"error\">%s</p>\n"\r
        subject="<dd><input type=\"text\" name=\"subject\" id=\"subject\" size=\"45\" maxlength=\"64\" tabindex=\"1\" value=\"%s\" class=\"inputbox autowidth\" /></dd>\n"\r
-       username="<dd><input tabindex=\"2\" name=\"username\" id=\"username\" size=\"45\" value=\"%s\" class=\"inputbox autowidth\" type=\"text\"></dd>\n"\r
-       message="<textarea name=\"message\" id=\"message\" rows=\"15\" cols=\"76\" tabindex=\"4\" onselect=\"storeCaret(this);\" onclick=\"storeCaret(this);\" onkeyup=\"storeCaret(this);\" onfocus=\"initInsertions();\" class=\"inputbox\" >%s</textarea>\n"\r
+       username="<dd><input tabindex=\"2\" name=\"username\" id=\"username\" size=\"45\" value=\"%s\" class=\"inputbox autowidth\" type=\"text\" /></dd>\n"\r
+       message="<textarea name=\"message\" id=\"message\" rows=\"15\" cols=\"76\" tabindex=\"4\" onselect=\"storeCaret(this);\" onclick=\"storeCaret(this);\" onkeyup=\"storeCaret(this);\" onfocus=\"initInsertions();\" class=\"inputbox\" >%s%s</textarea>\n"\r
        disable_bbcode="<div><label for=\"disable_bbcode\"><input type=\"checkbox\" name=\"disable_bbcode\" id=\"disable_bbcode\" %s /> Disable BBCode</label></div>\n"\r
        disable_smilies="<div><label for=\"disable_smilies\"><input type=\"checkbox\" name=\"disable_smilies\" id=\"disable_smilies\" %s /> Disable smilies</label></div>\n"\r
        disable_magic_url="<div><label for=\"disable_magic_url\"><input type=\"checkbox\" name=\"disable_magic_url\" id=\"disable_magic_url\" %s /> Do not automatically parse URLs</label></div>\n"\r
        attach_sig="<div><label for=\"attach_sig\"><input type=\"checkbox\" name=\"attach_sig\" id=\"attach_sig\" %s /> Attach a signature (signatures can be altered via the UCP)</label></div>\n"\r
        notify="<div><label for=\"notify\"><input type=\"checkbox\" name=\"notify\" id=\"notify\" %s /> Notify me when a reply is posted</label></div>\n"\r
+       forceID="<input type=\"text\" name=\"forceID\" value=\"%s\"/>\n"\r
+       \r
+       addquote=""\r
        \r
        # print "<!--preview.awk:\nargfile=" argfile\r
        while((getline argline < argfile)>0)\r
        {\r
+               gsub(/[\r\n]/,"",argline)\r
                eq=index(argline,"=")\r
                argtab[substr(argline,1,eq-1)]=substr(argline,eq+1)\r
                # print substr(argline,1,eq-1) "=" argtab[substr(argline,1,eq-1)]\r
        }\r
        # print "-->"\r
        close(argfile)\r
+       if(argtab["edit"] ~ /^m[0-9]+$/)\r
+       {\r
+               argtab["forceID"]=substr(argtab["edit"],2)\r
+               argfile= mpostpath argtab["forceID"]\r
+               \r
+               while((getline argline < argfile)>0)\r
+               {\r
+                       gsub(/[\r\n]/,"",argline)\r
+                       eq=index(argline,"=")\r
+                       if(argline ~ /^((username)|(subject))_h=/)\r
+                               argtab[substr(argline,1,eq-3)]=substr(argline,eq+1)\r
+                       else if(argline ~ /^BBHTML=/)\r
+                       {\r
+                               argtab["message"]=substr(argline,eq+1)\r
+                               gsub(/<br>/,"\n",argtab["message"])\r
+                       }\r
+                       else if(argline ~ /^((BB)|(username)|(subject)|(message)|(HTML)|(debug))=/)\r
+                       {}\r
+                       else\r
+                               argtab[substr(argline,1,eq-1)]=substr(argline,eq+1)\r
+               }\r
+               close(argfile)\r
+       }\r
+       else if(argtab["addquote"] ~ /^(m|(ok)|(pm)|(fl))[0-9]+$/)\r
+       {\r
+               if(argtab["addquote"] ~ /^m[0-9]+$/)\r
+                       argfile= mpostpath substr(argtab["addquote"],2)\r
+               if(argtab["addquote"] ~ /^ok[0-9]+$/)\r
+                       argfile= okpath substr(argtab["addquote"],3)\r
+               if(argtab["addquote"] ~ /^pm[0-9]+$/)\r
+                       argfile= pmpath substr(argtab["addquote"],3)\r
+               if(argtab["addquote"] ~ /^fl[0-9]+$/)\r
+                       argfile= failpath substr(argtab["addquote"],3)\r
+               #else\r
+                       #argfile is not changed = quote self?\r
+               while((getline argline < argfile)>0)\r
+               {\r
+                       gsub(/[\r\n]/,"",argline)\r
+                       eq=index(argline,"=")\r
+                       if(argline ~ /^BBHTML=/)\r
+                       {\r
+                               addquotehtml=substr(argline,eq+1)\r
+                               gsub(/ ?<br\/> ?/,"\n",addquotehtml)\r
+                       }\r
+                       if(argline ~ /^username_h=/)\r
+                               addquotename=substr(argline,eq+1)\r
+                       if(argline ~ /^subject_h/)\r
+                       {\r
+                               addquotesub=substr(argline,eq+1)\r
+                               if(addquotesub ~ /^Re:/)\r
+                                       argtab["subject"]=addquotesub\r
+                               else\r
+                                       argtab["subject"]="Re: "addquotesub\r
+                       }\r
+                       if(argline ~ /^timetext/)\r
+                       {\r
+                               addquotetime=", at "substr(argline,eq+1)\r
+                       }\r
+               }\r
+               close(argfile)\r
+               if(addquotehtml!="")\r
+                       addquote="[quote=&quot;"addquotename addquotetime"&quot;]"addquotehtml"[/quote]"\r
+       }\r
 };\r
 {\r
        if ($0 ~ /^###HTML/)\r
@@ -52,12 +124,17 @@ BEGIN{
                if(argtab["wrong"]!="")\r
                        printf(wrong,argtab["wrong"])\r
        }\r
+       else if ($0 ~ /^###forceID/)\r
+       {\r
+               if(argtab["forceID"]!="")\r
+                       printf(forceID,argtab["forceID"])\r
+       }\r
        else if ($0 ~ /^###subject/)\r
                        printf(subject,((argtab["subject"]=="")?"###default_subject;":argtab["subject"]))\r
        else if ($0 ~ /^###username/)\r
                printf(username,argtab["username"])\r
        else if ($0 ~ /^###message/)\r
-               printf(message,argtab["message"])\r
+               printf(message,argtab["message"],addquote)\r
        else if ($0 ~ /^###disable_bbcode/)\r
                printf(disable_bbcode,(argtab["disable_bbcode"]=="on")?"checked=\"checked\"":"")\r
        else if ($0 ~ /^###disable_smilies/)\r
index e6cf606f89d3a4da3c6c65d2527e2b7ce645e97a..8f27581707916a1127526f8bbef7fbc65215d29a 100644 (file)
@@ -14,6 +14,7 @@ BEGIN{
        mvpath=    "/bin/mv"
        rmpath=    "/bin/rm"
        catpath=   "/bin/cat"
+       lspath=    "/bin/ls"
        
        useragent2="bothasar_t (http://1190.bicyclesonthemoon.dnsd.info/ott/; Time thread mirror bot)"
        useragent3="bothasar_p (http://1190.bicyclesonthemoon.dnsd.info/ott/; Time thread post bot)"
@@ -54,6 +55,7 @@ BEGIN{
        RM_PATH="#define RM_PATH \"" rmpath "\""
        MV_PATH="#define MV_PATH \"" mvpath "\""
        CAT_PATH="#define CAT_PATH \"" catpath "\""
+       LS_PATH="#define LS_PATH \"" lspath "\""
        
        LAST_PATH="#define LAST_PATH \"" mempath "/lasttime.\""
        NAME_PATH="#define NAME_PATH \"" mempath "/name\""
@@ -69,6 +71,10 @@ BEGIN{
        MLIST_PATH="#define MLIST_PATH \"" mempath "/mlist/\""
        MLAST_PATH="#define MLAST_PATH \"" mempath "/mlist/last\""
        MSTD_LAST_PATH="#define MSTD_LAST_PATH \"" mempath "/mlist/last\""
+       okpath="\tokpath=\"" mempath "/mpost/ok/\""
+       pmpath="\tpmpath=\"" mempath "/mpost/pm/\""
+       failpath="\tfailpath=\"" mempath "/mpost/fail/\""
+       mpostpath="\tmpostpath=\"" mempath "/mpost/\""
        
        LOG_PATH="#define LOG_PATH \"" logpath "/bot2.log.\""
        LOG_PATH3="#define LOG_PATH \"" logpath "/bot3.log\""
@@ -85,6 +91,8 @@ BEGIN{
        TEMP_PATH3v="#define TEMP_PATH \"" tmppath "/mview.\""
        TEMP_PATHp="#define TEMP_PATH \"" tmppath "/preview.\""
        TEMP_PATHv="#define TEMP_PATH \"" tmppath "/view.\""
+       TEMP_PATHr="#define TEMP_PATH \"" tmppath "/posted.\""
+       TEMP_PATHm="#define TEMP_PATH \"" tmppath "/mpview.\""
        
        LIST_PATH="#define LIST_PATH \"" mirrpath "/postlist/\""
        SIG_PATH="#define SIG_PATH \"" mirrpath "/sig/\""
@@ -121,6 +129,8 @@ BEGIN{
        AWK_PREVIEW="#define AWK_PREVIEW \"" propath "/preview.awk\""
        BOT_PATH="#define BOT_PATH \"" propath "/bot2\""
        AWK_B2H="#define AWK_B2H \"" propath "/bb2html.awk\""
+       AWK_POSTED="#define AWK_POSTED \"" propath "/posted.awk\""
+       AWK_VERIFY="#define AWK_VERIFY \"" propath "/verify.awk\""
        findpost_path="\tfindpost_path=\"" propath "/findpost\""
        imgformat_path="\timgformat_path=\"" propath "/image\""
 
@@ -205,6 +215,11 @@ BEGIN{
                print CAT_PATH
                next
        }
+       if($1 ~ /^###LS_PATH$/)
+       {
+               print LS_PATH
+               next
+       }
        
        
        
@@ -273,6 +288,26 @@ BEGIN{
                print MLAST_PATH
                next
        }
+       if($1 ~ /^###okpath$/)
+       {
+               print okpath
+               next
+       }
+       if($1 ~ /^###pmpath$/)
+       {
+               print pmpath
+               next
+       }
+       if($1 ~ /^###failpath$/)
+       {
+               print failpath
+               next
+       }
+       if($1 ~ /^###mpostpath$/)
+       {
+               print mpostpath
+               next
+       }
        if($1 ~ /^###MSTD_LAST_PATH$/)
        {
                print MSTD_LAST_PATH
@@ -354,6 +389,16 @@ BEGIN{
                print TEMP_PATHv
                next
        }
+       if($1 ~ /^###TEMP_PATHr$/)
+       {
+               print TEMP_PATHr
+               next
+       }
+       if($1 ~ /^###TEMP_PATHm$/)
+       {
+               print TEMP_PATHm
+               next
+       }
        
        
        
@@ -525,6 +570,16 @@ BEGIN{
                print AWK_PREVIEW
                next
        }
+       if($1 ~ /^###AWK_POSTED$/)
+       {
+               print AWK_POSTED
+               next
+       }
+       if($1 ~ /^###AWK_VERIFY$/)
+       {
+               print AWK_VERIFY
+               next
+       }
        if($1 ~ /^###BOT_PATH$/)
        {
                print BOT_PATH
diff --git a/pro.zip/redirect.cpp b/pro.zip/redirect.cpp
new file mode 100644 (file)
index 0000000..a30495b
--- /dev/null
@@ -0,0 +1,31 @@
+// OTT mirror\r
+// Copyright (C) 2014 Balthasar Szczepañski\r
+// redirect.cpp\r
+// redirect srevice for the "Jump to:" list.\r
+// 24.08.2014\r
+//\r
+// This file is part of OTT mirror.\r
+//\r
+// OTT mirror is free software: you can redistribute it and/or modify\r
+// it under the terms of the GNU Affreo General Public License as published by\r
+// the Free Software Foundation, either version 3 of the License, or\r
+// (at your option) any later version.\r
+// \r
+// OTT mirror is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU Affreo General Public License for more details.\r
+// \r
+// You should have received a copy of the GNU Affreo General Public License\r
+// along with OTT mirror. If not, see <http://www.gnu.org/licenses/>.\r
+\r
+#include <cgi.h>\r
+int main(int argc, char **argv)\r
+{\r
+       s_cgi *cgi;\r
+       char *redirect;\r
+       cgi=cgiInit();\r
+       redirect=cgiGetValue(cgi,"f");\r
+       cgiRedirect(redirect?redirect:"/ott");\r
+       return 0;\r
+}
\ No newline at end of file
diff --git a/pro.zip/verify.awk b/pro.zip/verify.awk
new file mode 100644 (file)
index 0000000..265e9d1
--- /dev/null
@@ -0,0 +1,44 @@
+BEGIN{\r
+       FS="="\r
+       for(i=0;i<256;++i)\r
+       {\r
+               ch=sprintf("%c",i)\r
+               hex=sprintf("%02X",i);\r
+               ch2hex[ch]=hex\r
+       }\r
+       if(reversed!="")\r
+       {\r
+               ok=1\r
+               fail=0\r
+       }\r
+       else\r
+       {\r
+               ok=0\r
+               fail=1\r
+       }\r
+}\r
+{\r
+       gsub(/[\r\n]/,"",$0)\r
+       eq=index($0,"=")\r
+       argtab[substr($0,1,eq-1)]=substr($0,eq+1)\r
+}\r
+END{\r
+       if(fff!=""||argtab["username"]==""||argtab["password"]==""||(argtab["username"]==urlencode(name)&&argtab["password"]==urlencode(pass,1)))\r
+               exit ok\r
+       else\r
+               exit fail\r
+}\r
+function urlencode(name,all,   len,iii,escaped,ch)\r
+{\r
+       len=length(name)\r
+       escaped=""\r
+       for(iii=1;iii<=len;++iii)\r
+       {\r
+               ch=substr(name,iii,1);\r
+               if ((ch ~ /[a-zA-Z0-9\.-_~]/)&&(all==""))\r
+                       escaped = escaped ch\r
+               else\r
+                       escaped = escaped "%" ch2hex[ch]\r
+       }\r
+       return escaped\r
+}\r