diff options
| author | Shitiz Garg <mail@dragooon.net> | 2014-06-22 18:55:35 +0530 |
|---|---|---|
| committer | Shitiz Garg <mail@dragooon.net> | 2014-06-27 17:48:36 +0530 |
| commit | aebe03f88cb3c2aee6e0b859be82d5235efdacea (patch) | |
| tree | 8e8fe02616a856f463036ab321fb6e04992689a8 /phpBB/viewtopic.php | |
| parent | 6cf6ec33545ae3be2cd6f02f0c23f154006a29cf (diff) | |
| download | forums-aebe03f88cb3c2aee6e0b859be82d5235efdacea.tar forums-aebe03f88cb3c2aee6e0b859be82d5235efdacea.tar.gz forums-aebe03f88cb3c2aee6e0b859be82d5235efdacea.tar.bz2 forums-aebe03f88cb3c2aee6e0b859be82d5235efdacea.tar.xz forums-aebe03f88cb3c2aee6e0b859be82d5235efdacea.zip | |
[ticket/12759] Cache the lang options earlier
Previously it would re-run on every post
PHPBB3-12759
Diffstat (limited to 'phpBB/viewtopic.php')
| -rw-r--r-- | phpBB/viewtopic.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index d87f7de2b0..760b4e5c87 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1270,6 +1270,7 @@ if ($config['load_cpf_viewtopic']) // filter out fields not to be displayed on viewtopic. Yes, it's a hack, but this shouldn't break any MODs. $profile_fields_cache = array(); + $profile_rows = array(); foreach ($profile_fields_tmp as $profile_user_id => $profile_fields) { $profile_fields_cache[$profile_user_id] = array(); @@ -1278,10 +1279,15 @@ if ($config['load_cpf_viewtopic']) if ($profile_field['data']['field_show_on_vt']) { $profile_fields_cache[$profile_user_id][$used_ident] = $profile_field; + $profile_rows[] = $profile_field; } } } - unset($profile_fields_tmp); + + // Cache the language options for optimisation + $cp->cache_profile_fields_lang_options($profile_rows); + + unset($profile_fields_tmp, $profile_rows); } // Generate online information for user |
