Merge pull request #650 from openclassify/dia

#1995 SEO fixes for w3 validator
This commit is contained in:
Ozcan Durak 2020-08-26 15:35:48 +03:00 committed by GitHub
commit d6191b04fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 92 additions and 55 deletions

View File

@ -26,6 +26,7 @@ return [
'estimated_pending_time', 'estimated_pending_time',
'default_published_time', 'default_published_time',
'default_GET', 'default_GET',
'add_canvas',
'thumbnail_width', 'thumbnail_width',
'thumbnail_height', 'thumbnail_height',
'picture_width', 'picture_width',

View File

@ -108,6 +108,13 @@ return [
'default_value' => 270, 'default_value' => 270,
], ],
], ],
'add_canvas' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
'mode' => 'checkbox',
],
],
'thumbnail_height' => [ 'thumbnail_height' => [
'type' => 'anomaly.field_type.integer', 'type' => 'anomaly.field_type.integer',
'config' => [ 'config' => [

View File

@ -79,6 +79,9 @@ return [
'default_GET' => [ 'default_GET' => [
'name' => 'Default Ad GET', 'name' => 'Default Ad GET',
], ],
'add_canvas' => [
'name' => 'Add Canvas',
],
'thumbnail_width' => [ 'thumbnail_width' => [
'name' => 'Thumbnail Width', 'name' => 'Thumbnail Width',
], ],

View File

@ -317,9 +317,18 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
// Create thumbnail image // Create thumbnail image
$image = Image::make(file_get_contents($adv->files[0]->url())); $image = Image::make(file_get_contents($adv->files[0]->url()));
$image->resize( $image->resize(
setting_value('visiosoft.module.advs::thumbnail_width'), null,
setting_value('visiosoft.module.advs::thumbnail_height') setting_value('visiosoft.module.advs::thumbnail_height'),
); function ($constraint) {
$constraint->aspectRatio();
});
if (setting_value('visiosoft.module.advs::add_canvas')) {
$image->resizeCanvas(
setting_value('visiosoft.module.advs::thumbnail_width'),
setting_value('visiosoft.module.advs::thumbnail_height'),
'center', false, 'fff'
);
}
$fileName = 'tn-' . $adv->files[0]->name; $fileName = 'tn-' . $adv->files[0]->name;
$image->save(app_storage_path() . '/files-module/local/images/' . $fileName); $image->save(app_storage_path() . '/files-module/local/images/' . $fileName);

View File

@ -278,10 +278,6 @@ class AdvsController extends PublicController
$radio = $returnvalues['radio']; $radio = $returnvalues['radio'];
} }
if (!empty($param['user'])) {
$user = $this->userRepository->find($param['user']);
}
Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000)); Cookie::queue(Cookie::make('last_search', $this->requestHttp->getRequestUri(), 84000));
$viewType = $this->requestHttp->cookie('viewType'); $viewType = $this->requestHttp->cookie('viewType');
@ -302,6 +298,12 @@ class AdvsController extends PublicController
$this->template->set('meta_title', $catText); $this->template->set('meta_title', $catText);
} }
if (!empty($param['user'])) {
$user = $this->userRepository->find($param['user']);
$this->template->set('showTitle', false);
$this->template->set('meta_title', $user->name() . ' ' . trans('visiosoft.module.advs::field.ads'));
}
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request', 'param', $compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request', 'param',
'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges', 'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges',
'seenList', 'searchedCountry', 'radio', 'categoryId', 'cityId', 'allCats', 'catText'); 'seenList', 'searchedCountry', 'radio', 'categoryId', 'cityId', 'allCats', 'catText');
@ -400,7 +402,11 @@ class AdvsController extends PublicController
$this->template->set('meta_keywords', implode(',', explode(' ', $adv->name))); $this->template->set('meta_keywords', implode(',', explode(' ', $adv->name)));
$this->template->set('meta_description', strip_tags($adv->advs_desc, '')); $this->template->set('meta_description', strip_tags($adv->advs_desc, ''));
$this->template->set('meta_title', $adv->name . "|" . end($categories)['name']); $this->template->set('showTitle', false);
$this->template->set(
'meta_title',
$adv->name . " " . end($categories)['name'] . ' ' . setting_value('streams::domain')
);
if (substr($adv->cover_photo, 0, 4) === "http") { if (substr($adv->cover_photo, 0, 4) === "http") {
$coverPhoto = $adv->cover_photo; $coverPhoto = $adv->cover_photo;
} else { } else {

View File

@ -1,15 +1,15 @@
<!doctype html> <!doctype html>
<!--[if lt IE 7]> <!--[if lt IE 7]>
<html class="nojs ms lt_ie7" lang="en"><![endif]--> <html class="nojs ms lt_ie7" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if IE 7]> <!--[if IE 7]>
<html class="nojs ms ie7" lang="en"><![endif]--> <html class="nojs ms ie7" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if IE 8]> <!--[if IE 8]>
<html class="nojs ms ie8" lang="en"><![endif]--> <html class="nojs ms ie8" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if gt IE 8]> <!--[if gt IE 8]>
<html class="nojs ms" lang="en"><![endif]--> <html class="nojs ms" lang="{{ config('app.locale') }}"><![endif]-->
<html> <html lang="{{ config('app.locale') }}">
<head> <head>
{% include "visiosoft.theme.base::partials/metadata" %} {% include "visiosoft.theme.base::partials/metadata" %}

