diff --git a/system/includes/functions.php b/system/includes/functions.php index 864126e..7d08e95 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -57,10 +57,10 @@ function get_posts($page = 1, $perpage = 0){ // Create a new instance of the markdown parser $md = new MarkdownParser(); - foreach($posts as $k=>$v){ + foreach($posts as $index => $v){ $post = new stdClass; - + // Extract the date $arr = explode('_', $v); @@ -91,9 +91,19 @@ function get_posts($page = 1, $perpage = 0){ $post->title = str_replace('

','',$arr[0]); $post->body = $arr[1]; + // Get first and last post + if ($index == 0) { + $post->cls = 'item first'; + } + elseif ($index == count($posts) - 1) { + $post->cls = 'item last'; + } + else { + $post->cls = 'item'; + } + $tmp[] = $post; } - return $tmp; } @@ -187,6 +197,17 @@ function get_tag($tag){ $arr = explode('

', $content); $post->title = str_replace('

','',$arr[0]); $post->body = $arr[1]; + + // Get first and last post + if ($index == 0) { + $post->cls = 'item first'; + } + elseif ($index == count($posts) - 1) { + $post->cls = 'item last'; + } + else { + $post->cls = 'item'; + } $tmp[] = $post; } @@ -239,6 +260,17 @@ function get_archive($req){ $arr = explode('

', $content); $post->title = str_replace('

','',$arr[0]); $post->body = $arr[1]; + + // Get first and last post + if ($index == 0) { + $post->cls = 'item first'; + } + elseif ($index == count($posts) - 1) { + $post->cls = 'item last'; + } + else { + $post->cls = 'item'; + } $tmp[] = $post; } @@ -604,16 +636,16 @@ function publisher(){ function analytics(){ $analytics = config('google.analytics.id'); $script = << - var _gaq = _gaq || []; - _gaq.push(['_setAccount', '{$analytics}']); - _gaq.push(['_trackPageview']); - (function() { - var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); - })(); - + EOF; if (!empty($analytics)) { return $script; diff --git a/themes/default/main.html.php b/themes/default/main.html.php index adde055..86369e2 100644 --- a/themes/default/main.html.php +++ b/themes/default/main.html.php @@ -1,19 +1,6 @@ - - -
+

title ?>

- Posted in tag) ?> by - Komentar