<?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;
?>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7530 | 10년 전 | 818 | ||
| 7529 |
파랑새1597
|
10년 전 | 1243 | |
| 7528 |
파랑새1597
|
10년 전 | 1333 | |
| 7527 |
integrity7
|
10년 전 | 1414 | |
| 7526 | 10년 전 | 2442 | ||
| 7525 |
다빈치코드777
|
10년 전 | 1120 | |
| 7524 | 10년 전 | 1590 | ||
| 7523 | 10년 전 | 980 | ||
| 7522 |
|
10년 전 | 1008 | |
| 7521 |
blackkil
|
10년 전 | 1896 | |
| 7520 | 10년 전 | 1313 | ||
| 7519 |
Gaumi
|
10년 전 | 1093 | |
| 7518 | 10년 전 | 1504 | ||
| 7517 | 10년 전 | 843 | ||
| 7516 | 10년 전 | 1311 | ||
| 7515 | 10년 전 | 1429 | ||
| 7514 |
|
10년 전 | 4500 | |
| 7513 |
멋진남자임
|
10년 전 | 1140 | |
| 7512 |
다빈치코드777
|
10년 전 | 891 | |
| 7511 |
|
10년 전 | 3417 | |
| 7510 | 10년 전 | 1382 | ||
| 7509 | 10년 전 | 1162 | ||
| 7508 | 10년 전 | 726 | ||
| 7507 |
senseme
|
10년 전 | 768 | |
| 7506 |
멋진남자임
|
10년 전 | 1663 | |
| 7505 | 10년 전 | 4042 | ||
| 7504 | 10년 전 | 2171 | ||
| 7503 | 10년 전 | 1009 | ||
| 7502 | 10년 전 | 533 | ||
| 7501 | 10년 전 | 1462 | ||
| 7500 | 10년 전 | 1508 | ||
| 7499 | 10년 전 | 3412 | ||
| 7498 | 10년 전 | 1248 | ||
| 7497 |
dethos79
|
10년 전 | 2979 | |
| 7496 | 10년 전 | 2189 | ||
| 7495 | 10년 전 | 915 | ||
| 7494 |
CHAVO
|
10년 전 | 1156 | |
| 7493 | 10년 전 | 2668 | ||
| 7492 | 10년 전 | 1301 | ||
| 7491 | 10년 전 | 1509 | ||
| 7490 | 10년 전 | 2364 | ||
| 7489 | 10년 전 | 2133 | ||
| 7488 |
toptopon
|
10년 전 | 915 | |
| 7487 |
|
10년 전 | 1060 | |
| 7486 | 10년 전 | 3376 | ||
| 7485 | 10년 전 | 1331 | ||
| 7484 | 10년 전 | 1386 | ||
| 7483 | 10년 전 | 1044 | ||
| 7482 | 10년 전 | 677 | ||
| 7481 | 10년 전 | 868 | ||
| 7480 | 10년 전 | 1249 | ||
| 7479 | 10년 전 | 2622 | ||
| 7478 | 10년 전 | 1185 | ||
| 7477 |
멋진남자임
|
10년 전 | 1534 | |
| 7476 |
zeppeto
|
10년 전 | 1151 | |
| 7475 |
200점아빠
|
10년 전 | 932 | |
| 7474 | 10년 전 | 4020 | ||
| 7473 | 10년 전 | 1008 | ||
| 7472 |
나르시스1
|
10년 전 | 1257 | |
| 7471 | 10년 전 | 889 | ||
| 7470 | 10년 전 | 1307 | ||
| 7469 |
플라이SINJI
|
10년 전 | 1015 | |
| 7468 |
|
10년 전 | 576 | |
| 7467 |
|
10년 전 | 691 | |
| 7466 | 10년 전 | 1149 | ||
| 7465 | 10년 전 | 1202 | ||
| 7464 |
|
10년 전 | 1214 | |
| 7463 | 10년 전 | 1277 | ||
| 7462 |
진짜별사탕
|
10년 전 | 881 | |
| 7461 | 10년 전 | 968 | ||
| 7460 | 10년 전 | 3761 | ||
| 7459 |
멋진남자임
|
10년 전 | 1577 | |
| 7458 |
멋진남자임
|
10년 전 | 504 | |
| 7457 | 10년 전 | 934 | ||
| 7456 | 10년 전 | 783 | ||
| 7455 | 10년 전 | 2192 | ||
| 7454 | 10년 전 | 645 | ||
| 7453 | 10년 전 | 853 | ||
| 7452 |
중국어사이트제작
|
10년 전 | 516 | |
| 7451 | 10년 전 | 924 | ||
| 7450 | 10년 전 | 648 | ||
| 7449 |
울라라라우
|
10년 전 | 967 | |
| 7448 | 10년 전 | 1642 | ||
| 7447 |
멋진남자임
|
10년 전 | 525 | |
| 7446 | 10년 전 | 568 | ||
| 7445 |
네이비칼라
|
10년 전 | 1705 | |
| 7444 |
senseme
|
10년 전 | 1424 | |
| 7443 | 11년 전 | 1353 | ||
| 7442 | 11년 전 | 744 | ||
| 7441 |
멋진남자임
|
11년 전 | 1457 | |
| 7440 | 11년 전 | 930 | ||
| 7439 |
|
11년 전 | 786 | |
| 7438 |
|
11년 전 | 955 | |
| 7437 |
basement
|
11년 전 | 1050 | |
| 7436 |
잘살아보자
|
11년 전 | 1147 | |
| 7435 | 11년 전 | 1105 | ||
| 7434 | 11년 전 | 3801 | ||
| 7433 |
|
11년 전 | 2767 | |
| 7432 |
alexkim
|
11년 전 | 876 | |
| 7431 |
이웃집초보
|
11년 전 | 1326 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기