-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.php
33 lines (29 loc) · 801 Bytes
/
functions.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
<?php
/**
* Reusable functions for the project
* @author RN Kushwaha <Rn.kushwaha022@gmail.com>
* @since v1 Date: 3rd Sept, 2018
*/
if( !defined('_ACCESS_OK') ){
header("HTTP/1.0 404 Not Found");
die('Page not found!');
}
// update this path to load the image correctly for edit purpose
if( !defined('SERVER_IMG_PATH') ){
define('SERVER_IMG_PATH', 'http://localhost/');
}
//load css, js and images with last modified time appended to the url
//so that static resources will not be served from cache
if(!function_exists('loadStaticResource')){
function loadStaticResource($file, $version=true){
if(file_exists($file)){
if($version===true ) {
echo $file.'?v='.filemtime($file);
} else{
echo $file;
}
} else{
echo $file;
}
}
}