From 220609999a78fedce1459df5e89c40b2bd1f7d90 Mon Sep 17 00:00:00 2001 From: szalej Date: Wed, 16 Jan 2013 10:50:20 +0100 Subject: Update inc/functions.php Hide Referrer (nullrefer.com) --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 15037847..bc58b117 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1385,7 +1385,7 @@ function markup_url($matches) { $markup_urls[] = $url; - return '' . $url . '' . $after; + return '' . $url . '' . $after; } function unicodify($body) { -- cgit v1.3 From 5bf53cb581e8e9598405cd1d8531c2672417d32e Mon Sep 17 00:00:00 2001 From: szalej Date: Wed, 16 Jan 2013 11:34:31 +0100 Subject: Update inc/functions.php url ads --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index bc58b117..8bae66d3 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1385,7 +1385,7 @@ function markup_url($matches) { $markup_urls[] = $url; - return '' . $url . '' . $after; + return '' . $url . '' . $after; } function unicodify($body) { -- cgit v1.3 From 3ef2c05bb20d5fc7de528676e8a7c02bfd9135fb Mon Sep 17 00:00:00 2001 From: Marcin Ɓabanowski Date: Wed, 16 Jan 2013 19:49:26 +0100 Subject: url_ads: fix it not working --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 8bae66d3..5d3a5757 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1378,7 +1378,7 @@ function quote($body, $quote=true) { } function markup_url($matches) { - global $markup_urls; + global $config, $markup_urls; $url = $matches[1]; $after = $matches[2]; -- cgit v1.3 From 18516ff8289cc4e0c147f185d29824643b1f960d Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 31 Jul 2013 03:43:01 -0400 Subject: Rename $config['url_ads'] to $config['link_prefix'] --- inc/config.php | 6 ++---- inc/functions.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'inc/functions.php') diff --git a/inc/config.php b/inc/config.php index cf55d149..35b31b86 100644 --- a/inc/config.php +++ b/inc/config.php @@ -335,10 +335,8 @@ $config['auto_unicode'] = true; // Whether to turn URLs into functional links $config['markup_urls'] = true; - $config['url_ads'] = ''; - // Use it if you want to add something before URL - //for example hide referrer 'http://www.nullrefer.com/?' 'http://anonym.to/?' - //or add some sort of ads + // Optional URL prefix for links (eg. "http://anonym.to/?") + $config['link_prefix'] = ''; // Wordfilters are used to automatically replace certain words/phrases with something else. diff --git a/inc/functions.php b/inc/functions.php index 5d3a5757..a261e350 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1385,7 +1385,7 @@ function markup_url($matches) { $markup_urls[] = $url; - return '' . $url . '' . $after; + return '' . $url . '' . $after; } function unicodify($body) { -- cgit v1.3 From babeec8bb9f54eece943b74628c95f976f5ee814 Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 27 Jul 2013 01:50:38 -0400 Subject: localise time values --- inc/functions.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index a261e350..8fdd8927 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -554,35 +554,35 @@ function checkFlood($post) { function until($timestamp) { $difference = $timestamp - time(); if ($difference < 60) { - return $difference . ' second' . ($difference != 1 ? 's' : ''); + return $difference . ' ' . ngettext('second', 'seconds', $difference); } elseif ($difference < 60*60) { - return ($num = round($difference/(60))) . ' minute' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60))) . ' ' . ngettext('minute', 'minutes', $num); } elseif ($difference < 60*60*24) { - return ($num = round($difference/(60*60))) . ' hour' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60))) . ' ' . ngettext('hour', 'hours', $num); } elseif ($difference < 60*60*24*7) { - return ($num = round($difference/(60*60*24))) . ' day' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24))) . ' ' . ngettext('day', 'days', $num); } elseif ($difference < 60*60*24*365) { - return ($num = round($difference/(60*60*24*7))) . ' week' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*7))) . ' ' . ngettext('week', 'weeks', $num); } - return ($num = round($difference/(60*60*24*365))) . ' year' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*365))) . ' ' . ngettext('year', 'years', $num); } function ago($timestamp) { $difference = time() - $timestamp; if ($difference < 60) { - return $difference . ' second' . ($difference != 1 ? 's' : ''); + return $difference . ' ' . ngettext('second', 'seconds', $difference); } elseif ($difference < 60*60) { - return ($num = round($difference/(60))) . ' minute' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60))) . ' ' . ngettext('minute', 'minutes', $num); } elseif ($difference < 60*60*24) { - return ($num = round($difference/(60*60))) . ' hour' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60))) . ' ' . ngettext('hour', 'hours', $num); } elseif ($difference < 60*60*24*7) { - return ($num = round($difference/(60*60*24))) . ' day' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24))) . ' ' . ngettext('day', 'days', $num); } elseif ($difference < 60*60*24*365) { - return ($num = round($difference/(60*60*24*7))) . ' week' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*7))) . ' ' . ngettext('week', 'weeks', $num); } - return ($num = round($difference/(60*60*24*365))) . ' year' . ($num != 1 ? 's' : ''); + return ($num = round($difference/(60*60*24*365))) . ' ' . ngettext('year', 'years', $num); } function displayBan($ban) { -- cgit v1.3 From 3f98522ff2cb6cc90b6f7e1285b27b4ba374eb9c Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 27 Jul 2013 01:21:30 -0400 Subject: i18n one more string in inc/functions.php --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 8fdd8927..783663e7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -599,7 +599,7 @@ function displayBan($ban) { // Show banned page and exit die( Element('page.html', array( - 'title' => 'Banned!', + 'title' => _('Banned!'), 'config' => $config, 'body' => Element('banned.html', array( 'config' => $config, -- cgit v1.3 From 67db0a878a033d98a7daab578a7be8b70dc85b64 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 00:25:32 -0400 Subject: js i18n: finish implementation with addition of the compiled locale strings file to additional javascripts --- inc/functions.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 783663e7..d904e1a2 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1277,6 +1277,12 @@ function buildJavascript() { 'uri' => addslashes((!empty($uri) ? $config['uri_stylesheets'] : '') . $uri)); } + // Check if we have translation for the javascripts; if yes, we add it to additional javascripts + list($pure_locale) = explode(".", $config['locale']); + if (file_exists ($jsloc = "inc/locale/".$pure_locale."/LC_MESSAGES/javascript.js")) { + array_unshift($config['additional_javascript'], $jsloc); + } + $script = Element('main.js', array( 'config' => $config, 'stylesheets' => $stylesheets -- cgit v1.3 From 42e16e233a53e73d8d8796814a588d5df1091f7b Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 31 Jul 2013 06:54:53 -0400 Subject: Javascript l10n: Work without $config['additional_javascript_compile'] --- inc/functions.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index d904e1a2..1ffa32df 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1277,16 +1277,17 @@ function buildJavascript() { 'uri' => addslashes((!empty($uri) ? $config['uri_stylesheets'] : '') . $uri)); } - // Check if we have translation for the javascripts; if yes, we add it to additional javascripts - list($pure_locale) = explode(".", $config['locale']); - if (file_exists ($jsloc = "inc/locale/".$pure_locale."/LC_MESSAGES/javascript.js")) { - array_unshift($config['additional_javascript'], $jsloc); - } - $script = Element('main.js', array( 'config' => $config, 'stylesheets' => $stylesheets )); + + // Check if we have translation for the javascripts; if yes, we add it to additional javascripts + list($pure_locale) = explode(".", $config['locale']); + if (file_exists ($jsloc = "inc/locale/$pure_locale/LC_MESSAGES/javascript.js")) { + $script = file_get_contents($jsloc) . "\n\n" . $script; + } + if ($config['additional_javascript_compile']) { foreach ($config['additional_javascript'] as $file) { $script .= file_get_contents($file); -- cgit v1.3