Skip to content

Commit

Permalink
Merge pull request #23 from PopojiCMS/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
DwiraSurvivor authored Oct 9, 2020
2 parents 7ef88bd + 739426f commit d6a5d57
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 56 deletions.
16 changes: 8 additions & 8 deletions po-includes/app/Http/Controllers/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ public function index($seotitle)
SEOTools::setTitle($category->title.' - '.getSetting('web_name'));
SEOTools::setDescription($category->title.' - '.getSetting('web_description'));
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . '/category/' . $category->seotitle);
SEOTools::opengraph()->setTitle($category->title.' - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription($category->title.' - '.getSetting('web_description'));
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . '/category/' . $category->seotitle);
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage($category->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($category->picture, null, $category->updated_by));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle($category->title.' - '.getSetting('web_name'));
SEOTools::twitter()->setDescription($category->title.' - '.getSetting('web_description'));
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . '/category/' . $category->seotitle);
SEOTools::twitter()->setImage($category->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($category->picture, null, $category->updated_by));
SEOTools::jsonLd()->setTitle($category->title.' - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription($category->title.' - '.getSetting('web_description'));
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . '/category/' . $category->seotitle);
SEOTools::jsonLd()->setImage($category->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($category->picture, null, $category->updated_by));

$posts = Post::leftJoin('users', 'users.id', 'posts.created_by')
Expand All @@ -65,21 +65,21 @@ public function index($seotitle)
SEOTools::setTitle('All Category - '.getSetting('web_name'));
SEOTools::setDescription('All Category - '.getSetting('web_description'));
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . '/category/all');
SEOTools::opengraph()->setTitle('All Category - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription('All Category - '.getSetting('web_description'));
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . '/category/all');
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle('All Category - '.getSetting('web_name'));
SEOTools::twitter()->setDescription('All Category - '.getSetting('web_description'));
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . '/category/all');
SEOTools::twitter()->setImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::jsonLd()->setTitle('All Category - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription('All Category - '.getSetting('web_description'));
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . '/category/all');
SEOTools::jsonLd()->setImage(asset('po-content/uploads/'.getSetting('logo')));

$posts = Post::leftJoin('users', 'users.id', 'posts.created_by')
Expand Down
8 changes: 4 additions & 4 deletions po-includes/app/Http/Controllers/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ public function index()
SEOTools::setTitle('Contact - '.getSetting('web_name'));
SEOTools::setDescription('Contact - '.getSetting('web_description'));
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . '/contact');
SEOTools::opengraph()->setTitle('Contact - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription('Contact - '.getSetting('web_description'));
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . '/contact');
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle('Contact - '.getSetting('web_name'));
SEOTools::twitter()->setDescription('Contact - '.getSetting('web_description'));
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . '/contact');
SEOTools::twitter()->setImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::jsonLd()->setTitle('Contact - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription('Contact - '.getSetting('web_description'));
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . '/contact');
SEOTools::jsonLd()->setImage(asset('po-content/uploads/'.getSetting('logo')));

return view(getTheme('contact'));
Expand Down
16 changes: 8 additions & 8 deletions po-includes/app/Http/Controllers/GalleryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ public function index($seotitle)
SEOTools::setTitle($album->title.' - '.getSetting('web_name'));
SEOTools::setDescription($album->title.' - '.getSetting('web_description'));
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . '/album/' . $album->seotitle);
SEOTools::opengraph()->setTitle($album->title.' - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription($album->title.' - '.getSetting('web_description'));
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . '/album/' . $album->seotitle);
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle($album->title.' - '.getSetting('web_name'));
SEOTools::twitter()->setDescription($album->title.' - '.getSetting('web_description'));
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . '/album/' . $album->seotitle);
SEOTools::twitter()->setImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::jsonLd()->setTitle($album->title.' - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription($album->title.' - '.getSetting('web_description'));
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . '/album/' . $album->seotitle);
SEOTools::jsonLd()->setImage(asset('po-content/uploads/'.getSetting('logo')));

