Browse Source

Sitemap problems

Fix sitemap problems.
pull/31/merge
Danang Probo Sayekti 12 years ago
parent
commit
521f44df0a
1 changed files with 17 additions and 21 deletions
  1. +17
    -21
      system/includes/functions.php

+ 17
- 21
system/includes/functions.php View File

@ -872,7 +872,7 @@ function generate_rss($posts){
echo $feed;
}
// Return post, tag, archive url.
// Return post, archive url.
function get_path(){
$posts = get_post_sorted();
@ -911,22 +911,6 @@ function get_path(){
// The post URL
$post->url = site_url().date('Y/m', $post->date).'/'.str_replace('.md','',$arr[2]);
$tag = array();
$url = array();
$t = explode(',', $arr[1]);
foreach($t as $tt) {
$tag[] = array($tt, site_url(). 'tag/' . $tt);
}
foreach($tag as $a) {
$url[] = $a[1];
}
$post->tag = implode(', ', $url);
$post->tagb = implode(' » ', $url);
$tmp[] = $post;
}
@ -1011,11 +995,23 @@ function generate_sitemap($str){
}
elseif ($str == 'tag') {
$posts = get_path();
$tag = array();
$posts = get_post_unsorted();
$tags = array();
foreach($posts as $p) {
$tag[] = $p->tag;
foreach($posts as $index => $v){
$arr = explode('_', $v);
$data = $arr[1];
$mtag = explode(',', $data);
foreach($mtag as $etag) {
$tags[] = $etag;
}
}
foreach($tags as $t) {
$tag[] = site_url() . 'tag/' . $t;
}
$tag = array_unique($tag, SORT_REGULAR);


Loading…
Cancel
Save