View File

@ -1,15 +1,15 @@
<!doctype html> <!doctype html>
<!--[if lt IE 7]> <!--[if lt IE 7]>
<html class="nojs ms lt_ie7" lang="en"><![endif]--> <html class="nojs ms lt_ie7" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if IE 7]> <!--[if IE 7]>
<html class="nojs ms ie7" lang="en"><![endif]--> <html class="nojs ms ie7" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if IE 8]> <!--[if IE 8]>
<html class="nojs ms ie8" lang="en"><![endif]--> <html class="nojs ms ie8" lang="{{ config('app.locale') }}"><![endif]-->
<!--[if gt IE 8]> <!--[if gt IE 8]>
<html class="nojs ms" lang="en"><![endif]--> <html class="nojs ms" lang="{{ config('app.locale') }}"><![endif]-->
<html> <html lang="{{ config('app.locale') }}">
<head> <head>
{% include "visiosoft.theme.base::partials/metadata" %} {% include "visiosoft.theme.base::partials/metadata" %}

View File

@ -9,7 +9,7 @@
{{ title ?: setting_value('streams::name','Visiosoft LTD.') }} {{ title ?: setting_value('streams::name','Visiosoft LTD.') }}
</title> </title>
<style type="text/css" rel="stylesheet" media="all"> <style rel="stylesheet" media="all">
/* Media Queries */ /* Media Queries */
@media only screen and (max-width: 500px) { @media only screen and (max-width: 500px) {
.button { .button {

View File

@ -2,9 +2,6 @@
Main CSS can be found in metadata.twig Main CSS can be found in metadata.twig
#} #}
<!-- VueJS Requirements -->
<script type="text/javascript" src="{{ asset('js/app.js') }}"></script>
{# Core Theme Components #} {# Core Theme Components #}
{{ asset_add("theme.js", "visiosoft.theme.base::js/popper.min.js") }} {{ asset_add("theme.js", "visiosoft.theme.base::js/popper.min.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/bootstrap.min.js") }} {{ asset_add("theme.js", "visiosoft.theme.base::js/bootstrap.min.js") }}
@ -24,20 +21,20 @@
{{ asset_script("theme.js") }} {{ asset_script("theme.js") }}
{# Include Styles Loaded From Outside #} {# Include Styles Loaded From Outside #}
<style type="text/css"> <style>
{% for style in asset_inlines("styles.css", ["min"]) %} {% for style in asset_inlines("styles.css", ["min"]) %}
{{ style|raw }} {{ style|raw }}
{% endfor %} {% endfor %}
</style> </style>
{# Include Scripts Loaded From Outside #} {# Include Scripts Loaded From Outside #}
<script type="text/javascript"> <script>
{% for script in asset_inlines("scripts.js", ["min"]) %} {% for script in asset_inlines("scripts.js", ["min"]) %}
{{ script|raw }} {{ script|raw }}
{% endfor %} {% endfor %}
</script> </script>
<script type="text/javascript"> <script>
{% for script in asset_inlines("customjs.js") %} {% for script in asset_inlines("customjs.js") %}
{{ script|raw }} {{ script|raw }}
{% endfor %} {% endfor %}

View File

@ -11,7 +11,7 @@
<img src="{{ img('visiosoft.theme.base::images/default-categories-icon.png').url }}" alt="{{ main_category.name }}" <img src="{{ img('visiosoft.theme.base::images/default-categories-icon.png').url }}" alt="{{ main_category.name }}"
class="img-responsive"> class="img-responsive">
{% endif %} {% endif %}
<font>{{ main_category.name }}</font> <span>{{ main_category.name }}</span>
<p class="p-0 sub-categories"> <p class="p-0 sub-categories">
{% set sub_categories = entries('cats','category').where('parent_category_id', main_category.id).where('deleted_at', null).orderBy('sort_order').get() %} {% set sub_categories = entries('cats','category').where('parent_category_id', main_category.id).where('deleted_at', null).orderBy('sort_order').get() %}
{% for sub_category in sub_categories|slice(0,sub_categories_limit) %} {% for sub_category in sub_categories|slice(0,sub_categories_limit) %}

View File

@ -1,4 +1,4 @@
<section id="messages"> <div id="messages">
<!-- Success Messages --> <!-- Success Messages -->
{% if message_exists('success') %} {% if message_exists('success') %}
@ -54,4 +54,4 @@
</div> </div>
{% endif %} {% endif %}
</section> </div>

View File

@ -1,6 +1,3 @@
<!-- Locale -->
<meta http-equiv="Content-Language" content="{{ config('app.locale') }}">
<!-- VueJS Requirements --> <!-- VueJS Requirements -->
<meta name="csrf-token" content="{{ csrf_token() }}" /> <meta name="csrf-token" content="{{ csrf_token() }}" />
@ -27,7 +24,7 @@
{% include "visiosoft.theme.base::partials/styles" %} {% include "visiosoft.theme.base::partials/styles" %}
{# Custom Theme Components #} {# Custom Theme Components #}
<style type="text/css"> <style>
{% for style in asset_inlines("custom-theme.css", ["min"]) %} {% for style in asset_inlines("custom-theme.css", ["min"]) %}
{{ style|raw }} {{ style|raw }}
{% endfor %} {% endfor %}

View File

@ -1,12 +1,12 @@
<!-- Meta Tags --> <!-- Meta Tags -->
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width"/> <meta name="viewport" content="width=device-width"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="{{ config_get('streams::distribution.name') }}"/> <meta name="generator" content="{{ config_get('streams::distribution.name') }}"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" <meta name="description"
content="{{ (template.get('meta_description') ?: setting_value('streams::description'))|slice(0,160) }}"/> content="{{ (template.get('meta_description') ?: setting_value('streams::description'))|slice(0,160) }}"/>
<meta name="keywords" content="{{ template.get('meta_keywords') }}" /> <meta name="keywords" content="{{ template.get('meta_keywords') }}" />
{{ setting_value('visiosoft.module.advs::google_statistic_code')|raw }}
<!-- Meta Tags --> <!-- Meta Tags -->
<title> <title>

View File

@ -28,16 +28,24 @@
<ul class="nav navbar-nav navbar-right d-block d-sm-none"> <ul class="nav navbar-nav navbar-right d-block d-sm-none">
<li class="nav-item"> <li class="nav-item">
{% if auth_check() %} {% if auth_check() %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">{{ trans('visiosoft.theme.base::field.logout.name') }}</a> <a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">
{{ trans('visiosoft.theme.base::field.logout.name') }}
</a>
{% else %} {% else %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}">{{ trans('visiosoft.theme.base::field.login.name') }}</a> <a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}" rel="nofollow">
{{ trans('visiosoft.theme.base::field.login.name') }}
</a>
{% endif %} {% endif %}
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ url_route('profile::profile') }}">{{ trans('visiosoft.theme.base::field.profile') }}</a> <a class="nav-link" href="{{ url_route('profile::profile') }}" rel="nofollow">
{{ trans('visiosoft.theme.base::field.profile') }}
</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("visiosoft.theme.base::button.post_ad.name") }}</a> <a href="/advs/create_adv" class="btn btn-primary" rel="nofollow">
{{ trans("visiosoft.theme.base::button.post_ad.name") }}
</a>
</li> </li>
</ul> </ul>
{% endif %} {% endif %}
@ -47,16 +55,24 @@
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li class="nav-item"> <li class="nav-item">
{% if auth_check() %} {% if auth_check() %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">{{ trans('visiosoft.theme.base::field.logout.name') }}</a> <a class="nav-link" href="{{ url_route('anomaly.module.users::logout') }}">
{{ trans('visiosoft.theme.base::field.logout.name') }}
</a>
{% else %} {% else %}
<a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}">{{ trans('visiosoft.theme.base::field.login.name') }}</a> <a class="nav-link" href="{{ url_route('anomaly.module.users::login') }}" rel="nofollow">
{{ trans('visiosoft.theme.base::field.login.name') }}
</a>
{% endif %} {% endif %}
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ url_route('profile::profile') }}">{{ trans('visiosoft.theme.base::field.profile') }}</a> <a class="nav-link" href="{{ url_route('profile::profile') }}" rel="nofollow">
{{ trans('visiosoft.theme.base::field.profile') }}
</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("visiosoft.theme.base::button.post_ad.name") }}</a> <a href="/advs/create_adv" class="btn btn-primary" rel="nofollow">
{{ trans("visiosoft.theme.base::button.post_ad.name") }}
</a>
</li> </li>
</ul> </ul>
{% endif %} {% endif %}

View File

@ -1 +0,0 @@
{{ setting_value('visiosoft.module.advs::google_statistic_code')|raw }}

View File

@ -1,3 +1,3 @@
<style type="text/css"> <style>
{{ setting_value("visiosoft.theme.base::style")|raw }} {{ setting_value("visiosoft.theme.base::style")|raw }}
</style> </style>

View File

@ -62,21 +62,23 @@ class UploadController extends AdminController
$fullImg = WaterMark::make($this->request->file('upload')->getRealPath()) $fullImg = WaterMark::make($this->request->file('upload')->getRealPath())
->resize(null, setting_value('visiosoft.field_type.media::imageResizeH', 600),function ($constraint) { ->resize(null, setting_value('visiosoft.field_type.media::imageResizeH', 600),function ($constraint) {
$constraint->aspectRatio(); $constraint->aspectRatio();
}) });
->resizeCanvas(
setting_value('visiosoft.field_type.media::imageCanvasW', 800),
setting_value('visiosoft.field_type.media::imageCanvasH', 600),
'center', false, 'fff'
);
$mdImg = WaterMark::make($this->request->file('upload')->getRealPath()) $mdImg = WaterMark::make($this->request->file('upload')->getRealPath())
->resize(null, setting_value('visiosoft.module.advs::picture_height'),function ($constraint) { ->resize(null, setting_value('visiosoft.module.advs::picture_height'),function ($constraint) {
$constraint->aspectRatio(); $constraint->aspectRatio();
}) });
->resizeCanvas( if (setting_value('visiosoft.module.advs::add_canvas')) {
setting_value('visiosoft.module.advs::picture_width', 400), $fullImg->resizeCanvas(
setting_value('visiosoft.module.advs::picture_height', 300), setting_value('visiosoft.field_type.media::imageCanvasW', 800),
'center', false, 'fff' setting_value('visiosoft.field_type.media::imageCanvasH', 600),
); 'center', false, 'fff'
);
$mdImg->resizeCanvas(
setting_value('visiosoft.module.advs::picture_width', 400),
setting_value('visiosoft.module.advs::picture_height', 300),
'center', false, 'fff'
);
}
foreach ([$fullImg, $mdImg] as $index => $image) { foreach ([$fullImg, $mdImg] as $index => $image) {
if ($watermarktype == 'image') { if ($watermarktype == 'image') {
$watermarkimage_id = $settings->value('visiosoft.module.advs::watermark_image'); $watermarkimage_id = $settings->value('visiosoft.module.advs::watermark_image');