/**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $routeName = 'map';
     $routeMethod = 'index';
     if (in_array($request->input('order', ''), ['status', 'name', 'views', 'created_at', 'updated_at'])) {
         $order = $request->input('order');
     } else {
         $order = setting_value('maps', 'defaultOrder');
     }
     if ($request->has('query')) {
         $query = $request->input('query');
         $maps = $this->map->getQueryPageOrderedBy($query, $order, 'desc');
     } else {
         $maps = $this->map->getPageOrderedBy($order, 'desc');
     }
     $data = compact('routeName', 'routeMethod', 'maps');
     \Clockwork::info($maps);
     return view('admin.sections.map.index', $data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $routeName = 'source';
     $routeMethod = 'index';
     if (in_array($request->input('order', ''), ['origin_type', 'origin_format', 'origin_size', 'name', 'sync_status', 'synced_at', 'created_at', 'updated_at'])) {
         $order = $request->input('order');
         $direction = 'asc';
     } else {
         $order = setting_value('sources', 'defaultOrder');
         $direction = 'desc';
     }
     if ($request->has('query')) {
         $query = $request->input('query');
         $sources = $this->source->getQueryPageOrderedBy($query, $order, $direction);
     } else {
         $sources = $this->source->getPageOrderedBy($order, $direction);
     }
     $data = compact('routeName', 'routeMethod', 'sources');
     \Clockwork::info($sources);
     return view('admin.sections.source.index', $data);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @return Response
  */
 public function edit()
 {
     return view('admin.settings.profile.edit', ['name' => setting_value('name'), 'cover' => setting_value('cover'), 'avatar' => setting_value('avatar'), 'bio' => setting_value('bio'), 'email' => setting_value('email')]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return view('articles.index', ['articles' => Article::with('tags', 'category')->public()->latest('published_at')->simplePaginate(setting_value('paginate_size'))]);
 }
示例#5
0
 public function index($slug)
 {
     $tag = Tag::where('slug', $slug)->firstOrFail();
     $articles = $tag->articles()->with('tags', 'category')->public()->latest('published_at')->simplePaginate(setting_value('paginate_size'));
     return view('tags', ['tag' => $tag, 'articles' => $articles]);
 }
示例#6
0
$analytics = setting_value($dbc, 'site-analytics');
$facebook = setting_value($dbc, 'facebook-info');
$google = setting_value($dbc, 'google-info');
$linkedin = setting_value($dbc, 'linkedin-info');
$twitter = setting_value($dbc, 'twitter-info');
$pinterest = setting_value($dbc, 'pinterest-info');
$github = setting_value($dbc, 'github-info');
$behance = setting_value($dbc, 'behance-info');
$youtube = setting_value($dbc, 'youtube-info');
$filter1_name = setting_value($dbc, 'filter1-name');
$filter2_name = setting_value($dbc, 'filter2-name');
$filter3_name = setting_value($dbc, 'filter3-name');
# Embedded CSS:
$child_css = setting_value($dbc, 'child-css');
# Embedded JS:
$child_js = setting_value($dbc, 'child-js');
# Widgets:
$header_w1 = widget_value($dbc, 'header-w1');
$side_w1 = widget_value($dbc, 'side-w1');
$side_w2 = widget_value($dbc, 'side-w2');
$side_w3 = widget_value($dbc, 'side-w3');
$side_w4 = widget_value($dbc, 'side-w4');
$side_w5 = widget_value($dbc, 'side-w5');
$side_w6 = widget_value($dbc, 'side-w6');
$contact_w1 = widget_value($dbc, 'contact-w1');
$contact_w2 = widget_value($dbc, 'contact-w2');
# If a path is not declared then set it to home page
$path = get_path();
if (!isset($path['call_parts'][0]) || $path['call_parts'][0] == '') {
    $path['call_parts'][0] = $home_page;
}
示例#7
0
 public function getQueryPageOrderedBy($query = '', $column = 'id', $order = 'asc')
 {
     $maps = Map::allowed()->with('user')->where('name', 'like', '%' . $query . '%')->orderBy($column, $order)->paginate(setting_value('maps', 'pageResults'));
     return $maps;
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function edit()
 {
     return view('admin.settings.general.edit', ['title' => setting_value('title'), 'subtitle' => setting_value('subtitle'), 'keywords' => setting_value('keywords'), 'description' => setting_value('description'), 'paginate_size' => setting_value('paginate_size')]);
 }
示例#9
0
<?php

//ajax
include '../config/connection.php';
$limit = $_GET['limit'];
$start = $_GET['start'];
function setting_value($dbc, $id)
{
    $q = "SELECT * FROM settings WHERE id = '{$id}'";
    $r = mysqli_query($dbc, $q);
    $data = mysqli_fetch_assoc($r);
    return $data['value'];
}
$site_url = setting_value($dbc, 'site-url');
$q = "SELECT * FROM images WHERE status = 1 ORDER BY id DESC LIMIT {$start},{$limit}";
$r = mysqli_query($dbc, $q);
while ($images = mysqli_fetch_assoc($r)) {
    ?>
    <div class="gal-tile">                
       <a class="fancybox" rel="group" href="<?php 
    echo $images['path'];
    ?>
"><img class="tile-img" src="<?php 
    echo $images['path'];
    ?>
" alt="<?php 
    echo stripslashes($images['alt']);
    ?>
" /></a>   
    </div>
<?php 
 public function getQueryPageOrderedBy($query = '', $column = 'id', $order = 'asc')
 {
     $sources = Source::where('name', 'like', '%' . $query . '%')->orderBy($column, $order)->paginate(setting_value('sources', 'pageResults'));
     return $sources;
 }
示例#11
0
    </div>

    <div class="row">

        @forelse($maps as $map)
        <div class="col-sm-12 col-md-6 col-lg-4">
            <!-- Widget: user widget style 1 -->
            <div class="box box-widget widget-user">
                <!-- Add the bg color to the header using any of the bg-* classes -->
                <?php 
$url = setting_value('mapbox', 'stylesApiUrl');
$url .= setting_value('mapbox', 'username');
$url .= '/' . $map->style . '/static/';
$url .= $map->longitude . "," . $map->latitude . "," . $map->zoom . "," . $map->bearing . "," . $map->pitch . "/";
$url .= "800x200";
$url .= "?access_token=" . setting_value('mapbox', 'accessToken');
?>
                {{-- https://api.mapbox.com/styles/v1/mapbox/streets-v8/static/0,20,3,20/800x200?access_token=pk.eyJ1IjoiamF1bWVzYWxhIiwiYSI6ImNpanZ4dmlndDAwNWl2Mm00d3RpY2VweTkifQ.fh0cb8ZJhawwDnZUlZx47Q --}}
                <div class="widget-user-header bg-black" style="background: url({{ $url }}) center center;">
                    <h3 class="widget-user-username">{{ $map->name }}</h3>
                    <?php 
$createdAt = $map->created_at;
$date = Carbon::createFromFormat('Y-m-d H:i:s', $createdAt);
?>
                    <h6 class="widget-user-desc">
                        @if($map->active)
                            <i class="fa fa-circle text-success margin-r-5"></i>
                        @else
                            <i class="fa fa-circle text-danger margin-r-5"></i>
                        @endif
                        By {{ $map->user->name }}, {{ $date->diffForHumans() }}
示例#12
0
<?php

include '../config/connection.php';
// Get site-email and site-url
function setting_value($dbc, $id)
{
    $q = "SELECT * FROM settings WHERE id = '{$id}'";
    $r = mysqli_query($dbc, $q);
    $data = mysqli_fetch_assoc($r);
    return $data['value'];
}
$errors = '';
$site_email = setting_value($dbc, 'site-email');
$site_title = setting_value($dbc, 'site-title');
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Process form if lname is empty
    if (empty($_POST['lname'])) {
        if (empty($_POST['name']) || empty($_POST['email']) || empty($_POST['message'])) {
            $errors .= "<h3 class='error'>Error: All fields are required...</h3>";
            echo $errors;
        }
        // get data
        $name = strip_tags(trim($_POST['name']));
        $name = str_replace(array("\r", "\n"), array(" ", " "), $name);
        $email_address = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL);
        $email_message = trim($_POST["message"]);
        // validate email
        if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$/i", $email_address)) {
            $errors = "<h3 class='error'>Error: Invalid email address...</h3>";
            echo $errors;
        }
示例#13
0
 /**
  * Get a setting value by its handle. (Alias)
  *
  * @param string $handle
  * @param string $default
  *
  * @return string
  */
 function setting($handle, $default = '')
 {
     return setting_value($handle, $default);
 }
 public function index($slug)
 {
     $category = Category::where('slug', $slug)->firstOrFail();
     $articles = Article::with('tags', 'category')->where('category_id', $category->id)->public()->latest('published_at')->simplePaginate(setting_value('paginate_size'));
     return view('categories', ['category' => $category, 'articles' => $articles]);
 }