From e056b1eb70d47675dd4658abe830a2a609227ef5 Mon Sep 17 00:00:00 2001 From: Michael Save Date: Thu, 12 Apr 2012 12:53:45 +1000 Subject: fix fatal errors. works with v0.9.6 --- tools/benchmark.php | 78 ++++++++++++++--------------- tools/inc/cli.php | 4 -- tools/rebuild.php | 142 ++++++++++++++++++++++++++-------------------------- 3 files changed, 110 insertions(+), 114 deletions(-) (limited to 'tools') diff --git a/tools/benchmark.php b/tools/benchmark.php index 60aba638..8c97364c 100755 --- a/tools/benchmark.php +++ b/tools/benchmark.php @@ -4,49 +4,49 @@ * benchmark.php - benchmarks thumbnailing methods * */ - - require dirname(__FILE__) . '/inc/cli.php'; - require 'inc/image.php'; + +require dirname(__FILE__) . '/inc/cli.php'; +require 'inc/image.php'; + +// move back to this directory +chdir(dirname(__FILE__)); + +if(count($argv) != 2) + die("Usage: {$argv[0]} [file]\n"); + +$file = $argv[1]; +$extension = strtolower(substr($file, strrpos($file, '.') + 1)); +$out = tempnam($config['tmp'], 'thumb'); +$count = 300; + +function benchmark($method) { + global $config, $file, $extension, $out, $count; - // move back to this directory - chdir(dirname(__FILE__)); + $config['thumb_method'] = $method; - if(count($argv) != 2) - die("Usage: {$argv[0]} [file]\n"); + printf("Method: %s\nThumbnailing %d times... ", $method, $count); - $file = $argv[1]; - $extension = strtolower(substr($file, strrpos($file, '.') + 1)); - $out = tempnam($config['tmp'], 'thumb'); - $count = 300; - - function benchmark($method) { - global $config, $file, $extension, $out, $count; - - $config['thumb_method'] = $method; - - printf("Method: %s\nThumbnailing %d times... ", $method, $count); - - $start = microtime(true); - for($i = 0; $i < $count; $i++) { - $image = new Image($file, $extension); - $thumb = $image->resize( - $config['thumb_ext'] ? $config['thumb_ext'] : $extension, - $config['thumb_width'], - $config['thumb_height'] - ); - - $thumb->to($out); - $thumb->_destroy(); - $image->destroy(); - } - $end = microtime(true); - - printf("Took %.2f seconds (%.2f/second; %.2f ms)\n", $end - $start, $rate = ($count / ($end - $start)), 1000 / $rate); + $start = microtime(true); + for($i = 0; $i < $count; $i++) { + $image = new Image($file, $extension); + $thumb = $image->resize( + $config['thumb_ext'] ? $config['thumb_ext'] : $extension, + $config['thumb_width'], + $config['thumb_height'] + ); - unlink($out); + $thumb->to($out); + $thumb->_destroy(); + $image->destroy(); } + $end = microtime(true); - benchmark('gd'); - benchmark('imagick'); - benchmark('convert'); + printf("Took %.2f seconds (%.2f/second; %.2f ms)\n", $end - $start, $rate = ($count / ($end - $start)), 1000 / $rate); + unlink($out); +} + +benchmark('gd'); +benchmark('imagick'); +benchmark('convert'); + diff --git a/tools/inc/cli.php b/tools/inc/cli.php index 4dc19412..294609cd 100644 --- a/tools/inc/cli.php +++ b/tools/inc/cli.php @@ -33,10 +33,6 @@ if(!getenv('TINYBOARD_PATH')) { putenv('TINYBOARD_PATH=' . getcwd()); require 'inc/functions.php'; -require 'inc/display.php'; -require 'inc/template.php'; -require 'inc/database.php'; -require 'inc/user.php'; require 'inc/mod.php'; $mod = Array( diff --git a/tools/rebuild.php b/tools/rebuild.php index 1560893c..3b5c0de2 100755 --- a/tools/rebuild.php +++ b/tools/rebuild.php @@ -1,5 +1,6 @@ #!/usr/bin/php clearCacheFiles(); + +if(!$options['quiet']) + echo "Regenerating theme files...\n"; +rebuildThemes('all'); + +if(!$options['quiet']) + echo "Generating Javascript file...\n"; +buildJavascript(); + +$main_js = $config['file_script']; + +$boards = listBoards(); + +foreach($boards as &$board) { + if($options['board'] && $board['uri'] != $options['board']) + continue; if(!$options['quiet']) - echo "== Tinyboard {$config['version']} ==\n"; + echo "Opening board /{$board['uri']}/...\n"; + openBoard($board['uri']); - if(!$options['quiet']) - echo "Clearing template cache...\n"; - $twig = new Twig_Environment($loader, Array( - 'cache' => "{$config['dir']['template']}/cache" - )); - $twig->clearCacheFiles(); + if($config['file_script'] != $main_js) { + // different javascript file + if(!$options['quiet']) + echo "Generating Javascript file...\n"; + buildJavascript(); + } - if(!$options['quiet']) - echo "Regenerating theme files...\n"; - rebuildThemes('all'); if(!$options['quiet']) - echo "Generating Javascript file...\n"; - buildJavascript(); + echo "Creating index pages...\n"; + buildIndex(); - $main_js = $config['file_script']; + if($options['quick']) + continue; // do no more - $boards = listBoards(); - - foreach($boards as &$board) { - if($options['board'] && $board['uri'] != $options['board']) - continue; - - if(!$options['quiet']) - echo "Opening board /{$board['uri']}/...\n"; - openBoard($board['uri']); - - if($config['file_script'] != $main_js) { - // different javascript file - if(!$options['quiet']) - echo "Generating Javascript file...\n"; - buildJavascript(); - } - - - if(!$options['quiet']) - echo "Creating index pages...\n"; - buildIndex(); - - if($options['quick']) - continue; // do no more - - if($options['full']) { - $query = query(sprintf("SELECT `id` FROM `posts_%s`", $board['uri'])) or error(db_error()); - while($post = $query->fetch()) { - if(!$options['quiet']) - echo "Rebuilding #{$post['id']}...\n"; - rebuildPost($post['id']); - } - } - - $query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); + if($options['full']) { + $query = query(sprintf("SELECT `id` FROM `posts_%s`", $board['uri'])) or error(db_error()); while($post = $query->fetch()) { if(!$options['quiet']) echo "Rebuilding #{$post['id']}...\n"; - buildThread($post['id']); + rebuildPost($post['id']); } } - if(!$options['quiet']) - printf("Complete! Took %g seconds\n", microtime(true) - $start); - - unset($board); - modLog('Rebuilt everything using tools/rebuild.php'); + $query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); + while($post = $query->fetch()) { + if(!$options['quiet']) + echo "Rebuilding #{$post['id']}...\n"; + buildThread($post['id']); + } +} + +if(!$options['quiet']) + printf("Complete! Took %g seconds\n", microtime(true) - $start); + +unset($board); +modLog('Rebuilt everything using tools/rebuild.php'); -- cgit v1.3 From 12d1636b405e3dd9a700c504956c74b0ef1f6a46 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 2 Jul 2013 22:48:43 -0400 Subject: tools/inc/lib/jsgettext/: bundle jsgettext library from https://code.google.com/p/jsgettext --- tools/inc/lib/jsgettext/JSParser.php | 94 ++++++++++++++++++++++++++++++++ tools/inc/lib/jsgettext/PoeditParser.php | 83 ++++++++++++++++++++++++++++ tools/inc/lib/jsgettext/PoeditString.php | 29 ++++++++++ tools/inc/lib/jsgettext/jsgettext.php | 59 ++++++++++++++++++++ tools/inc/lib/jsgettext/po2json.php | 42 ++++++++++++++ tools/inc/lib/jsgettext/test.js | 27 +++++++++ 6 files changed, 334 insertions(+) create mode 100644 tools/inc/lib/jsgettext/JSParser.php create mode 100644 tools/inc/lib/jsgettext/PoeditParser.php create mode 100644 tools/inc/lib/jsgettext/PoeditString.php create mode 100644 tools/inc/lib/jsgettext/jsgettext.php create mode 100644 tools/inc/lib/jsgettext/po2json.php create mode 100644 tools/inc/lib/jsgettext/test.js (limited to 'tools') diff --git a/tools/inc/lib/jsgettext/JSParser.php b/tools/inc/lib/jsgettext/JSParser.php new file mode 100644 index 00000000..f3cec7f7 --- /dev/null +++ b/tools/inc/lib/jsgettext/JSParser.php @@ -0,0 +1,94 @@ +regs[$this->regsCounter] = $match[1]; + $id = "<regsCounter}>>"; + $this->regsCounter++; + return $id; + } + protected function _extractStrings($match) { + $this->strings[$this->stringsCounter] = $this->importRegExps($match[0]); + $id = "<stringsCounter}>>"; + $this->stringsCounter++; + return $id; + } + protected function importRegExps($input) { + $regs = $this->regs; + return preg_replace_callback("#<>#", function ($match) use($regs) { + return $regs[$match[1]]; + }, $input); + } + + protected function importStrings($input) { + $strings = $this->strings; + return preg_replace_callback("#<>#", function ($match) use($strings) { + return $strings[$match[1]]; + }, $input); + } + + public function __construct($file, $keywords = '_') { + $this->content = file_get_contents($file); + $this->keywords = (array)$keywords; + } + + public function parse() { + $output = htmlspecialchars($this->content, ENT_NOQUOTES); + + // extract reg exps + $output = preg_replace_callback( + '# ( / (?: (?>[^/\\\\]++) | \\\\\\\\ | (?[^"\\\\]++) | \\\\\\\\ | (?[^'\\\\]++) | \\\\\\\\ | (?strings; + $output = preg_replace_callback("#<>#", function($match) use($strings) { + return $strings[$match[1]]; + }, $output); + + $keywords = implode('|', $this->keywords); + + $strings = array(); + + // extract func calls + preg_match_all( + '# (?:'.$keywords.') \(\\ *" ( (?: (?>[^"\\\\]++) | \\\\\\\\ | (?[^'\\\\]++) | \\\\\\\\ | (? \ No newline at end of file diff --git a/tools/inc/lib/jsgettext/PoeditParser.php b/tools/inc/lib/jsgettext/PoeditParser.php new file mode 100644 index 00000000..5ed0ac00 --- /dev/null +++ b/tools/inc/lib/jsgettext/PoeditParser.php @@ -0,0 +1,83 @@ +file = $file; + } + + public function parse() { + $contents = file_get_contents($this->file); + + $parts = preg_split('#(\r\n|\n){2}#', $contents, -1, PREG_SPLIT_NO_EMPTY); + + $this->header = array_shift($parts); + + foreach ($parts as $part) { + + // parse comments + $comments = array(); + preg_match_all('#^\\#: (.*?)$#m', $part, $matches, PREG_SET_ORDER); + foreach ($matches as $m) $comments[] = $m[1]; + + $isFuzzy = preg_match('#^\\#, fuzzy$#im', $part) ? true : false; + + preg_match_all('# ^ (msgid|msgstr)\ " ( (?: (?>[^"\\\\]++) | \\\\\\\\ | (?_fixQuotes($matches2[0][2]); + $v = !empty($matches2[1][2]) ? $this->_fixQuotes($matches2[1][2]) : ''; + + $this->strings[$k] = new PoeditString($k, $v, $isFuzzy, $comments); + } + } + + public function merge($strings) { + foreach ((array)$strings as $str) { + if (!in_array($str, array_keys($this->strings))) { + $this->strings[$str] = new PoeditString($str); + } + } + } + + public function getHeader() { + return $this->header; + } + + public function getStrings() { + return $this->strings; + } + + public function getJSON() { + $str = array(); + foreach ($this->strings as $s) { + if ($s->value) $str[$s->key] = $s->value; + } + return json_encode($str); + } + + public function toJSON($outputFilename, $varName = 'l10n') { + $str = "$varName = " . $this->getJSON(); + return file_put_contents($outputFilename, $str) !== false; + } + + public function save($filename = null) { + $data = $this->header . "\n\n"; + foreach ($this->strings as $str) { + $data .= $str; + } + return file_put_contents($filename ? $filename : $this->file, $data) !== false; + } +} + + +?> \ No newline at end of file diff --git a/tools/inc/lib/jsgettext/PoeditString.php b/tools/inc/lib/jsgettext/PoeditString.php new file mode 100644 index 00000000..3d59d004 --- /dev/null +++ b/tools/inc/lib/jsgettext/PoeditString.php @@ -0,0 +1,29 @@ +key = $key; + $this->value = $value; + $this->fuzzy = $fuzzy; + $this->comments = (array)$comments; + } + + public function __toString() { + $str =''; + foreach ($this->comments as $c) { + $str .= "#: $c\n"; + } + if ($this->fuzzy) $str .= "#, fuzzy\n"; + $str .= 'msgid "'.str_replace('"', '\\"', $this->key).'"' . "\n"; + $str .= 'msgstr "'.str_replace('"', '\\"', $this->value).'"' . "\n"; + $str .= "\n"; + return $str; + } +} + +?> \ No newline at end of file diff --git a/tools/inc/lib/jsgettext/jsgettext.php b/tools/inc/lib/jsgettext/jsgettext.php new file mode 100644 index 00000000..3ce2c9f7 --- /dev/null +++ b/tools/inc/lib/jsgettext/jsgettext.php @@ -0,0 +1,59 @@ + array(), + '-o' => null, + '-k' => '_' + ); + $len = count($args); + $i = 0; + while ($i < $len) { + if (preg_match('#^-[a-z]$#i', $args[$i])) { + $options[$args[$i]] = isset($args[$i+1]) ? trim($args[$i+1]) : true; + $i += 2; + } + else { + $options['files'][] = $args[$i]; + $i++; + } + } + return $options; + } + + $options = buildOptions($argv); + + if (!file_exists($options['-o']) || !is_writable($options['-o'])) { + die("Invalid output file name. Make sure it exists and is writable."); + } + + $inputFiles = $options['files']; + + if (empty($inputFiles)) { + die("You did not provide any input file."); + } + + $poeditParser = new PoeditParser($options['-o']); + $poeditParser->parse(); + + $errors = array(); + + foreach ($inputFiles as $f) { + if (!is_readable($f) || !preg_match('#\.js$#', $f)) { + $errors[] = ("$f is not a valid javascript file."); + continue; + } + $jsparser = new JSParser($f, explode(' ', $options['-k'])); + $jsStrings = $jsparser->parse(); + $poeditParser->merge($jsStrings); + } + + if (!empty($errors)) { + echo "\nThe following errors occured:\n" . implode("\n", $errors) . "\n"; + } + + $poeditParser->save(); +?> diff --git a/tools/inc/lib/jsgettext/po2json.php b/tools/inc/lib/jsgettext/po2json.php new file mode 100644 index 00000000..847b0899 --- /dev/null +++ b/tools/inc/lib/jsgettext/po2json.php @@ -0,0 +1,42 @@ + null, + '-i' => null, + '-n' => 'l10n' + ); + $len = count($args); + $i = 0; + while ($i < $len) { + if (preg_match('#^-[a-z]$#i', $args[$i])) { + $options[$args[$i]] = isset($args[$i+1]) ? trim($args[$i+1]) : true; + $i += 2; + } + else { + $options[] = $args[$i]; + $i++; + } + } + return $options; + } + + $options = buildOptions($argv); + + if (!file_exists($options['-i']) || !is_readable($options['-i'])) { + die("Invalid input file. Make sure it exists and is readable."); + } + + $poeditParser = new PoeditParser($options['-i']); + $poeditParser->parse(); + + if ($poeditParser->toJSON($options['-o'], $options['-n'])) { + $strings = count($poeditParser->getStrings()); + echo "Successfully exported " . count($strings) . " strings.\n"; + } + else { + echo "Cannor write to file '{$options['-o']}'.\n"; + } +?> diff --git a/tools/inc/lib/jsgettext/test.js b/tools/inc/lib/jsgettext/test.js new file mode 100644 index 00000000..996e9a8a --- /dev/null +++ b/tools/inc/lib/jsgettext/test.js @@ -0,0 +1,27 @@ +function _(s) { + return typeof l10n[s] != 'undefined' ? l10n[s] : s; +} +function test(param) { + var a = _("Hello world, testing jsgettext"); + func(_('Test string')); + var reg1 = /"[a-z]+"/i; + var reg2 = /[a-z]+\+\/"aa"/i; + var s1 = _('string 1: single quotes'); + var s2 = _("string 2: double quotes"); + var s3 = _("/* comment in string */"); + var s4 = _("regexp in string: /[a-z]+/i"); + var s5 = jsgettext( "another function" ); + var s6 = avoidme("should not see me!"); + var s7 = _("string 2: \"escaped double quotes\""); + var s8 = _('string 2: \'escaped single quotes\''); + + // "string in comment" + //; + + /** + * multiple + * lines + * comment + * _("Hello world from comment") + */ +} \ No newline at end of file -- cgit v1.3 From 79b6428718d1c0a3272f970a2689bc1ab031e94c Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 2 Jul 2013 23:57:47 -0400 Subject: tools/inc/lib/jsgettext/: apply fixes from bugtracker --- tools/inc/lib/jsgettext/jsgettext.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/inc/lib/jsgettext/jsgettext.php b/tools/inc/lib/jsgettext/jsgettext.php index 3ce2c9f7..6c70f0b4 100644 --- a/tools/inc/lib/jsgettext/jsgettext.php +++ b/tools/inc/lib/jsgettext/jsgettext.php @@ -10,7 +10,7 @@ '-k' => '_' ); $len = count($args); - $i = 0; + $i = 1; while ($i < $len) { if (preg_match('#^-[a-z]$#i', $args[$i])) { $options[$args[$i]] = isset($args[$i+1]) ? trim($args[$i+1]) : true; @@ -26,7 +26,11 @@ $options = buildOptions($argv); - if (!file_exists($options['-o']) || !is_writable($options['-o'])) { + if (!file_exists($options['-o'])) { + touch($options['-o']); + } + + if (!is_writable($options['-o'])) { die("Invalid output file name. Make sure it exists and is writable."); } -- cgit v1.3 From ad809eecebbede02b7e089c5ca2451f9520adddf Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 2 Jul 2013 23:58:37 -0400 Subject: tools/inc/lib/jsgettext/: remove unnecessary file --- tools/inc/lib/jsgettext/test.js | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 tools/inc/lib/jsgettext/test.js (limited to 'tools') diff --git a/tools/inc/lib/jsgettext/test.js b/tools/inc/lib/jsgettext/test.js deleted file mode 100644 index 996e9a8a..00000000 --- a/tools/inc/lib/jsgettext/test.js +++ /dev/null @@ -1,27 +0,0 @@ -function _(s) { - return typeof l10n[s] != 'undefined' ? l10n[s] : s; -} -function test(param) { - var a = _("Hello world, testing jsgettext"); - func(_('Test string')); - var reg1 = /"[a-z]+"/i; - var reg2 = /[a-z]+\+\/"aa"/i; - var s1 = _('string 1: single quotes'); - var s2 = _("string 2: double quotes"); - var s3 = _("/* comment in string */"); - var s4 = _("regexp in string: /[a-z]+/i"); - var s5 = jsgettext( "another function" ); - var s6 = avoidme("should not see me!"); - var s7 = _("string 2: \"escaped double quotes\""); - var s8 = _('string 2: \'escaped single quotes\''); - - // "string in comment" - //; - - /** - * multiple - * lines - * comment - * _("Hello world from comment") - */ -} \ No newline at end of file -- cgit v1.3 From 73fb2cfe5531a74a6368ed653ef1026774febcd0 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 00:12:28 -0400 Subject: tools/i18n_*: introduction of translation tools for tinyboard; supporting javascript i18n --- tools/i18n_compile.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ tools/i18n_extract.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100755 tools/i18n_compile.php create mode 100755 tools/i18n_extract.php (limited to 'tools') diff --git a/tools/i18n_compile.php b/tools/i18n_compile.php new file mode 100755 index 00000000..c85ccb83 --- /dev/null +++ b/tools/i18n_compile.php @@ -0,0 +1,44 @@ +#!/usr/bin/php + Date: Wed, 3 Jul 2013 00:50:43 -0400 Subject: tools/inc/lib/jsgettext/: misc fixes --- tools/inc/lib/jsgettext/JSParser.php | 4 ++-- tools/inc/lib/jsgettext/PoeditParser.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/inc/lib/jsgettext/JSParser.php b/tools/inc/lib/jsgettext/JSParser.php index f3cec7f7..adba59bc 100644 --- a/tools/inc/lib/jsgettext/JSParser.php +++ b/tools/inc/lib/jsgettext/JSParser.php @@ -41,7 +41,7 @@ class JSParser { } public function parse() { - $output = htmlspecialchars($this->content, ENT_NOQUOTES); + $output = $this->content; //htmlspecialchars($this->content, ENT_NOQUOTES); // extract reg exps $output = preg_replace_callback( @@ -91,4 +91,4 @@ class JSParser { return $strings; } } -?> \ No newline at end of file +?> diff --git a/tools/inc/lib/jsgettext/PoeditParser.php b/tools/inc/lib/jsgettext/PoeditParser.php index 5ed0ac00..eebd816e 100644 --- a/tools/inc/lib/jsgettext/PoeditParser.php +++ b/tools/inc/lib/jsgettext/PoeditParser.php @@ -66,7 +66,7 @@ class PoeditParser { } public function toJSON($outputFilename, $varName = 'l10n') { - $str = "$varName = " . $this->getJSON(); + $str = "$varName = " . $this->getJSON() . ";"; return file_put_contents($outputFilename, $str) !== false; } @@ -80,4 +80,4 @@ class PoeditParser { } -?> \ No newline at end of file +?> -- cgit v1.3 From ca72ad64cab0e37437ac2cc3328468ba4dbf3a8b Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:04:08 -0400 Subject: js i18n: misc fixes; quick-reply.js i18n Conflicts: js/quick-reply.js templates/main.js --- tools/i18n_compile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/i18n_compile.php b/tools/i18n_compile.php index c85ccb83..ce00051c 100755 --- a/tools/i18n_compile.php +++ b/tools/i18n_compile.php @@ -35,10 +35,10 @@ foreach ($locales as $loc) { if (file_exists($locdir."/LC_MESSAGES/tinyboard.po")) $join = "-j"; else $join = ""; `cd $locdir/LC_MESSAGES; - msgfmt tinyboard.po`; + msgfmt tinyboard.po -o tinyboard.mo`; // Generate javascript.po `cd tools/inc/lib/jsgettext/; php po2json.php -i ../../../../$locdir/LC_MESSAGES/javascript.po \ - -o ../../../../$locdir/LC_MESSAGES/javascript.js -k tb_i18n`; + -o ../../../../$locdir/LC_MESSAGES/javascript.js`; } -- cgit v1.3 From cb82c7d28a9d6ee6fc97ef5b7dc28b174b8fb2b3 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:24:09 -0400 Subject: i18n tools: small fixes --- tools/i18n_compile.php | 8 ++++---- tools/i18n_extract.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tools') diff --git a/tools/i18n_compile.php b/tools/i18n_compile.php index ce00051c..ba193767 100755 --- a/tools/i18n_compile.php +++ b/tools/i18n_compile.php @@ -34,11 +34,11 @@ foreach ($locales as $loc) { // Generate tinyboard.po if (file_exists($locdir."/LC_MESSAGES/tinyboard.po")) $join = "-j"; else $join = ""; - `cd $locdir/LC_MESSAGES; - msgfmt tinyboard.po -o tinyboard.mo`; + passthru("cd $locdir/LC_MESSAGES; + msgfmt tinyboard.po -o tinyboard.mo"); // Generate javascript.po - `cd tools/inc/lib/jsgettext/; + passthru("cd tools/inc/lib/jsgettext/; php po2json.php -i ../../../../$locdir/LC_MESSAGES/javascript.po \ - -o ../../../../$locdir/LC_MESSAGES/javascript.js`; + -o ../../../../$locdir/LC_MESSAGES/javascript.js"); } diff --git a/tools/i18n_extract.php b/tools/i18n_extract.php index 1e729c3b..b43e16a0 100755 --- a/tools/i18n_extract.php +++ b/tools/i18n_extract.php @@ -38,10 +38,10 @@ foreach ($locales as $loc) { // Generate tinyboard.po if (file_exists($locdir."/LC_MESSAGES/tinyboard.po")) $join = "-j"; else $join = ""; - `cd $locdir/LC_MESSAGES; - xgettext -d tinyboard -L php --from-code utf-8 $join -c $(find ../../../../ -name \*.php)`; + passthru("cd $locdir/LC_MESSAGES; + xgettext -d tinyboard -L php --from-code utf-8 $join -c $(find ../../../../ -name \*.php)"); // Generate javascript.po - `cd tools/inc/lib/jsgettext/; - php jsgettext.php -o ../../../../$locdir/LC_MESSAGES/javascript.po $(find ../../../../js/ -name \*.js)`; + passthru("cd tools/inc/lib/jsgettext/; + php jsgettext.php -o ../../../../$locdir/LC_MESSAGES/javascript.po $(find ../../../../js/ -name \*.js)"); } -- cgit v1.3 From 1f2b4e0181fc032e4f9be58306d66cb9828f9dae Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 3 Jul 2013 01:37:48 -0400 Subject: i18n_extract tool: replace the bundled lib with gettext forced to assume python, since it extracts more strings --- tools/i18n_extract.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/i18n_extract.php b/tools/i18n_extract.php index b43e16a0..33650b50 100755 --- a/tools/i18n_extract.php +++ b/tools/i18n_extract.php @@ -42,6 +42,6 @@ foreach ($locales as $loc) { xgettext -d tinyboard -L php --from-code utf-8 $join -c $(find ../../../../ -name \*.php)"); // Generate javascript.po - passthru("cd tools/inc/lib/jsgettext/; - php jsgettext.php -o ../../../../$locdir/LC_MESSAGES/javascript.po $(find ../../../../js/ -name \*.js)"); + passthru("cd $locdir/LC_MESSAGES; + xgettext -d javascript -L Python --force-po --from-code utf-8 $join -c $(find ../../../../js/ -name \*.js)"); } -- cgit v1.3 From 0f7b2529940082270271603c5845f11081048c8f Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 31 Jul 2013 16:04:46 -0400 Subject: Convert to UNIX line endings --- stylesheets/dark.css | 300 ++++++++--------- stylesheets/miku.css | 174 +++++----- stylesheets/testorange.css | 416 ++++++++++++------------ stylesheets/wasabi.css | 782 ++++++++++++++++++++++----------------------- tools/benchmark.php | 0 tools/i18n_compile.php | 0 tools/i18n_extract.php | 0 tools/rebuild.php | 0 8 files changed, 836 insertions(+), 836 deletions(-) mode change 100755 => 100644 tools/benchmark.php mode change 100755 => 100644 tools/i18n_compile.php mode change 100755 => 100644 tools/i18n_extract.php mode change 100755 => 100644 tools/rebuild.php (limited to 'tools') diff --git a/stylesheets/dark.css b/stylesheets/dark.css index 8fd7dde4..2248c9d3 100644 --- a/stylesheets/dark.css +++ b/stylesheets/dark.css @@ -1,150 +1,150 @@ -/** - * dark.css - * For AwsumChan by Circlepuller - */ -body { - background: #1E1E1E; - color: #999999; - font-family: sans-serif; - font-size: 12px; -} -h1 { - font-size: 20pt; - text-align: center; - letter-spacing: 0px; -} -div.title, h1 { - color: lime; - font-family: Arial, Helvetica, sans-serif; -} -div.title p { - font-size: 10px; -} -a:link, a:visited, p.intro a.email span.name { - color: #CCCCCC; - text-decoration: underline; - font-family: sans-serif; -} -a:link:hover, a:visited:hover { - color: #FF0000; - font-family: sans-serif; - text-decoration: underline overline; -} -a.post_no { - color: #AAAAAA; - text-decoration: none; -} -a.post_no:hover { - color: maroon; - text-decoration: underline overline; -} -div.post.reply { - background: #333333; - border: #555555 1px solid; -} -div.post.reply.highlighted { - background: transparent; - border: transparent 1px solid; -} -div.post.reply div.body a:link, div.post.reply div.body a:visited { - color: #CCCCCC; -} -div.post.reply div.body a:link:hover, div.post.reply div.body a:visited:hover { - color: #FF0000; -} -p.intro span.subject { - font-size: 12px; - font-family: sans-serif; - color: #446655; - font-weight: 800; -} -p.intro span.name { - color: #00CC00; - font-weight: 800; -} -p.intro a.capcode, p.intro a.nametag { - color: magenta; - margin-left: 0; -} -p.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name { - color: #00CCCC; -} -input[type="text"], textarea, select { - background: #333333; - color: #CCCCCC; - border: #666666 1px solid; - padding-left: 5px; - padding-right: -5px; - font-family: sans-serif; - font-size: 10pt; -} -input[type="password"] { - background: #333333; - color: #CCCCCC; - border: #666666 1px solid; -} -form table tr th { - background: #333333; - color: #AAAAAA; - font-weight: 800; - text-align: left; - padding: 0; -} -div.banner { - background: #00AA00; - color: #FFFFFF; - text-align: center; - width: 250px; - padding: 4px; - padding-left: 12px; - padding-right: 12px; - margin-left: auto; - margin-right: auto; - font-size: 12px; -} -input[type="submit"] { - background: #333333; - border: #888888 1px solid; - color: #CCCCCC; -} -input[type="submit"]:hover { - background: #555555; - border: #888888 1px solid; - color: #FF0000; -} -p.fileinfo a:hover { - text-decoration: underline; -} -span.trip { - color: #AAAAAA; -} -div.pages { - color: #AAAAAA; - background: #333333; - border: #666666 1px solid; - font-family: sans-serif; - font-size: 10pt; -} -div.pages a.selected { - color: #CCCCCC; -} -hr { - height: 1px; - border: #333333 1px solid; -} -div.boardlist { - color: #999999; -} -div.ban { - background-color: transparent; - border: transparent 0px solid; -} -div.ban h2 { - background: transparent; - color: lime; - font-size: 12px; -} -table.modlog tr th { - background: #333333; - color: #AAAAAA; -} +/** + * dark.css + * For AwsumChan by Circlepuller + */ +body { + background: #1E1E1E; + color: #999999; + font-family: sans-serif; + font-size: 12px; +} +h1 { + font-size: 20pt; + text-align: center; + letter-spacing: 0px; +} +div.title, h1 { + color: lime; + font-family: Arial, Helvetica, sans-serif; +} +div.title p { + font-size: 10px; +} +a:link, a:visited, p.intro a.email span.name { + color: #CCCCCC; + text-decoration: underline; + font-family: sans-serif; +} +a:link:hover, a:visited:hover { + color: #FF0000; + font-family: sans-serif; + text-decoration: underline overline; +} +a.post_no { + color: #AAAAAA; + text-decoration: none; +} +a.post_no:hover { + color: maroon; + text-decoration: underline overline; +} +div.post.reply { + background: #333333; + border: #555555 1px solid; +} +div.post.reply.highlighted { + background: transparent; + border: transparent 1px solid; +} +div.post.reply div.body a:link, div.post.reply div.body a:visited { + color: #CCCCCC; +} +div.post.reply div.body a:link:hover, div.post.reply div.body a:visited:hover { + color: #FF0000; +} +p.intro span.subject { + font-size: 12px; + font-family: sans-serif; + color: #446655; + font-weight: 800; +} +p.intro span.name { + color: #00CC00; + font-weight: 800; +} +p.intro a.capcode, p.intro a.nametag { + color: magenta; + margin-left: 0; +} +p.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name { + color: #00CCCC; +} +input[type="text"], textarea, select { + background: #333333; + color: #CCCCCC; + border: #666666 1px solid; + padding-left: 5px; + padding-right: -5px; + font-family: sans-serif; + font-size: 10pt; +} +input[type="password"] { + background: #333333; + color: #CCCCCC; + border: #666666 1px solid; +} +form table tr th { + background: #333333; + color: #AAAAAA; + font-weight: 800; + text-align: left; + padding: 0; +} +div.banner { + background: #00AA00; + color: #FFFFFF; + text-align: center; + width: 250px; + padding: 4px; + padding-left: 12px; + padding-right: 12px; + margin-left: auto; + margin-right: auto; + font-size: 12px; +} +input[type="submit"] { + background: #333333; + border: #888888 1px solid; + color: #CCCCCC; +} +input[type="submit"]:hover { + background: #555555; + border: #888888 1px solid; + color: #FF0000; +} +p.fileinfo a:hover { + text-decoration: underline; +} +span.trip { + color: #AAAAAA; +} +div.pages { + color: #AAAAAA; + background: #333333; + border: #666666 1px solid; + font-family: sans-serif; + font-size: 10pt; +} +div.pages a.selected { + color: #CCCCCC; +} +hr { + height: 1px; + border: #333333 1px solid; +} +div.boardlist { + color: #999999; +} +div.ban { + background-color: transparent; + border: transparent 0px solid; +} +div.ban h2 { + background: transparent; + color: lime; + font-size: 12px; +} +table.modlog tr th { + background: #333333; + color: #AAAAAA; +} diff --git a/stylesheets/miku.css b/stylesheets/miku.css index abc4fc97..23fb1d9d 100644 --- a/stylesheets/miku.css +++ b/stylesheets/miku.css @@ -1,87 +1,87 @@ -/** - * miku.css - * For AwsumChan by Circlepuller - */ -body { - background: #D2FFEE url('img/fade-miku.png') top repeat-x; -} - -a:link, a:visited { - text-decoration: none; - color: #0093AB; -} - -a:link:hover, a:visited:hover { - color: #DD0000; -} - -a.post_no { - color: #000033; -} - -p.intro a.email span.name { - color: #0093AB; -} - -p.intro a.email:hover span.name { - color: #DD0000; -} - -h2, div.title, h1 { - color: #800000; -} - -form table tr th { - background: #95D2D3; -} - -div.banner { - background-color: #E04000; -} - -div.post.op hr { - border-color: #B7C9D5; -} - -p.intro span.subject { - color: #117743; - font-weight: 800; -} - -p.intro span.name { - color: #117743; - font-weight: 800; -} - -div.post.reply.highlighted { - background: #9988EE; -} - -div.post.reply { - background: #B6DDDE; - border-color: #8FCCCD; -} - -div.ban { - border: 1px solid #0093AB; -} - -div.ban h2 { - background: #B6DDDE; - color: #0093AB; -} - -div.pages { - color: #8899AA; - background: #B6DDDE; - border-right: 1px solid #8FCCCD; - border-bottom: 1px solid #8FCCCD; -} - -hr { - border-color: #B7D9C5; -} - -div.boardlist { - color: #0093AB; -} +/** + * miku.css + * For AwsumChan by Circlepuller + */ +body { + background: #D2FFEE url('img/fade-miku.png') top repeat-x; +} + +a:link, a:visited { + text-decoration: none; + color: #0093AB; +} + +a:link:hover, a:visited:hover { + color: #DD0000; +} + +a.post_no { + color: #000033; +} + +p.intro a.email span.name { + color: #0093AB; +} + +p.intro a.email:hover span.name { + color: #DD0000; +} + +h2, div.title, h1 { + color: #800000; +} + +form table tr th { + background: #95D2D3; +} + +div.banner { + background-color: #E04000; +} + +div.post.op hr { + border-color: #B7C9D5; +} + +p.intro span.subject { + color: #117743; + font-weight: 800; +} + +p.intro span.name { + color: #117743; + font-weight: 800; +} + +div.post.reply.highlighted { + background: #9988EE; +} + +div.post.reply { + background: #B6DDDE; + border-color: #8FCCCD; +} + +div.ban { + border: 1px solid #0093AB; +} + +div.ban h2 { + background: #B6DDDE; + color: #0093AB; +} + +div.pages { + color: #8899AA; + background: #B6DDDE; + border-right: 1px solid #8FCCCD; + border-bottom: 1px solid #8FCCCD; +} + +hr { + border-color: #B7D9C5; +} + +div.boardlist { + color: #0093AB; +} diff --git a/stylesheets/testorange.css b/stylesheets/testorange.css index 505ba5f5..7b1ce0a6 100644 --- a/stylesheets/testorange.css +++ b/stylesheets/testorange.css @@ -1,208 +1,208 @@ -/* +piwnichan style, based on testorange.css from Karachan */ - -body { - font-family: sans-serif; - font-size: 12px; - color:#bebebe; - - background-color: #1e1e1e; - background-image: url('img/testorange_testo.png'), url('img/testorange_top_bg.gif'), url('img/testorange_bg.gif'); - background-repeat: no-repeat, repeat-x, repeat; - background-attachment: fixed, scroll, scroll; - background-position: right bottom, 0% 0%, 0% 0%; -} - -a:link, a:visited, div.post.reply div.body a { - color:#ff9100; - text-decoration: none; -} -a:link:hover, a:visited:hover, div.post.reply div.body a:hover { - color:#ffff00; -} - -a.email span.name { - color:#ff9100 !important; - -} - -input { - color: #000; - background: #fff; -} -textarea { - background: #dedede url('img/testorange_textarea_bg.gif') repeat-x; -} -input, textarea { - border: 1px #fff solid; -} - -hr { - width: 100%; - height: 1px; - border: none; - background: #707070; - overflow: hidden; -} - -.reflink a:hover{ - font-weight: bold; -} -.adminbar { - text-align:right; - clear:both; - float:right; -} -h1 { - clear:both; - text-align:center; - font-size: 2.5em; - color:#ff9100; - width:100%; -} -div.title { - color:#ff9100; -} -div.banner, .replymode, .catalogmode { - text-align:center; - margin: 5px 0 5px 0; - padding: 5px 2px 5px 2px; - color:#000; - font-weight: bold; - width:100%; -} -.postblock, form table th { - color: #000; - font-size: 11px; - font-weight: bold; - text-align: center !important; -} - -.postarea { -} -.rules { - width: 468px; - font-size: 10px; -} -.rules li { - margin-left: 1em; -} -.footer { - text-align:center; - font-size:12px; -} -.passvalid { - text-align:center; - width:100%; - color:#ffffff; -} -.dellist { - font-weight: bold; - text-align:center; -} -.delbuttons { - text-align:center; - padding-bottom:4px; - -} -.managehead { - background-color: #1e1e1e; - color: #bebebe; - padding:0px; -} -.postlists { - background: #000; - width:100%; - padding:0px; - color: #bebebe; -} -.row1 { - background-color: #1e1e1e; - color: #bebebe; -} -.row2 { - background: #1e1e1e; - color: #bebebe; -} -.unkfunc { - background:inherit; - color:#789922; -} -.filesize { - text-decoration:none; -} -.filetitle { - background:inherit; - font-size:1.2em; - color: #bebebe; - font-weight:800; -} -span.name, .postername { - color:#fff !important; - font-weight:bold; -} -span.trip, .postertrip { - color:#707070; -} -.oldpost { - color:#CC1105; - font-weight:800; -} -.omittedposts { - color:#707070; -} -.reply { - padding: 5px; - border: 1px #707070 solid !important; - background: #282828 !important; - - -webkit-border-radius: 10px; - -khtml-border-radius: 10px; - -moz-border-radius: 10px; - border-radius: 10px; -} -.replyhl { - background-color: #1e1e1e; - color: #bebebe; -} -.doubledash { - vertical-align:top; - clear:both; - float:left; -} -.replytitle { - font-size: 1.2em; - color:#fff; - font-weight:800; -} -.commentpostername { - color: #fff; - font-weight:800; -} -.thumbnailmsg { - font-size: small; - color: #bebebe; -} -form table th, div.banner, div.pages, .replymode, .postblock, .passvalid, .catalogmode { - background: #ff9100 url('img/testorange_f_bg.gif') repeat-x !important; -} -div.pages { - color: black; - border: 0; -} - -.abbrev { - color:#707070; -} -.highlight { - background:#000; - border: 1px dashed #ff9100; -} - -#watchedthreads { - background-color: #282828 !important; -} - -.reflinkpreview { - background-color: #282828 !important; -} - +/* +piwnichan style, based on testorange.css from Karachan */ + +body { + font-family: sans-serif; + font-size: 12px; + color:#bebebe; + + background-color: #1e1e1e; + background-image: url('img/testorange_testo.png'), url('img/testorange_top_bg.gif'), url('img/testorange_bg.gif'); + background-repeat: no-repeat, repeat-x, repeat; + background-attachment: fixed, scroll, scroll; + background-position: right bottom, 0% 0%, 0% 0%; +} + +a:link, a:visited, div.post.reply div.body a { + color:#ff9100; + text-decoration: none; +} +a:link:hover, a:visited:hover, div.post.reply div.body a:hover { + color:#ffff00; +} + +a.email span.name { + color:#ff9100 !important; + +} + +input { + color: #000; + background: #fff; +} +textarea { + background: #dedede url('img/testorange_textarea_bg.gif') repeat-x; +} +input, textarea { + border: 1px #fff solid; +} + +hr { + width: 100%; + height: 1px; + border: none; + background: #707070; + overflow: hidden; +} + +.reflink a:hover{ + font-weight: bold; +} +.adminbar { + text-align:right; + clear:both; + float:right; +} +h1 { + clear:both; + text-align:center; + font-size: 2.5em; + color:#ff9100; + width:100%; +} +div.title { + color:#ff9100; +} +div.banner, .replymode, .catalogmode { + text-align:center; + margin: 5px 0 5px 0; + padding: 5px 2px 5px 2px; + color:#000; + font-weight: bold; + width:100%; +} +.postblock, form table th { + color: #000; + font-size: 11px; + font-weight: bold; + text-align: center !important; +} + +.postarea { +} +.rules { + width: 468px; + font-size: 10px; +} +.rules li { + margin-left: 1em; +} +.footer { + text-align:center; + font-size:12px; +} +.passvalid { + text-align:center; + width:100%; + color:#ffffff; +} +.dellist { + font-weight: bold; + text-align:center; +} +.delbuttons { + text-align:center; + padding-bottom:4px; + +} +.managehead { + background-color: #1e1e1e; + color: #bebebe; + padding:0px; +} +.postlists { + background: #000; + width:100%; + padding:0px; + color: #bebebe; +} +.row1 { + background-color: #1e1e1e; + color: #bebebe; +} +.row2 { + background: #1e1e1e; + color: #bebebe; +} +.unkfunc { + background:inherit; + color:#789922; +} +.filesize { + text-decoration:none; +} +.filetitle { + background:inherit; + font-size:1.2em; + color: #bebebe; + font-weight:800; +} +span.name, .postername { + color:#fff !important; + font-weight:bold; +} +span.trip, .postertrip { + color:#707070; +} +.oldpost { + color:#CC1105; + font-weight:800; +} +.omittedposts { + color:#707070; +} +.reply { + padding: 5px; + border: 1px #707070 solid !important; + background: #282828 !important; + + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; +} +.replyhl { + background-color: #1e1e1e; + color: #bebebe; +} +.doubledash { + vertical-align:top; + clear:both; + float:left; +} +.replytitle { + font-size: 1.2em; + color:#fff; + font-weight:800; +} +.commentpostername { + color: #fff; + font-weight:800; +} +.thumbnailmsg { + font-size: small; + color: #bebebe; +} +form table th, div.banner, div.pages, .replymode, .postblock, .passvalid, .catalogmode { + background: #ff9100 url('img/testorange_f_bg.gif') repeat-x !important; +} +div.pages { + color: black; + border: 0; +} + +.abbrev { + color:#707070; +} +.highlight { + background:#000; + border: 1px dashed #ff9100; +} + +#watchedthreads { + background-color: #282828 !important; +} + +.reflinkpreview { + background-color: #282828 !important; +} + diff --git a/stylesheets/wasabi.css b/stylesheets/wasabi.css index 73d78017..a080a12a 100644 --- a/stylesheets/wasabi.css +++ b/stylesheets/wasabi.css @@ -1,391 +1,391 @@ -/** - * wasabi.css - * For AwsumChan by Circlepuller - */ -body { - background: #F7F9B0 url('img/fade-yellow.png') repeat-x 50% 0%; - color: black; - font-family: arial, helvetica, sans-serif; - font-size: 10pt; - margin: 0 8px; - padding-left: 5px; - padding-right: 5px; -} -table * { - margin: 0; -} -a:link, a:visited { - text-decoration: underline; - color: #400040; -} -a:link:hover, a:visited:hover { - color: limegreen; -} -a.post_no { - color: black; - text-decoration: none; - margin: 0; - padding: 0; -} -p.intro a.post_no, p.intro a.email { - margin: 0; -} -p.intro a.email span.name { - color: #34345C; -} -p.intro a.email:hover span.name { - color: #ff0000; -} -p.intro label { - display: inline; -} -h2 { - color: #AF0A0F; - font-size: 11pt; - margin: 0px; - padding: 0px; -} -h1 { - font-family: tahoma; - letter-spacing: -2px; - font-size: 20pt; - margin-bottom: 0; -} -h1.logo img { - display: inline; - float: none; - background-image: url('/static/logo_bg.gif'); - background-repeat: no-repeat; - background-position: center; -} -div.title, h1 { - color: #AF0A0F; - text-align: center; -} -div.title { - font-size: 8pt; - margin-bottom: 2em; -} -form { - margin-bottom: 4em; -} -form table { - margin: auto; -} -form table input { - height: auto; -} -input[type="text"], input[type="password"], textarea { - border: 1px solid #a9a9a9; - text-indent: 0px; - text-shadow: none; - text-transform: none; - word-spacing: normal; -} -form table tr td { - text-align: left; - margin: 0px; - padding: 0px; -} -form table tr th { - text-align: left; - padding: 4px; -} -form table tr th { - background: #D7FE85; -} -form table tr td div { - text-align: center; - float: left; - padding-left: 3px; -} -form table tr td div input { - display: block; - margin: 2px auto 0 auto; -} -form table tr td div label { - font-size: 10px; -} -.unimportant, .unimportant * { - font-size: 10px; -} -p.fileinfo { - display: block; - margin: 0px; - padding-right: 7em; -} -div.banner { - background-color: #400040; - font-size: 12pt; - font-weight: bold; - text-align: center; - margin: 1em 0; -} -div.banner, div.banner a { - color: white; -} -div.banner a:hover { - color: #EEF2FF; - text-decoration: none; -} -img.banner { - float: none; - margin: 4px auto 0 auto; -} -img { - display: block; - float: left; - margin: 10px 20px; - border: none; -} -div.post img { - padding: 5px; - margin: 5px 20px 0 0; -} -div.post img.icon { - display: inline; - float: none; - margin: 0 5px; - padding: 0; -} -div.post.op { - margin-right: 20px; - margin-bottom: 5px; -} -div.post.op hr { - border-color: #D9BFB7; -} -p.intro { - margin: 0.5em 0; - padding: 0; - padding-bottom: 0.2em; -} -input.delete { - float: left; - margin: 1px 6px 0 0; -} -p.intro span.subject { - color: #0F0C5D; - font-weight: bold; -} -p.intro span.name { - color: #117743; - font-weight: bold; -} -p.intro a.capcode, p.intro a.nametag { - color: #F00000; - margin-left: 0; -} -p.intro a { - margin-left: 8px; -} -div.delete { - float: right; -} -div.post.reply p { - margin: 0.3em 0 0 0; -} -div.post.reply div.body { - margin-left: 1.8em; - margin-top: 0.8em; - padding-right: 3em; - padding-bottom: 0.3em; -} -div.post.reply.highlighted { - background-color: #FFF; - border-color: #CCC; -} -div.post.reply div.body a { - color: #D00; -} -div.post { - max-width: 97%; -} -div.post div.body { - word-wrap: break-word; -} -div.post.reply { - background: #D7FE85; - margin: 0.2em 16px; - padding: 0.2em 0.3em 0.5em 0.6em; - border-width: 1px; - border-style: none solid solid none; - border-color: lightgreen; - display: inline-block; -} -span.trip { - color: #228854; -} -span.quote { - color: #3C6D8A; -} -span.omitted { - display: block; - margin-top: 1em; -} -br.clear { - clear: left; -} -span.controls { - float: right; - margin: 0; - padding: 0; - font-size: 80%; -} -span.controls.op { - float: none; - margin-left: 10px; -} -span.controls a { - margin: 0; -} -div#wrap { - width: 900px; - margin:0 auto; -} -div.ban { - background-color: white; - border: 1px solid #400040; - max-width: 700px; - margin: 30px auto; -} -div.ban p, div.ban h2 { - padding: 3px 7px; -} -div.ban h2 { - background: #D7FE85; - color: #400040; - font-size: 12pt; -} -div.ban p { - font-size: 12px; - margin-bottom: 12px; -} -div.ban p.reason { - font-weight: bold; -} -span.heading { - color: #AF0A0F; - font-size: 11pt; - font-weight: bold; - display: block; -} -span.spoiler { - background: black; - color: black; -} -div.post.reply div.body span.spoiler a { - color: black; -} -span.spoiler:hover, div.post.reply div.body span.spoiler:hover a { - color: white; -} -div.styles { - float: right; - padding-bottom: 20px; -} -div.styles a { - margin: 0 10px; -} -div.styles a.selected { - text-decoration: none; -} -table.test { - width: 100%; -} -table.test td, table.test th { - text-align: left; - padding: 5px; -} -table.test tr.h th { - background: #98E; -} -table.test td img { - margin: 0; -} -fieldset label { - display: block; -} -div.pages { - color: limegreen; - background: #D7FE85; - display: inline; - padding: 8px; - border-right: 1px solid limegreen; - border-bottom: 1px solid limegreen; -} -div.pages a.selected { - color: black; - font-weight: bolder; -} -div.pages a:link { - text-decoration: none; -} -div.pages form { - margin: 0; - padding: 0; - display: inline; -} -div.pages form input { - margin: 0 5px; - display: inline; -} -hr { - border: none; - border-top: 1px solid limegreen; - height: 0px; -} -div.boardlist { - color: limegreen; - font-size: 9pt; - margin-top: 3px; -} -div.boardlist.bottom { - margin-top: 20px; -} -div.boardlist a { - text-decoration: none; -} -div.report { - color: #333; -} -table.modlog { - margin: auto; - width: 100%; -} -table.modlog tr td { - text-align: left; - margin: 0px; - padding: 4px 15px 0 0; -} -table.modlog tr th { - text-align: left; - padding: 4px 15px 5px 5px; - white-space: nowrap; -} -table.modlog tr th { - background: #D7FE85; -} -td.minimal, th.minimal { - width: 1%; - white-space: nowrap; -} -div.top_notice { - text-align: center; - margin: 5px auto; -} -span.public_ban { - display: block; - color: red; - font-weight: bold; - margin-top: 15px; -} -span.toolong { - display: block; - margin-top: 15px; -} -div.blotter { - color: red; - font-weight: bold; - text-align: center; -} +/** + * wasabi.css + * For AwsumChan by Circlepuller + */ +body { + background: #F7F9B0 url('img/fade-yellow.png') repeat-x 50% 0%; + color: black; + font-family: arial, helvetica, sans-serif; + font-size: 10pt; + margin: 0 8px; + padding-left: 5px; + padding-right: 5px; +} +table * { + margin: 0; +} +a:link, a:visited { + text-decoration: underline; + color: #400040; +} +a:link:hover, a:visited:hover { + color: limegreen; +} +a.post_no { + color: black; + text-decoration: none; + margin: 0; + padding: 0; +} +p.intro a.post_no, p.intro a.email { + margin: 0; +} +p.intro a.email span.name { + color: #34345C; +} +p.intro a.email:hover span.name { + color: #ff0000; +} +p.intro label { + display: inline; +} +h2 { + color: #AF0A0F; + font-size: 11pt; + margin: 0px; + padding: 0px; +} +h1 { + font-family: tahoma; + letter-spacing: -2px; + font-size: 20pt; + margin-bottom: 0; +} +h1.logo img { + display: inline; + float: none; + background-image: url('/static/logo_bg.gif'); + background-repeat: no-repeat; + background-position: center; +} +div.title, h1 { + color: #AF0A0F; + text-align: center; +} +div.title { + font-size: 8pt; + margin-bottom: 2em; +} +form { + margin-bottom: 4em; +} +form table { + margin: auto; +} +form table input { + height: auto; +} +input[type="text"], input[type="password"], textarea { + border: 1px solid #a9a9a9; + text-indent: 0px; + text-shadow: none; + text-transform: none; + word-spacing: normal; +} +form table tr td { + text-align: left; + margin: 0px; + padding: 0px; +} +form table tr th { + text-align: left; + padding: 4px; +} +form table tr th { + background: #D7FE85; +} +form table tr td div { + text-align: center; + float: left; + padding-left: 3px; +} +form table tr td div input { + display: block; + margin: 2px auto 0 auto; +} +form table tr td div label { + font-size: 10px; +} +.unimportant, .unimportant * { + font-size: 10px; +} +p.fileinfo { + display: block; + margin: 0px; + padding-right: 7em; +} +div.banner { + background-color: #400040; + font-size: 12pt; + font-weight: bold; + text-align: center; + margin: 1em 0; +} +div.banner, div.banner a { + color: white; +} +div.banner a:hover { + color: #EEF2FF; + text-decoration: none; +} +img.banner { + float: none; + margin: 4px auto 0 auto; +} +img { + display: block; + float: left; + margin: 10px 20px; + border: none; +} +div.post img { + padding: 5px; + margin: 5px 20px 0 0; +} +div.post img.icon { + display: inline; + float: none; + margin: 0 5px; + padding: 0; +} +div.post.op { + margin-right: 20px; + margin-bottom: 5px; +} +div.post.op hr { + border-color: #D9BFB7; +} +p.intro { + margin: 0.5em 0; + padding: 0; + padding-bottom: 0.2em; +} +input.delete { + float: left; + margin: 1px 6px 0 0; +} +p.intro span.subject { + color: #0F0C5D; + font-weight: bold; +} +p.intro span.name { + color: #117743; + font-weight: bold; +} +p.intro a.capcode, p.intro a.nametag { + color: #F00000; + margin-left: 0; +} +p.intro a { + margin-left: 8px; +} +div.delete { + float: right; +} +div.post.reply p { + margin: 0.3em 0 0 0; +} +div.post.reply div.body { + margin-left: 1.8em; + margin-top: 0.8em; + padding-right: 3em; + padding-bottom: 0.3em; +} +div.post.reply.highlighted { + background-color: #FFF; + border-color: #CCC; +} +div.post.reply div.body a { + color: #D00; +} +div.post { + max-width: 97%; +} +div.post div.body { + word-wrap: break-word; +} +div.post.reply { + background: #D7FE85; + margin: 0.2em 16px; + padding: 0.2em 0.3em 0.5em 0.6em; + border-width: 1px; + border-style: none solid solid none; + border-color: lightgreen; + display: inline-block; +} +span.trip { + color: #228854; +} +span.quote { + color: #3C6D8A; +} +span.omitted { + display: block; + margin-top: 1em; +} +br.clear { + clear: left; +} +span.controls { + float: right; + margin: 0; + padding: 0; + font-size: 80%; +} +span.controls.op { + float: none; + margin-left: 10px; +} +span.controls a { + margin: 0; +} +div#wrap { + width: 900px; + margin:0 auto; +} +div.ban { + background-color: white; + border: 1px solid #400040; + max-width: 700px; + margin: 30px auto; +} +div.ban p, div.ban h2 { + padding: 3px 7px; +} +div.ban h2 { + background: #D7FE85; + color: #400040; + font-size: 12pt; +} +div.ban p { + font-size: 12px; + margin-bottom: 12px; +} +div.ban p.reason { + font-weight: bold; +} +span.heading { + color: #AF0A0F; + font-size: 11pt; + font-weight: bold; + display: block; +} +span.spoiler { + background: black; + color: black; +} +div.post.reply div.body span.spoiler a { + color: black; +} +span.spoiler:hover, div.post.reply div.body span.spoiler:hover a { + color: white; +} +div.styles { + float: right; + padding-bottom: 20px; +} +div.styles a { + margin: 0 10px; +} +div.styles a.selected { + text-decoration: none; +} +table.test { + width: 100%; +} +table.test td, table.test th { + text-align: left; + padding: 5px; +} +table.test tr.h th { + background: #98E; +} +table.test td img { + margin: 0; +} +fieldset label { + display: block; +} +div.pages { + color: limegreen; + background: #D7FE85; + display: inline; + padding: 8px; + border-right: 1px solid limegreen; + border-bottom: 1px solid limegreen; +} +div.pages a.selected { + color: black; + font-weight: bolder; +} +div.pages a:link { + text-decoration: none; +} +div.pages form { + margin: 0; + padding: 0; + display: inline; +} +div.pages form input { + margin: 0 5px; + display: inline; +} +hr { + border: none; + border-top: 1px solid limegreen; + height: 0px; +} +div.boardlist { + color: limegreen; + font-size: 9pt; + margin-top: 3px; +} +div.boardlist.bottom { + margin-top: 20px; +} +div.boardlist a { + text-decoration: none; +} +div.report { + color: #333; +} +table.modlog { + margin: auto; + width: 100%; +} +table.modlog tr td { + text-align: left; + margin: 0px; + padding: 4px 15px 0 0; +} +table.modlog tr th { + text-align: left; + padding: 4px 15px 5px 5px; + white-space: nowrap; +} +table.modlog tr th { + background: #D7FE85; +} +td.minimal, th.minimal { + width: 1%; + white-space: nowrap; +} +div.top_notice { + text-align: center; + margin: 5px auto; +} +span.public_ban { + display: block; + color: red; + font-weight: bold; + margin-top: 15px; +} +span.toolong { + display: block; + margin-top: 15px; +} +div.blotter { + color: red; + font-weight: bold; + text-align: center; +} diff --git a/tools/benchmark.php b/tools/benchmark.php old mode 100755 new mode 100644 diff --git a/tools/i18n_compile.php b/tools/i18n_compile.php old mode 100755 new mode 100644 diff --git a/tools/i18n_extract.php b/tools/i18n_extract.php old mode 100755 new mode 100644 diff --git a/tools/rebuild.php b/tools/rebuild.php old mode 100755 new mode 100644 -- cgit v1.3 From d322c43e419c4349dbf576a924e7b8feb33b076b Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 1 Aug 2013 03:26:39 -0400 Subject: Update for latest Tinyboard (table prefixes) -- breaks compatiability with earlier Tinyboard versions --- tools/rebuild.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/rebuild.php b/tools/rebuild.php index 3b5c0de2..13452264 100644 --- a/tools/rebuild.php +++ b/tools/rebuild.php @@ -81,7 +81,7 @@ foreach($boards as &$board) { continue; // do no more if($options['full']) { - $query = query(sprintf("SELECT `id` FROM `posts_%s`", $board['uri'])) or error(db_error()); + $query = query(sprintf("SELECT `id` FROM ``posts_%s``", $board['uri'])) or error(db_error()); while($post = $query->fetch()) { if(!$options['quiet']) echo "Rebuilding #{$post['id']}...\n"; @@ -89,7 +89,7 @@ foreach($boards as &$board) { } } - $query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); + $query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); while($post = $query->fetch()) { if(!$options['quiet']) echo "Rebuilding #{$post['id']}...\n"; -- cgit v1.3 From 7aae4df443abfa03aa12e43332712c1d7d3e8c14 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 1 Aug 2013 03:48:00 -0400 Subject: chmod +x --- tools/benchmark.php | 0 tools/i18n_compile.php | 0 tools/i18n_extract.php | 0 tools/rebuild.php | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/benchmark.php mode change 100644 => 100755 tools/i18n_compile.php mode change 100644 => 100755 tools/i18n_extract.php mode change 100644 => 100755 tools/rebuild.php (limited to 'tools') diff --git a/tools/benchmark.php b/tools/benchmark.php old mode 100644 new mode 100755 diff --git a/tools/i18n_compile.php b/tools/i18n_compile.php old mode 100644 new mode 100755 diff --git a/tools/i18n_extract.php b/tools/i18n_extract.php old mode 100644 new mode 100755 diff --git a/tools/rebuild.php b/tools/rebuild.php old mode 100644 new mode 100755 -- cgit v1.3 From 8709b3fdfd638dba85d607cf76d1bef88b7a7cb5 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 1 Aug 2013 03:58:44 -0400 Subject: Add convert+gifsicle --- tools/benchmark.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/benchmark.php b/tools/benchmark.php index 8c97364c..f2b5831b 100755 --- a/tools/benchmark.php +++ b/tools/benchmark.php @@ -47,6 +47,10 @@ function benchmark($method) { } benchmark('gd'); -benchmark('imagick'); +if (extension_loaded('imagick')) { + benchmark('imagick'); +} else { + echo "Imagick extension not loaded... skipping.\n"; +} benchmark('convert'); - +benchmark('convert+gifsicle'); -- cgit v1.3 From d6526d27da4b5687749bdc3ce0b8c0611e72517d Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 4 Aug 2013 06:01:40 -0400 Subject: benchmark: add gm --- tools/benchmark.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/benchmark.php b/tools/benchmark.php index f2b5831b..ed7c200d 100755 --- a/tools/benchmark.php +++ b/tools/benchmark.php @@ -53,4 +53,5 @@ if (extension_loaded('imagick')) { echo "Imagick extension not loaded... skipping.\n"; } benchmark('convert'); -benchmark('convert+gifsicle'); +benchmark('gm'); +becnhmark('convert+gifsicle'); -- cgit v1.3 From bb300c5d38285ea54a0d898023f24ca5d180ea9b Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Mon, 19 Aug 2013 01:33:30 +1000 Subject: tools/delete-stray-images.php --- tools/delete-stray-images.php | 61 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tools/delete-stray-images.php (limited to 'tools') diff --git a/tools/delete-stray-images.php b/tools/delete-stray-images.php new file mode 100644 index 00000000..cf0dff46 --- /dev/null +++ b/tools/delete-stray-images.php @@ -0,0 +1,61 @@ +#!/usr/bin/php +fetch(PDO::FETCH_ASSOC)) { + $valid_src[] = $post['file']; + $valid_thumb[] = $post['thumb']; + } + + $files_src = array_map('basename', glob($board['dir'] . $config['dir']['img'] . '*')); + $files_thumb = array_map('basename', glob($board['dir'] . $config['dir']['thumb'] . '*')); + + $stray_src = array_diff($files_src, $valid_src); + $stray_thumb = array_diff($files_thumb, $valid_thumb); + + $stats = array( + 'deleted' => 0, + 'size' => 0 + ); + + foreach ($stray_src as $src) { + $stats['deleted']++; + $stats['size'] = filesize($board['dir'] . $config['dir']['img'] . $src); + if (!file_unlink($board['dir'] . $config['dir']['img'] . $src)) { + $er = error_get_last(); + die("error: " . $er['message'] . "\n"); + } + } + + foreach ($stray_src as $thumb) { + $stats['deleted']++; + $stats['size'] = filesize($board['dir'] . $config['dir']['thumb'] . $thumb); + if (!file_unlink($board['dir'] . $config['dir']['thumb'] . $src)) { + $er = error_get_last(); + die("error: " . $er['message'] . "\n"); + } + } + + echo sprintf("deleted %s files (%s)\n", $stats['deleted'], format_bytes($stats['size'])); +} -- cgit v1.3 From 0e89d39e67ded72bc33552cf692df439b8e963cb Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Mon, 19 Aug 2013 01:36:38 +1000 Subject: +x --- tools/delete-stray-images.php | 1 - 1 file changed, 1 deletion(-) mode change 100644 => 100755 tools/delete-stray-images.php (limited to 'tools') diff --git a/tools/delete-stray-images.php b/tools/delete-stray-images.php old mode 100644 new mode 100755 index cf0dff46..a2718dff --- a/tools/delete-stray-images.php +++ b/tools/delete-stray-images.php @@ -11,7 +11,6 @@ require dirname(__FILE__) . '/inc/cli.php'; - $boards = listBoards(); foreach ($boards as $board) { -- cgit v1.3 From 4562457de7a63b33ca6abb7504161b5a63b3aac9 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Mon, 19 Aug 2013 01:48:40 +1000 Subject: typo --- tools/delete-stray-images.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/delete-stray-images.php b/tools/delete-stray-images.php index a2718dff..cf94dfe5 100755 --- a/tools/delete-stray-images.php +++ b/tools/delete-stray-images.php @@ -47,10 +47,10 @@ foreach ($boards as $board) { } } - foreach ($stray_src as $thumb) { + foreach ($stray_thumb as $thumb) { $stats['deleted']++; $stats['size'] = filesize($board['dir'] . $config['dir']['thumb'] . $thumb); - if (!file_unlink($board['dir'] . $config['dir']['thumb'] . $src)) { + if (!file_unlink($board['dir'] . $config['dir']['thumb'] . $thumb)) { $er = error_get_last(); die("error: " . $er['message'] . "\n"); } -- cgit v1.3 From ce3d2019e1f334ba5787cf125e4b0ac09a9283b4 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 7 Sep 2013 00:10:32 +1000 Subject: inc/mod.php => inc/mod/auth.php --- tools/inc/cli.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/inc/cli.php b/tools/inc/cli.php index 294609cd..ac430cca 100644 --- a/tools/inc/cli.php +++ b/tools/inc/cli.php @@ -33,7 +33,7 @@ if(!getenv('TINYBOARD_PATH')) { putenv('TINYBOARD_PATH=' . getcwd()); require 'inc/functions.php'; -require 'inc/mod.php'; +require 'inc/mod/auth.php'; $mod = Array( 'id' => -1, -- cgit v1.3 From c43386253aafe5e9bb36b72c2337385a1c22d4fb Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 15 Sep 2013 04:23:18 +1000 Subject: disable $config['try_smarter'] --- tools/rebuild.php | 1 + 1 file changed, 1 insertion(+) (limited to 'tools') diff --git a/tools/rebuild.php b/tools/rebuild.php index 13452264..7d6a5abc 100755 --- a/tools/rebuild.php +++ b/tools/rebuild.php @@ -64,6 +64,7 @@ foreach($boards as &$board) { if(!$options['quiet']) echo "Opening board /{$board['uri']}/...\n"; openBoard($board['uri']); + $config['try_smarter'] = false; if($config['file_script'] != $main_js) { // different javascript file -- cgit v1.3