?> "><?php echo $data['TEMPLATES'][$data['TEMPLATE']]; ?> </option> <?php } ?> <?php foreach ($data['TEMPLATES'] as $key => $value) { ?> <option value="<?php echo $key; ?> "><?php echo removeHyphen($value); ?> </option> <?php } ?> </select> </label> </div> <div class="large-6 small-12 columns"> <label for="type"> Article | Page</label> <div class="switch round large"> <input id="type" type="checkbox" <?php if (!empty($data['TYPE']) && $data['TYPE'] == 1) { ?> checked="checked" <?php
echo MEDIAPATH . $data['IMG']; ?> " alt="<?php echo $data['TITLE']; ?> "/> <h1 class="article-heading padd-1-top"><?php echo $data['TITLE']; ?> </h1> <ul class="inline-list post-meta border bb padd-4-bottom nospace"> <li><a href="<?php echo PUBLICPATH . $data['SECURL']; ?> "><?php echo removeHyphen($data['SECURL']); ?> </a></li> <li class="divide"></li> <li><?php echo date('M dS Y', strtotime($data['DATE'])); ?> </li> <li class="divide"></li> <li><li><a href="<?php echo PUBLICPATH . $data['LINK']; ?> #disqus_thread">Comments</a></li> </ul> </div> </div>
" /> </div> </a> <a href="<?php echo PUBLICPATH . $data['article'][$i]['LINK']; ?> " class="padd-2-top" ><h3 class="post-title-2" data-equalizer-watch="third-post-title"><?php echo elliStr($data['article'][$i]['TITLE'], 30); ?> </h3></a> <ul class="inline-list post-meta push-4-bottom"> <li><a href="<?php echo PUBLICPATH . $data['article'][$i]['SECURL']; ?> "><?php echo removeHyphen($data['article'][$i]['SEC']); ?> </a></li> <li class="divide"></li> <li><?php echo date('M dS', strtotime($data['article'][$i]['DATE'])); ?> </li> <li class="divide"></li> <li><a href="<?php echo PUBLICPATH . $data['article'][$i]['LINK']; ?> #disqus_thread">Comments</a></li> </ul> <p><?php echo elliStr($data['article'][$i]['DES'], 150);
echo PUBLICPATH . $data['items'][$i]['LINK']; ?> "><h3 class="post-title-3 push-2-bottom push-2-top"><?php echo $data['items'][$i]['TITLE']; ?> </h3></a> <p><?php echo elliStr($data['items'][$i]['DES'], 200); ?> </p> <ul class="inline-list post-meta"> <li><a href="<?php echo PUBLICPATH . $data['items'][$i]['SECURL']; ?> "><?php echo removeHyphen($data['items'][$i]['SECURL']); ?> </a></li> <li class="divide"></li> <li><?php echo date('M dS', strtotime($data['items'][$i]['DATE'])); ?> </li> <li class="divide"></li> <li><a href="<?php echo PUBLICPATH . $data['items'][$i]['LINK']; ?> #disqus_thread">Comments</a></li> </ul> </div> </div>
public function index($parameter = null) { $this->model('Article'); /* * If no parameter is received then will be the index page. */ if (!$parameter) { $article = new Article(); $data['bits'] = objectToArray($article->articleList('Bits', 'SECURL', 0, 10)); $data['article'] = objectToArray($article->articleList(1, 'FEATURED', 0, 10)); if (sizeof($data['article']) < 8) { $data['article'] = array_merge(objectToArray(objectToArray($article->articleList(0, 'TYPE', 0, 10)))); } $data['username'] = "******"; $data['TITLE'] = "Tech Stream"; $data['DESCRIPTION'] = "Tech stream is a Web Design and Development blog dedicated to provide inspiring and innovative contents."; $this->view('home/index.html', $data); } else { /* * In case of parameter the following checking has to be done : * 1. If parameter is an article * 2. If parameter is a Page * 1. If the parameter is name of section. */ $article = new Article($parameter); /* * If the Parameter represents Public URL of an entry then its a valid request */ if ($article->count()) { $data = objectToArray($article->data()); $data['CONTENT'] = str_replace('[IMAGE]', MEDIAPATH, $data['CONTENT']); $data['DESCRIPTION'] = $data['DES']; $data['CANONICAL'] = PUBLICPATH . $data['LINK']; $data['TITLE '] = $data['TITLE'] . "| Tech Stream"; $data['sidebar']['article'] = objectToArray($article->articleList(0, 'TYPE', 0, 5)); switch ($article->data()->TEMPLATE) { case 0: $this->view('home/article.html', $data); break; case 1: $this->view('home/bits.html', $data); break; default: $this->view('home/bits.html', $data); break; } } else { $parameter = explode('/', $parameter); if ($parameter[0] == 'All') { $targetParameter = 0; $targetEntry = 'TEMPLATE'; } else { $targetParameter = $parameter[0]; $targetEntry = 'SECURL'; } $section = $article->articleList($targetParameter, $targetEntry); $total = $article->count(); if ($section) { $data['start'] = 0; $data['page'] = 1; $data['limit'] = 10; // Number of articles on a page $data['sectionUrl'] = PUBLICPATH . $parameter[0]; $total = $article->count(); $data['totalArticle'] = $total; if (!isset($parameter[1]) || $parameter[1] < 1) { $parameter[1] = 1; } if (is_numeric($parameter[1])) { $data['page'] = $parameter[1]; $data['start'] = $data['limit'] * ($parameter[1] - 1); if ($data['start'] >= $total) { // Redirect to 404 echo "no found"; die; } } $data['sidebar']['article'] = objectToArray($article->articleList(0, 'TYPE', 0, 5)); $data['items'] = objectToArray($article->articleList($targetParameter, $targetEntry, $data['start'], $data['limit'])); if ($targetParameter) { $data['TITLE'] = removeHyphen($data['items'][0]['SECURL']) . "| Tech Stream"; } else { $data['TITLE'] = "All Articles" . "| Tech Stream"; } $data['TOTAL'] = $total; $data['DESCRIPTION'] = "Find out the list of articles and posts in : " . $data['TITLE']; if ($data['items'][0]['TYPE'] == 1) { $this->view('home/list.bits.html', $data); } else { $this->view('home/list.article.html', $data); } } else { $article = new Article('NotFound'); $data = objectToArray($article->data()); $data['CONTENT'] = str_replace('[IMAGE]', MEDIAPATH, $data['CONTENT']); $data['sidebar']['article'] = objectToArray($article->articleList(0, 'TYPE', 0, 5)); $data['DESCRIPTION'] = $data['DES']; $this->view('home/bits.html', $data); } } } }