Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#### Features:
**List of features related with structure**
- **public**
Contains the index.php file, to start application and configures auto-loading. Different server configurations added into this directory too. Finally, you can find the Sitemap generator that run after creation or updating a post.
Contains the index.php file, to start application and configures auto-loading. Different server configurations added into this directory too. Finally, you can find the Sitemap generator that runs after creation or updating a post.
- **public/assets**
Assets can contain your media files like images, audios & videos.
- **public/css** & **public/js**
Contains the styles & scripts _(After changes on these files, you can use minifier script to update minified versions, just run `docker-compose exec php-mvc-app php minifier.php`)_
- **public/feed**
There is a RSS generator in here and run after creation or updating a post.
There is a RSS generator in here and runs after creation or updating a post.
- **src**
Contains migrations for a DB and routes.
- **src/App**
Expand Down Expand Up @@ -58,7 +58,7 @@ Check Cross-site request forgery token
- **Helper::slug(...)**
Slugify string to make user-friendly URL
- **Cache::checkCache(...)**, **Cache::cache(...)** & **Cache::clearCache(...)**
Check existed cache, cache data and clear cache, by Memcached
Check existing cache, cache data and clear cache, by Memcached
- **UserInfo::current()**
Return current user information
- **UserInfo::info(...)**
Expand Down
Binary file added public/assets/images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* This script can produce a sitemap.xml in public folder
* This one call by XmlGenerator::feed() function after
* That called by XmlGenerator::feed() function after
* each post creation or updating
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Console/commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
];

/**
* Add script to current one to run it
* Run script if existed and match with timing
*/
foreach ($commands as $k => $v) {
if ($timingMapping[$v]) {
Expand Down
6 changes: 3 additions & 3 deletions src/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function registerForm()
'Auth/register',
[
'page_title' => 'Register',
'page_subtitle' => 'Register to send post in Blog'
'page_subtitle' => 'Register to send post in Blog',
]
);
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public function verify()
'Auth/verify',
[
'page_title' => 'Email Verification',
'page_subtitle' => 'Verification process failed! Please register again with a new email address.'
'page_subtitle' => 'Verification process failed! Please register again with a new email address.',
]
);
}
Expand All @@ -118,7 +118,7 @@ public function loginForm()
'Auth/login',
[
'page_title' => 'Login',
'page_subtitle' => 'Login to send post in Blog'
'page_subtitle' => 'Login to send post in Blog',
]
);
}
Expand Down
13 changes: 9 additions & 4 deletions src/Controllers/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public function index()
[
'page_title' => 'Blog',
'page_subtitle' => 'Basic PHP MVC | Blog',
'page_type' => 'article',

'posts' => $posts
'posts' => $posts,
]
);
}
Expand All @@ -53,8 +54,10 @@ public function show(string $slug)
[
'page_title' => $post['title'],
'page_subtitle' => $post['subtitle'],
'page_type' => 'article',
'page_banner' => '/assets/images/' . Helper::slug($post['title'], '-', false) . '.jpg',

'post' => $post
'post' => $post,
]
);
}
Expand All @@ -75,7 +78,8 @@ public function create()
'Blog/create',
[
'page_title' => 'Create Post',
'page_subtitle' => 'Create new post in Blog'
'page_subtitle' => 'Create new post in Blog',
'page_type' => 'article',
]
);
}
Expand Down Expand Up @@ -138,8 +142,9 @@ public function edit(string $slug)
[
'page_title' => 'Edit ' . $post['title'],
'page_subtitle' => $post['subtitle'],
'page_type' => 'article',

'post' => $post
'post' => $post,
]
);
}
Expand Down
53 changes: 53 additions & 0 deletions src/Views/Include/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,59 @@
<script>
const apiAddress = '<?= URL_ROOT; ?>';
</script>

