Compare commits

...

3 Commits

Author SHA1 Message Date
Retro_Guy 41ed0a7df9 Add copy_link to article header 2024-03-20 08:14:31 -07:00
Retro_Guy 50bd662e99 Clean up some php warnings. 2024-03-17 11:22:00 -07:00
Retro_Guy ffb899d6e0 Fix overboard.php cache file version checking. 2024-03-12 08:16:54 -07:00
6 changed files with 28 additions and 9 deletions

View File

@ -239,6 +239,15 @@ $iconv_enable = true;
// '^de\.' => "german.inc" // '^de\.' => "german.inc"
// ); // );
// Get server protocol etc. into string
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
$sitelink = "https";
} else {
$sitelink = "http";
}
$sitelink .= "://";
$sitelink .= $_SERVER['HTTP_HOST'];
/* /*
* Do not edit anything below this line * Do not edit anything below this line
*/ */

View File

@ -485,7 +485,7 @@ function show_header($head, $group, $local_poster = false)
function show_header_short($head, $group, $local_poster = false) function show_header_short($head, $group, $local_poster = false)
{ {
global $article_show, $text_header, $file_article, $file_thread, $attachment_show; global $article_show, $text_header, $file_article, $file_thread, $attachment_show;
global $file_attachment, $anonym_address, $CONFIG, $config_name; global $file_attachment, $anonym_address, $CONFIG, $config_name, $sitelink;
if (isset($_COOKIE['tzo'])) { if (isset($_COOKIE['tzo'])) {
$offset = $_COOKIE['tzo']; $offset = $_COOKIE['tzo'];
} else { } else {
@ -532,6 +532,10 @@ function show_header_short($head, $group, $local_poster = false)
?> ?>
<p id="<?php echo $head->id; ?>" style="position: absolute; z-index: -9999;"><?php echo htmlspecialchars($head->id); ?></p> <p id="<?php echo $head->id; ?>" style="position: absolute; z-index: -9999;"><?php echo htmlspecialchars($head->id); ?></p>
&nbsp;<a href="#" onclick="CopyToClipboard('<?php echo $head->id; ?>');return false;" style="text-decoration: none" title="Copy message-id to clipboard"><i>copy mid</i></a> &nbsp;<a href="#" onclick="CopyToClipboard('<?php echo $head->id; ?>');return false;" style="text-decoration: none" title="Copy message-id to clipboard"><i>copy mid</i></a>
<p id="<?php echo $head->number . 'copy'; ?>" style="position: absolute; z-index: -9999;"><?php echo $sitelink . '/' . $config_name . '/article-flat.php?id=' . $head->number . '&group=' . urlencode($group) . '#' . $head->number; ?></p>
&nbsp;<a href="#" onclick="CopyToClipboard('<?php echo $head->number . 'copy'; ?>');return false;" style="text-decoration: none" title="Copy article link to clipboard"><i>copy link</i></a>
<?php <?php
echo '&nbsp;&nbsp;Newsgroups: '; echo '&nbsp;&nbsp;Newsgroups: ';

View File

@ -1589,7 +1589,7 @@ function threads_db_open($database, $table = "threads")
echo 'Connection failed: ' . $e->getMessage(); echo 'Connection failed: ' . $e->getMessage();
exit(); exit();
} }
$dbh->exec("CREATE TABLE IF NOT EXISTS $table( $dbh->exec("CREATE TABLE IF NOT EXISTS threads(
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
headers TEXT, headers TEXT,
unique (headers))"); unique (headers))");
@ -1604,9 +1604,9 @@ function history_db_open($database, $table = 'history')
echo 'Connection failed: ' . $e->getMessage(); echo 'Connection failed: ' . $e->getMessage();
exit(); exit();
} }
$dbh->exec("CREATE TABLE IF NOT EXISTS $table( $dbh->exec("CREATE TABLE IF NOT EXISTS history(
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
newsgroup TEXT, newsgroup TEXT,
number TEXT, number TEXT,
msgid TEXT, msgid TEXT,
status TEXT, status TEXT,
@ -1636,7 +1636,7 @@ function overview_db_open($database, $table = 'overview')
echo 'Connection failed: ' . $e->getMessage(); echo 'Connection failed: ' . $e->getMessage();
exit(); exit();
} }
$dbh->exec("CREATE TABLE IF NOT EXISTS $table( $dbh->exec("CREATE TABLE IF NOT EXISTS overview(
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
newsgroup TEXT, newsgroup TEXT,
number TEXT, number TEXT,
@ -1672,7 +1672,7 @@ function article_db_open($database, $table = 'articles')
echo 'Connection failed: ' . $e->getMessage(); echo 'Connection failed: ' . $e->getMessage();
exit(); exit();
} }
$dbh->exec("CREATE TABLE IF NOT EXISTS $table( $dbh->exec("CREATE TABLE IF NOT EXISTS articles(
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
newsgroup TEXT, newsgroup TEXT,
number TEXT UNIQUE, number TEXT UNIQUE,
@ -1967,7 +1967,7 @@ function get_user_mail_auth_data($user)
$userfile = $spooldir . '/' . $user . '-articleviews.dat'; $userfile = $spooldir . '/' . $user . '-articleviews.dat';
if (is_file($userfile)) { if (is_file($userfile)) {
$userdata = unserialize(file_get_contents($userfile)); $userdata = unserialize(file_get_contents($userfile));
if (! $userdata['DO.NOT.DELETE']) { if (isset($userdata['DO.NOT.DELETE'])) {
$userdata['DO.NOT.DELETE'] = time(); $userdata['DO.NOT.DELETE'] = time();
} }
} else { } else {

View File

@ -195,6 +195,7 @@ foreach ($grouplist as $findgroup) {
} }
} }
$this_overboard['version'] = $version;
file_put_contents($cachefile, serialize($this_overboard)); file_put_contents($cachefile, serialize($this_overboard));
if (isset($user_time)) { if (isset($user_time)) {
$oldest = ($user_time - 900); $oldest = ($user_time - 900);

View File

@ -291,6 +291,9 @@ if (isset($_POST['sendMessage'])) {
} }
} }
if (isset($_POST['command']) && $_POST['command'] == 'Send') { if (isset($_POST['command']) && $_POST['command'] == 'Send') {
$mail_to = '';
$subject = '';
$message = '';
if (isset($_POST['id'])) { if (isset($_POST['id'])) {
$database = $spooldir . '/mail.db3'; $database = $spooldir . '/mail.db3';
$dbh = mail_db_open($database); $dbh = mail_db_open($database);
@ -336,7 +339,7 @@ view_mailbox($user);
// Show My Messages // Show My Messages
function view_mailbox($user) function view_mailbox($user)
{ {
global $spooldir, $offset; global $spooldir, $offset, $rslight_version;
$database = $spooldir . '/mail.db3'; $database = $spooldir . '/mail.db3';
$dbh = mail_db_open($database); $dbh = mail_db_open($database);
echo '<hr><h1 class="np_thread_headline">My Messages:</h1>'; echo '<hr><h1 class="np_thread_headline">My Messages:</h1>';

View File

@ -198,6 +198,8 @@ if ($_POST['command'] != 'Configuration' && $_POST['command'] != 'SaveConfig') {
if (isset($_POST['source'])) { if (isset($_POST['source'])) {
$link = explode(':', $_POST['source']); $link = explode(':', $_POST['source']);
$golink = '<a href="' . $link[1] . '">Continue to ' . $link[0] . '</a>'; $golink = '<a href="' . $link[1] . '">Continue to ' . $link[0] . '</a>';
} else {
$golink = '';
} }
echo "<center>"; echo "<center>";
echo "<hr><p>You are logged in as " . $_POST['username'] . "</p>"; echo "<hr><p>You are logged in as " . $_POST['username'] . "</p>";