File: aksara/Modules/Blogs/Views/category.php

Recommend this page to a friend!
  Classes of Aby Dahana  >  Aksara  >  aksara/Modules/Blogs/Views/category.php  >  Download  
File: aksara/Modules/Blogs/Views/category.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Aksara
A CodeIgniter based API and CRUD generator
Author: By
Last change: Initial commit for update 4.2.7

##### Bug Fixed:
Core: Fix the CRUD function both back end and front end;
Core: Fix the query string parameter for each returned data;
Core: Fix the table data that return nothing when no data exists;
Model: Fix the multiple database connection when switching the main connection to the second connection;
Model: Fix the field check when table using alias;
Javascript: Fix the query string extraction that return null value;
Javascript: Fix the geocoding (place search) on the map when using Google or OpenStreet provider;
Galleries: Fix the link that turned image not found when clicked from gallery category;
Dashboard: Fix RecursiveIterator that return error when catch unreadable upload folder;

##### Changes:
Modules: Change the "not found" page message to matched with modules;
Group: Replace the module structure for permission with path;
Permission: Change the permission check with module path;
Permission: Remove the field of module, submodule and controller and replaced with path instead;
Activity Log: Remove the field of module, submodule and controller and replaced with path instead;
Group Privileges: Remove the field of module, submodule and controller and replaced with path instead;

##### Improvements:
Core: Replace the permission with module path so it will work with unlimited sub module;
Core: Add title trim to prevent blank title when the requested data was not found;
Core: Block the Internet Explorer under version 11 that no longer supports common used javascript;
Modules: Change the "not found" page message to matched with modules;
Installer: Add the character restriction for encryption key and cookie name to prevent breaking the configuration parameter;
Javascript: Increase the maximum depth of menu builder;
Seeder: Apply column modification related to app__activity_logs, app__groups_privileges and app__settings table;
Redesign the "not found" page;
Add new language phrases;

##### New Features:
Galleries: Add the slide view for next and previous image if available;
Settings: Add the action sound toggle;
Addon: Install the add on directly from the Aksara Market;
Addon: Customize the installed theme;
Authentication: Add the annually sign in when active years is presents;
Date: 1 month ago
Size: 4,707 bytes
 

Contents

Class file image Download
<div class="leading pt-5 pb-5 mb-5 bg-light relative" style="background: url(<?php echo (isset($category->category_image) && $category->category_image != 'placeholder.png' ? get_image('blogs', $category->category_image) : get_image('blogs', 'cover.jpg')); ?>) center center no-repeat; background-size: cover">
    <div class="clip gradient-top"></div>
    <div class="area" >
        <ul class="circles">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
    <div class="container pt-5 pb-5">
        <div class="row">
            <div class="col-md-8 offset-md-2">
                <h1 class="text-center text-light">
                    <?php echo $meta->title; ?>
</h1>
                <p class="lead text-center text-light mb-5">
                    <?php echo $meta->description; ?>
</p>
            </div>
        </div>
        <div class="row">
            <div class="col-md-8 offset-md-2 col-lg-6 offset-lg-3">
                <form action="<?php echo base_url('blogs/search', array('category' => (service('request')->uri->getTotalSegments() > 1 ? service('request')->uri->getSegment(2) : null), 'per_page' => null)); ?>" method="POST" class="form-horizontal relative --xhr-form">
                    <input type="text" name="q" class="form-control form-control-lg pt-4 pr-4 pb-4 pl-4 border-0" placeholder="<?php echo phrase('search_post_under') . ' ' . $meta->title; ?>" />
                    <button type="submit" class="btn btn-lg float-right absolute top right">
                        <i class="mdi mdi-magnify font-weight-bold"></i>
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>

<div class="container pb-5">
    <div class="row">
        <div class="col-md-8 pb-5">
       
            <?php
               
if($results)
                {
                    foreach(
$results as $key => $val)
                    {
                       
$item_tags = array_map('trim', explode(',', $val->post_tags));
                       
$tags = null;
                       
                        if(
sizeof($item_tags) > 0)
                        {
                            foreach(
$item_tags as $label => $badge)
                            {
                                if(
$label == 2) break;
                                if(
$badge)
                                {
                                   
$tags .= '
                                        <a href="'
. go_to('../tags', array('q' => $badge)) . '" class="--xhr">
                                            <span class="badge badge-secondary mr-2">
                                                #'
. trim($badge) . '
                                            </span>
                                        </a>
                                    '
;
                                }
                            }
                        }
                       
                        echo
'
                            <div class="row">
                                <div class="col-3 col-sm-3">
                                    <a href="'
. go_to('../' . $val->category_slug . '/' . $val->post_slug) . '" class="--xhr">
                                        <img id="og-image" src="'
. get_image('blogs', $val->featured_image, 'thumb') . '" class="img-fluid rounded" />
                                    </a>
                                </div>
                                <div class="col-9 col-sm-9">
                                    <div class="mb-1">
                                        <a href="'
. base_url('user/' . $val->username) . '" class="--xhr">
                                            <b>
                                                <i class="mdi mdi-account"></i> '
. $val->first_name . ' ' . $val->last_name . '
                                            </b>
                                        </a>
                                        <span class="text-sm text-muted">
                                            <i class="mdi mdi-clock-outline"></i> '
. time_ago($val->updated_timestamp) . '
                                        </span>
                                    </div>
                                    <a href="'
. go_to('../' . $val->category_slug . '/' . $val->post_slug) . '" class="--xhr">
                                        <h5>
                                            '
. $val->post_title . '
                                        </h5>
                                    </a>
                                    <p class="mb-0">
                                        <a href="'
. go_to('../' . $val->category_slug . '/' . $val->post_slug) . '" class="--xhr text-muted">
                                            '
. truncate($val->post_excerpt, 128) . '
                                        </a>
                                    </p>
                                    <div>
                                        '
. ($tags ? $tags : null) . '
                                    </div>
                                </div>
                            </div>
                            <hr />
                        '
;
                    }
                   
                    echo
$template->pagination;
                }
                else
                {
                    echo
'
                        <div class="text-muted">
                            <i class="mdi mdi-information-outline"></i>
                            '
. phrase('no_post_found_under_this_category') . '
                        </div>
                    '
;
                }
           
?>

        </div>
        <div class="col-md-4">
            <div class="sticky-top">
                <h5 class="mb-3">
                    <?php echo phrase('other_categories'); ?>
</h5>
                <?php
                   
if($categories)
                    {
                        foreach(
$categories as $key => $val)
                        {
                            echo
'
                                <div class="row form-group">
                                    <div class="col-2 pr-0">
                                        <img src="'
. get_image('blogs', $val->category_image, 'icon') . '" class="img-fluid rounded" />
                                    </div>
                                    <div class="col">
                                        <a href="'
. go_to('../' . $val->category_slug) . '" class="--xhr">
                                            <h5>
                                                '
. $val->category_title . '
                                            </h5>
                                            <p class="text-muted mb-0">
                                                '
. number_format($val->total_data) . ' ' . ($val->total_data > 1 ? phrase('articles') : phrase('article')) . '
                                            </p>
                                        </a>
                                    </div>
                                </div>
                            '
;
                        }
                    }
               
?>
</div>
        </div>
    </div>
</div>


For more information send a message to info at phpclasses dot org.