1<?php
2
3if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../../../../../../').'/');
4define ('CKG_META_DIR',DOKU_INC .'data/meta');
5
6function ckg_get_title($page,$dir) {
7
8  $id = preg_replace('/.txt/','.meta',$page) ;
9
10      $meta_file = CKG_META_DIR . $dir . $id;
11      if(file_exists($meta_file) && is_readable ($meta_file)){
12           $inf_str = file_get_contents($meta_file);
13           $inf = @unserialize($inf_str);
14           if(isset($inf['current']['title']) && !empty($inf['current']['title'])) {
15               return ($inf['current']['title']);
16           }
17      }
18      return "";
19 }
20
21