<!-- LD JSON -->
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Corporation",
"name": "GiliApps",
"legalName" : "GiliApps",
"url": "<?= URL_ROOT; ?>",
"logo": "<?= URL_ROOT; ?>/assets/images/logo.png",
"foundingDate": "2014-01-10",
"founders": [
{
"@type": "Person",
"name": "Ismael Azaran"
} ],
"address": {
"@type": "PostalAddress",
"streetAddress": "7035 Balmoral St, Burnaby",
"addressLocality": "Vancouver",
"addressRegion": "BC",
"postalCode": "V5E 1J4",
"addressCountry": "Canada"
},
"geo": {
"@type": "GeoCoordinates",
"longitude": "-122.9587149",
"latitude": "49.22043"
},
"hasMap": "https://www.google.com/maps/place/Giliapps/@49.22043,-122.9587149,15z/data=!4m2!3m1!1s0x0:0x7c4b556928c54c6b?sa=X&ved=0ahUKEwiYxKWQ1ejVAhWQZpoKHai5AdAQ_BIIoAEwEg",
"openingHours": "Mo 09:00-18:00 Tu 09:00-18:00 We 09:00-18:00 Th 09:00-18:00 Fr 09:00-18:00 Sa Closed Su Closed",
"contactPoint": {
"@type": "PostalAddress",
"contactType": "Support",
"telephone": "[+1-778-806-1308]"
},
"sameAs": [
"https://www.instagram.com/giliapps",
"https://twitter.com/Giliapps",
"https://www.facebook.com/Giliapps",
"http://www.linkedin.com/company/giliapps",
"https://www.pinterest.com/giliapps",
"http://www.youtube.com/user/Giliapps",
"http://giliapps.tumblr.com",
"https://foursquare.com/v/giliapps/5412e16f498e0e4501f1cdb2",
"http://vimeo.com/giliapps",
"https://github.com/Giliapps",
"https://codepen.io/Giliapps",
"http://weheartit.com/giliapps"
]
}
</script>

<script src="/js/main.min.js"></script>
</body>

Expand Down
29 changes: 26 additions & 3 deletions src/Views/Include/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,42 @@
<meta name="title" content="<?= TITLE . ' ⦿ ' . $data['page_title']; ?>">
<meta name="description" content="<?= $data['page_subtitle']; ?>">
<meta name="author" content="<?= TITLE; ?>">
<meta name="copyright"
content="Copyright © <?= DATE('Y'); ?> | All rights reserved. Developed with 🖤 by <?= TITLE; ?>">
<meta name="copyright" content="Copyright © <?= DATE('Y'); ?> | All rights reserved. Developed with 🖤 by <?= TITLE; ?>">

<meta property="og:url" content="<?= URL_ROOT . $_SERVER['REQUEST_URI']; ?>">
<meta property="og:title" content="<?= TITLE . ' ⦿ ' . $data['page_title']; ?>">
<meta property="og:description" content="<?= $data['page_subtitle']; ?>">
<meta property="og:image" content="<?= URL_ROOT . ($data['page_banner'] ?? '/assets/images/banner.png'); ?>">
<meta property="og:image:url" content="<?= URL_ROOT . ($data['page_banner'] ?? '/assets/images/banner.png'); ?>">
<meta property="og:image:secure_url" content="<?= URL_ROOT . ($data['page_banner'] ?? '/assets/images/banner.png'); ?>">
<meta property="og:site_name" content="<?= TITLE; ?>">
<meta property="og:type" content="<?= $data['page_type'] ?? 'website'; ?>">
<meta property="og:locale" content="en_US">

<?php
if (isset($data['page_type']) && $data['page_type'] == 'article') {
?>
<meta property="article:published_time" content="<?= date(DATE_ATOM) ?>">
<meta property="article:tag" content="php,mvc">
<meta property="article:author" content="GiliApps">
<?php
}
?>

<meta itemprop="name" content="<?= TITLE; ?>">
<meta itemprop="headline" content="<?= TITLE . ' ⦿ ' . $data['page_title']; ?>">
<meta itemprop="description" content="<?= $data['page_subtitle']; ?>">
<meta itemprop="image" content="<?= URL_ROOT . ($data['page_banner'] ?? '/assets/images/banner.png'); ?>">
<meta itemprop="thumbnailUrl" content="<?= URL_ROOT . ($data['page_banner'] ?? '/assets/images/banner.png'); ?>">

<meta name="twitter:url" content="<?= URL_ROOT . $_SERVER['REQUEST_URI']; ?>">
<meta name="twitter:title" content="<?= TITLE . ' ⦿ ' . $data['page_title']; ?>">
<meta name="twitter:description" content="<?= $data['page_subtitle']; ?>">
<meta name="twitter:image" content="<?= URL_ROOT . ($data['page_banner'] ?? '/assets/images/banner.png'); ?>">
<meta name="twitter:image:alt" content="<?= TITLE . ' ⦿ ' . $data['page_title']; ?>">
<meta name="twitter:site" content="@giliapps">
<meta name="twitter:site:id" content="@giliapps">
<meta name="twitter:creator" content="@giliapps">
<meta name="twitter:card" content="summary_large_image">

<!-- Favicon generated by https://realfavicongenerator.net/ -->
Expand Down Expand Up @@ -96,4 +119,4 @@
<?php } ?>
</ul>
</div>
</nav>
</nav>