-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinc.functions.php
More file actions
98 lines (89 loc) · 2.04 KB
/
inc.functions.php
File metadata and controls
98 lines (89 loc) · 2.04 KB
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
<?php
/**
* Created by PhpStorm.
* User: lilis
* Date: 2016. 8. 9.
* Time: 오후 10:14
*/
function copyright()
{
$currentYear = date("Y");
print "2001–$currentYear";
}
function age()
{
$currentYear = date("Y");
print $currentYear - 1982 + 1;
}
function talkInc($path)
{
echo <<<HTML
<div class="col s12 m12 l12">
<div class="card white hoverable">
<div class="card-content">
<!--<div class="fb-like" data-share="true" data-width="450" data-show-faces="true"> </div>-->
HTML;
include("$path");
echo "<hr />";
include("inc.disqus.comment.php");
echo <<<HTML
</div>
</div>
</div>
HTML;
}
function loginForm($target)
{
print <<< HTML
<div id="Admin" class="modal">
<div class="modal-content">
<form method="POST" action="$target.php">
<div class="row">
<div class="col s12 input-field">
<input name="ID" id="ID" type="text" class="valid" autofocus/> <label for="ID">ID</label>
</div>
</div>
<div class="row">
<div class="col s12 input-field">
<input name="PW" id="PW" type="password" class="valid"/> <label for="PW">Password</label>
</div>
</div>
<div class="row">
<div class="center-align">
<button type="submit" name="login" id="login" class="btn waves-effect waves-light">Login
</button>
</div>
</div>
</form>
</div>
</div>
HTML;
}
function login($target)
{
if (isset($_POST['login']) && !empty($_POST['ID']) && !empty($_POST['PW'])) {
if ($_POST['ID'] != 'lilis' || $_POST['PW'] != 'genius') {
header("location:./");
} elseif ($_POST['ID'] == 'lilis' && $_POST['PW'] == 'genius') {
header("location:$target.php");
}
}
}
function videoGrid($array)
{
$array = array_reverse($array);
foreach ($array as $code => $title) {
print <<<HTML
<div class="col s12 m6 l4">
<div class="card hoverable">
<div class="video-container">
<iframe src="http://www.youtube.com/embed/$code" frameborder="0" allowfullscreen></iframe>
</div>
<div class="valign-wrapper">
<p class="valign" style="margin-left: 0.5em;">$title</p>
</div>
</div>
</div>
HTML;
}
}