This repository has been archived by the owner on May 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
61 lines (53 loc) · 1.82 KB
/
index.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
<?php
// Asaph v1.0 - www.phoboslab.org
define( 'ASAPH_PATH', '' );
require_once( ASAPH_PATH.'lib/asaph.class.php' );
header( 'Content-type: text/html; charset=utf-8' );
// Is mod_rewrite enabled? (see .htaccess)
if( isset($_GET['rw']) ) {
define( 'ASAPH_LINK_PREFIX', Asaph_Config::$absolutePath );
$params = explode( '/', $_GET['rw'] );
} else {
define( 'ASAPH_LINK_PREFIX', Asaph_Config::$absolutePath.'?' );
$params = empty($_GET) ? array() : explode( '/', key($_GET) );
}
// about page
if( !empty($params[0]) && $params[0] == 'about' ) {
include( ASAPH_PATH.Asaph_Config::$templates['about'] );
}
// feed
else if( !empty($params[0]) && $params[0] == 'feed' ) {
$asaph = new Asaph( Asaph_Config::$postsPerPage );
$posts = $asaph->getPosts( 0 );
include( ASAPH_PATH.Asaph_Config::$templates['feed'] );
}
// tagcloud
else if( !empty($params[0]) && $params[0] == 'tagcloud' ) {
$asaph = new Asaph(Asaph_Config::$postsPerPage);
$posts = $asaph->getTagCloud( );
include( ASAPH_PATH.Asaph_Config::$templates['tagcloud'] );
}
// blog tag
else if( !empty($params[0]) && $params[0] == 'tag' ) {
$page = !empty($params[2]) ? $params[2]-1 : 0;
$asaph = new Asaph( Asaph_Config::$postsPerPage );
$posts = $asaph->getPosts( $page, $params[1] );
$pages = $asaph->getPages();
include( ASAPH_PATH.Asaph_Config::$templates['posts'] );
}
// blog single
else if(( !empty($params[0]) && $params[0] == 'post' )&&
( !empty($params[1]) && is_numeric($params[1]))) {
$asaph = new Asaph( 0 );
$post = $asaph->getSinglePost( $params[1] );
include( ASAPH_PATH.Asaph_Config::$templates['single'] );
}
// blog normal
else {
$page = !empty($params[1]) ? $params[1]-1 : 0;
$asaph = new Asaph( Asaph_Config::$postsPerPage );
$posts = $asaph->getPosts( $page );
$pages = $asaph->getPages();
include( ASAPH_PATH.Asaph_Config::$templates['posts'] );
}
?>