Merge commit 'origin/master' into branch_2.3

This commit is contained in:
Shish 2009-01-25 09:58:56 -08:00
commit dfc7411975
4 changed files with 14 additions and 7 deletions

View File

@ -99,8 +99,10 @@ class PixelFileHandler implements Extension {
$q = $config->get_int("thumb_quality");
$mem = $config->get_int("thumb_max_memory") / 1024 / 1024; // IM takes memory in MB
// convert to bitmap & back to strip metadata -- otherwise we
// can end up with 3KB of jpg data and 200KB of misc extra...
// "-limit memory $mem" broken?
exec("convert {$inname}[0] -geometry {$w}x{$h} -quality {$q} jpg:$outname");
exec("convert {$inname}[0] -geometry {$w}x{$h} bmp:- | convert bmp:- -quality {$q} jpg:$outname");
return true;
}

View File

@ -86,7 +86,7 @@ class Index implements Extension {
send_event(new PostListBuildingEvent($event->context, $search_terms));
if(!(count($search_terms) == 0 && count($images) == 0)) {
if(count($search_terms) > 0 || count($images) > 0 || $page_number > 0) {
$this->theme->set_page($page_number, $total_pages, $search_terms);
$this->theme->display_page($event->page, $images);
}

View File

@ -3,20 +3,24 @@
class Upgrade implements Extension {
public function receive_event(Event $event) {
if($event instanceof InitExtEvent) {
$this->do_things();
$this->do_things($event->context);
}
}
private function do_things() {
global $config;
global $database;
private function do_things($context) {
$config = $context->config;
$database = $context->database;
if(!is_numeric($config->get_string("db_version"))) {
$config->set_int("db_version", 2);
}
if($config->get_int("db_version") < 6) {
$database->upgrade_schema("ext/upgrade/schema.xml");
// cry :S
}
if($config->get_int("db_version") < 6) { // 7
// add column image->locked
}
}
}

View File

@ -187,6 +187,7 @@ function create_tables($dsn) { // {{{
width INTEGER NOT NULL,
height INTEGER NOT NULL,
posted TIMESTAMP NOT NULL DEFAULT SCORE_NOW,
locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N,
INDEX(owner_id),
INDEX(width),
INDEX(height),