-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfetch_kmla_announcements.php
75 lines (68 loc) · 1.9 KB
/
fetch_kmla_announcements.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
header("Content-Type: text/html; charset=utf-8");
$f = file_get_contents("http://www.minjok.hs.kr/app/kumla_notice/kumla_all.html");
if (preg_match_all('/<li>\[([^\]]+):([^\]]+)\](.*?)<br>/sim', $f, $m, PREG_SET_ORDER)) {
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.ticker.js" charset="utf-8"></script>
<link rel="stylesheet" href="/theme/dev/theme.css" />
<style type="text/css">
* {
overflow: hidden;
}
#ticker {
width: 100%;
height: 76px;
box-sizing: border-box;
}
#ticker ul,
#ticker ul li {
width: 100%;
box-sizing: border-box;
}
li {
font-size: 10pt;
height: <?php echo ((isset($_GET['lines']) && is_numeric($_GET['lines'])) ? $_GET['lines'] : 1) * 10 + 7 ?>pt;
}
</style>
</head>
<body>
<div id="ticker">
<ul id="js-news" class="js-hidden">
<?php
foreach ($m as $each) {
$type = trim($each[1]);
$date = trim($each[2]);
$msg = trim(strip_tags($each[3]));
?>
<li class="news-item"><span style="font-size:8pt;color:orange;font-weight:bold;">></span>
<a href="http://www.minjok.hs.kr/members/" target="_new" style="color:black">
<?php echo "<b>[$date] $type</b>: $msg" ?>
</a>
</li>
<?php } ?>
</ul>
</div>
<script type="text/javascript">
$(function() {
$('#ticker').Vnewsticker({
speed: 500,
pause: 3000,
mousePause: true,
showItems: 3,
direction: "up"
});
});
</script>
</body>
</html>
<?php
} else {
$f = str_replace("<head>", "<head><meta charset=\"utf-8\" /><base href=\"http://www.minjok.hs.kr/app/kumla_notice/\" /><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />", $f);
echo $f;
}