Skip to content

Commit

Permalink
Merge commit 'upstream/master'
Browse files Browse the repository at this point in the history
Conflicts:

	modules/akismet/views/admin_akismet.html.php
	modules/comment/helpers/comment_rss.php
	modules/gallery/helpers/gallery_rss.php
	modules/gallery/libraries/I18n.php
	modules/gallery/views/permissions_browse.html.php
	modules/gallery/views/simple_uploader.html.php
	modules/info/views/info_block.html.php
	modules/organize/controllers/organize.php
	modules/organize/views/organize.html.php
	modules/organize/views/organize_album.html.php
	themes/default/views/album.html.php
	themes/default/views/movie.html.php
	themes/default/views/photo.html.php
  • Loading branch information
andyst committed Aug 29, 2009
2 parents d5660d2 + a9fcec7 commit a5dfc81
Show file tree
Hide file tree
Showing 120 changed files with 2,673 additions and 3,079 deletions.
5 changes: 5 additions & 0 deletions .htaccess
Expand Up @@ -44,6 +44,11 @@
#
# Then just use your Gallery 3 without the index.php in the url.
#
# NOTE: future upgrades of Gallery 3 will overwrite this file! If you
# want these changes to be persistent, you should talk to your system
# administrator about putting this block into your Apache config
# files.
#
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteBase /
Expand Down
3 changes: 2 additions & 1 deletion index.php
Expand Up @@ -21,7 +21,8 @@
define("IN_PRODUCTION", true);

// Gallery requires PHP 5.2+
version_compare(PHP_VERSION, "5.2.3", "<") and exit("Gallery requires PHP 5.2.3 or newer.");
version_compare(PHP_VERSION, "5.2.3", "<") and
exit("Gallery requires PHP 5.2.3 or newer (you're using " . PHP_VERSION . ")");

