default.php (4192B)
1 <?php 2 $lang = array( 3 'site_lang_recent_pages' =>'Recent Pages', 4 'site_lang_related_pages'=>'Related Pages', 5 'site_lang_keywords' =>'Keywords', 6 'site_lang_categories' =>'Categories', 7 'site_lang_calendar' =>'Calendar', 8 'site_lang_from' =>'from', 9 'site_lang_to' =>'to', 10 'site_lang_in' =>'in', 11 'site_date_format' =>'%x', 12 'site_date_format_full' =>'%x', 13 'site_footer_category' =>'about', 14 'site_title' =>'My Blog' 15 ); 16 extract($lang,EXTR_SKIP); 17 18 ?><html lang="de"> 19 <head> 20 <title><?php echo TITLE ?> - <?php echo $site_title ?></title> 21 <meta content="text/html; charset=UTF-8" http-equiv="content-type" /> 22 <meta name="viewport" content="width=device-width, initial-scale=1" /> 23 <link rel="stylesheet" href="<?php echo SITE_UP ?>default.css"> 24 </head> 25 <body> 26 27 <header> 28 <h1><?php echo $site_title ?></h1> 29 </header> 30 31 <main> 32 33 <article> 34 35 <header id="name"> 36 37 <?php if ( is_array($PAGE) ) { ?> 38 <span class="category"><a href="<?php echo SITE_UP.'category'.SLASH.$PAGE['category'] ?>"><?php echo $CATEGORY_NAMES[$PAGE['category']] ?></a></span><br/><br/> 39 <span class="author"><?php echo $PAGE['author'] ?></span> 40 <span class="date"><?php echo strftime($site_date_format_full,$PAGE['date']) ?></span><br/> 41 <?php } ?> 42 43 <h1><?php echo TITLE ?></h1> 44 </header> 45 46 <?php echo CONTENT ?> 47 48 <?php if ( is_array($PAGE) ) { ?> 49 <ul class="keywords"><?php foreach( $PAGE['keywords'] as $keyword ) { ?><li><a href="<?php echo SITE_UP.'tag'.SLASH.$keyword ?>"><?php echo $keyword ?></a></li><?php } ?></ul> 50 <?php } ?> 51 52 </article> 53 54 55 <?php if ( is_array($PAGE) ) { ?> 56 <nav id="related"> 57 <header> 58 <h1><?php echo $site_lang_related_pages ?></h1> 59 </header> 60 <ul> 61 <?php foreach( $PAGES_RELATED as $page ) 62 {?> 63 <li> 64 <a href="<?php echo SITE_UP.$page['url'] ?>"><?php echo $page['title'] ?></a> 65 </li> 66 <?php } ?> 67 </ul> 68 69 </nav> 70 <?php } ?> 71 72 73 <nav id="categories"> 74 <header> 75 <h1><?php echo $site_lang_categories ?></h1> 76 </header> 77 78 <ul> 79 <?php $count=0; 80 foreach( $PAGES_BY_CATEGORY as $category=>$pages) 81 { ?> 82 <li><a href="<?php echo SITE_UP.'category/'.$category ?>"><?php echo $CATEGORY_NAMES[$category] ?></a></li> 83 <?php } ?> 84 </ul> 85 </nav> 86 87 88 89 90 91 <nav id="recent"> 92 <header> 93 <h1><?php echo $site_lang_recent_pages ?></h1> 94 </header> 95 <ul> 96 <?php $count=0; foreach( array_reverse($PAGES_BY_DATE) as $pagesOnDate) 97 { 98 foreach( $pagesOnDate as $page ) 99 { 100 101 if ($count++ > 10) break; ?> 102 <li> 103 <a href="<?php echo SITE_UP.$page['url'] ?>"><?php echo $page['title'] ?></a> 104 </li> 105 <?php }} ?> 106 </ul> 107 108 </nav> 109 110 111 <nav id="calendar"> 112 <header> 113 <h1><?php echo $site_lang_calendar ?></h1> 114 </header> 115 116 <ul class="year"> 117 <?php $oldYear = 0; foreach( array_reverse($PAGES_BY_DATE,true) as $date => $pagesOnDate) 118 { 119 $year = date('Y',$date); 120 if ( $year != $oldYear ) 121 { 122 $oldYear = $year; 123 ?> 124 <li> 125 <a href="<?php echo SITE_UP.$year ?>"><?php echo $year ?></a> 126 <ul class="month"> 127 <?php 128 $oldMonth = 0; 129 foreach( array_reverse($PAGES_BY_DATE,true) as $date2 => $pagesOnDate) 130 { 131 $y = date('Y',$date2); 132 if ( $y != $year) 133 continue; 134 135 $month = date('m',$date2); 136 if ( $month != $oldMonth ) 137 { 138 $oldMonth = $month; 139 140 ?> 141 <li> 142 <a href="<?php echo SITE_UP.$year.SLASH.$month ?>"><?php echo date('F',$date2) ?></a> 143 </li> 144 <?php }} ?> 145 </ul> 146 </li> 147 148 <?php } } ?> 149 </ul> 150 151 </nav> 152 153 154 <nav id="keywords"> 155 <header> 156 <h1><?php echo $site_lang_keywords ?></h1> 157 </header> 158 159 <ul> 160 <?php $count=0; foreach( $PAGES_BY_KEYWORD as $keyword=>$pages) 161 { 162 $fontsize = min(3,((count($pages)-1)/5)+1); ?> 163 164 <li style="font-size:<?php echo $fontsize ?>em;"><a href="<?php echo SITE_UP.'tag/'.$keyword ?>"><?php echo $keyword ?></a> 165 </li> 166 <?php } ?> 167 </ul> 168 169 </nav> 170 171 172 </main> 173 174 <footer> 175 176 <ul> 177 <?php foreach( $PAGES_BY_CATEGORY[$site_footer_category] as $page) {?> 178 <li><a href="<?php echo SITE_UP.$page['url'] ?>"><?php echo $page['title']?></a></li> 179 <?php } ?> 180 </ul> 181 182 </footer> 183 184 </body> 185 </html>