summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-16 21:08:01 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-16 21:08:01 +1000
commitb666886416f793074669a7e2bc1d7cc3c2b4746a (patch)
treee5f69f4279621ce72747707e164aa358354b084c /post.php
parent88dff2a683ea580930b95ffa33cccdf648d89cab (diff)
A few modifications:
1. Finally, clean up some of the crappy code in inc/display.php; no more extreme clutter. new Thread() and new Post() take an array as the first parameter now. 2. Poster country flags. Currently requires the "geoip" extension. 3. Give post images a classname. This was also long-overdue.
Diffstat (limited to 'post.php')
-rw-r--r--post.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/post.php b/post.php
index 8a8487e8..11792379 100644
--- a/post.php
+++ b/post.php
@@ -421,6 +421,15 @@ if (isset($_POST['delete'])) {
wordfilters($post['body']);
$post['body'] = escape_markup_modifiers($post['body']);
+ if ($config['country_flags']) {
+ if (!geoip_db_avail(GEOIP_COUNTRY_EDITION)) {
+ error('GeoIP not available: ' . geoip_db_filename(GEOIP_COUNTRY_EDITION));
+ }
+ if ($country_code = @geoip_country_code_by_name('8.8.8.8')) {
+ $post['body'] .= '<tinyboard flag_country>' . strtolower($country_code) . '</tinyboard>';
+ }
+ }
+
if ($mod && isset($post['raw']) && $post['raw']) {
$post['body'] = '<tinyboard raw html>' . $post['body'] . '</tinyboard>';
}