// Gallery requires short_tags to be on
!ini_get("short_open_tag") and exit("Gallery requires short_open_tag to be on.");
Expand Down
44 changes: 22 additions & 22 deletions installer/install.sql
Expand Up @@ -11,7 +11,7 @@ CREATE TABLE {access_caches} (
`edit_2` binary(1) NOT NULL default '0',
`add_2` binary(1) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {access_caches} VALUES (1,1,'1','0','0','1','0','0');
DROP TABLE IF EXISTS {access_intents};
Expand All @@ -29,7 +29,7 @@ CREATE TABLE {access_intents} (
`edit_2` binary(1) default NULL,
`add_2` binary(1) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {access_intents} VALUES (1,1,'1','1','0','0','1','1','0','0');
DROP TABLE IF EXISTS {caches};
Expand All @@ -43,7 +43,7 @@ CREATE TABLE {caches} (
`cache` longblob,
PRIMARY KEY (`id`),
KEY `tags` (`tags`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {comments};
SET @saved_cs_client = @@character_set_client;
Expand Down Expand Up @@ -72,7 +72,7 @@ CREATE TABLE {comments} (
`text` text,
`updated` int(9) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {graphics_rules};
SET @saved_cs_client = @@character_set_client;
Expand All @@ -86,7 +86,7 @@ CREATE TABLE {graphics_rules} (
`priority` int(9) NOT NULL,
`target` varchar(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {graphics_rules} VALUES (1,1,'a:3:{s:5:\"width\";i:200;s:6:\"height\";i:200;s:6:\"master\";i:2;}','gallery','resize',100,'thumb');
INSERT INTO {graphics_rules} VALUES (2,1,'a:3:{s:5:\"width\";i:640;s:6:\"height\";i:480;s:6:\"master\";i:2;}','gallery','resize',100,'resize');
Expand All @@ -99,7 +99,7 @@ CREATE TABLE {groups} (
`special` tinyint(1) default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {groups} VALUES (1,'Everybody',1);
INSERT INTO {groups} VALUES (2,'Registered Users',1);
Expand All @@ -111,7 +111,7 @@ CREATE TABLE {groups_users} (
`user_id` int(9) NOT NULL,
PRIMARY KEY (`group_id`,`user_id`),
UNIQUE KEY `user_id` (`user_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {groups_users} VALUES (1,1);
INSERT INTO {groups_users} VALUES (1,2);
Expand All @@ -129,7 +129,7 @@ CREATE TABLE {incoming_translations} (
PRIMARY KEY (`id`),
UNIQUE KEY `key` (`key`,`locale`),
KEY `locale_key` (`locale`,`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {items};
SET @saved_cs_client = @@character_set_client;
Expand Down Expand Up @@ -171,7 +171,7 @@ CREATE TABLE {items} (
KEY `type` (`type`),
KEY `random` (`rand_key`),
KEY `weight` (`weight`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,NULL,0,NULL,'',1,NULL,NULL,2,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1');
DROP TABLE IF EXISTS {items_tags};
Expand All @@ -184,7 +184,7 @@ CREATE TABLE {items_tags} (
PRIMARY KEY (`id`),
KEY `tag_id` (`tag_id`,`id`),
KEY `item_id` (`item_id`,`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {logs};
SET @saved_cs_client = @@character_set_client;
Expand All @@ -200,7 +200,7 @@ CREATE TABLE {logs} (
`url` varchar(255) default NULL,
`user_id` int(9) default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {messages};
SET @saved_cs_client = @@character_set_client;
Expand All @@ -212,7 +212,7 @@ CREATE TABLE {messages} (
`value` varchar(255) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `key` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {modules};
SET @saved_cs_client = @@character_set_client;
Expand All @@ -224,7 +224,7 @@ CREATE TABLE {modules} (
`version` int(9) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {modules} VALUES (1,1,'gallery',10);
INSERT INTO {modules} VALUES (2,1,'user',1);
Expand All @@ -248,7 +248,7 @@ CREATE TABLE {outgoing_translations} (
PRIMARY KEY (`id`),
UNIQUE KEY `key` (`key`,`locale`),
KEY `locale_key` (`locale`,`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {permissions};
SET @saved_cs_client = @@character_set_client;
Expand All @@ -259,7 +259,7 @@ CREATE TABLE {permissions} (
`name` varchar(64) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {permissions} VALUES (1,'View','view');
INSERT INTO {permissions} VALUES (2,'View Full Size','view_full');
Expand All @@ -276,7 +276,7 @@ CREATE TABLE {search_records} (
PRIMARY KEY (`id`),
KEY `item_id` (`item_id`),
FULLTEXT KEY `data` (`data`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {search_records} VALUES (1,1,0,' Gallery');
DROP TABLE IF EXISTS {sessions};
Expand All @@ -287,7 +287,7 @@ CREATE TABLE {sessions} (
`data` text NOT NULL,
`last_activity` int(10) unsigned NOT NULL,
PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {tags};
SET @saved_cs_client = @@character_set_client;
Expand All @@ -298,7 +298,7 @@ CREATE TABLE {tags} (
`count` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {tasks};
SET @saved_cs_client = @@character_set_client;
Expand All @@ -316,7 +316,7 @@ CREATE TABLE {tasks} (
`updated` int(9) default NULL,
PRIMARY KEY (`id`),
KEY `owner_id` (`owner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS {themes};
SET @saved_cs_client = @@character_set_client;
Expand All @@ -327,7 +327,7 @@ CREATE TABLE {themes} (
`version` int(9) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {themes} VALUES (1,'default',1);
INSERT INTO {themes} VALUES (2,'admin_default',1);
Expand All @@ -350,7 +350,7 @@ CREATE TABLE {users} (
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
UNIQUE KEY `hash` (`hash`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {users} VALUES (1,'guest','Guest User','',0,0,NULL,0,1,NULL,NULL,NULL);
INSERT INTO {users} VALUES (2,'admin','Gallery Administrator','',0,0,NULL,1,0,NULL,NULL,NULL);
Expand All @@ -364,7 +364,7 @@ CREATE TABLE {vars} (
`value` text,
PRIMARY KEY (`id`),
UNIQUE KEY `module_name` (`module_name`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
) AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;
INSERT INTO {vars} VALUES (1,'gallery','active_site_theme','default');
INSERT INTO {vars} VALUES (2,'gallery','active_admin_theme','admin_default');
Expand Down
7 changes: 7 additions & 0 deletions installer/installer.php
Expand Up @@ -104,6 +104,13 @@ static function select_db($config) {
mysql_select_db($config["dbname"]);
}

static function verify_version($config) {
$result = mysql_query("SHOW VARIABLES WHERE variable_name = \"version\"");
$row = mysql_fetch_object($result);
$version = substr($row->Value, 0, strpos($row->Value, "-"));
return version_compare($version, "5.0.0", ">=");
}

static function db_empty($config) {
$query = "SHOW TABLES IN {$config['dbname']} LIKE '{$config['prefix']}items'";
return mysql_num_rows(mysql_query($query)) == 0;
Expand Down
5 changes: 5 additions & 0 deletions installer/views/invalid_db_version.html.php
@@ -0,0 +1,5 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<h1> Uh oh! </h1>
<p class="error">
The MySql database that you are referencing is less than the minimum version of 5.0.0.
</p>
6 changes: 6 additions & 0 deletions installer/web.php
Expand Up @@ -41,6 +41,8 @@

if (!installer::connect($config)) {
$content = render("invalid_db_info.html.php");
} else if (!installer::verify_version($config)) {
$content = render("invalid_db_version.html.php");
} else if (!installer::select_db($config)) {
$content = render("missing_db.html.php");
} else if (!installer::db_empty($config)) {
Expand Down Expand Up @@ -104,6 +106,10 @@ function check_environment() {
$errors[] = "PHP is missing the <a href=\"http://php.net/iconv\">iconv extension</a>";
}

if (!(extension_loaded("simplexml"))) {
$errors[] = "PHP is missing the <a href=\"http://php.net/simplexml\">SimpleXML extension</a>";
}

if (extension_loaded("mbstring") && (ini_get("mbstring.func_overload") & MB_OVERLOAD_STRING)) {
$errors[] = "The <a href=\"http://php.net/mbstring\">mbstring extension</a> is overloading PHP's native string functions. Please disable it.";
}
Expand Down
15 changes: 15 additions & 0 deletions lib/gallery.ajax.js
@@ -0,0 +1,15 @@
(function($) {
$.widget("ui.gallery_ajax", {
_init: function() {
this.element.click(function(event) {
eval("var ajax_handler = " + $(event.currentTarget).attr("ajax_handler"));
$.get($(event.currentTarget).attr("href"), function(data) {
eval("var data = " + data);
ajax_handler(data);
});
event.preventDefault();
return false;
});
}
});
})(jQuery);

0 comments on commit a5dfc81

Please sign in to comment.