-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.php
91 lines (81 loc) · 2.65 KB
/
init.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/*
| fur.zerendo - A small configurable blogger template.
| @file ./init.php
| @author SamBrishes <[email protected]>
| @version 1.0.0
|
| @website https://github.com/pytesNET/fur.zerendo
| @license X11 / MIT License
| @copyright Copyright © 2018 - 2019 SamBrishes, pytesNET <[email protected]>
*/
if(!defined("BLUDIT")){ die("Go directly to Jail. Do not pass Go. Do not collect 200 Cookies!"); }
##
## DEFINE BASICS
##
define("FUR_ZERENDO", "fur.zerendo");
define("FUR_ZERENDO_VERSION", "1.0.0");
##
## LOAD PAW.DESIGNER STUFF
##
if(!function_exists("pd_load_theme")){
require_once("system/paw-designer.func.php");
}
pd_load_theme();
##
## THEME FUNCTIONS
##
/*
| ZERENDO WHEREAMI
| @since 0.1.0
*/
function zerendo_whereAmI(){
global $page;
if(pd_is_home(true)){
return "Homepage";
} else if(pd_is_404()){
return "Error 404";
} else if(pd_is_search()){
return "Search";
} else if(pd_is_category()){
return "Category Archive";
} else if(pd_is_tag()){
return "Tag Archive";
} else if(pd_is_page() && !pd_is_static()){
return "Post »" . $page->title() . "«";
}
return "Page »" . $page->title() . "«";
}
/*
| BLOG POST WITHIN LOOPS
| @since 0.1.0
*/
function zerendo_post($post){
if(!is_a($post, "Page")){
return false;
}
$id = preg_replace("#[^a-z0-9_-]#", "-", $post->key());
$thumb = $post->coverImage();
?>
<div class="<?php echo pd_page_classes($post, "", "post"); ?>">
<div class="post-thumbnail">
<a href="<?php echo $post->permalink(); ?>">
<?php if($thumb){ ?>
<img src="<?php echo $post->coverImage(); ?>" />
<?php } else { ?>
<span class="thumbnail-empty"></span>
<?php } ?>
</a>
</div>
<div class="post-content">
<a href="<?php echo $post->permalink(); ?>" class="post-title"><?php echo $post->title(); ?></a>
<div class="post-excerpt">
<?php echo pd_page_excerpt($post, 175); ?>
</div>
<div class="post-meta">
<a href="<?php echo $post->permalink(); ?>" class="post-readmore">Readmore</a>
</div>
</div>
</div>
<?php
}