웹마스터 팁
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
제목 | 글쓴이 | 날짜 |
---|---|---|
초보의 php를 활용한 OneFrame(NoFrame) 홈페이지 만들기 - 1 [17] | 아이쿠 | 2002.08.30 |
array_multisort를 이용한 간단한 순위체크 [4] | Doogi | 2002.08.28 |
변수를 사용하여 echo로 변수값 출력하기. [7] | ZipShin | 2002.08.28 |
sleep() 제대루 쓰기... 요것두 [별루 알아도 도움 안되는 팁] [5] | sMokaHallo | 2002.08.24 |
[허접] implode() 함수로 배열을 변수로! | Myzzix | 2002.08.23 |
[허접] rand() 함수를 이용한 뒤죽박죽 날짜 출력 [5] | Myzzix | 2002.08.23 |
파일하나로 만드는 한줄 메모장(테마기능 포함) [8] | Mr. JH | 2002.08.22 |
PHP의 제어구조 [2] | Mr. JH | 2002.08.22 |
PHP 시간관련 함수 [3] | Mr. JH | 2002.08.22 |
PHP에서 사용하는 간단하지만 중요한 MySQL함수들 [3] | Mr. JH | 2002.08.22 |
꼭 알아야 하는 4가지 쿼리문 | Mr. JH | 2002.08.22 |
테이블 생성시 데이터베이스의 타입설정 [2] | Mr. JH | 2002.08.22 |
누구나 만들수있는 게시판 [글삭제, 수정 부분] [4] | Mr. JH | 2002.08.21 |
누구나 만들수있는 게시판 [글보기 view.php 부분] [1] | Mr. JH | 2002.08.21 |
누구나 만들수있는 게시판 [글목록 list.php 부분] [6] | Mr. JH | 2002.08.21 |
누구나 만들수있는 게시판 [schema, write, write_ok] [10] | Mr. JH | 2002.08.21 |
제로 카운터 숫자 조정하기 [8] | 이주경 | 2002.08.21 |
Print 이건또 뭐지? 사이트 찾다보니 있던데..^^ [13] | ZipShin | 2002.08.16 |
기초 통계 프로그램 for 귀차니스트;; [3] | TheMics | 2002.08.10 |
쓸모있는 PHP Tip (다 알구 있을런지 모르겠네여..^^) [1] | 이삐아이(체리) | 2002.08.09 |