diff options
-rwxr-xr-x | installer/install.sql | 23 | ||||
-rw-r--r-- | installer/installer.php | 3 | ||||
-rw-r--r-- | modules/comment/helpers/comment_rss.php | 3 | ||||
-rw-r--r-- | modules/comment/views/comments.html.php | 2 | ||||
-rw-r--r-- | modules/gallery/controllers/admin_languages.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/l10n_client.html.php | 1 | ||||
-rw-r--r-- | modules/gallery/views/permissions_browse.html.php | 5 | ||||
-rw-r--r-- | modules/recaptcha/views/admin_recaptcha.html.php | 2 | ||||
-rw-r--r-- | modules/rss/controllers/rss.php | 5 | ||||
-rw-r--r-- | modules/slideshow/helpers/slideshow_event.php | 52 | ||||
-rw-r--r-- | themes/default/views/album.html.php | 2 |
12 files changed, 57 insertions, 45 deletions
diff --git a/installer/install.sql b/installer/install.sql index 21464379..c60a81bc 100755 --- a/installer/install.sql +++ b/installer/install.sql @@ -226,7 +226,7 @@ CREATE TABLE {modules} ( UNIQUE KEY `name` (`name`) ) 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 (1,1,'gallery',11); INSERT INTO {modules} VALUES (2,1,'user',1); INSERT INTO {modules} VALUES (3,1,'comment',2); INSERT INTO {modules} VALUES (4,1,'organize',1); @@ -364,7 +364,7 @@ CREATE TABLE {vars} ( `value` text, PRIMARY KEY (`id`), UNIQUE KEY `module_name` (`module_name`,`name`) -) AUTO_INCREMENT=27 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=28 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'); @@ -373,12 +373,13 @@ INSERT INTO {vars} VALUES (4,'gallery','thumb_size','200'); INSERT INTO {vars} VALUES (5,'gallery','resize_size','640'); INSERT INTO {vars} VALUES (6,'gallery','default_locale','en_US'); INSERT INTO {vars} VALUES (7,'gallery','image_quality','75'); -INSERT INTO {vars} VALUES (9,'gallery','blocks_dashboard_sidebar','a:4:{i:2;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"block_adder\";}i:3;a:2:{i:0;s:7:\"gallery\";i:1;s:5:\"stats\";}i:4;a:2:{i:0;s:7:\"gallery\";i:1;s:13:\"platform_info\";}i:5;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"project_news\";}}'); -INSERT INTO {vars} VALUES (14,'gallery','blocks_dashboard_center','a:4:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}i:9;a:2:{i:0;s:7:\"comment\";i:1;s:15:\"recent_comments\";}}'); -INSERT INTO {vars} VALUES (17,'gallery','choose_default_tookit','1'); -INSERT INTO {vars} VALUES (18,'gallery','date_format','Y-M-d'); -INSERT INTO {vars} VALUES (19,'gallery','date_time_format','Y-M-d H:i:s'); -INSERT INTO {vars} VALUES (20,'gallery','time_format','H:i:s'); -INSERT INTO {vars} VALUES (21,'gallery','show_credits','1'); -INSERT INTO {vars} VALUES (22,'gallery','credits','Powered by <a href=\"%url\">Gallery %version</a>'); -INSERT INTO {vars} VALUES (24,'comment','spam_caught','0'); +INSERT INTO {vars} VALUES (8,'gallery','image_sharpen','15'); +INSERT INTO {vars} VALUES (21,'gallery','time_format','H:i:s'); +INSERT INTO {vars} VALUES (22,'gallery','show_credits','1'); +INSERT INTO {vars} VALUES (23,'gallery','credits','Powered by <a href=\"%url\">Gallery %version</a>'); +INSERT INTO {vars} VALUES (10,'gallery','blocks_dashboard_sidebar','a:4:{i:2;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"block_adder\";}i:3;a:2:{i:0;s:7:\"gallery\";i:1;s:5:\"stats\";}i:4;a:2:{i:0;s:7:\"gallery\";i:1;s:13:\"platform_info\";}i:5;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"project_news\";}}'); +INSERT INTO {vars} VALUES (20,'gallery','date_time_format','Y-M-d H:i:s'); +INSERT INTO {vars} VALUES (19,'gallery','date_format','Y-M-d'); +INSERT INTO {vars} VALUES (15,'gallery','blocks_dashboard_center','a:4:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}i:9;a:2:{i:0;s:7:\"comment\";i:1;s:15:\"recent_comments\";}}'); +INSERT INTO {vars} VALUES (18,'gallery','choose_default_tookit','1'); +INSERT INTO {vars} VALUES (25,'comment','spam_caught','0'); diff --git a/installer/installer.php b/installer/installer.php index 7173a7ee..7fed25c7 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -127,7 +127,8 @@ class installer { $salt .= chr($char); } $password = substr(md5(time() * rand()), 0, 6); - $hashed_password = $salt . md5($salt . $password); + // Escape backslash in preparation for our UPDATE statement. + $hashed_password = str_replace("\\", "\\\\", $salt . md5($salt . $password)); $sql = self::prepend_prefix($config["prefix"], "UPDATE {users} SET `password` = '$hashed_password' WHERE `id` = 2"); if (mysql_query($sql)) { diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index b539887b..4424981d 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -42,10 +42,9 @@ class comment_rss_Core { $comments->where("item_id", $id); } - $comments = $comments->find_all($limit, $offset); $feed->view = "comment.mrss"; $feed->children = array(); - foreach ($comments as $comment) { + foreach ($comments->find_all($limit, $offset) as $comment) { $item = $comment->item(); $feed->children[] = new ArrayObject( array("pub_date" => date("D, d M Y H:i:s T", $comment->created), diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index b7ebdf3a..7eb34c20 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -8,7 +8,7 @@ <? if (!$comments->count()): ?> <p id="gNoCommentsYet"> <?= t("No comments yet. Be the first to <a %attrs>comment</a>!", - array("attrs" => "href=\"#add_comment_form\" class=\"showCommentForm\"")) ?> + array("attrs" => html::mark_clean("href=\"#add_comment_form\" class=\"showCommentForm\""))) ?> </p> <? endif ?> <ul> diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index 894daedb..d91e5205 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -61,7 +61,7 @@ class Admin_Languages_Controller extends Admin_Controller { return $this->index($form); } - if ($form->sharing->share) { + if ($this->input->post("share")) { l10n_client::submit_translations(); message::success(t("Translations submitted")); } else { diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index adfc7fd2..f72ef982 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -268,7 +268,7 @@ class gallery_Core { } else { $disabledState = " "; } - if ($item->is_photo()) { + if ($item->parent()->id != 1) { $options_menu ->append(Menu::factory("ajax_link") ->id("make_album_cover") diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php index 3a43f7d3..b0f424be 100644 --- a/modules/gallery/views/l10n_client.html.php +++ b/modules/gallery/views/l10n_client.html.php @@ -74,7 +74,6 @@ </div> <script type="text/javascript"> var MSG_TRANSLATE_TEXT = <?= t("Translate Text")->for_js() ?>; - var MSG_CLOSE_X = <?= t("X")->for_js() ?>; var l10n_client_data = <?= json_encode($string_list) ?>; var plural_forms = <?= json_encode($plural_forms) ?>; var toggle_l10n_mode_url = <?= html::js_string(url::site("l10n_client/toggle_l10n_mode")) ?>; diff --git a/modules/gallery/views/permissions_browse.html.php b/modules/gallery/views/permissions_browse.html.php index b9af9117..99a1b7bd 100644 --- a/modules/gallery/views/permissions_browse.html.php +++ b/modules/gallery/views/permissions_browse.html.php @@ -29,7 +29,8 @@ <ul id="gMessage"> <li class="gError"> <?= t("Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable <a %mod_rewrite_attrs>mod_rewrite</a> and set <a %apache_attrs><i>AllowOverride FileInfo Options</i></a> to fix this.", - array("mod_rewrite_attrs" => html::mark_clean("href=\"http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html\" target=\"_blank\"", "apache_attrs" => "href=\"http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride\" target=\"_blank\""))) ?> + array("mod_rewrite_attrs" => html::mark_clean('href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank"'), + "apache_attrs" => html::mark_clean('href="http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride" target="_blank"'))) ?> </li> </ul> <? endif ?> @@ -54,4 +55,4 @@ <div id="gEditPermissionForm"> <?= $form ?> </div> -</div>
\ No newline at end of file +</div> diff --git a/modules/recaptcha/views/admin_recaptcha.html.php b/modules/recaptcha/views/admin_recaptcha.html.php index 35722be4..0a4b1f8f 100644 --- a/modules/recaptcha/views/admin_recaptcha.html.php +++ b/modules/recaptcha/views/admin_recaptcha.html.php @@ -4,7 +4,7 @@ <p> <?= t("reCAPTCHA is a free CAPTCHA service that helps to digitize books, newspapers and old time radio shows. In order to use it, you need to sign up for a <a href=\"%domain_url\">reCAPTCHA Public/Private Key pair</a>, which is also free. Once registered, the challenge and response strings are evaluated at <a href=\"%recaptcha_url\">recaptcha.net</a> to determine if the form content has been entered by a bot.", array("domain_url" => $form->get_key_url, - "recaptcha_url" => html::mark_safe("http://recaptcha.net"))) ?> + "recaptcha_url" => html::mark_clean("http://recaptcha.net"))) ?> </p> <?= $form ?> diff --git a/modules/rss/controllers/rss.php b/modules/rss/controllers/rss.php index e9dd9fff..b89bed40 100644 --- a/modules/rss/controllers/rss.php +++ b/modules/rss/controllers/rss.php @@ -26,13 +26,16 @@ class Rss_Controller extends Controller { url::redirect(url::merge(array("page" => 1))); } + // Configurable page size between 1 and 100, default 20 + $page_size = max(1, min(100, $this->input->get("page_size", self::$page_size))); + // Run the appropriate feed callback if (module::is_active($module_id)) { $class_name = "{$module_id}_rss"; if (method_exists($class_name, "feed")) { $feed = call_user_func( array($class_name, "feed"), $feed_id, - ($page - 1) * self::$page_size, self::$page_size, $id); + ($page - 1) * $page_size, $page_size, $id); } } if (empty($feed)) { diff --git a/modules/slideshow/helpers/slideshow_event.php b/modules/slideshow/helpers/slideshow_event.php index 77e296e8..ce26b189 100644 --- a/modules/slideshow/helpers/slideshow_event.php +++ b/modules/slideshow/helpers/slideshow_event.php @@ -31,36 +31,44 @@ class slideshow_event_Core { } static function album_menu($menu, $theme) { - $descendants_count = ORM::factory("item", $theme->item->id) + $descendants_count = ORM::factory("item", $theme->item()->id) ->descendants_count(array("type" => "photo")); if ($descendants_count > 1) { - $menu - ->append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url("javascript:PicLensLite.start(" . - "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") - ->css_id("gSlideshowLink")); + $menu->append(Menu::factory("link") + ->id("slideshow") + ->label(t("View slideshow")) + ->url("javascript:PicLensLite.start(" . + "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})") + ->css_id("gSlideshowLink")); } } static function photo_menu($menu, $theme) { - $menu - ->append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url("javascript:PicLensLite.start(" . - "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") - ->css_id("gSlideshowLink")); + $menu->append(Menu::factory("link") + ->id("slideshow") + ->label(t("View slideshow")) + ->url("javascript:PicLensLite.start(" . + "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})") + ->css_id("gSlideshowLink")); } static function tag_menu($menu, $theme) { - $menu - ->append(Menu::factory("link") - ->id("slideshow") - ->label(t("View slideshow")) - ->url("javascript:PicLensLite.start(" . - "{maxScale:0,feedUrl:PicLensLite.indexFeeds()[0].url})") - ->css_id("gSlideshowLink")); + $menu->append(Menu::factory("link") + ->id("slideshow") + ->label(t("View slideshow")) + ->url("javascript:PicLensLite.start(" . + "{maxScale:0,feedUrl:'" . self::_feed_url($theme) . "'})") + ->css_id("gSlideshowLink")); + } + + private static function _feed_url($theme) { + if ($item = $theme->item()) { + if (!$item->is_album()) { + $item = $item->parent(); + } + return rss::url("gallery/album/{$item->id}?page_size=100"); + } else { + return rss::url("tag/tag/{$theme->tag()->id}?page_size=100"); + } } } diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php index caabeee3..8bc81a31 100644 --- a/themes/default/views/album.html.php +++ b/themes/default/views/album.html.php @@ -30,7 +30,7 @@ <? if ($user->admin || access::can("add", $item)): ?> <? $addurl = url::file("index.php/simple_uploader/app/$item->id") ?> <li><?= t("There aren't any photos here yet! <a %attrs>Add some</a>.", - array("attrs" => "href=\"$addurl\" class=\"gDialogLink\"")) ?></li> + array("attrs" => html::mark_clean("href=\"$addurl\" class=\"gDialogLink\""))) ?></li> <? else: ?> <li><?= t("There aren't any photos here yet!") ?></li> <? endif; ?> |