forked from laukstein/ajax-seo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhumans.txt
110 lines (88 loc) · 3.18 KB
/
humans.txt
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
// Configuration
// --------------------------------------------------
include 'content/config.php';
header('Content-Type: text/plain');
// HTTP header caching
// --------------------------------------------------
class datemod
{
public $gmtime;
public $moddate;
function date($dir = null, $exclude = array('error_log.txt', '.git', 'cgi-bin', '.', '..'))
{
$d = isset($dir) ? $dir : '.';
$exclude = array_flip($exclude);
if (!is_dir($d)) {
return;
}
$dh = opendir($d);
if (!$dh) {
return;
}
$stack = array(
$dh
);
$level = 0;
while (count($stack)) {
if (false !== ($file = readdir($stack[0]))) {
if (!isset($exclude[$file])) {
//print str_repeat(' ',$level);
$df = "$d/$file";
if (is_dir($df)) {
$dh = opendir($df);
if ($dh) {
$f = $file;
array_unshift($stack, $dh);
++$level;
}
} else {
$d = (isset($dir) ? $dir . '/' : null);
if (isset($f) && $level > 0) {
$mod = date('Y-m-d H:i:s', filemtime("$d$f/$file"));
} else {
$mod = date('Y-m-d H:i:s', filemtime("$d$file"));
}
$array[] = $mod;
}
}
} else {
closedir(array_shift($stack));
--$level;
}
}
//sort($array);
//print_r($array);
$fmod = date('D, d M Y H:i:s T', strtotime(max($array)));
// Connect to MySQL
// --------------------------------------------------
include 'content/connect.php';
$tablemod = mysql_query("SELECT DATE_FORMAT(MAX(pubdate), '%a, %d %b %Y %T') AS pubdate FROM `" . MYSQL_TABLE . "`");
while ($row = @mysql_fetch_array($tablemod, MYSQL_ASSOC)) {
$rowmod = $row['pubdate'] . date(' T');
$this -> gmtime = date('Y-m-d H:i:s', strtotime($fmod)) >= date('Y-m-d H:i:s', strtotime($rowmod)) ? $fmod : $rowmod;
$this -> moddate = date('Y/m/d', strtotime($this -> gmtime));
}
}
function cache(&$gmtime)
{
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
if ($_SERVER['HTTP_IF_MODIFIED_SINCE'] == $gmtime) {
http_response_code(304);
exit;
}
}
header("Last-Modified: $gmtime");
}
}
$datemod = new datemod();
$datemod -> date();
$datemod -> cache($datemod -> gmtime);
echo "/* SITE */
Author: Binyamin Laukstein
Contact: http://laukstein.com/contact
Last update: {$datemod->moddate}
Standards: HTML5, CSS3, Microdata, JSON
Components: jQuery, PHP, MySQL
Source: https://github.com/laukstein/ajax-seo";
?>