| 1 | <?php |
|---|
| 2 | if(ereg('gzip', getenv('HTTP_ACCEPT_ENCODING')) && |
|---|
| 3 | !ini_get('zlib.output_compression')) |
|---|
| 4 | { |
|---|
| 5 | ob_start('ob_gzhandler'); |
|---|
| 6 | } |
|---|
| 7 | else ob_start(); |
|---|
| 8 | |
|---|
| 9 | $handle = fopen (JLOG_BASEPATH.'personal'.DIRECTORY_SEPARATOR.'template.tpl', "r"); |
|---|
| 10 | $_body = ""; |
|---|
| 11 | while (!feof($handle)) $_body .= fgets($handle); |
|---|
| 12 | fclose ($handle); |
|---|
| 13 | |
|---|
| 14 | $handle = fopen (JLOG_BASEPATH.'personal'.DIRECTORY_SEPARATOR.'subcurrent.inc', "r"); |
|---|
| 15 | $c['subnav_current'] = ""; |
|---|
| 16 | while (!feof($handle)) $c['subnav_current'] .= fgets($handle); |
|---|
| 17 | fclose ($handle); |
|---|
| 18 | |
|---|
| 19 | // Aditional Header Data |
|---|
| 20 | |
|---|
| 21 | header("Content-Type: text/html; charset=UTF-8"); |
|---|
| 22 | if(!isset($c['meta']['aditionalheader'])) $c['meta']['aditionalheader'] = ""; |
|---|
| 23 | $c['meta']['aditionalheader'] .= ' <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n"; |
|---|
| 24 | if(isset($c['meta']['robots'])) $c['meta']['aditionalheader'] .= ' <meta name="robots" content="'.$c['meta']['robots'].'" />'."\n"; |
|---|
| 25 | if(isset($c['meta']['keywords'])) $c['meta']['aditionalheader'] .= ' <meta name="KeyWords" content="'.htmlspecialchars(strip_tags($c['meta']['keywords']), ENT_QUOTES).'" />'."\n"; |
|---|
| 26 | if(isset($c['meta']['description'])) $c['meta']['aditionalheader'] .= ' <meta name="Description" content="'.htmlspecialchars(strip_tags(trim($c['meta']['description']), ENT_QUOTES)).'" />'."\n"; |
|---|
| 27 | if(isset($c['meta']['date'])) $c['meta']['aditionalheader'] .= ' <meta name="date" content="'.$c['meta']['date'].'" />'; |
|---|
| 28 | if(isset($c['meta']['pingback'])) { |
|---|
| 29 | $c['meta']['aditionalheader'] .= "\n".' <link rel="pingback" href="'.JLOG_PATH.'/xmlrpc.php" />'; |
|---|
| 30 | header("X-Pingback: ".JLOG_PATH."/xmlrpc.php"); |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | $c['meta']['aditionalheader'] .= |
|---|
| 34 | ' <meta http-equiv="Content-Style-Type" content="text/css" /> |
|---|
| 35 | <meta name="generator" content="Jlog v'.JLOG_SOFTWARE_VERSION.'" /> |
|---|
| 36 | <link rel="start" href="'.JLOG_PATH.'/" title="'.$l['meta_start'].'" /> |
|---|
| 37 | <link rel="search" href="'.JLOG_PATH.'/search.php" title="'.$l['meta_search'].'" /> |
|---|
| 38 | <link rel="alternate" type="application/rss+xml" title="RSS 2.0 - Summaries" href="'.JLOG_PATH.'/personal/rss.xml" /> |
|---|
| 39 | <link rel="alternate" type="application/rss+xml" title="RSS 2.0 - Full Posts" href="'.JLOG_PATH.'/personal/rss-full.xml" /> |
|---|
| 40 | <script type="text/javascript" src="'.JLOG_PATH.'/scripts/javascripts.js"></script>'; |
|---|
| 41 | |
|---|
| 42 | // do this on admincenter |
|---|
| 43 | if(defined('JLOG_ADMIN')) { |
|---|
| 44 | // turn off cashing |
|---|
| 45 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
|---|
| 46 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") ." GMT"); |
|---|
| 47 | header("Cache-Control: no-cache"); |
|---|
| 48 | header("Pragma: no-cache"); |
|---|
| 49 | header("Cache-Control: post-check=0, pre-check=0", FALSE); |
|---|
| 50 | // include admin.css |
|---|
| 51 | $c['meta']['aditionalheader'] .= "\n ".'<link rel="stylesheet" href="'.JLOG_PATH.'/personal/css/admin.css" type="text/css" />'; |
|---|
| 52 | $c['main'] = "<div id='admin'>".$c['main']."</div>"; |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | $_search = array ( |
|---|
| 56 | "<jlog:language />", |
|---|
| 57 | "<jlog:website />", |
|---|
| 58 | "<jlog:title />", |
|---|
| 59 | "<jlog:aditional-header />", |
|---|
| 60 | "<jlog:homelink />", |
|---|
| 61 | "<jlog:skipcontent />", |
|---|
| 62 | "<jlog:home />", |
|---|
| 63 | "<jlog:slogan-h />", |
|---|
| 64 | "<jlog:slogan />", |
|---|
| 65 | "<jlog:search-h />", |
|---|
| 66 | "<jlog:searchstring />", |
|---|
| 67 | "<jlog:search />", |
|---|
| 68 | "<jlog:categorieslist-h />", |
|---|
| 69 | "<jlog:current-h />", |
|---|
| 70 | "<jlog:subcurrent />", |
|---|
| 71 | "<jlog:archive-more />", |
|---|
| 72 | "<jlog:archivelink />", |
|---|
| 73 | "<jlog:archive />", |
|---|
| 74 | "<jlog:sub-info />", |
|---|
| 75 | "<jlog:rss-info />", |
|---|
| 76 | "<jlog:rss-link />", |
|---|
| 77 | "<jlog:copyright />", |
|---|
| 78 | "<jlog:content />", |
|---|
| 79 | "<jlog:powered />" |
|---|
| 80 | ); |
|---|
| 81 | |
|---|
| 82 | $_replace = array ( |
|---|
| 83 | $l['language'], |
|---|
| 84 | htmlspecialchars(JLOG_WEBSITE, ENT_QUOTES), |
|---|
| 85 | htmlspecialchars($c['meta']['title']), |
|---|
| 86 | $c['meta']['aditionalheader'], |
|---|
| 87 | JLOG_PATH, |
|---|
| 88 | $l['content_skip'], |
|---|
| 89 | $l['meta_start'], |
|---|
| 90 | $l['subnav_aboutpage'], |
|---|
| 91 | JLOG_DESCRIPTION, |
|---|
| 92 | $l['content_search_topic'], |
|---|
| 93 | '', // bugfix |
|---|
| 94 | $l['content_search'], |
|---|
| 95 | $l['content_categorieslist_h'], |
|---|
| 96 | $l['subnav_current'], |
|---|
| 97 | $c['subnav_current'], |
|---|
| 98 | $l['content_archive'], |
|---|
| 99 | archive(), |
|---|
| 100 | $l['content_archivelink'], |
|---|
| 101 | $l['subnav_info'], |
|---|
| 102 | $l['subnav_rss'], |
|---|
| 103 | "<a href='".JLOG_PATH."/personal/rss-full.xml'><img src='".JLOG_PATH."/img/JLOG_rss-full.png' alt='XML - Fullpost' /></a> <a href='".JLOG_PATH."/personal/rss.xml'><img src='".JLOG_PATH."/img/JLOG_rss-summary.png' alt='XML - Summary' /></a>", |
|---|
| 104 | "©".date('Y')." ".JLOG_PUBLISHER.", ".$l['subnav_copyright'], |
|---|
| 105 | $c['main'], |
|---|
| 106 | $l['subnav_powered']." <a href='".JLOG_SOFTWARE_URL."' title='version ".JLOG_SOFTWARE_VERSION."'>Jlog</a>" |
|---|
| 107 | ); |
|---|
| 108 | |
|---|
| 109 | $body = str_replace($_search, $_replace, $_body); |
|---|
| 110 | |
|---|
| 111 | $jlogTemplateTags = new JLOG_Tags($body); |
|---|
| 112 | |
|---|
| 113 | if(($categorieslist_tag = $jlogTemplateTags->getTag('categorieslist')) !== false) { |
|---|
| 114 | if(strlen($categorieslist_class = $jlogTemplateTags->getAttributeValue('categorieslist', 'class'))>0) $categorieslist_class = ' class="'.$categorieslist_class.'"'; |
|---|
| 115 | if( $categorieslist = $categories->output_whole_list("\n ".'<ul'.$categorieslist_class.'>'."\n")) { |
|---|
| 116 | $body = str_replace($categorieslist_tag, $categorieslist, $body ); |
|---|
| 117 | } |
|---|
| 118 | else $body = str_replace($categorieslist_tag, '', $body ); |
|---|
| 119 | } |
|---|
| 120 | |
|---|
| 121 | $body = $plugins->callHook('body', $body, $jlogTemplateTags); |
|---|
| 122 | |
|---|
| 123 | /* // we don't need it yet, but perhaps later |
|---|
| 124 | |
|---|
| 125 | function ensureUTF8($str) { |
|---|
| 126 | $pattern = '~([\\xC2-\\xDF][\\x80-\\xBF]| #utf8-2 |
|---|
| 127 | \\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEC][\\x80-\\xBF]{2}| #utf8-3 |
|---|
| 128 | \\xED[\\x80-\\x9F][\\x80-\\xBF]|[\\xEE-\\xEF][\\x80-\\xBF]{2}| #utf8-3 |
|---|
| 129 | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2}|[\\xF1-\\xF3][\\x80-\\xBF]{3}| #utf8-4 |
|---|
| 130 | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}) #utf8-4 |
|---|
| 131 | |([^\\x00-\\x7F])~x'; |
|---|
| 132 | return preg_replace_callback($pattern, 'ensureUTF8CharCallback', $str); |
|---|
| 133 | } |
|---|
| 134 | |
|---|
| 135 | function ensureUTF8CharCallback($charmatch) { |
|---|
| 136 | if (isset($charmatch[2]) && $charmatch[2] != '') { |
|---|
| 137 | return chr(0xC0|ord($charmatch[2])>>6).chr(0x80|ord($charmatch[2])&0x3F); |
|---|
| 138 | } else { |
|---|
| 139 | return $charmatch[0]; |
|---|
| 140 | } |
|---|
| 141 | } |
|---|
| 142 | */ |
|---|
| 143 | ?> |
|---|