웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
파일 하나로 끝내는-_- NZEO 북마크...-_-a
2003.01.13 21:15
우선 $HTTP_REFERER를 이용하므로 새창으로 띄우면 안됩니다-_-ㆀ
아..그리고 이름을 좀 바꿨어요-_- bookmark에서 clipping으로;;;
회원정보 중 $member[no]를 이용합니다..
id보단 편하지 않나요;; 중복염려 제로(id도 마찬가진가...)에....글자수도 적구...ㅡㅡ;;
NZEO사이트도 그런식인거같은데;;;
그리구 NZEO사이트와 똑같이 20개이상은 안돼게 해놨어요...
NZEO와 같은 셀렉트 박스를 이용하려면...우선 제로님의 zSelectBox.js파일받아서 페이지에 넣어주시구
아래와 같이 넣어주세요...(아웃로긴 포함된페이지에 한함...;; 안그럼 outlogin.php를 먼저 인클루드해주세요-_-)
여기에 쓰인 이미지는.....삭제시켜버려서..ㅠ_ㅜ
이상한 부분이나 안돼시는 부분 지적해주세요......-_-
제가 초보라 잘모르지만 지적해주시면 고치도록 노력해볼게요..;;
저같은 경우전 잘되기땜에 별문제는 없을거라 생각됩니다만.....ㅡㅡ;
/////////// 여기서부터 인클루드 시킬부분... //////////////////////////////////////////////////
<?
if(!$member[no]) {
?>
<td rowspan=2><img src="<?=$dir[img]?>main/clip_submit.gif" width=14 height=23></td><td rowspan=2 width=67 height=23></td>
</tr>
<tr>
<td width=101 height=19>
<script>
var selectBox = new Array();
var option = new Array();
selectBox["id"] = "BookMark";
selectBox["fontsize"] = "9";
selectBox["width"] = "101";
selectBox["height"] = "19";
selectBox["fontcolor"] = "#333333";
selectBox["bordercolor"] = "#666666";
selectBox["focusbgcolor"] = "#e4e4e4";
selectBox["bullet"] = "<img src=<?=$dir[img]?>bullet/select_bul.gif width=10 height=6>";
selectBox["padding"] = "0";
selectBox["onChange"] = true;
option[0] = "<font class=ineal>로그인 필요...</FONT>";
<?
}
else
{
?>
<td rowspan=2><a href="/bbs/clip.php"><img src="<?=$dir[img]?>main/clip_submit.gif" width=14 height=23></a></td><td rowspan=2 width=67 height=23></td>
</tr>
<tr>
<td width=101 height=19>
<script>
var selectBox = new Array();
var option = new Array();
selectBox["id"] = "BookMark";
selectBox["fontsize"] = "9";
selectBox["width"] = "101";
selectBox["height"] = "19";
selectBox["fontcolor"] = "#333333";
selectBox["bordercolor"] = "#666666";
selectBox["focusbgcolor"] = "#e4e4e4";
selectBox["bullet"] = "<img src=<?=$dir[img]?>bullet/select_bul.gif width=10 height=6>";
selectBox["padding"] = "0";
selectBox["onChange"] = true;
option[0] = "<font class=ineal>My Clipping...</FONT>";
<?
$result=mysql_query("select * from clip WHERE member_no = '$member[no]'", $connect) or die(mysql_error());
$temp=mysql_fetch_array(mysql_query("select count(*) from clip WHERE member_no = '$member[no]'", $connect));
$total=$temp["count(*)"];
$num=$total;
while($data=mysql_fetch_array($result))
{
?>
option[<?=$num?>] = "<?=$data[name]?>,<?=$data[url]?>";
<?
$num--;
}
}
?>
option["select"] = 0;
printZSelectBox(selectBox,option);
</script>
</td>
</tr>
</table>
/////////// 여기까지가 인클루드 시킬부분... //////////////////////////////////////////////////
여기서부터 소스시작~ 제로보드 설치 디렉토리에 넣어주세요...
<?
// 라이브러리 함수 파일 인크루드
include "lib.php";
// DB 연결
if(!$connect) $connect=dbConn();
// 멤버정보 구하기
$member=member_info();
if(!$member[no]) Error("로그인된 회원만이 사용할수 있습니다");
// 클립보기/등록.
if(!$exec) {
$this_page = "이 페이지(http://를 포함한...)를 적어주세요..";
if($HTTP_REFERER=='$this_page') $HTTP_REFERER="";
$result2=mysql_query("select * from clip WHERE member_no = '$member[no]'", $connect) or die(mysql_error());
$temp2=mysql_fetch_array(mysql_query("select count(*) from clip WHERE member_no = '$member[no]'", $connect));
$total_clip=$temp2["count(*)"];
?>
<HTML>
<HEAD>
<STYLE TYPE="text/css" TITLE="">
P,td,br,BODY,TD,SELECT,input,DIV,form,TEXTAREA,center,option,blockquote {font-size:9pt;}
BODY {color:#333333;font-family:돋움;
scrollbar-face-color:#FFFFFF;
scrollbar-highlight-color: #aaaaaa;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-shadow-color: #aaaaaa;
scrollbar-darkshadow-color: #FFFFFF;
scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color: #aaaaaa;
}
img {border:none}
.t {line-height:140%}
.bold {font-weight:bold}
.bt_s {border:solid 1 black;font-family:verdana;font-size:7pt;font-weight:bold;color:white;background-color:#404040;}
.in_t {border:solid 1;background-color:white;border-color:#404040;line-height:120%}
a:link { text-decoration: none; color: black; font-size: 8pt; }
a:visited { text-decoration: none; color: black; font-size: 8pt; }
a:active { text-decoration: none; color: #4E87FF; font-size: 8pt; }
a:hover { text-decoration:none; color:#4E87FF; font-size: 8pt; }
.tah7 {font-family:Tahoma,Verdana,Arial;font-size:7pt}
.tah8 {font-family:Tahoma,Verdana,Arial;font-size:8pt}
.tah9 {font-family:Tahoma,Verdana,Arial;font-size:9pt}
</STYLE>
<script>
function clearField(field){ if (field.value == field.defaultValue) { field.value = ""; } }
function checkField(field){ if (field.value == "") { field.value = field.defaultValue; } }
function clip_check_submit(obj) {
if(!obj.name.value) {
alert("Clip Name을 입력하세요");
obj.name.focus();
return false;
}
if(!obj.url.value) {
alert("URL을 입력하세요");
obj.url.focus();
return false;
}
return true;
}
</script>
</HEAD>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td valign=top height=600 align=center>
<table border='1' width='500' style='border-style:solid;' cellspacing='0' bordercolordark='white' bordercolorlight='black' cellpadding=3>
<tr>
<td colspan=3 class='f_4 bold tah8'><b>What is 'My Clipping'...?</b></td>
</tr>
<tr>
<td colspan=3 class='tah8 t' height=35>
이 사이트 내의 페이지나, 다른 사이트까지 북마크를 하실수 있는 Service입니다.<br>
최고 20개까지만 북마크를 등록하실수 있기 때문에 아껴서 사용해 주세요.<br>
더 많이 지원해 드리고 싶지만, DB자원이 한정되어 있어서 어쩔수 없음을 이해해 주시면 감사하겠습니다.
</td>
</tr>
</table>
<br>
<?
if($total_clip>=20) {
}
else {
?>
<table border=0 cellspacing=0 cellpadding=3 width=500 >
<col width=80></col><col width=></col>
<form actoin="<?=$PHP_SELF?>" method=post onsubmit="return clip_check_submit(this)">
<input type=hidden name=exec value="insert">
<tr nowrap>
<td class=tah7 align=right>Clip Name</td>
<td><input type=input name=name size=20 maxlength=20 class="in_t tah7" onFocus="clearField(this)" onBlur="checkField(this)" value="Clip Name"></td>
</tr>
<tr nowrap>
<td class=tah7 align=right>URL</td>
<td><input type=input name=url value="<?=$HTTP_REFERER?>" size=65 maxlength=250 class="in_t tah7"></td>
</tr>
<tr nowrap>
<td colspan=2 align=center><input type=submit value="Add This Clip" class=bt_s></td>
</tr>
</form>
</table>
<br>
<?
}
?>
<table border=0 width=500 cellspacing=1 cellpadding=5 style=table-layout:fixed>
<col width=120></col><col width=></col><col width=50></col>
<tr>
<td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr>
<tr align=center>
<td class=tah7>Name</td>
<td class=tah7>URL</td>
<td class=tah7>Del</td>
</tr>
<tr>
<td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr><?
$num_clip=$total_clip;
while($data2=mysql_fetch_array($result2))
{echo "
<tr class=fixed>
<td nowrap class='tah8' height=35 align=center><b><!-- $num_clip -->$data2[name]</b></td>
<td nowrap><a href='$data2[url]'>$data2[url]</a></td>
<td align=center><a href='$PHP_SELF?exec=delete&no=$data2[no]' onclick="return confirm('삭제하시겠습니까?')"><font style='font:bold 10px Verdana;color:c60000;text-decoration:none'>X</font></a></td>
</tr>
<tr>
<td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr>";
$num_clip--;
}
?>
</table>
</td>
</tr>
</table>
</HTML>
<?
}
// 클립추가
if($exec=="insert") {
if($total_clip>=20) {
Error("클립은 20개까지만 저장가능합니다....^^;;");
}
else {
if(isblank($name)) Error("이름을 입력하셔야 합니다");
if(isblank($url)) Error("URL을 입력하셔야 합니다");
if($name=="Clip Name") Error("Clip Name을 제대로 입력하셔야 합니다");
mysql_query("insert into clip (member_no, name, url) values ('$member[no]','$name','$url')", $connect) or die(mysql_error());
}
header("Location: $PHP_SELF");
}
// 클립삭제
if($exec=="delete") {
mysql_query("DELETE FROM clip WHERE no = '$no' and member_no = '$member[no]'", $connect);
header("Location: $PHP_SELF");
}
?>
아..그리고 이름을 좀 바꿨어요-_- bookmark에서 clipping으로;;;
회원정보 중 $member[no]를 이용합니다..
id보단 편하지 않나요;; 중복염려 제로(id도 마찬가진가...)에....글자수도 적구...ㅡㅡ;;
NZEO사이트도 그런식인거같은데;;;
그리구 NZEO사이트와 똑같이 20개이상은 안돼게 해놨어요...
NZEO와 같은 셀렉트 박스를 이용하려면...우선 제로님의 zSelectBox.js파일받아서 페이지에 넣어주시구
아래와 같이 넣어주세요...(아웃로긴 포함된페이지에 한함...;; 안그럼 outlogin.php를 먼저 인클루드해주세요-_-)
여기에 쓰인 이미지는.....삭제시켜버려서..ㅠ_ㅜ
이상한 부분이나 안돼시는 부분 지적해주세요......-_-
제가 초보라 잘모르지만 지적해주시면 고치도록 노력해볼게요..;;
저같은 경우전 잘되기땜에 별문제는 없을거라 생각됩니다만.....ㅡㅡ;
/////////// 여기서부터 인클루드 시킬부분... //////////////////////////////////////////////////
<?
if(!$member[no]) {
?>
<td rowspan=2><img src="<?=$dir[img]?>main/clip_submit.gif" width=14 height=23></td><td rowspan=2 width=67 height=23></td>
</tr>
<tr>
<td width=101 height=19>
<script>
var selectBox = new Array();
var option = new Array();
selectBox["id"] = "BookMark";
selectBox["fontsize"] = "9";
selectBox["width"] = "101";
selectBox["height"] = "19";
selectBox["fontcolor"] = "#333333";
selectBox["bordercolor"] = "#666666";
selectBox["focusbgcolor"] = "#e4e4e4";
selectBox["bullet"] = "<img src=<?=$dir[img]?>bullet/select_bul.gif width=10 height=6>";
selectBox["padding"] = "0";
selectBox["onChange"] = true;
option[0] = "<font class=ineal>로그인 필요...</FONT>";
<?
}
else
{
?>
<td rowspan=2><a href="/bbs/clip.php"><img src="<?=$dir[img]?>main/clip_submit.gif" width=14 height=23></a></td><td rowspan=2 width=67 height=23></td>
</tr>
<tr>
<td width=101 height=19>
<script>
var selectBox = new Array();
var option = new Array();
selectBox["id"] = "BookMark";
selectBox["fontsize"] = "9";
selectBox["width"] = "101";
selectBox["height"] = "19";
selectBox["fontcolor"] = "#333333";
selectBox["bordercolor"] = "#666666";
selectBox["focusbgcolor"] = "#e4e4e4";
selectBox["bullet"] = "<img src=<?=$dir[img]?>bullet/select_bul.gif width=10 height=6>";
selectBox["padding"] = "0";
selectBox["onChange"] = true;
option[0] = "<font class=ineal>My Clipping...</FONT>";
<?
$result=mysql_query("select * from clip WHERE member_no = '$member[no]'", $connect) or die(mysql_error());
$temp=mysql_fetch_array(mysql_query("select count(*) from clip WHERE member_no = '$member[no]'", $connect));
$total=$temp["count(*)"];
$num=$total;
while($data=mysql_fetch_array($result))
{
?>
option[<?=$num?>] = "<?=$data[name]?>,<?=$data[url]?>";
<?
$num--;
}
}
?>
option["select"] = 0;
printZSelectBox(selectBox,option);
</script>
</td>
</tr>
</table>
/////////// 여기까지가 인클루드 시킬부분... //////////////////////////////////////////////////
여기서부터 소스시작~ 제로보드 설치 디렉토리에 넣어주세요...
<?
// 라이브러리 함수 파일 인크루드
include "lib.php";
// DB 연결
if(!$connect) $connect=dbConn();
// 멤버정보 구하기
$member=member_info();
if(!$member[no]) Error("로그인된 회원만이 사용할수 있습니다");
// 클립보기/등록.
if(!$exec) {
$this_page = "이 페이지(http://를 포함한...)를 적어주세요..";
if($HTTP_REFERER=='$this_page') $HTTP_REFERER="";
$result2=mysql_query("select * from clip WHERE member_no = '$member[no]'", $connect) or die(mysql_error());
$temp2=mysql_fetch_array(mysql_query("select count(*) from clip WHERE member_no = '$member[no]'", $connect));
$total_clip=$temp2["count(*)"];
?>
<HTML>
<HEAD>
<STYLE TYPE="text/css" TITLE="">
P,td,br,BODY,TD,SELECT,input,DIV,form,TEXTAREA,center,option,blockquote {font-size:9pt;}
BODY {color:#333333;font-family:돋움;
scrollbar-face-color:#FFFFFF;
scrollbar-highlight-color: #aaaaaa;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-shadow-color: #aaaaaa;
scrollbar-darkshadow-color: #FFFFFF;
scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color: #aaaaaa;
}
img {border:none}
.t {line-height:140%}
.bold {font-weight:bold}
.bt_s {border:solid 1 black;font-family:verdana;font-size:7pt;font-weight:bold;color:white;background-color:#404040;}
.in_t {border:solid 1;background-color:white;border-color:#404040;line-height:120%}
a:link { text-decoration: none; color: black; font-size: 8pt; }
a:visited { text-decoration: none; color: black; font-size: 8pt; }
a:active { text-decoration: none; color: #4E87FF; font-size: 8pt; }
a:hover { text-decoration:none; color:#4E87FF; font-size: 8pt; }
.tah7 {font-family:Tahoma,Verdana,Arial;font-size:7pt}
.tah8 {font-family:Tahoma,Verdana,Arial;font-size:8pt}
.tah9 {font-family:Tahoma,Verdana,Arial;font-size:9pt}
</STYLE>
<script>
function clearField(field){ if (field.value == field.defaultValue) { field.value = ""; } }
function checkField(field){ if (field.value == "") { field.value = field.defaultValue; } }
function clip_check_submit(obj) {
if(!obj.name.value) {
alert("Clip Name을 입력하세요");
obj.name.focus();
return false;
}
if(!obj.url.value) {
alert("URL을 입력하세요");
obj.url.focus();
return false;
}
return true;
}
</script>
</HEAD>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<tr>
<td valign=top height=600 align=center>
<table border='1' width='500' style='border-style:solid;' cellspacing='0' bordercolordark='white' bordercolorlight='black' cellpadding=3>
<tr>
<td colspan=3 class='f_4 bold tah8'><b>What is 'My Clipping'...?</b></td>
</tr>
<tr>
<td colspan=3 class='tah8 t' height=35>
이 사이트 내의 페이지나, 다른 사이트까지 북마크를 하실수 있는 Service입니다.<br>
최고 20개까지만 북마크를 등록하실수 있기 때문에 아껴서 사용해 주세요.<br>
더 많이 지원해 드리고 싶지만, DB자원이 한정되어 있어서 어쩔수 없음을 이해해 주시면 감사하겠습니다.
</td>
</tr>
</table>
<br>
<?
if($total_clip>=20) {
}
else {
?>
<table border=0 cellspacing=0 cellpadding=3 width=500 >
<col width=80></col><col width=></col>
<form actoin="<?=$PHP_SELF?>" method=post onsubmit="return clip_check_submit(this)">
<input type=hidden name=exec value="insert">
<tr nowrap>
<td class=tah7 align=right>Clip Name</td>
<td><input type=input name=name size=20 maxlength=20 class="in_t tah7" onFocus="clearField(this)" onBlur="checkField(this)" value="Clip Name"></td>
</tr>
<tr nowrap>
<td class=tah7 align=right>URL</td>
<td><input type=input name=url value="<?=$HTTP_REFERER?>" size=65 maxlength=250 class="in_t tah7"></td>
</tr>
<tr nowrap>
<td colspan=2 align=center><input type=submit value="Add This Clip" class=bt_s></td>
</tr>
</form>
</table>
<br>
<?
}
?>
<table border=0 width=500 cellspacing=1 cellpadding=5 style=table-layout:fixed>
<col width=120></col><col width=></col><col width=50></col>
<tr>
<td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr>
<tr align=center>
<td class=tah7>Name</td>
<td class=tah7>URL</td>
<td class=tah7>Del</td>
</tr>
<tr>
<td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr><?
$num_clip=$total_clip;
while($data2=mysql_fetch_array($result2))
{echo "
<tr class=fixed>
<td nowrap class='tah8' height=35 align=center><b><!-- $num_clip -->$data2[name]</b></td>
<td nowrap><a href='$data2[url]'>$data2[url]</a></td>
<td align=center><a href='$PHP_SELF?exec=delete&no=$data2[no]' onclick="return confirm('삭제하시겠습니까?')"><font style='font:bold 10px Verdana;color:c60000;text-decoration:none'>X</font></a></td>
</tr>
<tr>
<td colspan=3 height=1 align=center bgcolor=#333333></td>
</tr>";
$num_clip--;
}
?>
</table>
</td>
</tr>
</table>
</HTML>
<?
}
// 클립추가
if($exec=="insert") {
if($total_clip>=20) {
Error("클립은 20개까지만 저장가능합니다....^^;;");
}
else {
if(isblank($name)) Error("이름을 입력하셔야 합니다");
if(isblank($url)) Error("URL을 입력하셔야 합니다");
if($name=="Clip Name") Error("Clip Name을 제대로 입력하셔야 합니다");
mysql_query("insert into clip (member_no, name, url) values ('$member[no]','$name','$url')", $connect) or die(mysql_error());
}
header("Location: $PHP_SELF");
}
// 클립삭제
if($exec=="delete") {
mysql_query("DELETE FROM clip WHERE no = '$no' and member_no = '$member[no]'", $connect);
header("Location: $PHP_SELF");
}
?>
댓글 14
제목 | 글쓴이 | 날짜 |
---|---|---|
동일서버내 페이지에서 로그인정보 활용하기... [4] | 수로 | 2008.09.06 |
게시판 에디터 폰트 글자(글씨)크기 변경하는 법 | 씨에씨에 | 2008.09.12 |
주소록 구현 (외부 페이지) [17] | CSLab | 2008.09.15 |
"권한이 없습니다." Alert 창 대신 로그인 화면으로 이동시키기 [4] | Slur | 2008.09.22 |
VPN 환경에서 제로보드 [4] | superion | 2008.09.26 |
[권한이 없습니다] 권한에 따른 다른 메시지 출력하기 [10] [1] | 반도체맨 | 2008.10.03 |
제로보드XE가입 -> 트랙자동가입 기능 | 개돌 | 2008.10.14 |
제로보드(zbxe) 설치 후 로그인 안되는 문제. [3] | sophistlv.myid.net | 2008.10.15 |
개인 웹서버 백업 및 게시물 등록 날짜 수정 방법 [10] | eunbini | 2008.10.24 |
카페24 계정 사용 중에 제로보드XE 로그인 오류가 날 때 [1] | vltm | 2008.10.24 |
플래시 BGM 음악 제로보드에 넣는 방법 | 푸른커튼 | 2008.10.29 |
외국에서 접속시 로그인 않되는문제 [1] | minams | 2008.10.30 |
FTP프로그램을 이용하지 않고 업로드 하기 [8] | 싱하형 | 2008.10.31 |
라이트박스(facebox) 적용하기 [7] | 퍼플F | 2008.11.02 |
일반 페이지에 로그인(세션) 정보 활용하기 [13] | noirzo | 2008.11.07 |
1.1.0 업데이트 로그인문제관련 [6] | 그냥뛰어 | 2008.11.24 |
XE 로그인이 안될때 확인해 보세요. [7] | 똑디 | 2008.12.11 |
XE와 별도 프로그램 연동시 세션공유 [15] | 똑디 | 2008.12.12 |
로그인한 회원만 최근 게시글, 검색등 볼수 있도록 하기 [3] | [_)s | 2008.12.31 |
제로보드XE 쉽게 업데이트 하는 방법.. [13] | 청개구리00 | 2009.01.12 |