$gallerys = Gallery::leftJoin('users', 'users.id', 'gallerys.created_by')
Expand All @@ -65,21 +65,21 @@ public function index($seotitle)
SEOTools::setTitle('All Category - '.getSetting('web_name'));
SEOTools::setDescription('All Category - '.getSetting('web_description'));
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . '/album/all');
SEOTools::opengraph()->setTitle('All Category - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription('All Category - '.getSetting('web_description'));
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . '/album/all');
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle('All Category - '.getSetting('web_name'));
SEOTools::twitter()->setDescription('All Category - '.getSetting('web_description'));
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . '/album/all');
SEOTools::twitter()->setImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::jsonLd()->setTitle('All Category - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription('All Category - '.getSetting('web_description'));
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . '/album/all');
SEOTools::jsonLd()->setImage(asset('po-content/uploads/'.getSetting('logo')));

$gallerys = Album::where('active', '=', 'Y')
Expand Down
8 changes: 4 additions & 4 deletions po-includes/app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,21 @@ public function error404()
SEOTools::setTitle('Not Found - '.getSetting('web_name'));
SEOTools::setDescription(getSetting('web_description'));
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . '/404');
SEOTools::opengraph()->setTitle('Not Found - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription(getSetting('web_description'));
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . '/404');
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle('Not Found - '.getSetting('web_name'));
SEOTools::twitter()->setDescription(getSetting('web_description'));
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . '/404');
SEOTools::twitter()->setImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::jsonLd()->setTitle('Not Found - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription(getSetting('web_description'));
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . '/404');
SEOTools::jsonLd()->setImage(asset('po-content/uploads/'.getSetting('logo')));

return response()->view(getTheme('404'), [], 404);
Expand Down
8 changes: 4 additions & 4 deletions po-includes/app/Http/Controllers/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ public function index($seotitle)
SEOTools::setTitle($pages->title.' - '.getSetting('web_name'));
SEOTools::setDescription(\Str::limit(strip_tags($pages->content), 200));
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . '/pages/' . $pages->seotitle);
SEOTools::opengraph()->setTitle($pages->title.' - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription(\Str::limit(strip_tags($pages->content), 200));
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . '/pages/' . $pages->seotitle);
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage($pages->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($pages->picture, null, $pages->updated_by));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle($pages->title.' - '.getSetting('web_name'));
SEOTools::twitter()->setDescription(\Str::limit(strip_tags($pages->content), 200));
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . '/pages/' . $pages->seotitle);
SEOTools::twitter()->setImage($pages->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($pages->picture, null, $pages->updated_by));
SEOTools::jsonLd()->setTitle($pages->title.' - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription(\Str::limit(strip_tags($pages->content), 200));
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . '/pages/' . $pages->seotitle);
SEOTools::jsonLd()->setImage($pages->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($pages->picture, null, $pages->updated_by));

return view(getTheme('pages'), compact('pages'));
Expand Down
35 changes: 22 additions & 13 deletions po-includes/app/Http/Controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,32 @@ public function index($seotitle, Request $request)
$content = $post->content;
}

$seturl = '';
if(getSetting('slug') == 'post/slug-id') {
$seturl = '/detailpost/' . $post->seotitle . '-' . $post->id;
} else {
$seturl = '/detailpost/' . $post->seotitle;
}

$twitterid = explode('/', getSetting('twitter'));
SEOTools::setTitle($post->title.' - '.getSetting('web_name'));
SEOTools::setDescription($post->meta_description);
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . $seturl);
SEOTools::opengraph()->setTitle($post->title.' - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription($post->meta_description);
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . $seturl);
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage($post->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($post->picture, null, $post->updated_by));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle($post->title.' - '.getSetting('web_name'));
SEOTools::twitter()->setDescription($post->meta_description);
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . $seturl);
SEOTools::twitter()->setImage($post->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($post->picture, null, $post->updated_by));
SEOTools::jsonLd()->setTitle($post->title.' - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription($post->meta_description);
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . $seturl);
SEOTools::jsonLd()->setImage($post->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($post->picture, null, $post->updated_by));

