Example #1
0
            </tr>
        </thead>
        <tbody>
            <?php 
//print_r($data);
if ($data['num'] > 0) {
    foreach ($data['posts'] as $p) {
        # code...
        //print_r($p);
        //echo $p->id;
        if ($p->status == '0') {
            $status = UNPUBLISHED;
        } else {
            $status = PUBLISHED;
        }
        echo "\n                        <tr>\n                            <td>{$p->id}</td>\n                            <td><a href=\"" . Url::post($p->id) . "\" target=\"_new\">{$p->title}</a></td>\n                            <td>" . Categories::name($p->cat) . "</td>\n                            <td>" . Date::format($p->date) . "</td>\n                            <td>{$status}</td>\n                            <td>\n                                <a href=\"index.php?page=posts&act=edit&id={$p->id}&token=" . TOKEN . "\" class=\"label label-success\">" . EDIT . "</a> \n                                <a href=\"index.php?page=posts&act=del&id={$p->id}&token=" . TOKEN . "\" class=\"label label-danger\" \n                                onclick=\"return confirm('Are you sure you want to delete this item?');\">" . DELETE . "</a>\n                            </td>\n                            <td>\n                                <input type=\"checkbox\" name=\"post_id[]\" value=\"{$p->id}\" id=\"select\">\n                            </td>\n                        </tr>\n                        ";
    }
} else {
    echo "\n                    <tr>\n                        <td>\n                        " . NO_POST_FOUND . "\n                        </td>\n                    </tr>";
}
?>
            
        </tbody>
        <tfoot>
            <th><?php 
echo ID;
?>
</th>
            <th><?php 
echo TITLE;
?>
Example #2
0
 /**
  * Categories URL Function.
  * This will create the categories url automatically based on the SMART_URL 
  * will formatted as friendly url if SMART_URL is set to true.
  * 
  * @author Puguh Wijayanto (www.metalgenix.com)
  * @since 0.0.1
  */
 public static function cat($vars)
 {
     switch (SMART_URL) {
         case true:
             # code...
             $url = Site::$url . "/" . $vars . "/" . Typo::slugify(Categories::name($vars));
             break;
         default:
             # code...
             $url = Site::$url . "/index.php?cat={$vars}";
             break;
     }
     return $url;
 }
Example #3
0
<!-- Page Header -->
    <!-- Set your background image for this header on the line below. -->
    <header class="intro-header" style="background-image: url('<?php 
echo Site::$url;
?>
/inc/themes/cleanblog/img/home-bg.jpg')">
        <div class="container">
            <div class="row">
                <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                    <div class="site-heading">
                        <h1><?php 
echo Categories::name($_GET['cat']);
?>
</h1>
                        <hr class="small">
                        <span class="subheading"><?php 
echo Options::get('siteslogan');
?>
</span>
                    </div>
                </div>
            </div>
        </div>
    </header>
    
    <!-- Main Content -->
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
            <?php 
if ($data['num'] > 0) {
Example #4
0
* @license http://www.opensource.org/licenses/mit-license.php MIT
*
*/
$post = "";
$cat = Db::escape(Typo::Xclean($_GET['cat']));
$data['max'] = Options::get('post_perpage');
if (isset($_GET['paging'])) {
    $paging = Typo::int($_GET['paging']);
    if ($paging > 0) {
        $offset = ($paging - 1) * $data['max'];
    } else {
        $offset = 0;
    }
    $pagingtitle = " - Page {$paging}";
} else {
    $offset = 0;
    $paging = 1;
    $pagingtitle = "";
}
$data['sitetitle'] = "Category: " . Categories::name($cat) . $pagingtitle;
$data['posts'] = Db::result(sprintf("SELECT * FROM `posts` \n                    WHERE `type` = 'post' \n                    AND `cat` = '%d'\n                    AND `status` = '1'\n                    ORDER BY `date` \n                    DESC LIMIT %d, %d", $cat, $offset, $data['max']));
$data['num'] = Db::$num_rows;
$url = Url::cat($_GET['cat']);
$paging = array('paging' => $paging, 'table' => 'posts', 'where' => '`type` = \'post\' AND `cat` = \'' . $cat . '\'', 'max' => $data['max'], 'url' => $url, 'type' => Options::get('pagination'));
$data['paging'] = Paging::create($paging, SMART_URL);
Theme::theme('header', $data);
Theme::theme('cat', $data);
Theme::footer();
exit;
/* End of file cat.control.php */
/* Location: ./inc/lib/Control/Frontend/cat.control.php */