themed redirection after answer

main
fuzzykitten 2025-02-20 13:13:53 -05:00
parent 460c50b4ba
commit a9c2dfc00a
2 changed files with 45 additions and 8 deletions

View File

@ -93,11 +93,15 @@ function answer_redirect($sub, $css)
header( "refresh:3;url=/s/$sub/$css" );
// we wait 3 seconds with the redirection
$print_string = "<h1>Redirection in about 3 secs."
. " If that does not work, go"
. " <a href='/s/$sub/$css'>back</a>.";
$html_string = '<title>wait for it...</title></head>'
. '<body><p id="page">'
. '<div class=\'postcontainer\'>'
. '<div></div><div class=\'post\'>'
. 'Redirection in about 3 secs.'
. ' If that does not work, go'
. " <a href='/s/$sub'>back</a>.</div></div>";
echo "$print_string";
echo "$html_string";
}
// Translate simple bbcode to html, and highlight quotes, like so:

View File

@ -94,11 +94,15 @@ function answer_redirect($sub)
header( "refresh:3;url=/mob/s/$sub" );
// we wait 3 seconds with the redirection
$print_string = "<h3>Redirection in about 3 secs."
. " If that does not work, go"
. " <a href='/mob/s/$sub'>back</a>.";
$html_string = '<title>wait for it...</title></head>'
. '<body><div class="site-container">'
. '<div class="posts" id="posts">'
. '<div class="message first">'
. '<h3>Redirection in about 3 secs.'
. ' If that does not work, go'
. " <a href='/mob/s/$sub'>back</a>.</div></div>";
echo "$print_string";
echo "$html_string";
}
// Translate simple bbcode to html, and highlight quotes, like so:
@ -971,6 +975,7 @@ function make_tables($db)
"text_id" TEXT NOT NULL,
"text" TEXT NOT NULL,
"org_id" INTEGER NOT NULL,
"timestamp" TEXT,
UNIQUE(post_id, sub) ON CONFLICT IGNORE
)');
@ -988,6 +993,34 @@ function make_tables($db)
}
// Make a rough timestamp, like Q1/2025
function make_timestamp(){
$month = date("F");
$year = date("Y");
$quarter_1 = 'January, February, March';
$quarter_2 = 'April, May, June';
$quarter_3 = 'July, August, September';
$quarter_4 = 'October, November, December';
if ( in_array($month, $quarter_1 ) ){
$timestamp = 'Q1';
} elseif ( in_array($month, $quarter_2 ) ){
$timestamp = 'Q2';
} elseif ( in_array($month, $quarter_3 ) ){
$timestamp = 'Q3';
} elseif ( in_array($month, $quarter_4 ) ){
$timestamp = 'Q4';
} else {
echo "something is wrong";
}
$timestamp .= '/' . $year;
return $timestamp;
}
// Make a new post to a sub
function make_post($db, $sub, $settings, $text, $org_id)
{