-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtalks.php
More file actions
108 lines (100 loc) · 3.26 KB
/
talks.php
File metadata and controls
108 lines (100 loc) · 3.26 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
99
100
101
102
103
104
105
106
107
108
<?php
/**
* Created by PhpStorm.
* User: lilis
*/
include('inc.header.php');
define('TALKDIR', 'talks/');
?>
<main class="container">
<div class="row">
<div class="col l10 m10 s12">
<div class="row">
<?php
// 가장 최근 파일 불러오기
$files = glob(TALKDIR . '*.php');
arsort($files);
$count_page = count($files);
if (!isset($_REQUEST['date'])) {
$date = basename($files[$count_page - 1], '.php');
} else {
$date = $_REQUEST['date'];
}
$temp = new DateTime($date);
$tempDate = $temp->format('Ymd');
$currentInt = array_search(TALKDIR . $tempDate . '.php', $files);
$nextURL = "talks.php?date=" . basename($files[($currentInt - 1)], '.php');
$prevURL = "talks.php?date=" . basename($files[($currentInt + 1)], '.php');
$page_first_exp = explode("/", $files[$count_page - 1]);
$page_last_exp = explode("/", $files[0]);
$page_first = basename($page_first_exp[1], ".php");
$page_last = basename($page_last_exp[1], ".php");
$page_current_exp = explode("=", $_SERVER['QUERY_STRING']);
$page_current = $page_current_exp[1];
$recent_date = basename($files[$count_page - 1], '.php');
if (empty($date)) {
null;
} else {
talkInc(TALKDIR . "$date.php");
}
// 제목 가져오기
/*$tFile = fopen(TALKDIR . "$date.php", "r");
$tFileMod = str_replace('<span class="card-title">','',fgets($tFile));
$title = str_replace('</span>','',$tFileMod);
fclose($tFile);*/
// var_dump($title);
?>
</div>
<div class="row">
<?php
echo "<ul class=\"pagination center-align\">\r\n";
if (empty($date)) {
null;
} elseif ($count_page == 1) {
null;
} else {
if ($currentInt == ($count_page - 1)) {
echo "<li class=\"waves-effect\"><a href=\"$nextURL\"><i class=\"material-icons\">chevron_right</i></a></li>";
} elseif ($currentInt == 0) {
echo "<li class=\"waves-effect\"><a href=\"$prevURL\"><i class=\"material-icons\">chevron_left</i></a></li>";
} else {
print "<li class=\"waves-effect\"><a href=\"$prevURL\"><i class=\"material-icons\">chevron_left</i></a></li>";
print " ";
print "<li class=\"waves-effect\"><a href=\"$nextURL\"><i class=\"material-icons\">chevron_right</i></a></li>";
}
}
echo "</ul>\r\n";
?>
</div>
<div class="row">
<div class="s12 center-align">
<a class="btn-floating btn grey modal-trigger" href="#Admin">
<i class="material-icons">lock</i> </a>
</div>
</div>
</div>
<div class="col l2 m2 s12">
<div class="row">
<p class="grey-text">
<small>Total: <?php echo $count_page; ?></small>
</p>
<ul id="talksList">
<?php
for ($i = ($count_page - 1); $i >= 0; $i--) {
$exp = explode("/", $files[$i]);
$fileName = basename($exp[1], '.php');
echo "<li><small><a href=\"talks.php?date=" . $fileName . "\">" . date('Y/m/d', strtotime($fileName)) . "</a></small></li>\r\n";
}
?>
</ul>
</div>
</div>
</div>
<?php loginForm('talks_create'); ?>
</main>
<script>
$(document).ready(function () {
$('.modal-trigger').leanModal();
});
</script>
<?php include('inc.footer.php'); ?>