웹마스터 팁
히든프레임 사랑비BGM 컨트롤하기(수정완료)
2008.11.16 17:03
히든 프레임으로 사랑비 BGM을 사용할 때 제로보드 레이아웃에서 사랑비 BGM 플레이어를 컨트롤 하는 '리모컨'입니다.
parent.frames['bgm'] 부분의 bgm을 사랑비 bgm 플레이어 프레임 이름으로 바꿔 주시면됩니다.
<frame name=bgm src=./bgm/sarangbi_bgm.php noresize> 이런식일때 사용하시면 됩니다.
예제 링크 : http://pwnet.kr
추가적으로 생성한 오브젝트가 3개 있습니다.
1. mintime :: 현재 재생중인 시간을 표시하는 레이어. 기본상태 00:00
2. maxtime :: 현재 음악의 총 재생 시간을 표시하는 레이어. 기본상태 00:00
3. mu 폼의 mus 인풋박스 :: 사랑비 플레이어의 메시지를 표시하는 텍스트 박스
<!-- Sarangbi BGM Frame Controller -->
<div class="blogTitleBox">
<h2>PWnet BGM (<span id=mintime>00:00</span>/<span id=maxtime>00:00</span>)</h2>
</div>
<div class="widgetBox" align=center>
<!--<marquee scrollamount="5" behavior=alternate><span id=msglayer><h2 style="color:#00afcf;">Loading...</h2></span></marquee>-->
<form name=mu><input name=mus size=24 style="font-size:8pt;color:#00afcf;"></form>
<a onclick="parent.frames['bgm'].method_PreviousButtonPush();" onMouseOver="document.pre.src='http://pwnet.kr/bgm/skin/tomboy/button/back_over.gif';" onMouseOut="document.pre.src='http://pwnet.kr/bgm/skin/tomboy/button/back.gif';"><img name=pre src="http://pwnet.kr/bgm/skin/tomboy/button/back.gif" width="13" height="13" border="0" alt="이전"></a>
<a onclick="parent.frames['bgm'].method_PlayButtonPush();" onMouseOver="document.pla.src='http://pwnet.kr/bgm/skin/tomboy/button/play_over.gif';" onMouseOut="document.pla.src='+ '+ 'http://pwnet.kr/bgm/skin/tomboy/button/play.gif';"><img name=pla src="http://pwnet.kr/bgm/skin/tomboy/button/play.gif" width="13 " height="13" border="0" alt="재생"></a>
<a onclick="parent.frames['bgm'].method_NextButtonPush();" onMouseOver="document.nex.src='http://pwnet.kr/bgm/skin/tomboy/button/forward_over.gif';" onMouseOut="document.nex.src='http://pwnet.kr/bgm/skin/tomboy/button/forward.gif';"><img name=nex src="http://pwnet.kr/bgm/skin/tomboy/button/forward.gif" width="13" height="13" border="0" alt="다음"></a>
<a onclick="parent.frames['bgm'].method_PauseButtonPush();" onMouseOver="document.pau.src='http://pwnet.kr/bgm/skin/tomboy/button/pause_over.gif';" onMouseOut="document.pau.src='http://pwnet.kr/bgm/skin/tomboy/button/pause.gif';"><img name=pau src="http://pwnet.kr/bgm/skin/tomboy/button/pause.gif" width="13 " height=" 13" border="0" alt="잠시멈춤"></a>
<a onclick="parent.frames['bgm'].method_StopButtonPush();" onMouseOver="document.sto.src='http://pwnet.kr/bgm/skin/tomboy/button/stop_over.gif';" onMouseOut="document.sto.src='+ 'http://pwnet.kr/bgm/skin/tomboy/button/stop.gif';"><img name=sto src="http://pwnet.kr/bgm/skin/tomboy/button/stop.gif" width="13" height="13" border="0" alt="정지"></a>
<a onclick="parent.frames['bgm'].method_VolumnUpButtonPush();" onMouseOver="document.volup.src='+ 'http://pwnet.kr/bgm/skin/tomboy/button/volume_up_over.gif';" onMouseOut="document.volup.src='http://pwnet.kr/bgm/skin/tomboy/button/volume_up.gif';"><img name=volup src="http://pwnet.kr/bgm/skin/tomboy/button/volume_up.gif" width="13" height="13" border="0" alt="소리 +"></a>
<a onclick="parent.frames['bgm'].method_VolumnDownButtonPush();" onMouseOver="document.voldn.src='http://pwnet.kr/bgm/skin/tomboy/button/volume_down_over.gif';" onMouseOut="document.voldn.src='http://pwnet.kr/bgm/skin/tomboy/button/volume_down.gif';"><img name=voldn src="http://pwnet.kr/bgm/skin/tomboy/button/volume_down.gif" width="13" height="13" border="0" alt="소리 -"></a>
<a onclick="parent.frames['bgm'].method_BGMListButtonPush();" onMouseOver="document.lis.src='http://pwnet.kr/bgm/skin/tomboy/button/list_over.gif';" onMouseOut="document.lis.src='http://pwnet.kr/bgm/skin/tomboy/button/list.gif';"><img name=lis src="http://pwnet.kr/bgm/skin/tomboy/button/list.gif" width="13" height="13" border="0" alt="플레이리스트"></a>
<!--@if($logged_info->is_admin == 'Y')-->
<a onclick="parent.frames['bgm'].method_SetupButtonPush();" onMouseOver="document.adm.src='http://pwnet.kr/bgm/skin/tomboy/button/admin_over.gif';" onMouseOut="document.adm.src='http://pwnet.kr/bgm/skin/tomboy/button/admin.gif';"><img name=adm src="http://pwnet.kr/bgm/skin/tomboy/button/admin.gif" width="13" height="13" border="0" alt="관리자페이지"></a> </div><!--@end-->
sarangbi_bgm.js 수정내용
// 웹브라우저 상태창에 출력
function private_Browser_Status( msg)
{
if( invar_use_Browser_Status)
{
if( msg == '::SARANGBI BGM::')
window.defaultStatus = msg;
else
window.defaultStatus = '[배경 음악] ' + msg;
try {
parent.frames['main'].mu.mus.value = msg;}
catch(exception) {
}
}}
// 시간 표시 함수
function private_time()
{
total_time=Math.floor( document.Sarangbi_Bgm.Duration);
cur_time=Math.floor( document.Sarangbi_Bgm.currentPosition);
if( invar_Error > 0){
if( invar_Error <= 3){
private_subject_show(11);
invar_Error++;
}else
method_NextButtonPush();
}else
if( invar_Buffring == true)
private_subject_show(6);
else{
invar_total_min=Math.floor( total_time/60);
invar_total_sec=total_time - invar_total_min*60;
invar_cur_min=Math.floor( cur_time/60);
invar_cur_sec=cur_time - invar_cur_min*60;
if( invar_total_min < 10) invar_total_min = "0" + invar_total_min;
if( invar_total_sec < 10) invar_total_sec = "0" + invar_total_sec;
if( invar_cur_min < 10) invar_cur_min = "0" + invar_cur_min;
if( invar_cur_sec < 10) invar_cur_sec = "0" + invar_cur_sec;
if( private_GetMediaState() == 2 && invar_use_Browser_Status) window.defaultStatus = '+
'[배경 음악] ' + invar_MusicTitle[invar_CurrentTrack] + " (" + invar_cur_min + ":" + invar_cur_sec + ")";
if( invar_alltime_show) document.all.sarangbi_bgm_alltime.innerHTML = invar_total_min + ":" + invar_total_sec;
if( invar_curtime_show) document.all.sarangbi_bgm_curtime.innerHTML = invar_cur_min + ":" + invar_cur_sec;
private_Browser_Status(invar_MusicTitle[invar_CurrentTrack]);
try {
parent.frames['main'].mintime.innerHTML = invar_cur_min + ':' + invar_cur_sec;
parent.frames['main'].maxtime.innerHTML = invar_total_min + ':' + invar_total_min;
} catch(exception) {
}
}}
sarangbi_bgm.php 부분에
// 음악 리스트 출력 함수
function bgm_list()
{
global $img_list, $img_list_over, $list_alt, $blend, $blend_time, $skin_dir, $list_width, $list_height, $list_one_music_height, $invar_use_frame, $invar_list_frame, $num_list;
if( $img_list == '')
missing_img('Music List 출력');
else{
echo "<script language=javascript>
function method_BGMListButtonPush()
{
if( $invar_use_frame){
$invar_list_frame.location.href='http://pwnet.kr/bgm/sarangbi_bgm_list.php';
}else{
var w = $list_width;
var h = $list_height;
var sw = window.screen.availWidth;
var sh = window.screen.availHeight;
if( invar_MusicCount > $num_list)
h+=$list_one_music_height*$num_list;
else
h+=$list_one_music_height*invar_MusicCount;
var sarangbi_bgm_list=window.open('http://pwnet.kr/bgm/sarangbi_bgm_list.php','Sarangbi_BGM_MusicList','scrollbars=yes,resizable=yes,width='+w+',height='+h);
sarangbi_bgm_list.moveTo((sw - w) / 2, (sh - h) / 2);
}
}
function bgmlist_over(){
if( $blend)
bt('sarangbi_bgm_list_image', '$skin_dir$img_list_over');
else
sarangbi_bgm_list_image.src="$skin_dir$img_list_over";
private_btn_status('$list_alt');
}
function bgmlist_out(){
if( $blend)
bt('sarangbi_bgm_list_image', '$skin_dir$img_list');
else
sarangbi_bgm_list_image.src="$skin_dir$img_list";
}
document.write("<img id='sarangbi_bgm_list_image' src='$skin_dir$img_list' onmouseover='bgmlist_over();' onmouseout='bgmlist_out();' style='cursor:hand; filter:blendTrans(duration=$blend_time);' alt='$list_alt' onClick='method_BGMListButtonPush();'>");n</script>nn";
}
}
// pause 버튼 출력 함수 (다음곡 play)
function bgm_admin()
{
global $img_admin, $img_admin_over, $admin_alt, $skin_dir, $blend, $blend_time;
if( $img_admin == '')
missing_img('사랑비 BGM 관리 도구 출력');
else{
echo "<script language=javascript>
function method_SetupButtonPush()
{
var w = 620;
var h = 620;
var sw = window.screen.availWidth;
var sh = window.screen.availHeight;
var sarangbi_setup=window.open('http://pwnet.kr/bgm/sarangbi_bgm_admin.php','Sarangbi_BGM_Setup','scrollbars=yes, resizable=yes,width='+w+',height='+h);
sarangbi_setup.moveTo((sw - w) / 2, (sh - h) / 2);
}
function bgmadmin_over(){
if( $blend)
bt('sarangbi_bgm_admin_image', '$skin_dir$img_admin_over');
else
sarangbi_bgm_admin_image.src="$skin_dir$img_admin_over";
private_btn_status('$admin_alt');
}
function bgmadmin_out(){
if( $blend)
bt('sarangbi_bgm_admin_image', '$skin_dir$img_admin');
else
sarangbi_bgm_admin_image.src="$skin_dir$img_admin";
}
document.write("<img id='sarangbi_bgm_admin_image' src='$skin_dir$img_admin' onmouseover='bgmadmin_over();' onmouseout='bgmadmin_out();' style='cursor:hand; filter:blendTrans(duration=$blend_time);' alt='$admin_alt' onClick='method_SetupButtonPush();'>");n</script>nn";
}
}
댓글 6
-
팔공산
2008.11.16 23:27
-
ㅇㅅㅇ
2008.11.16 23:34
그래서 저는.. 리스트 하고 관리자 버튼 아예빼버렸는데..
뭐 좋은 방법 없나요? -
팔공산
2008.11.17 00:45
관리자버턴은 편법으로 어떻게 나오게 만들었는데 리스트는 안되네요.
<!--@if($logged_info->is_admin == 'Y')-->
<a href="/sa/sarangbi_bgm_admin.php" onMouseOver="document.adm.src='/sa/skin/mrsj/button/admin_over.gif';" onMouseOut="document.adm.src='/sa/skin/mrsj/button/admin.gif';" target="_blank"><img name=adm src="/sa/skin/mrsj/button/admin.gif" width="13" height="13" border="0" alt="관리자페이지"></a> <!--@end--> -
행복돌이
2008.11.17 12:59
랜덤 재생 , 음소거 이런 버튼 제어는 안됩니까? -
Pw-NET
2008.11.20 18:26
관리자, 리스트 수정하는거 올릴려고 했는데
월요일부터 오늘까지 저희 부대 훈련이라서 ㅠ.ㅠ
제 사이트쪽도 아직 수정을 못한상태입니다. 내일 휴가 나가니 나가서 수정할려구요
참고로 수정해야할 내용은 sarangbi_bgm.php 부분입니다. 해당 함수의 내용을 상대경로에서 절대 경로로 바꾸어 주어야합니다. -
Pw-NET
2008.11.21 12:06
수정 완료했습니다. 사랑비 폴더에 자바스크립트 파일과 php 파일을 변경하시면 됩니다.
제목 | 글쓴이 | 날짜 |
---|---|---|
히든프레임 사랑비BGM 컨트롤하기(수정완료) [6] | Pw-NET | 2008.11.16 |
약관 2개 만들기 [3] | WXPCM | 2008.11.15 |
IIS 6.0에 rewrite mod 적용하기 [5] | 천애소원 | 2008.11.14 |
제로보드XE 가로 스크롤 문제 해결 방법 [7] | digitalist | 2008.11.12 |
레이아웃에 위젯 넣을때 위젯 사이즈 조절 [4] | mojo9 | 2008.11.07 |
일반 페이지에 로그인(세션) 정보 활용하기 [13] | noirzo | 2008.11.07 |
제한된 웹사이트 [1] | 마호로 | 2008.11.05 |
라이트박스(facebox) 적용하기 [7] | 퍼플F | 2008.11.02 |
FTP프로그램을 이용하지 않고 업로드 하기 [8] | 싱하형 | 2008.10.31 |
외국에서 접속시 로그인 않되는문제 [1] | minams | 2008.10.30 |
플래시 BGM 음악 제로보드에 넣는 방법 | 푸른커튼 | 2008.10.29 |
카페24 계정 사용 중에 제로보드XE 로그인 오류가 날 때 [1] | vltm | 2008.10.24 |
개인 웹서버 백업 및 게시물 등록 날짜 수정 방법 [10] | eunbini | 2008.10.24 |
단일 Windows PC에 다중 버전 IE 설치하기 [5] | NetEagle | 2008.10.22 |
IE의 특정 도메인 인터넷 임시 파일 Cache만 삭제하기 [3] | NetEagle | 2008.10.22 |
cafe24사용자중 페이지에서 위젯편집시 자바스크립트 에러나시는 분들 [8] | 팔공산 | 2008.10.17 |
zbXE 1.0.6 일본어 팩 입니다~ [8] | 쿠로쿠마 | 2008.10.15 |
UTF-8에서 호환되는 사랑비 BGM 올립니다. [8] | 로로아 | 2008.10.15 |
제로보드XE가입 -> 트랙자동가입 기능 | 개돌 | 2008.10.14 |
캘린더 위젯 여러개 사용하기 [3] | 김초호 | 2008.10.07 |
설치 후에 리모컨버턴에 문제가 생깁니다.
위와 같이 설정을 하니 버턴을 클릭했을시 http://홈피주소/사랑비폴더/ 로 열리지 않고 http://홈피주소/zbxe폴더/로 열리네요, 제가 해본 결과도 그렇고 님의 홈페이지에서도 그렇게 작동을 하네요.
그리고 마지막에 </div>추가해야 합니다. 안그럼 레이아웃 깨어집니다.