<?php
//캐쉬기능추가
//1. 이파일과 동일한 경로에 cashe 라는 디렉토리를 생성한다.
//2. 퍼미션은 777로 준다.
$cashe_time = '10';//분단위, 숫자만
$cashe_dir = 'cashe';// /를 뺀 순수한 디렉토리명만
$cashe_file = preg_replace("`^(.*)(/[^/]+)$`", "\\1/" . $cashe_dir . "\\2", __FILE__);
if (!is_dir("./" . $cashe_dir)) {
echo "캐쉬 디렉토리가 존재하지 않습니다.";
exit;
}
//캐쉬 파일이 존재하고, 수정된 시간이 지정된 시간을 넘지 않았을 경우 인클루드 후 종료
if (is_file($cashe_file) && (filemtime ($cashe_file) + ($cashe_time * 60) > time())){
include $cashe_file;
exit;
}
ob_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rss 읽어오기</title>
<style>
body {margin:0px 10px 3px 10px;padding:0}
body,td,select {font-family:Verdana,Gulim;font-size:9pt;}
td {overflow:hidden;text-overflow:ellipsis;}
td.description p {margin:0;padding:3 0 3 0;}
a.lnk1:link,a.lnk1:visited,a.lnk1:hover {color:#0000ff;text-decoration:underline;}
a.lnk2:link,a.lnk2:visited {color:#808080;text-decoration:none;}
a.lnk2:hover {text-decoration:underline;}
a.lnk3:link {color:#0000ff;text-decoration:none;}
a.lnk3:visited {color:#800080;text-decoration:none;}
a.lnk3:hover {text-decoration:underline;}
a.lnk4:link,a.lnk4:visited {color:#D2691E;text-decoration:none;}
a.lnk4:hover {text-decoration:underline;}
a.lnk5:link,a.lnk5:visited {color:#0000ff;text-decoration:none;}
a.lnk5:hover {background-color:#eeeeee;}
.header1 {font-weight:bold;font-size:12pt;}
.btn_submit1 {border:1px solid gray;width:40;height:20;background-color:white;font-family:Gulim;font-size:9pt;padding:2 0 0 0}
.btn_submit2 {border:1px solid #c0c0c0;width:34;height:18;background-color:white;font-family:Gulim;font-size:8pt;line-height:12pt}
</style>
<base target=_blank>
</head>
<body bgcolor='#ffffff'>
<?php
//올블로그 명예의전당 rss 글내용이 하루에 한번만 바뀝니다.
$url = "http://www.allblog.net/Rss/BestPosts.xml";
$result = file($url);
$text = implode("\n", $result);
if(!empty($text)){
$item = explode("<item>", $text);
$count = count($item);
echo "
<table width=100% border=0 cellpadding=0 cellspacing=0 style=\"table-layout:fixed;\">
<tr><td>
<table width=100% border=0 cellpadding=0 cellspacing=0 style=\"table-layout:fixed;\">
<tr>
<td align=right valign=top style=\"padding:0 4 0 0;font-size:8pt;color:gray\" nowrap>총 <b>" . ($count - 1) . "</b>개 | 최종업데이트: " . date("Y-m-d H:i") . "</td>
</tr>
</table>
</td></tr>
<tr><td height=4></td></tr>
</table>
";
if (is_array($item) && count($item) > 1) {
for ($i = 1; $i < $count; $i++){
preg_match_all("`<title>(.+)</title><link>(.+)</link><source url=\".+\">(.+)</source><category>([^<]+)</category>(<category>([^<]+)</category>)?(<category />)?<pubDate>(.+)</pubDate><description><!\[CDATA\[(.+)\]\]></description>`s", $item[$i], $matches);
if (is_array($matches[1]) && count($matches[1]) > 0) {
foreach($matches[1] as $key => $val){
$title = (!empty($val)) ? $val : '';
$link = (!empty($matches[2][$key])) ? $matches[2][$key] : '';
$source = (!empty($matches[3][$key])) ? $matches[3][$key] : '';
$category1 = (!empty($matches[4][$key])) ? $matches[4][$key] : '';
$category2 = (!empty($matches[6][$key])) ? $matches[6][$key] : '';
$category = (!empty($category1) && !empty($category2)) ? $category1 . ", " . $category2 : $category1 . $category2;
$pubDate = (!empty($matches[8][$key])) ? date("Y-m-d H:i", strtotime($matches[8][$key])) : '';
$description = (!empty($matches[9][$key])) ? $matches[9][$key] : '';
$description_len = number_format(strlen($description));
if (!preg_match("`(<\s*\t*img\s*\t*|<\s*\t*a\s*\t*href)`i", $description)) $description = strip_tags(str_replace(array("<", ">", "<br /><hr />위 내용은 올블로그가 올블로그에 등록한 블로그로부터 수집하여 서버에 저장하고 있는 내용의 전체 또는 일부 입니다. 이 게시물에 대한 모든 저작권과 책임은 해당 블로그의 등록자에게 있습니다."), array("<", ">", ""), $description)) . "<br /><hr />위 내용은 올블로그가 올블로그에 등록한 블로그로부터 수집하여 서버에 저장하고 있는 내용의 전체 또는 일부 입니다. 이 게시물에 대한 모든 저작권과 책임은 해당 블로그의 등록자에게 있습니다.";
echo "
<a href=\"" . $link . "\"></a>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td bgcolor=#bdb76b><img width=1 height=1 alt=\"\"></td></tr>
<tr><td bgcolor=#ebebd5 style='padding:5 2 6 2'>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style=\"font-size:10pt\"><a href=\"" . $link . "\"><span style=\"font-weight:bold\">" . $title . "</span></a></td></tr>
</table>
</td></tr>
<tr><td style='padding:4 2 0 2'>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style='font-size:8pt;'> <font color=#808080>" . $pubDate . " 작성 <font color=#808080>| " . $category . "</font> <font color=#808080>| " . $description_len . "byte</font></font></td><td align=right style=\"font-family:Gulim;font-size:8pt;\" nowrap> </td></tr>
</table>
</td></tr>
</table>
<table id=\"desc_9612007\" width=100% border=0 cellpadding=0 cellspacing=0>
<tr><td style='padding:6 2 0 2;line-height:14pt;' class=description>" . $description . "</td></tr>
<tr><td height=10></td></tr>
</table>
<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td height=12></td></tr></table>
";
}
}
}
}
}
?>
</body>
</html>
<?php
$save_text = ob_get_contents();
ob_end_clean();
//캐쉬파일로 저장
$fp = @fopen($cashe_file, 'w');
if (empty($fp)) {
echo "캐쉬 디렉토리의 퍼미션을 확인하세요";
exit;
}
@fwrite($fp, $save_text);
@fclose($fp);
@chmod($cashe_file, 0777);
//출력
echo $save_text;
?>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7430 |
|
11년 전 | 4928 | |
| 7429 | 11년 전 | 1752 | ||
| 7428 |
멋진남자임
|
11년 전 | 1143 | |
| 7427 |
sdflksdj2
|
11년 전 | 794 | |
| 7426 | 11년 전 | 1340 | ||
| 7425 | 11년 전 | 1365 | ||
| 7424 | 11년 전 | 1032 | ||
| 7423 |
SeungYeon
|
11년 전 | 544 | |
| 7422 | 11년 전 | 787 | ||
| 7421 |
sdflksdj2
|
11년 전 | 662 | |
| 7420 | 11년 전 | 951 | ||
| 7419 |
|
11년 전 | 1376 | |
| 7418 |
멋진남자임
|
11년 전 | 1383 | |
| 7417 | 11년 전 | 584 | ||
| 7416 |
senseme
|
11년 전 | 1199 | |
| 7415 | 11년 전 | 942 | ||
| 7414 | 11년 전 | 695 | ||
| 7413 | 11년 전 | 4827 | ||
| 7412 | 11년 전 | 4393 | ||
| 7411 |
holla
|
11년 전 | 872 | |
| 7410 | 11년 전 | 4230 | ||
| 7409 | 11년 전 | 3915 | ||
| 7408 | 11년 전 | 4258 | ||
| 7407 | 11년 전 | 5045 | ||
| 7406 | 11년 전 | 4710 | ||
| 7405 | 11년 전 | 4274 | ||
| 7404 | 11년 전 | 735 | ||
| 7403 | 11년 전 | 5656 | ||
| 7402 | 11년 전 | 1486 | ||
| 7401 |
|
11년 전 | 953 | |
| 7400 | 11년 전 | 2958 | ||
| 7399 |
멋진남자임
|
11년 전 | 890 | |
| 7398 |
파랑새1597
|
11년 전 | 2647 | |
| 7397 | 11년 전 | 2245 | ||
| 7396 |
basketball
|
11년 전 | 1337 | |
| 7395 | 11년 전 | 1586 | ||
| 7394 | 11년 전 | 910 | ||
| 7393 | 11년 전 | 2047 | ||
| 7392 | 11년 전 | 826 | ||
| 7391 |
잘살아보자
|
11년 전 | 5343 | |
| 7390 |
잘살아보자
|
11년 전 | 2206 | |
| 7389 |
잘살아보자
|
11년 전 | 3305 | |
| 7388 |
파랑새1597
|
11년 전 | 911 | |
| 7387 | 11년 전 | 1084 | ||
| 7386 |
프리랜서퍼블리셔
|
11년 전 | 956 | |
| 7385 | 11년 전 | 1557 | ||
| 7384 |
울라라라우
|
11년 전 | 876 | |
| 7383 | 11년 전 | 1532 | ||
| 7382 |
잘살아보자
|
11년 전 | 4209 | |
| 7381 |
잘살아보자
|
11년 전 | 1972 | |
| 7380 |
잘살아보자
|
11년 전 | 1922 | |
| 7379 |
잘살아보자
|
11년 전 | 5884 | |
| 7378 |
senseme
|
11년 전 | 1869 | |
| 7377 |
잘살아보자
|
11년 전 | 2715 | |
| 7376 | 11년 전 | 2385 | ||
| 7375 |
잘살아보자
|
11년 전 | 1029 | |
| 7374 |
잘살아보자
|
11년 전 | 3135 | |
| 7373 |
잘살아보자
|
11년 전 | 2462 | |
| 7372 |
잘살아보자
|
11년 전 | 5822 | |
| 7371 |
잘살아보자
|
11년 전 | 3450 | |
| 7370 |
잘살아보자
|
11년 전 | 1896 | |
| 7369 |
잘살아보자
|
11년 전 | 2151 | |
| 7368 |
ksdhtm56
|
11년 전 | 535 | |
| 7367 | 11년 전 | 1407 | ||
| 7366 | 11년 전 | 912 | ||
| 7365 | 11년 전 | 3520 | ||
| 7364 |
잘살아보자
|
11년 전 | 1370 | |
| 7363 |
잘살아보자
|
11년 전 | 1342 | |
| 7362 |
잘살아보자
|
11년 전 | 1478 | |
| 7361 | 11년 전 | 3584 | ||
| 7360 | 11년 전 | 3537 | ||
| 7359 | 11년 전 | 3362 | ||
| 7358 |
멋진남자임
|
11년 전 | 1006 | |
| 7357 | 11년 전 | 3387 | ||
| 7356 | 11년 전 | 2589 | ||
| 7355 | 11년 전 | 3161 | ||
| 7354 |
파랑새1597
|
11년 전 | 627 | |
| 7353 |
잘살아보자
|
11년 전 | 2407 | |
| 7352 |
잘살아보자
|
11년 전 | 2394 | |
| 7351 |
잘살아보자
|
11년 전 | 2466 | |
| 7350 |
잘살아보자
|
11년 전 | 1448 | |
| 7349 |
잘살아보자
|
11년 전 | 1938 | |
| 7348 |
잘살아보자
|
11년 전 | 1264 | |
| 7347 |
잘살아보자
|
11년 전 | 1067 | |
| 7346 |
멋진남자임
|
11년 전 | 1634 | |
| 7345 | 11년 전 | 967 | ||
| 7344 | 11년 전 | 3847 | ||
| 7343 | 11년 전 | 3618 | ||
| 7342 | 11년 전 | 1243 | ||
| 7341 | 11년 전 | 2498 | ||
| 7340 |
|
11년 전 | 914 | |
| 7339 | 11년 전 | 1720 | ||
| 7338 | 11년 전 | 3330 | ||
| 7337 | 11년 전 | 3623 | ||
| 7336 | 11년 전 | 4554 | ||
| 7335 | 11년 전 | 951 | ||
| 7334 | 11년 전 | 1511 | ||
| 7333 | 11년 전 | 2914 | ||
| 7332 |
|
11년 전 | 1089 | |
| 7331 |
KeePin뽁이
|
11년 전 | 1082 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기