summaryrefslogtreecommitdiff
path: root/inc/search.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2011-05-08 00:51:22 +0200
committerMichael Hamann <michael@content-space.de>2011-05-08 01:21:26 +0200
commit67c15ecea77ff971dcb554de77cf1c25de1140a0 (patch)
tree5c1b0c1502becf18b30cc265e4f40cff058afe40 /inc/search.php
parentdefb7d5769d8bc3c0a23d08419571a19429d1fc6 (diff)
downloadrpg-67c15ecea77ff971dcb554de77cf1c25de1140a0.tar.gz
rpg-67c15ecea77ff971dcb554de77cf1c25de1140a0.tar.bz2
Change when metadata is rendered - only when really needed
This changes the cache logic for metadata. It introduces a new mode that tries to avoid rendering the page again for simple requests but still updates the metadata when the page has been changed (but not when the cache timeout has been reached or purge is used). It simply compares the time of the last rendering with the last modified time of the page. The old boolean $render parameter has been changed into an int with three possible values. Compatibility for the old parameter is provided using a check with is_numeric using the following mapping: - false is still don't render (0 is the new value for that) - true is using that new render logic which means that many plugins will still work unchanged even if they request a lot of data using $render=true (1 is the new value for that providing full compatibility in the case 1 has been used instead of true) The default value for p_get_first_heading is now that new simple cache logic, the default value for getting metadata is the cache logic which should be used with care but is the only way to request (rendered) metadata that can change because of plugin installations or upgrades.
Diffstat (limited to 'inc/search.php')
-rw-r--r--inc/search.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/search.php b/inc/search.php
index db0b008f0..7b53edabe 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -616,7 +616,7 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){
if($type == 'f'){
if($opts['hash']) $item['hash'] = md5(io_readFile($base.'/'.$file,false));
- if($opts['firsthead']) $item['title'] = p_get_first_heading($item['id'],false);
+ if($opts['firsthead']) $item['title'] = p_get_first_heading($item['id'],METADATA_DONT_RENDER);
}
// finally add the item