From 9781a796217d15ab10dfa55c8162e7389eb6cdfb Mon Sep 17 00:00:00 2001 From: Danang Probo Sayekti Date: Mon, 4 Jan 2016 09:08:57 +0700 Subject: [PATCH] Fix footnote link Make the footnote link absolute when on teaser --- cache/installedVersion.json | 2 +- system/includes/functions.php | 57 ++++++++++++++++++++++++++++++++++---- themes/twentysixteen/main.html.php | 1 + 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/cache/installedVersion.json b/cache/installedVersion.json index 53efec0..f81f1ef 100644 --- a/cache/installedVersion.json +++ b/cache/installedVersion.json @@ -1,4 +1,4 @@ { "id": 782014, - "tag_name": "v2.7.0" + "tag_name": "v2.7.1" } diff --git a/system/includes/functions.php b/system/includes/functions.php index cb0ffe3..41e5657 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -523,6 +523,8 @@ function get_category_info($category) // Extract the title and body $desc->title = get_content_tag('t', $content, $category); + + // Get the contents and convert it to HTML $desc->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); $desc->description = get_content_tag("d", $content, get_description($desc->body)); @@ -558,15 +560,28 @@ function default_category() function category_list() { - $arr = get_category_info(null); + $dir = "cache/widget"; + $filename = "cache/widget/category.list.cache"; + $tmp = array(); $cat = array(); $list = array(); - foreach ($arr as $a) { - $cat[] = array($a->md, $a->title); + if (is_dir($dir) === false) { + mkdir($dir, 0775, true); + } + + if (file_exists($filename)) { + $cat = unserialize(file_get_contents($filename)); + } else { + $arr = get_category_info(null); + foreach ($arr as $a) { + $cat[] = array($a->md, $a->title); + } + array_push($cat, array('uncategorized', 'Uncategorized')); + asort($cat); + $tmp = serialize($cat); + file_put_contents($filename, print_r($tmp, true)); } - array_push($cat, array('uncategorized', 'Uncategorized')); - asort($cat); echo '