웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
홈페이지에 실시간뉴스 보여주기
2001.06.05 13:33
미리보기 : http://looster.xdns.co.kr
매일경제신문의 뉴스를 인용하고 있습니다.
비상업적인 용도에 한해서 법적인 제재를 가하지 않는다고 합니다. 유념하세욥.
이것도 팁의 일종일까요? 게시판 관리자께서 알아서 샤샥해주세요.
전 팁이라고 생각하고 올리는겁니다. 자작프로그램하고 교차해서 올렸는데... 알아서
요리해주세요.
news.php의 내용입니다.
<?
$fp=@fopen("http://channel.mk.co.kr/main.html","r");
while(!feof($fp)) {
$fl = fgets($fp,4096);
if(ereg("<p style=margin-top:8px><marquee ID=NewsFlash direction=up scrollamount=1 scrolldelay=160 height=45 width=343>",$fl)) {
$fl = fgets($fp, 4096); //1
$fl = $fl.fgets($fp, 4096); //2
$fl = $fl.fgets($fp, 4096); //3
$fl = $fl.fgets($fp, 4096); //4
$fl = $fl.fgets($fp, 4096); //5
$fl = $fl.fgets($fp, 4096); //6
$fl = $fl.fgets($fp, 4096); //7
$fl = $fl.fgets($fp, 4096); //8
$fl = $fl.fgets($fp, 4096); //9
$fl = $fl.fgets($fp, 4096); //10
$fl = $fl.fgets($fp, 4096); //11
$fl = $fl.fgets($fp, 4096); //12
$fl = ereg_replace("onmouseover","target=_blank onmouseover", $fl);
$where = strpos($fl,"</marquee>");
if ($where < 1) { $where = strlen(fl);}
$fl = substr($fl, 0, $where);
break;
}
}
?>
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<meta http-equiv="Pragma" content="no-cache">
<style type="text/css">
<!--
.8 {font-size:8pt;font-family:굴림,Helvetica}
.9 {font-size:9pt;font-family:굴림,Helvetica}
.9h {font-size: 9pt;font-family:굴림,Helvetica;line-height:16px}
.9h2 {font-size: 9pt;font-family:굴림,Helvetica;line-height:15px}
.10 {font-size:10pt;font-family:굴림,arial,Helvetica;line-height:120%}
.11 {font-size:11pt;font-family:굴림,Helvetica}
.14 {font-size:15pt;font-family:굴림,Helvetica;text-decoration:underline}
.box_focus {color:black; background-color: #E4E4E4; font-size:9pt;font-family:굴림,Helvetica }
.box_focus2 {color:black; background-color: #FFFFFF; font-size:9pt;font-family:굴림,Helvetica; line-height:15px }
.box_focus3 {color:black; background-color: #FDE5B7; font-size:9pt;font-family:굴림,Helvetica; line-height:15px }
.time2 { font-family:Arial,Verdana,Helvetica; font-size : 8pt; line-HEIGHT:105%; color:#808080}
.copyright {font-size:10pt; font-family:seoul,돋움, arial}
a:link {text-decoration:none;color:#000000;}
a:visited {text-decoration:none;color:#000000;}
a:active {text-decoration:underline ;color:#000000;}
a:hover {text-decoration:underline ;color:#000000;}
-->
</style>
</head>
<body>
<table border=0 cellpadding=0 cellspacing=1 bgcolor=#CCCCCC>
<tr>
<td bgcolor=#FFFFFF>
<SCRIPT Language=JAVASCRIPT>
<!--
function MfStop(){
NewsFlash.stop();
}
function MfStart(){
NewsFlash.start();
}
-->
</SCRIPT>
<p style=margin-top:8px><marquee ID=NewsFlash direction=up scrollamount=1 scrolldelay=200 height=20 width=280>
<?= $fl ?>
</marquee>
</td>
</tr>
</table>
</body>
</html>
--------------------------------- 여기까지
사용하실때는 iframe 으로 하시면 될껍니다.
예제 )
<div id="layer1" style="width:280px; height:31px; position:absolute; left:130px; top:5px; z-index:1;">
<iframe src="news.php" frameborder="0" height="35" width="282" leftmargin="0" marginheight="0" marginwidth="0" scrolling="no" topmargin="0"></iframe>
</div>
---------------------------------- 예제 끝
매일경제신문의 뉴스를 인용하고 있습니다.
비상업적인 용도에 한해서 법적인 제재를 가하지 않는다고 합니다. 유념하세욥.
이것도 팁의 일종일까요? 게시판 관리자께서 알아서 샤샥해주세요.
전 팁이라고 생각하고 올리는겁니다. 자작프로그램하고 교차해서 올렸는데... 알아서
요리해주세요.
news.php의 내용입니다.
<?
$fp=@fopen("http://channel.mk.co.kr/main.html","r");
while(!feof($fp)) {
$fl = fgets($fp,4096);
if(ereg("<p style=margin-top:8px><marquee ID=NewsFlash direction=up scrollamount=1 scrolldelay=160 height=45 width=343>",$fl)) {
$fl = fgets($fp, 4096); //1
$fl = $fl.fgets($fp, 4096); //2
$fl = $fl.fgets($fp, 4096); //3
$fl = $fl.fgets($fp, 4096); //4
$fl = $fl.fgets($fp, 4096); //5
$fl = $fl.fgets($fp, 4096); //6
$fl = $fl.fgets($fp, 4096); //7
$fl = $fl.fgets($fp, 4096); //8
$fl = $fl.fgets($fp, 4096); //9
$fl = $fl.fgets($fp, 4096); //10
$fl = $fl.fgets($fp, 4096); //11
$fl = $fl.fgets($fp, 4096); //12
$fl = ereg_replace("onmouseover","target=_blank onmouseover", $fl);
$where = strpos($fl,"</marquee>");
if ($where < 1) { $where = strlen(fl);}
$fl = substr($fl, 0, $where);
break;
}
}
?>
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<meta http-equiv="Pragma" content="no-cache">
<style type="text/css">
<!--
.8 {font-size:8pt;font-family:굴림,Helvetica}
.9 {font-size:9pt;font-family:굴림,Helvetica}
.9h {font-size: 9pt;font-family:굴림,Helvetica;line-height:16px}
.9h2 {font-size: 9pt;font-family:굴림,Helvetica;line-height:15px}
.10 {font-size:10pt;font-family:굴림,arial,Helvetica;line-height:120%}
.11 {font-size:11pt;font-family:굴림,Helvetica}
.14 {font-size:15pt;font-family:굴림,Helvetica;text-decoration:underline}
.box_focus {color:black; background-color: #E4E4E4; font-size:9pt;font-family:굴림,Helvetica }
.box_focus2 {color:black; background-color: #FFFFFF; font-size:9pt;font-family:굴림,Helvetica; line-height:15px }
.box_focus3 {color:black; background-color: #FDE5B7; font-size:9pt;font-family:굴림,Helvetica; line-height:15px }
.time2 { font-family:Arial,Verdana,Helvetica; font-size : 8pt; line-HEIGHT:105%; color:#808080}
.copyright {font-size:10pt; font-family:seoul,돋움, arial}
a:link {text-decoration:none;color:#000000;}
a:visited {text-decoration:none;color:#000000;}
a:active {text-decoration:underline ;color:#000000;}
a:hover {text-decoration:underline ;color:#000000;}
-->
</style>
</head>
<body>
<table border=0 cellpadding=0 cellspacing=1 bgcolor=#CCCCCC>
<tr>
<td bgcolor=#FFFFFF>
<SCRIPT Language=JAVASCRIPT>
<!--
function MfStop(){
NewsFlash.stop();
}
function MfStart(){
NewsFlash.start();
}
-->
</SCRIPT>
<p style=margin-top:8px><marquee ID=NewsFlash direction=up scrollamount=1 scrolldelay=200 height=20 width=280>
<?= $fl ?>
</marquee>
</td>
</tr>
</table>
</body>
</html>
--------------------------------- 여기까지
사용하실때는 iframe 으로 하시면 될껍니다.
예제 )
<div id="layer1" style="width:280px; height:31px; position:absolute; left:130px; top:5px; z-index:1;">
<iframe src="news.php" frameborder="0" height="35" width="282" leftmargin="0" marginheight="0" marginwidth="0" scrolling="no" topmargin="0"></iframe>
</div>
---------------------------------- 예제 끝
댓글 19
제목 | 글쓴이 | 날짜 |
---|---|---|
타켓으로 페이지 이동하는 스크립트 [2] | 로크 | 2005.04.16 |
홈페이지 만드실때 방문자의 해상도가 걱정 되신다면 [5] | 한용 | 2005.11.11 |
새창으로 페이지열기에 대한... [2] | 나만의길 | 2006.01.04 |
홈페이지 TOP 버튼 만들어 보기 [7] | 인테리어뱅크 | 2006.04.10 |
페이지를 풀창으로 띄우는 방법 [1] | 인테리어뱅크 | 2006.04.11 |
홈페이지 하단 링크주소 없에는 소스 2 [4] | 인터니즈 | 2006.04.27 |
홈페이지 하단 링크주소 없에는 소스 [6] | 인테리어뱅크 | 2006.04.10 |
내 홈페이지에 유명사이트 검색엔진을 달자...(네이버,다음,야후 등등) [3] | 트래비스 | 2006.05.10 |
홈페이지의 필수!! 뮤직 플레이어!! [3] | 김민환 | 2006.10.14 |
[동영상강좌] 홈페이지에 BGM을 달아보자 [5] | 서기 | 2007.01.10 |
비밀번호 입력해야 해당 페이지 보이기 [3] | 이명우 | 2007.02.28 |
자신의 홈페이지에 (검색,사전,로또,주식) 통합버전을 넣어보자. [3] | Rising.kr | 2008.01.21 |
웹페이지에 마우스 따라다니는 예쁜 시계를 넣자 [5] | gosoo99 | 2008.04.08 |
페이지 자동 이동 방법 3가지!!! [10] | zero | 2000.03.06 |
PHP 인증 페이지를 만들자! - Lesson 1 수정본 #2 | ☺[폐]허접-_- | 2002.01.24 |
PHP 인증 페이지를 만들자! - Lesson 2 수정본 #1 [5] | ☺[폐]허접-_- | 2002.01.24 |
PHP 인증 페이지를 만들자! - Lesson 3 수정본 #1 [3] | ☺[폐]허접-_- | 2002.01.24 |
공부용 방명록이에욥^^. 주석왕창(페이지분할등.기능있어욥~) [2] | 프리^^ | 2001.04.16 |
홈페이지에 실시간뉴스 보여주기 [19] | looster | 2001.06.05 |
이제 홈페이지 업데이트 안하는 수모를 겪지 말자! [7] | 담배를끊으면복이옴과 | 2002.02.02 |