// Look if the profile is a community page
foreach($contacts as $contact) {
if (pages_iscommunity($contact["url"], $pagelist))
- $pages[] = array("url"=>$contact["url"], "Name"=>$contact["Name"]);
+ $pages[] = array("url"=>$contact["url"], "Name"=>$contact["Name"], "id"=>$contact["id"]);
}
// Write back cached pagelist
$contacts = pages_getpages($a->user['uid']);
foreach($contacts as $contact) {
- $pages .= '<li class="tool"><a href="'.$contact["url"].'" class="label" target="external-link">'.$contact["Name"]."</a></li>";
+ $pages .= '<li class="tool"><a href="'.$a->get_baseurl().'/redir/'.$contact["id"].'" class="label" target="external-link">'.
+ $contact["Name"]."</a></li>";
}
$pages .= "</ul></div></div>";
if (sizeof($contacts) > 0)
// clear old cache
Cache::clear();
+ // clear item cache files if they are older than one day
+ $cache = get_config('system','itemcache');
+ if (($cache != '') and is_dir($cache)) {
+ if ($dh = opendir($cache)) {
+ while (($file = readdir($dh)) !== false) {
+ $fullpath = $cache."/".$file;
+ if ((filetype($fullpath) == "file") and filectime($fullpath) < (time() - 1800))
+ unlink($fullpath);
+ }
+ closedir($dh);
+ }
+ }
+
$manual_id = 0;
$generation = 0;
$hub_update = false;
$cache = get_config('system','itemcache');
if (($cache != '')) {
- $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".$attach."-".hash("crc32", $item['body']);
+ $cachefile = $cache."/".$item["guid"]."-".strtotime($item["edited"])."-".hash("crc32", $item['body']);
if (file_exists($cachefile))
$s = file_get_contents($cachefile);