Browse Source

Include functions.php

If there is functions.php inside themes root, include it.
pull/674/head
danpros 1 year ago
parent
commit
5adfd66d50
4 changed files with 11 additions and 6 deletions
  1. +3
    -3
      README.md
  2. +1
    -1
      config/users/username.ini.example
  3. +5
    -0
      system/includes/dispatch.php
  4. +2
    -2
      themes/blog/static.html.php

+ 3
- 3
README.md View File

@ -19,7 +19,7 @@ Install HTMLy using the source code:
4. Follow the installer to install HTMLy.
5. The installer will try to delete itself. Please delete the installer manually if the `install.php` still exist.
**Note:** If you don't need to log in to the dashboard right away, just rename `config.ini.example` to `config.ini`, delete `install.php`, and your are set. It's always good practice to set the `site.url`
**Note:** If you don't need to log in to the dashboard, just rename `config.ini.example` to `config.ini`, delete `install.php`, and you are set. It's always good practice to set the `site.url`
### Online install
@ -50,14 +50,14 @@ If you use the dashboard to write your posts, the folder structure and filenames
The following is an example of a folder and file structure from HTMLy:
```html
content/my-username/blog/my-category/post/2024-01-10-25-35-45_tag1,tag2_my-post-slug.md
content/my-username/blog/my-category/post/2024-01-10-15-35-45_tag1,tag2_my-post-slug.md
```
Here's the explanation:
* `my-username` is the username.
* `my-category` is the content category.
* `post` is the content type. Available content type `post`, `video`, `audio`, `link`, `quote`.
* `2024-01-10-25-35-45` is the published date. The date format is `Y-m-d-H-i-s`
* `2024-01-10-15-35-45` is the published date. The date format is `Y-m-d-H-i-s`
* `tag1,tag2` are the tags, separated by commas
* `my-post-slug` is the URL


+ 1
- 1
config/users/username.ini.example View File

@ -1,7 +1,7 @@
;Password
password = yourpassword
; Encryption. Set to clear, and later it will changed to password_hash automatically during login
;Encryption. Set to clear, and later it will changed to password_hash automatically during login
encryption = clear
;Role


+ 5
- 0
system/includes/dispatch.php View File

@ -380,8 +380,13 @@ function render($view, $locals = null, $layout = null)
if (($view_root = config('views.root')) == null)
error(500, "[views.root] is not set");
$fnc = "{$view_root}/functions.php";
ob_start();
if (file_exists($fnc)) {
include $fnc;
}
include "{$view_root}/{$view}.html.php";
content(trim(ob_get_clean()));


+ 2
- 2
themes/blog/static.html.php View File

@ -14,10 +14,10 @@
<div style="margin-top:30px;position:relative;">
<hr>
<?php if (!empty($next)): ?>
<span class="newer"><a href="<?php echo($next['url']); ?>" rel="next"><i class="fa fa-long-arrow-left"></i> <?php echo $p->title;?></a></span>
<span class="newer"><a href="<?php echo($next['url']); ?>" rel="next"><i class="fa fa-long-arrow-left"></i> <?php echo($next['title']); ?></a></span>
<?php endif; ?>
<?php if (!empty($prev)): ?>
<span class="older pull-right"><a href="<?php echo($prev['url']); ?>" rel="prev"><?php echo $p->title;?> <i class="fa fa-long-arrow-right"></i></a></span>
<span class="older pull-right"><a href="<?php echo($prev['url']); ?>" rel="prev"><?php echo($prev['title']); ?> <i class="fa fa-long-arrow-right"></i></a></span>
<?php endif; ?>
<div style="clear:both;"></div>
</div>


Loading…
Cancel
Save