diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/config/user_agents.php | 3 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_task.php | 6 | ||||
-rw-r--r-- | modules/gallery/helpers/item.php | 19 | ||||
-rw-r--r-- | modules/gallery/helpers/upgrade_checker.php | 3 |
4 files changed, 22 insertions, 9 deletions
diff --git a/modules/gallery/config/user_agents.php b/modules/gallery/config/user_agents.php index 23877c66..7978bb62 100644 --- a/modules/gallery/config/user_agents.php +++ b/modules/gallery/config/user_agents.php @@ -20,3 +20,6 @@ include(SYSPATH . "config/user_agents.php"); $config["robot"]["mj12bot"] = "MJ12bot"; $config["robot"]["speedy spider"] = "Speedy Spider"; +$config["robot"]["baidu"] = "Baiduspider"; +$config["robot"]["bing"] = "Ezooms"; +$config["robot"]["yandex"] = "YandexBot"; diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 4a97d865..4b477540 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -243,7 +243,8 @@ class gallery_task_Core { if (!$task->done) { Cache::instance()->set("update_l10n_cache:{$task->id}", - serialize(array($dirs, $files, $cache, $num_fetched))); + serialize(array($dirs, $files, $cache, $num_fetched)), + array("l10n")); } else { Cache::instance()->delete("update_l10n_cache:{$task->id}"); } @@ -293,7 +294,8 @@ class gallery_task_Core { $task->set("mode", "delete_files"); $task->set("current", 0); $task->set("total", count($files)); - Cache::instance()->set("file_cleanup_cache:{$task->id}", serialize($files)); + Cache::instance()->set("file_cleanup_cache:{$task->id}", serialize($files), + array("file_cleanup")); if (count($files) == 0) { break; } diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index a0654a88..2b663f45 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -407,19 +407,26 @@ class item_Core { * Set the display context callback for any future item renders. */ static function set_display_context_callback() { - $args = func_get_args(); - Cache::instance()->set("display_context_" . $sid = Session::instance()->id(), $args); + if (!request::user_agent("robot")) { + $args = func_get_args(); + Cache::instance()->set("display_context_" . $sid = Session::instance()->id(), $args, + array("display_context")); + } } /** * Call the display context callback for the given item */ static function get_display_context($item) { - $args = Cache::instance()->get("display_context_" . $sid = Session::instance()->id()); - $callback = $args[0]; - $args[0] = $item; - if (!$callback) { + if (!request::user_agent("robot")) { + $args = Cache::instance()->get("display_context_" . $sid = Session::instance()->id()); + $callback = $args[0]; + $args[0] = $item; + } + + if (empty($callback)) { $callback = "Albums_Controller::get_display_context"; + $args = array($item); } return call_user_func_array($callback, $args); } diff --git a/modules/gallery/helpers/upgrade_checker.php b/modules/gallery/helpers/upgrade_checker.php index c11a9319..66058e4f 100644 --- a/modules/gallery/helpers/upgrade_checker.php +++ b/modules/gallery/helpers/upgrade_checker.php @@ -72,7 +72,8 @@ class upgrade_checker_Core { $e->getLine(), $e->getTraceAsString())); } $result->timestamp = time(); - Cache::instance()->set("upgrade_checker_version_info", serialize($result), null, 86400 * 365); + Cache::instance()->set("upgrade_checker_version_info", serialize($result), + array("upgrade"), 86400 * 365); } /** |