return view(getTheme('detailpost'), compact('post', 'content', 'paginator', 'gallery'));
Expand All @@ -113,7 +120,7 @@ public function index($seotitle, Request $request)
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function article($year, $month, $dat, $seotitle, Request $request)
public function article($year, $month, $day, $seotitle, Request $request)
{
$checkpost = Post::where([['seotitle', '=', $seotitle],['active', '=', 'Y']])->first();

Expand Down Expand Up @@ -149,25 +156,27 @@ public function article($year, $month, $dat, $seotitle, Request $request)
$content = $post->content;
}

$seturl = '/article/' . $year . '/' . $month . '/' . $day . '/' . $post->seotitle;

$twitterid = explode('/', getSetting('twitter'));
SEOTools::setTitle($post->title.' - '.getSetting('web_name'));
SEOTools::setDescription($post->meta_description);
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . $seturl);
SEOTools::opengraph()->setTitle($post->title.' - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription($post->meta_description);
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . $seturl);
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage($post->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($post->picture, null, $post->updated_by));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle($post->title.' - '.getSetting('web_name'));
SEOTools::twitter()->setDescription($post->meta_description);
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . $seturl);
SEOTools::twitter()->setImage($post->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($post->picture, null, $post->updated_by));
SEOTools::jsonLd()->setTitle($post->title.' - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription($post->meta_description);
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . $seturl);
SEOTools::jsonLd()->setImage($post->picture == '' ? asset('po-content/uploads/'.getSetting('logo')) : getPicture($post->picture, null, $post->updated_by));

return view(getTheme('detailpost'), compact('post', 'content', 'paginator', 'gallery'));
Expand All @@ -193,21 +202,21 @@ public function search(Request $request)
SEOTools::setTitle($terms.' - '.getSetting('web_name'));
SEOTools::setDescription($terms.' - '.getSetting('web_description'));
SEOTools::metatags()->setKeywords(explode(',', getSetting('web_keyword')));
SEOTools::setCanonical(getSetting('web_url'));
SEOTools::setCanonical(getSetting('web_url') . '/search');
SEOTools::opengraph()->setTitle($terms.' - '.getSetting('web_name'));
SEOTools::opengraph()->setDescription($terms.' - '.getSetting('web_description'));
SEOTools::opengraph()->setUrl(getSetting('web_url'));
SEOTools::opengraph()->setUrl(getSetting('web_url') . '/search');
SEOTools::opengraph()->setSiteName(getSetting('web_author'));
SEOTools::opengraph()->addImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::twitter()->setSite('@'.$twitterid[count($twitterid)-1]);
SEOTools::twitter()->setTitle($terms.' - '.getSetting('web_name'));
SEOTools::twitter()->setDescription($terms.' - '.getSetting('web_description'));
SEOTools::twitter()->setUrl(getSetting('web_url'));
SEOTools::twitter()->setUrl(getSetting('web_url') . '/search');
SEOTools::twitter()->setImage(asset('po-content/uploads/'.getSetting('logo')));
SEOTools::jsonLd()->setTitle($terms.' - '.getSetting('web_name'));
SEOTools::jsonLd()->setDescription($terms.' - '.getSetting('web_description'));
SEOTools::jsonLd()->setType('WebPage');
SEOTools::jsonLd()->setUrl(getSetting('web_url'));
SEOTools::jsonLd()->setUrl(getSetting('web_url') . '/search');
SEOTools::jsonLd()->setImage(asset('po-content/uploads/'.getSetting('logo')));

$posts = Post::leftJoin('users', 'users.id', 'posts.created_by')
Expand Down
Loading

0 comments on commit d6a5d57

Please sign in to comment.