Add general search and refactor header
This commit is contained in:
@@ -81,4 +81,5 @@
|
||||
$route['reset/(:any)/(:any)'] = 'login/reset/$1/$2';
|
||||
$route['tools/twitch/(:any)'] = 'tools/twitch?twich-channel=$1';
|
||||
$route['projects/(:any)'] = 'projects/index/$1';
|
||||
$route['project/(:any)'] = 'projects/entry/$1';
|
||||
$route['tools/encrypter/(:any)'] = 'tools/encrypter/index/$1';
|
53
application/controllers/Search.php
Normal file
53
application/controllers/Search.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
use Coduo\PHPHumanizer\DateTimeHumanizer;
|
||||
|
||||
class Search extends MY_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('home', 'profile');
|
||||
$this->load->model('SearchModel', '', TRUE);
|
||||
$this->load->model('UserModel', '', TRUE);
|
||||
$this->load->model('PostsModel', '', TRUE);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$query = html_escape($this->input->get('q'));
|
||||
|
||||
$this->load->view('header', ['active' => 'search', 'title' => "Suche - $query", 'additionalStyles' => []]);
|
||||
$this->load->view('search', ['query' => $query]);
|
||||
$this->load->view('footer', ['additionalScripts' => ['search.js']]);
|
||||
}
|
||||
|
||||
public function getSearchResults() {
|
||||
header('Content-Type: application/json;charset=utf-8');
|
||||
|
||||
$query = $this->input->post('query');
|
||||
|
||||
if(strlen($query) < 3) {
|
||||
echo json_encode(['error' => true, 'message' => 'search-term']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$offset = filter_var($this->input->post('offset'), FILTER_VALIDATE_INT);
|
||||
$filters = is_array($this->input->post('filters')) ? $this->input->post('filters') : [];
|
||||
|
||||
$results = $this->SearchModel->search($query, 5, $offset, $filters);
|
||||
|
||||
if(empty($results)) {
|
||||
if($offset > 0) {
|
||||
$message = 'no-further-results';
|
||||
} else {
|
||||
$message = 'no-results';
|
||||
}
|
||||
echo json_encode(['error' => true, 'message' => $message]);
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode($results, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
}
|
10
application/language/de/search_lang.php
Normal file
10
application/language/de/search_lang.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
$lang['search_type_blogPost'] = 'Blog-Post';
|
||||
$lang['search_type_blogCategory'] = 'Blog-Kategorie';
|
||||
$lang['search_type_blogTag'] = 'Blog-Tag';
|
||||
$lang['search_type_project'] = 'Projekt';
|
||||
$lang['search_type_projectCategory'] = 'Projekt-Kategorie';
|
||||
$lang['search_type_user'] = 'Nutzer';
|
||||
$lang['search_type_userPost'] = 'Post';
|
205
application/models/SearchModel.php
Normal file
205
application/models/SearchModel.php
Normal file
@@ -0,0 +1,205 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class SearchModel extends CI_Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->lang->load('search', $_SESSION['site_lang']);
|
||||
}
|
||||
|
||||
public function search($query, $amount, $offset, $filters)
|
||||
{
|
||||
$results = $this->getRawResults($query, $amount, $offset, $filters);
|
||||
$results = $this->prepareResults($results);
|
||||
return $results;
|
||||
}
|
||||
|
||||
private function getRawResults($query, $amount, $offset, $filters)
|
||||
{
|
||||
mb_language('uni');
|
||||
mb_internal_encoding('UTF-8');
|
||||
|
||||
$lang = $_SESSION['site_lang'];
|
||||
|
||||
$query = strtolower($query);
|
||||
$offset *= $amount;
|
||||
|
||||
list($sql, $attr) = $this->buildQuery($filters);
|
||||
$attr = str_split($attr);
|
||||
foreach ($attr as $i => $a) {
|
||||
$a = $a === 'l' ? $lang : $query;
|
||||
$attr[$i] = $a;
|
||||
}
|
||||
$attr[] = $amount;
|
||||
$attr[] = $offset;
|
||||
|
||||
$this->db->cache_off();
|
||||
$results = $this->db->query($sql, $attr)->result_array();
|
||||
$this->db->cache_on();
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
private function buildQuery($filters)
|
||||
{
|
||||
$attributes = '';
|
||||
$query = 'SELECT a.*, u.username authorName, u.displayname authorDisplayname
|
||||
FROM (';
|
||||
|
||||
$possibilities = [
|
||||
'blogPost' => [
|
||||
'sql' => 'SELECT "blogPost" type, bp.postUrl url, bp.postAuthorID author, bp.postImage image, bt.postTitle title, bt.postDesc content, bp.postPublishDate date
|
||||
FROM blog_posts bp
|
||||
INNER JOIN blog_translations bt ON bt.postID = bp.postID AND bt.language = ?
|
||||
LEFT JOIN blog_content bc ON bc.postID = bp.postID AND bc.isActive = TRUE AND bc.language = ?
|
||||
WHERE (LOWER(bt.postTitle) RLIKE ?
|
||||
OR LOWER(bt.postDesc) RLIKE ?
|
||||
OR LOWER(bc.content) RLIKE ?
|
||||
OR bp.postID IN (SELECT bpt.post_id FROM blog_post_tags bpt WHERE bpt.tag_id IN(SELECT bt.ID FROM blog_tags bt WHERE bt.name RLIKE ? OR LOWER(bt.display_name) RLIKE ?))
|
||||
OR (SELECT username FROM users WHERE ID = bp.postAuthorID) RLIKE ?
|
||||
OR (SELECT display_name FROM blog_categories WHERE ID = bp.postCategoryID) RLIKE ?)
|
||||
AND postState = 1 AND postIsDeleted = FALSE',
|
||||
'attributes' => 'llqqqqqqq'
|
||||
],
|
||||
'blogCategory' => [
|
||||
'sql' => 'SELECT "blogCategory" type, c.name url, 1 author, null image, c.display_name title, null content, null date
|
||||
FROM blog_categories c
|
||||
WHERE c.name RLIKE ? OR LOWER(c.display_name) RLIKE ?',
|
||||
'attributes' => 'qq'
|
||||
],
|
||||
'blogTag' => [
|
||||
'sql' => 'SELECT "blogTag" type, t.name url, 1 author, null image, t.display_name title, null content, null date
|
||||
FROM blog_tags t
|
||||
WHERE t.name RLIKE ? OR LOWER(t.display_name) RLIKE ?',
|
||||
'attributes' => 'qq'
|
||||
],
|
||||
'user' => [
|
||||
'sql' => 'SELECT "user" type, u.username url, u.ID author, u.header_image image, u.displayname title, u.about content, u.date_created date
|
||||
FROM users u
|
||||
WHERE (username RLIKE ?
|
||||
OR lower(about) RLIKE ?)
|
||||
AND is_activated AND isDeleted = FALSE',
|
||||
'attributes' => 'qq',
|
||||
],
|
||||
'userPost' => [
|
||||
'sql' => 'SELECT "userPost" type, p.uuid url, p.user_id author, null image, p.content title, null content, p.date date
|
||||
FROM user_posts p
|
||||
WHERE LOWER(p.content) RLIKE ?
|
||||
OR (SELECT username FROM users WHERE ID = p.user_id) RLIKE ?',
|
||||
'attributes' => 'qq',
|
||||
],
|
||||
'project' => [
|
||||
'sql' => 'SELECT "project" type, p.name url, 1 as author, p.source image, t.title title, t.description content, p.datetime date
|
||||
FROM projects p
|
||||
INNER JOIN projects_translations t ON t.projectID = p.ID AND t.lang = ?
|
||||
WHERE LOWER(t.title) RLIKE ?
|
||||
OR LOWER(t.description) RLIKE ?
|
||||
OR LOWER(t.content) RLIKE ?',
|
||||
'attributes' => 'lqqq',
|
||||
],
|
||||
'projectCategory' => [
|
||||
'sql' => 'SELECT "projectCategory" type, c.collection url, 1 author, null image, c.displayname title, c.displayname content, null date
|
||||
FROM projects_categories c
|
||||
WHERE lower(collection) RLIKE ?
|
||||
OR lower(displayname) RLIKE ?',
|
||||
'attributes' => 'qq'
|
||||
],
|
||||
];
|
||||
|
||||
$filters = array_intersect(array_keys($possibilities), $filters);
|
||||
|
||||
if (empty($filters))
|
||||
$filters = array_keys($possibilities);
|
||||
|
||||
foreach ($filters as $filter) {
|
||||
$data = $possibilities[$filter];
|
||||
if (empty($data))
|
||||
continue;
|
||||
|
||||
$query .= $data['sql'];
|
||||
$query .= ' UNION ';
|
||||
$attributes .= $data['attributes'];
|
||||
}
|
||||
|
||||
$query = substr($query, 0, -6);
|
||||
|
||||
$query .= ') a
|
||||
LEFT JOIN users u ON a.author = u.ID
|
||||
ORDER BY date desc LIMIT ? OFFSET ?';
|
||||
|
||||
return [$query, $attributes];
|
||||
}
|
||||
|
||||
private function prepareResults($results)
|
||||
{
|
||||
foreach ($results as $i => $result) {
|
||||
list(
|
||||
'author' => $author,
|
||||
'authorDisplayname' => $displayname,
|
||||
'authorName' => $username,
|
||||
'content' => $content,
|
||||
'date' => $date,
|
||||
'image' => $image,
|
||||
'title' => $title,
|
||||
'type' => $type,
|
||||
'url' => $url,
|
||||
) = $result;
|
||||
|
||||
$date = date('d.m.Y', strtotime($date));
|
||||
|
||||
if (strlen($title) > 75) {
|
||||
$title = utf8_encode($title);
|
||||
$title = substr($title, 0, 75) . '...';
|
||||
$title = utf8_decode($title);
|
||||
}
|
||||
|
||||
if (strlen($content) > 200) {
|
||||
$content = utf8_encode($content);
|
||||
$content = substr($content, 0, 200) . '...';
|
||||
$content = utf8_decode($content);
|
||||
}
|
||||
|
||||
$showUser = TRUE;
|
||||
switch ($type) {
|
||||
case 'blogPost':
|
||||
$url = base_url('blog/post/' . $url);
|
||||
break;
|
||||
case 'project':
|
||||
$url = base_url('project/' . $url);
|
||||
break;
|
||||
case 'projectCategory':
|
||||
$url = base_url('projects/' . $url);
|
||||
$showUser = FALSE;
|
||||
break;
|
||||
case 'user':
|
||||
$url = base_url('user/' . $url);
|
||||
break;
|
||||
case 'userPost':
|
||||
$url = base_url('user/' . $username . '/post/' . $url);
|
||||
break;
|
||||
}
|
||||
|
||||
$type = lang('search_type_' . $type);
|
||||
|
||||
$newArray = [
|
||||
'showUser' => $showUser,
|
||||
'username' => $displayname,
|
||||
'authorUrl' => base_url('user/' . $username),
|
||||
'content' => $content,
|
||||
'date' => $date,
|
||||
'image' => $image,
|
||||
'title' => $title,
|
||||
'type' => $type,
|
||||
'url' => $url,
|
||||
];
|
||||
|
||||
|
||||
$results[$i] = $newArray;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
@@ -48,110 +48,111 @@
|
||||
href="<?= base_url('lang/change/fr?r=' . urlencode(base64_encode(base_url(uri_string())))); ?>"
|
||||
hreflang="fr">
|
||||
</head>
|
||||
<!--/head-->
|
||||
<body>
|
||||
<header class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top <?= isset($active) && $active == 'profile' ? 'bg-custom' : '' ?>" role="banner">
|
||||
<a data-track-content data-content-name="Header Logo Link" class="navbar-brand"
|
||||
href="<?= base_url(); ?>">
|
||||
<div class="logo-container">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 672 386.48" id="logo-container">
|
||||
<defs>
|
||||
<style>.a {
|
||||
fill: #fff;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path class="a b"
|
||||
d="M186,222.6V373.74A12.26,12.26,0,0,0,198.22,386H349.36A12.26,12.26,0,0,0,358,365.07L206.89,213.93A12.26,12.26,0,0,0,186,222.6Z" />
|
||||
<path class="a b"
|
||||
d="M349.36,0H198.22A12.26,12.26,0,0,0,186,12.26V163.4a12.26,12.26,0,0,0,20.93,8.67L358,20.93A12.26,12.26,0,0,0,349.36,0Z" />
|
||||
<path class="a c"
|
||||
d="M398.68,364.32,561,202a12.7,12.7,0,0,0,0-18L398.68,21.68a12.7,12.7,0,0,0-21.68,9V355.34A12.7,12.7,0,0,0,398.68,364.32Z" />
|
||||
<circle class="a d" cx="296.65" cy="193.11" r="65.52" />
|
||||
</svg>
|
||||
<h1 id="logo-text">KingOfDog</h1>
|
||||
</div>
|
||||
</a>
|
||||
<div class="navbar-content float-right">
|
||||
<ul>
|
||||
<?php if (isset($_SESSION['user'])): ?>
|
||||
<li>
|
||||
<div class="dropdown">
|
||||
<a href="#" role="button" data-toggle="dropdown" data-offset="0,20" id="notificationMenuButton" aria-haspopup="true" aria-expanded="false" class="navbar-link">
|
||||
<i class="fa fa-bell d-inline"></i>
|
||||
<div class="badge badge-pill badge-success" id="notificationCount"></div>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="notificationMenuButton" id="notificationMenu">
|
||||
<div class="list-group list-group-flush">
|
||||
<div class="text-center">
|
||||
<i class="fa fa-cog fa-spin fa-4x my-4"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!isset($_SESSION['user'])): ?>
|
||||
<li>
|
||||
<a href="<?= base_url('login') ?>" data-toggle="tooltip" data-placement="bottom"
|
||||
data-placement="bottom" title="<?= lang('header_login') ?>"
|
||||
class="navbar-link">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 926 534" id="login-icon">
|
||||
<defs>
|
||||
<style>.z {
|
||||
fill: #fff;
|
||||
}</style>
|
||||
</defs>
|
||||
<path class="z"
|
||||
d="M522,52H649.16c4.09,0,8.18.07,12.26.41,1.36.11,3.53.76,4.85.51l-3.43-.44q1.6.25,3.2.54,4,.73,7.9,1.75t7.74,2.3c1.53.51,3,1.11,4.55,1.64q3.76,1.5-1.5-.69,1.48.64,2.94,1.33a110.44,110.44,0,0,1,14.06,7.91c1.35.9,2.65,1.86,4,2.78,4.67,3.24-4.19-3.7.07.08,2.33,2.07,4.71,4.07,6.93,6.27q2.53,2.5,4.88,5.17a30.9,30.9,0,0,0,2.77,3.31c-4.5-3.78-1.92-2.53-.44-.41s2.7,4.08,3.9,6.21q1.09,1.94,2.07,3.94l.64,1.35q1.62,3.64-.76-1.82c-.14.91,1.22,3.4,1.51,4.32q.69,2.22,1.24,4.49c.24,1,.44,2.06.66,3.08,1.22,5.53-.31-6,0-.25.2,3.63.31,7.23.31,10.87q0,7.64,0,15.29-.07,20.14-.19,40.29-.56,99.11-1.39,198.23c-.14,17.88.83,36.23-.57,54.06-.18,2.26-1.34,4.9.51-3.52-.19.87-.28,1.78-.44,2.65q-.47,2.5-1.1,5-.72,2.81-1.65,5.55c-.41,1.21-.87,2.39-1.3,3.58-1.41,3.91,2.76-5.85-.23.36A96.41,96.41,0,0,1,715,451.8l-1,1.42q-2.42,3.24.58-.75c-.69,1.5-2.63,3.13-3.73,4.35q-3.17,3.51-6.61,6.77c-1.87,1.77-3.82,3.43-5.79,5.09-4.18,3.52,4.74-3.25.24-.21-1.25.84-2.46,1.73-3.72,2.55q-3.12,2-6.4,3.82-2,1.06-4,2l-1.34.63q-3.64,1.62,1.89-.77c-2.67.27-5.8,2.12-8.43,2.86q-3.6,1-7.29,1.72l-1.49.27q-4.05.64,2.13-.24a18,18,0,0,0-3.06.31c-3.14.27-6.27.31-9.42.3q-64.57-.18-129.14-.44l-4.45,0c-13.08,0-25.6,11.53-25,25s11,25,25,25l130.89.45c18.9.06,36.4-3.38,53.59-11.28,24.3-11.17,46.2-33.31,57.78-57.32,7.8-16.18,11.16-32.14,11.27-50,0-7.92.13-15.84.19-23.76q.78-98.3,1.42-196.6c.16-26.49.43-53,.36-79.46C779.35,56.38,728.57,12.07,674.53,4,651,.54,626.78,2,603.11,2H522c-13.08,0-25.6,11.5-25,25s11,25,25,25Z" />
|
||||
<path class="z y"
|
||||
d="M171,162H357V41s4-24,25-24c0,0,8-1,17,5L628,251s7,5,7,17c0,0-1,13-8,18L400,513s-10,11-28,4c0,0-15-9-15-23V374H171a27.74,27.74,0,0,1-18-8c-8-8-8-19-8-19V185s2-12,10-17S169,162,171,162Z" />
|
||||
</svg>
|
||||
<span><?= lang('header_login') ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($_SESSION['user'])): ?>
|
||||
<li>
|
||||
<div class="dropdown">
|
||||
<a href="" class="navbar-link dropdown-toggle" data-toggle="dropdown" id="userMenuButton" aria-haspopup="true" aria-expanded="false" role="button">
|
||||
<img src="<?= $_SESSION['user']['profilePic'] ?>?w=100" alt="" class="img-fluid rounded-circle">
|
||||
<?= $_SESSION['user']['displayname'] ?>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userMenuButton" id="userMenu">
|
||||
<a href="<?= base_url('user/' . $_SESSION['user']['username']) ?>" class="dropdown-item">
|
||||
<i class="fa fa-user"></i>
|
||||
<?= lang('header_profile') ?>
|
||||
</a>
|
||||
<a href="<?= base_url('user/' . $_SESSION['user']['username'] . '/edit') ?>" class="dropdown-item">
|
||||
<i class="fa fa-user-edit"></i>
|
||||
<?= lang('header_edit_profile') ?>
|
||||
</a>
|
||||
<?php if (get_instance()->hasPermission('dashboard.view')): ?>
|
||||
<a href="<?= base_url('admin') ?>" class="dropdown-item">
|
||||
<i class="fa fa-tachometer-alt"></i>
|
||||
<?= lang('header_admin_panel') ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<a href="<?= base_url('login/logout') ?>" class="dropdown-item">
|
||||
<i class="fa fa-sign-out-alt"></i>
|
||||
<?= lang('header_logout') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
<header class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top <?= isset($_SESSION['user']) ? 'loggedIn' : '' ?>" role="banner">
|
||||
<div>
|
||||
<button class="menu-icon">
|
||||
<span></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="navbar-logo-container">
|
||||
<div class="navbar-logo">
|
||||
<a href="<?= base_url() ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 672 386.48" class="navbar-logo-svg">
|
||||
<defs>
|
||||
<style>.a {
|
||||
fill: #fff;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path class="a b" d="M186,222.6V373.74A12.26,12.26,0,0,0,198.22,386H349.36A12.26,12.26,0,0,0,358,365.07L206.89,213.93A12.26,12.26,0,0,0,186,222.6Z"></path>
|
||||
<path class="a b" d="M349.36,0H198.22A12.26,12.26,0,0,0,186,12.26V163.4a12.26,12.26,0,0,0,20.93,8.67L358,20.93A12.26,12.26,0,0,0,349.36,0Z"></path>
|
||||
<path class="a c" d="M398.68,364.32,561,202a12.7,12.7,0,0,0,0-18L398.68,21.68a12.7,12.7,0,0,0-21.68,9V355.34A12.7,12.7,0,0,0,398.68,364.32Z"></path>
|
||||
<circle class="a d" cx="296.65" cy="193.11" r="65.52"></circle>
|
||||
</svg>
|
||||
<h1 class="navbar-logo-title">KingOfDog</h1>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="navbar-search">
|
||||
<input class="form-control" type="search" placeholder="Suchen nach Posts, Projekten, Blog-Einträgen und mehr">
|
||||
</div>
|
||||
|
||||
<div class="navbar-action">
|
||||
<a href="#" class="navbar-action-btn" role="button" id="searchButton" data-toggle="tooltip" data-placement="bottom" title="Suchen">
|
||||
<i class="fa fa-search"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php if (isset($_SESSION['user'])): ?>
|
||||
<div class="navbar-action">
|
||||
<div class="dropdown">
|
||||
<a href="#" role="button" data-toggle="dropdown" data-offset="0,20" id="notificationMenuButton" aria-haspopup="true" aria-expanded="false" class="navbar-action-btn">
|
||||
<i class="fa fa-bell"></i>
|
||||
<div class="badge badge-pill badge-success" id="notificationCount"></div>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="notificationMenuButton" id="notificationMenu">
|
||||
<div class="list-group list-group-flush">
|
||||
<div class="loadingSpinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="navbar-action">
|
||||
<div class="dropdown">
|
||||
<a href="#" class="navbar-action-btn dropdown-toggle" data-toggle="dropdown" id="userMenuButton" aria-haspopup="true" aria-expanded="false" role="button">
|
||||
<img src="<?= $_SESSION['user']['profilePic'] ?>?w=100" alt="" class="img-fluid rounded-circle">
|
||||
<text><?= $_SESSION['user']['displayname'] ?></text>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userMenuButton" id="userMenu">
|
||||
<a href="<?= base_url('user/' . $_SESSION['user']['username']) ?>" class="dropdown-item">
|
||||
<i class="fa fa-user"></i>
|
||||
<?= lang('header_profile') ?>
|
||||
</a>
|
||||
<a href="<?= base_url('user/' . $_SESSION['user']['username'] . '/edit') ?>" class="dropdown-item">
|
||||
<i class="fa fa-user-edit"></i>
|
||||
<?= lang('header_edit_profile') ?>
|
||||
</a>
|
||||
<?php if (get_instance()->hasPermission('dashboard.view')): ?>
|
||||
<a href="<? //= base_url('admin') ?>" class="dropdown-item">
|
||||
<i class="fa fa-tachometer-alt"></i>
|
||||
<?= lang('header_admin_panel') ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<a href="<?= base_url('login/logout') ?>" class="dropdown-item">
|
||||
<i class="fa fa-sign-out-alt"></i>
|
||||
<?= lang('header_logout') ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="navbar-action">
|
||||
<a href="<?= base_url('login?r=' . urlencode(base64_encode(uri_string()))) ?>" class="navbar-action-btn" role="button" data-toggle="tooltip" data-placement="bottom" title="<?= lang('header_login') ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 926 534" id="login-icon">
|
||||
<defs>
|
||||
<style>.z {
|
||||
fill: #fff;
|
||||
}</style>
|
||||
</defs>
|
||||
<path class="z"
|
||||
d="M522,52H649.16c4.09,0,8.18.07,12.26.41,1.36.11,3.53.76,4.85.51l-3.43-.44q1.6.25,3.2.54,4,.73,7.9,1.75t7.74,2.3c1.53.51,3,1.11,4.55,1.64q3.76,1.5-1.5-.69,1.48.64,2.94,1.33a110.44,110.44,0,0,1,14.06,7.91c1.35.9,2.65,1.86,4,2.78,4.67,3.24-4.19-3.7.07.08,2.33,2.07,4.71,4.07,6.93,6.27q2.53,2.5,4.88,5.17a30.9,30.9,0,0,0,2.77,3.31c-4.5-3.78-1.92-2.53-.44-.41s2.7,4.08,3.9,6.21q1.09,1.94,2.07,3.94l.64,1.35q1.62,3.64-.76-1.82c-.14.91,1.22,3.4,1.51,4.32q.69,2.22,1.24,4.49c.24,1,.44,2.06.66,3.08,1.22,5.53-.31-6,0-.25.2,3.63.31,7.23.31,10.87q0,7.64,0,15.29-.07,20.14-.19,40.29-.56,99.11-1.39,198.23c-.14,17.88.83,36.23-.57,54.06-.18,2.26-1.34,4.9.51-3.52-.19.87-.28,1.78-.44,2.65q-.47,2.5-1.1,5-.72,2.81-1.65,5.55c-.41,1.21-.87,2.39-1.3,3.58-1.41,3.91,2.76-5.85-.23.36A96.41,96.41,0,0,1,715,451.8l-1,1.42q-2.42,3.24.58-.75c-.69,1.5-2.63,3.13-3.73,4.35q-3.17,3.51-6.61,6.77c-1.87,1.77-3.82,3.43-5.79,5.09-4.18,3.52,4.74-3.25.24-.21-1.25.84-2.46,1.73-3.72,2.55q-3.12,2-6.4,3.82-2,1.06-4,2l-1.34.63q-3.64,1.62,1.89-.77c-2.67.27-5.8,2.12-8.43,2.86q-3.6,1-7.29,1.72l-1.49.27q-4.05.64,2.13-.24a18,18,0,0,0-3.06.31c-3.14.27-6.27.31-9.42.3q-64.57-.18-129.14-.44l-4.45,0c-13.08,0-25.6,11.53-25,25s11,25,25,25l130.89.45c18.9.06,36.4-3.38,53.59-11.28,24.3-11.17,46.2-33.31,57.78-57.32,7.8-16.18,11.16-32.14,11.27-50,0-7.92.13-15.84.19-23.76q.78-98.3,1.42-196.6c.16-26.49.43-53,.36-79.46C779.35,56.38,728.57,12.07,674.53,4,651,.54,626.78,2,603.11,2H522c-13.08,0-25.6,11.5-25,25s11,25,25,25Z" />
|
||||
<path class="z y"
|
||||
d="M171,162H357V41s4-24,25-24c0,0,8-1,17,5L628,251s7,5,7,17c0,0-1,13-8,18L400,513s-10,11-28,4c0,0-15-9-15-23V374H171a27.74,27.74,0,0,1-18-8c-8-8-8-19-8-19V185s2-12,10-17S169,162,171,162Z" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
</header>
|
||||
|
||||
<div id="navbar-swipe-open d-block d-md-none"></div>
|
||||
<button class="menu-icon">
|
||||
<span></span>
|
||||
</button>
|
||||
<div class="side-navigation">
|
||||
<span class="side-title">
|
||||
<img src="<?= base_url('assets/images/logo.png'); ?>" id="headerLogo" alt="logo">
|
||||
@@ -330,6 +331,7 @@
|
||||
|
||||
<div class="btn-floating-shadow"></div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($_SESSION['user']) && !empty($_SESSION['user'])): ?>
|
||||
<div class="modal fade" id="postModal" tabindex="-1" role="dialog" aria-labelledby="postLabel">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
@@ -341,7 +343,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="postModalBody">
|
||||
<form id="postForm">
|
||||
<form id="postForm" enctype="multipart/form-data" method="POST">
|
||||
<input type="hidden" value="-1" id="replyTo">
|
||||
<div class="form-group has-feedback-right" id="content">
|
||||
<div class="form-control" id="contentField" contenteditable style="min-height:100px"
|
||||
@@ -359,8 +361,8 @@
|
||||
<i class="fa fa-upload"></i>
|
||||
</label>
|
||||
</div>
|
||||
<small><?= lang('header_post_notice') ?></small>
|
||||
</form>
|
||||
<small><?= lang('header_post_notice') ?></small>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?= lang('close') ?></button>
|
||||
|
60
application/views/search.php
Normal file
60
application/views/search.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<h1>Suchen nach: <input id="searchTerm" value="<?= $query ?>" class="form-control" /></h1>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Filtern</h5>
|
||||
</div>
|
||||
<div class="list-group list-group-flush filter">
|
||||
<button class="list-group-item list-group-item-action" data-filter="blogPost">
|
||||
Blog-Post
|
||||
</button>
|
||||
<button class="list-group-item list-group-item-action" data-filter="blogCategory">
|
||||
Blog-Kategorie
|
||||
</button>
|
||||
<button class="list-group-item list-group-item-action" data-filter="blogTag">
|
||||
Blog-Tag
|
||||
</button>
|
||||
<button class="list-group-item list-group-item-action" data-filter="user">
|
||||
Nutzer
|
||||
</button>
|
||||
<button class="list-group-item list-group-item-action" data-filter="userPost">
|
||||
Post
|
||||
</button>
|
||||
<button class="list-group-item list-group-item-action" data-filter="project">
|
||||
Projekt
|
||||
</button>
|
||||
<button class="list-group-item list-group-item-action" data-filter="projectCategory">
|
||||
Projekt-Kategorie
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<ul id="searchResults" class="p-0">
|
||||
|
||||
</ul>
|
||||
<div class="loadingSpinner"></div>
|
||||
<div class="error-container text-center" style="display: none;">
|
||||
<i class="far fa-frown fa-4x mb-2"></i>
|
||||
<h4 class="message message-no-results">
|
||||
Es wurden leider keine Suchergebnisse gefunden. Versuche es doch mal mit einem anderen Suchbegriff.
|
||||
</h4>
|
||||
<h4 class="message message-no-further-results">
|
||||
Es wurden leider keine weiteren Suchergebnisse gefunden.
|
||||
</h4>
|
||||
<h4 class="message message-search-term">
|
||||
Der angegebene Suchbegriff ist zu kurz. Wir benötigen min. 3 Zeichen zur erfolgreichen Suche!
|
||||
</h4>
|
||||
<h4 class="message message-general">
|
||||
Ein unbekannter Fehler ist aufgetreten. Versuche es später erneut.
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user