<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
<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
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
-->\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
\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
</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>
</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" > Individual XKCD Comic Threads</option>
-
-<option value="60" > What If?</option>
-
-<option value="27" >Sound and Fury</option>
-
-<option value="9" > News & Articles</option>
-
-<option value="8" > Serious Business</option>
-
-<option value="16" > XKCD Meetups</option>
-
-<option value="2" > General</option>
-
-<option value="29" >Numberologics, Alchemy, Linguinomics, and other Academiology</option>
-
-<option value="17" > Mathematics</option>
-
-<option value="18" > Science</option>
-
-<option value="59" > Fictional Science</option>
-
-<option value="25" > Language/Linguistics</option>
-
-<option value="44" > School</option>
-
-<option value="30" >Analytical Engines</option>
-
-<option value="20" > The Help Desk</option>
-
-<option value="11" > Coding</option>
-
-<option value="12" > Computer Science</option>
-
-<option value="36" > Hardware</option>
-
-<option value="40" > Religious Wars</option>
-
-<option value="31" >Enigmas and Diversions</option>
-
-<option value="3" > Logic Puzzles</option>
-
-<option value="14" > Forum Games</option>
-
-<option value="53" > Mafia</option>
-
-<option value="4" > Your art and links</option>
-
-<option value="43" > Fit Club</option>
-
-<option value="32" >High Culture</option>
-
-<option value="21" > Gaming</option>
-
-<option value="22" > Movies and TV Shows</option>
-
-<option value="23" > Music</option>
-
-<option value="24" > Books</option>
-
-<option value="49" > Comics/Graphic Novels</option>
-
-<option value="39" > Food</option>
-
-<option value="33" >Site Administration</option>
-
-<option value="10" > Site/Forum issues</option>
-
-<option value="5" > News</option>
-
-<option value="52" >Duat</option>
-
-<option value="47" > Free as in Destitute</option>
-
-<option value="51" > Jesse is a handsome and intelligent man who smells nice</option>
-
-<option value="55" > 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"> mscha</option>
+<option value="http://geekwagon.net/projects/xkcd1190/" > geekwagon</option>
+<option value="http://xkcd.aubronwood.com" > aubronwood</option>
+<option value="http://mrob.com/time/replay/index.html" > Time replay</option>
+<option value="http://xkcd.modularthought.com/TimeDragsOn" > Time drags on</option>
+<option value="http://xkcdtime.comicsfu.com/" > Time ebook</option>
+<option value="http://xkcd.mscha.org/timeaftertime.html" >time after Time</option>
+<option value="http://xkcd.mscha.org/vieweraftertime/prickly0001" > Prickly, Lucky</option>
+<option value="http://xkcd.mscha.org/vieweraftertime/beany0001" > Beany 1</option>
+<option value="http://xkcd.mscha.org/vieweraftertime/bean2-001" > Beany 2</option>
+<option value="http://xkcd.mscha.org/vieweraftertime/t1i-0000" > t1i</option>
+<option value="http://" >meta time after Time</option>
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ongoing.htm?f=0" > bftf</option>
+<option value="http://forums.xkcd.com/viewtopic.php?f=7&t=101043" >the OTT</option>
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ott"> the ЯOЯЯIM TTO</option>
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ott/mview" > the Mustardtime Otherthread</option>
+<option value="http://contingency.chirpingmustard.com"> the Raftcastle</option>
+<option value="http://xkcd-time.wikia.com/wiki/Useful_External_Links" >resources</option>
+<option value="http://wiki.chirpingmustard.com" > the Wiki</option>
+<option value="http://db.chirpingmustard.com" > the Database</option>
+<option value="http://mrob.com/time" > the mr*bdex</option>
+<option value="http://xkcd-time.kieryn.com/" > Kieryn's dedication</option>
+<option value="http://edfel.atwebpages.com/Time-Map.php" > the Time map</option>
+<option value="http://ottermap.chirpingmustard.com" > the OTTer map</option>
+<option value="https://github.com/Pikrass/timescripts" > Pirkass' scripts</option>
+<option value="http://mrob.com/time/scripts-beta/index.html" > mrob27's scripts</option>
+<option value="http://xkcd.mscha.org/sciscitor/" > constellations</option>
+<option value="http://xkcd.mscha.org/jjjdavidson/" > graphs and stuff</option>
+<option value="http://calendar.chirpingmustard.com/" > the Ecclesiastical Calendar</option>
+<option value="http://xkcd-time.wikia.com/wiki/Games" >hotdogs</option>
+<option value="http://castle.chirpingmustard.com/" > Sandcastle Builder</option>
+<option value="http://mrob.com/time/Q04B/" > Q04B</option>
+<option value="http://kayzgames.itch.io/pfffth?secret=DuJYQ4KCOiZojPbSLXF7gTxoF9c%3d" > PFFFTH!</option>
+<option value="http://thred.github.io/xkcd-time-catapult/#0fbc" > the Trebuchet game</option>
+<option value="http://mrob.com/time/chirp.html" > Chirpy Raptor</option>
+<option value="http://automome.chirpingmustard.com/" > AUTOMOME (Link)</option>
+<option value="http://mrob.com/time/automome" > AUTOMOME (mrob27)</option>
+<option value="http://xkcd.modularthought.com/ottomeme/" > OTToMeme</option>
</select>
<input type="submit" value="Go" class="button2" />
</fieldset>
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> ® Forum Software © 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> ® Forum Software © phpBB Group<br/>
</div>
<computery stuff>:<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;">
<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> ® Forum Software © 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> ® Forum Software © phpBB Group<br/>
</div>
<computery stuff>:<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;">
###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" > Individual XKCD Comic Threads</option>\r
-<option value="60" > What If?</option>\r
-<option value="27" >Sound and Fury</option>\r
-<option value="9" > News & Articles</option>\r
-<option value="8" > Serious Business</option>\r
-<option value="16" > XKCD Meetups</option>\r
-<option value="2" > General</option>\r
-<option value="29" >Numberologics, Alchemy, Linguinomics, and other Academiology</option>\r
-<option value="17" > Mathematics</option>\r
-<option value="18" > Science</option>\r
-<option value="59" > Fictional Science</option>\r
-<option value="25" > Language/Linguistics</option>\r
-<option value="44" > School</option>\r
-<option value="30" >Analytical Engines</option>\r
-<option value="20" > The Help Desk</option>\r
-<option value="11" > Coding</option>\r
-<option value="12" > Computer Science</option>\r
-<option value="36" > Hardware</option>\r
-<option value="40" > Religious Wars</option>\r
-<option value="31" >Enigmas and Diversions</option>\r
-<option value="3" > Logic Puzzles</option>\r
-<option value="14" > Forum Games</option>\r
-<option value="53" > Mafia</option>\r
-<option value="4" > Your art and links</option>\r
-<option value="43" > Fit Club</option>\r
-<option value="32" >High Culture</option>\r
-<option value="21" > Gaming</option>\r
-<option value="22" > Movies and TV Shows</option>\r
-<option value="23" > Music</option>\r
-<option value="24" > Books</option>\r
-<option value="49" > Comics/Graphic Novels</option>\r
-<option value="39" > Food</option>\r
-<option value="33" >Site Administration</option>\r
-<option value="10" > Site/Forum issues</option>\r
-<option value="5" > News</option>\r
-<option value="52" >Duat</option>\r
-<option value="47" > Free as in Destitute</option>\r
-<option value="51" > Jesse is a handsome and intelligent man who smells nice</option>\r
-<option value="55" > 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"> mscha</option>\r
+<option value="http://geekwagon.net/projects/xkcd1190/" > geekwagon</option>\r
+<option value="http://xkcd.aubronwood.com" > aubronwood</option>\r
+<option value="http://mrob.com/time/replay/index.html" > Time replay</option>\r
+<option value="http://xkcd.modularthought.com/TimeDragsOn" > Time drags on</option>\r
+<option value="http://xkcdtime.comicsfu.com/" > 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" > Prickly, Lucky</option>\r
+<option value="http://xkcd.mscha.org/vieweraftertime/beany0001" > Beany 1</option>\r
+<option value="http://xkcd.mscha.org/vieweraftertime/bean2-001" > Beany 2</option>\r
+<option value="http://xkcd.mscha.org/vieweraftertime/t1i-0000" > t1i</option>\r
+<option value="http://" >meta time after Time</option>\r
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ongoing.htm?f=0" > bftf</option>\r
+<option value="http://forums.xkcd.com/viewtopic.php?f=7&t=101043" >the OTT</option>\r
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ott"> the ЯOЯЯIM TTO</option>\r
+<option value="http://1190.bicyclesonthemoon.dnsd.info/ott/mview" > the Mustardtime Otherthread</option>\r
+<option value="http://contingency.chirpingmustard.com"> the Raftcastle</option>\r
+<option value="http://xkcd-time.wikia.com/wiki/Useful_External_Links" >resources</option>\r
+<option value="http://wiki.chirpingmustard.com" > the Wiki</option>\r
+<option value="http://db.chirpingmustard.com" > the Database</option>\r
+<option value="http://mrob.com/time" > the mr*bdex</option>\r
+<option value="http://xkcd-time.kieryn.com/" > Kieryn's dedication</option>\r
+<option value="http://edfel.atwebpages.com/Time-Map.php" > the Time map</option>\r
+<option value="http://ottermap.chirpingmustard.com" > the OTTer map</option>\r
+<option value="https://github.com/Pikrass/timescripts" > Pirkass' scripts</option>\r
+<option value="http://mrob.com/time/scripts-beta/index.html" > mrob27's scripts</option>\r
+<option value="http://xkcd.mscha.org/sciscitor/" > constellations</option>\r
+<option value="http://xkcd.mscha.org/jjjdavidson/" > graphs and stuff</option>\r
+<option value="http://calendar.chirpingmustard.com/" > the Ecclesiastical Calendar</option>\r
+<option value="http://xkcd-time.wikia.com/wiki/Games" >hotdogs</option>\r
+<option value="http://castle.chirpingmustard.com/" > Sandcastle Builder</option>\r
+<option value="http://mrob.com/time/Q04B/" > Q04B</option>\r
+<option value="http://kayzgames.itch.io/pfffth?secret=DuJYQ4KCOiZojPbSLXF7gTxoF9c%3d" > PFFFTH!</option>\r
+<option value="http://thred.github.io/xkcd-time-catapult/#0fbc" > the Trebuchet game</option>\r
+<option value="http://mrob.com/time/chirp.html" > Chirpy Raptor</option>\r
+<option value="http://automome.chirpingmustard.com/" > AUTOMOME (Link)</option>\r
+<option value="http://mrob.com/time/automome" > AUTOMOME (mrob27)</option>\r
+<option value="http://xkcd.modularthought.com/ottomeme/" > 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
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> ® Forum Software © 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> ® Forum Software © phpBB Group<br/>\r
\r
</div>\r
<computery stuff>:<br/>\r
</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
</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> ® Forum Software © 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> ® Forum Software © phpBB Group<br/>
</div>
<computery stuff>:<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;">
.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; }
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; }
/* 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
---------------------------------------- */
.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"); }
# 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
{\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(/ /,"\\ ",tag)\r
+ gsub(/\t/,"\\ ",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
# 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.
#
{
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"
{
print "<ul class=\"profile-icons\" >" >> outfile
print "<li class=\"quote-icon\" ><a title=\"Reply with quote\" href=\"###foraaddr;/posting.php?mode=quote&f=7&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
}
};
-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
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
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
--- /dev/null
+// 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;
+}
cgi=cgiInit();
- printf("Content-type: text/html\n\n");
file = fopen(LAST_PATH,"rt");
if(file!=NULL)
{
}
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);
return 0;
}
+ printf("Content-type: text/html\n\n");
+
arg=cgiGetValue(cgi,"np");
if(arg!=NULL)
sscanf(arg,"%lu",&np);
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);
# 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.
#
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&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"&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>"
}
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
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
}\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
\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
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
}\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
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
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
}\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
\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
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
}\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
// 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.
//
###AWK_VIEW
###TEMP_PATHp
###AWK_B2H
+###AWK_VERIFY
s_cgi *cgi;
pid_t sub;
char *notify = &zero;
char *Preview = &zero;
char *post =&zero;
+char *addquote =&zero;
+char *edit =&zero;
+char *forceID =&zero;
char wrong[256];
void submit();
}
case '\n':
if(br&0x01)
- fprintf(file," <br/> ");
+ fprintf(file,"<br/>");
case '\r':
if(br&0x01)
break;
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");
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);
fclose(tempfile);
tf=false;
- printf("Content-type: text/html\n\n");
sprintf(arg1,"outfile=%s",temppath);
fflush(stdout);
sub=fork();
}
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)
{
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> » 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&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> » 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&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&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&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)
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);
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)
--- /dev/null
+// 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 • ЯOЯЯIM TTO • 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
--- /dev/null
+# 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"]"&attach_sig=on\">quote</a></td></tr>"\r
+}
\ No newline at end of file
# 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=""addquotename addquotetime""]"addquotehtml"[/quote]"\r
+ }\r
};\r
{\r
if ($0 ~ /^###HTML/)\r
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
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)"
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\""
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\""
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/\""
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\""
print CAT_PATH
next
}
+ if($1 ~ /^###LS_PATH$/)
+ {
+ print LS_PATH
+ next
+ }
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
print TEMP_PATHv
next
}
+ if($1 ~ /^###TEMP_PATHr$/)
+ {
+ print TEMP_PATHr
+ next
+ }
+ if($1 ~ /^###TEMP_PATHm$/)
+ {
+ print TEMP_PATHm
+ next
+ }
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
--- /dev/null
+// 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
--- /dev/null
+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