묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
또 다른 문제가 생겼습니다 (Help!!!!!!!)
2007.05.31 20:34
http://www.uccenglish.tv/shot_2.gifhttp://www.uccenglish.tv/shot_1.gif위에 첨부한 그림 두개에서 보시듯 1번 제목을 클릭해도 2번 제목을 클릭해도 같은 내용이 나옵니다. 아--- 초보에겐 갈수록 태산이군요. 고수님들 어찌해야 하나요... 어떤 변수같은 것이 필요한 걸까요? 도와주세요...
<?
include "connect.inc";
?>
<link rel="stylesheet" type="text/css" href="balloontip.css" />
<script type="text/javascript" src="balloontip.js"></script>
<?
$QUERY_S = $QUERY_STRING;
if(!$page){
$page="1";
}else{
$QUERY_r = explode("&page",$QUERY_S);
// $QUERY_S = $QUERY_r[0];
$QUERY_S = "board=$board&sear=$sear&search=$search";
}
if($Aboard!=""){
$allquery = mysql_query("select id from SHadmin_table where tid='$Aboard'");
while($allboard=mysql_fetch_array($allquery)){
$segment1[]=" id='".$allboard[0]."' ";
$segment2[]=" bid='".$allboard[0]."' ";
}
$segm1=implode("or",$segment1);
$segm2=implode("or",$segment2);
}else{
$segm1 = " id='".$board."' ";
$segm2 = " bid='".$board."' ";
}
$SBrow=mysql_fetch_array(mysql_query("select * from SHadmin_table where $segm1"));
$Bskin=$SBrow["skin"];
$Bnotice=$SBrow["notice"];
$Baccess=explode("|",$SBrow["access"]);
$Bfield=explode("|",$SBrow["field"]);
$Bname=$SBrow["name"];
$Btid=$SBrow["tid"];
$num_page=$SBrow["num_page"];
$Ptitle_len=$SBrow["title_len"];
$Pnotice=$Bnotice;
$Ppage=$Bname;
if($Aboard!="") $Ppage=$Aboard;
if($Baccess[0]!=0 and $Baccess[0] > $your_level){
err($alert_level);
exit;
}
if($order1!=""){
if($sear!=""){
$order = "order by $sear,$order1 $order2";
}else{
$order = "order by $order1 $order2";
}
}else{
if($sear!=""){
$order = "order by $sear,num $order2";
}else{
$order = "order by num desc";
}
}
if(!eregi("[^[:space:]]+",$search)) {
$query1 = "SELECT count(num) FROM SHboard Where ok=1 and $segm2 $order";
$query2 = "SELECT num,id,id2,email,title,cost,file_img,sign_date,ref,tnum,bid,comment FROM SHboard Where ok=1 and $segm2 $order";
}else {
$key = urlencode($search);
$query1 = "SELECT count(num) FROM SHboard WHERE ok=1 and $segm2 and $sear LIKE '%$search%' $order";
$query2 = "SELECT num,id,id2,email,title,cost,file_img,sign_date,ref,tnum,bid,comment FROM SHboard WHERE ok=1 and $segm2 and $sear LIKE '%$search%' $order";
}
***************** 1. query1,2의 끝에 각각 comment를 추가했음 *****************
$result0 = mysql_query($query1,$dbconn);
if(!$result0) {
err("잠시후 다시 이용해 주십시오.1");
exit;
}
$total_record = mysql_result($result0,0,0);
$result = mysql_query($query2,$dbconn);
if(!$result) {
err("잠시후 다시 이용해 주십시오.2");
exit;
}
if($total_record <= $num_page){
$first=0;
$last=$total_record;
}else {
$first=$num_page*($page-1);
$last=$num_page*$page;
if($last > $total_record){
$last=$total_record;
}
}
####################################################
for($i = $first; $i < $last; $i++) {
$db_num=mysql_result($result,$i,0);
$db_id=mysql_result($result,$i,1);
$db_id2=mysql_result($result,$i,2);
$db_email=mysql_result($result,$i,3);
$dc_title=explode("|",mysql_result($result,$i,4));
$db_cost=mysql_result($result,$i,5);
$db_file_img=mysql_result($result,$i,6);
$db_sign_date=mysql_result($result,$i,7);
$db_ref=mysql_result($result,$i,8);
$db_tnum=mysql_result($result,$i,9);
$board=mysql_result($result,$i,10);
$db_comment=mysql_result($result,$i,11); ***************** 2. 여기에 한즐 추가했음 *****************
$db_title=$dc_title[0];
$db_icon=$dc_title[1];
if($db_icon=="h"){
$db_icon="hot";
}else if($db_icon=="e"){
$db_icon="event";
}else if($db_icon=="19"){
$db_icon="19";
}else if($db_icon=="u"){
$db_icon="up";
}else if($db_icon=="n"){
$db_icon="new";
}else if($db_icon=="r"){
$db_icon="recom";
}
$re_board= "SHboard_reply";
$re_count = mysql_result(mysql_query("SELECT count(num) FROM $re_board where re_num='$db_num' and re_tnum='$db_tnum'"),0,0);
if($db_icon!=""){
$new_script = " <img src=skin/$Bskin/img/icon_".$db_icon.".gif border=0 align=absmiddle>";
}else{
$new_script = "";
}
$today_date = mktime(0,0,0,date('m',time()),date('d',time()),date('Y',time()))-60*60*24;
if($db_sign_date > $today_date){
$new_script.= " <img src=skin/$Bskin/img/icon_new.gif border=0>";
}else{
$new_script.="";
}
$db_r=mysql_fetch_array(mysql_query("select level,open from SHmember where id='+ '+ '$db_id'"));
$open=$db_r[1];
$db_level=$db_r[0];
$db_ref=explode("|",$db_ref);
$refx=count($db_ref);
if($db_level==""){
$db_level='0';
}
if($open=='1'){
$name[]="<img src=member_icon/".$db_level.".gif align=absmiddle> <a href=# onclick="window.open('message_send.php?to_id=$db_id','message','width=420,height=400,scrollbars=yes')" onfocus='this.blur()'>".$db_id2."</a>";
}else{
$name[]="<img src=member_icon/".$db_level.".gif align=absmiddle> ".$db_id2;
}
$num[]=$db_num;
$tnum[]=$db_tnum;
$cost[]=$db_cost;
$tlen=strlen($db_title);
if($tlen > $Ptitle_len){
$db_title=substr($db_title,0,$Ptitle_len);
}
$db_title = "<img src=skin/$Bskin/img/icon_dot.gif width=4 height=4 align=absmiddle border=0> ".$db_title." ".$new_script;
if($re_count==0){
$db_title=$db_title;
}else{
$db_title=$db_title."<font color=#666666 class=fon11> [".$re_count."]</font>";
}
################ 링크시작
$link="board_view.php?board=$board&num=$db_num&tnum=$db_tnum&page=$page&sear=$sear&search=$search";
if($db_cost > 0){
if($ssh_id == "" or $ssh_id2 == ""){
//$db_title=$alert_login;
$link="# onclick="alert('$alert_login')"";
}else{
$link="# onclick="canfirm('$link','유료글입니다. 지불하시겠습니까? 자신이 올린 자료이거나 이미 구입하신 타인의 자료는 중복과금되지 않습니다.');"";
}
}
if($Baccess[1] > 0){
if($ssh_id == "" or $ssh_id2 == ""){
//$db_title=$alert_login;
$link="# onclick="alert('$alert_login')"";
}else{
if($Baccess[1] > $your_level){
$link="# onclick="alert('$alert_level');return false"";
}
}
}
***************** 3. rel='balloon' 적용 ****************
$title[]="<a href=$link onfocus='this.blur()' rel='balloon'>$db_title</a>";
$sign_date[]=date("Y.m.d",$db_sign_date);
$ref[]=$refx;
$board_n=mysql_result(mysql_query("select name from SHadmin_table where id='$board'"),0,0);
$board_name[]=$board_n;
}
##########################
include "skin/$Pskin/page.inc";
?>
<script>
function canfirm(dire,msge){
als = confirm(msge);
if(als == true){
document.location=dire;
}else{
return true;
}
}
</script>
<?
include "skin/$Pskin/header.inc";
include "skin/$Bskin/list.htm";
include "skin/$Pskin/footer.inc";
?>
***************** 4. 이햐 미리보기창 *****************
<div id=balloon class=balloonstyle style='padding:3;'>
<table width=100% height=30 valign=top cellpadding=5 cellspacing=0 style='border:1;'+ '><tr><td width=15%>올린이</td><td width=30%><?=$db_id2?></td><td width=15%>가격</td><td width=30%><?=$db_cost?></td></tr><tr><td width=100% colspan=4>내용 : <?=$db_comment?></td></tr></table></div>
<?
include "connect.inc";
?>
<link rel="stylesheet" type="text/css" href="balloontip.css" />
<script type="text/javascript" src="balloontip.js"></script>
<?
$QUERY_S = $QUERY_STRING;
if(!$page){
$page="1";
}else{
$QUERY_r = explode("&page",$QUERY_S);
// $QUERY_S = $QUERY_r[0];
$QUERY_S = "board=$board&sear=$sear&search=$search";
}
if($Aboard!=""){
$allquery = mysql_query("select id from SHadmin_table where tid='$Aboard'");
while($allboard=mysql_fetch_array($allquery)){
$segment1[]=" id='".$allboard[0]."' ";
$segment2[]=" bid='".$allboard[0]."' ";
}
$segm1=implode("or",$segment1);
$segm2=implode("or",$segment2);
}else{
$segm1 = " id='".$board."' ";
$segm2 = " bid='".$board."' ";
}
$SBrow=mysql_fetch_array(mysql_query("select * from SHadmin_table where $segm1"));
$Bskin=$SBrow["skin"];
$Bnotice=$SBrow["notice"];
$Baccess=explode("|",$SBrow["access"]);
$Bfield=explode("|",$SBrow["field"]);
$Bname=$SBrow["name"];
$Btid=$SBrow["tid"];
$num_page=$SBrow["num_page"];
$Ptitle_len=$SBrow["title_len"];
$Pnotice=$Bnotice;
$Ppage=$Bname;
if($Aboard!="") $Ppage=$Aboard;
if($Baccess[0]!=0 and $Baccess[0] > $your_level){
err($alert_level);
exit;
}
if($order1!=""){
if($sear!=""){
$order = "order by $sear,$order1 $order2";
}else{
$order = "order by $order1 $order2";
}
}else{
if($sear!=""){
$order = "order by $sear,num $order2";
}else{
$order = "order by num desc";
}
}
if(!eregi("[^[:space:]]+",$search)) {
$query1 = "SELECT count(num) FROM SHboard Where ok=1 and $segm2 $order";
$query2 = "SELECT num,id,id2,email,title,cost,file_img,sign_date,ref,tnum,bid,comment FROM SHboard Where ok=1 and $segm2 $order";
}else {
$key = urlencode($search);
$query1 = "SELECT count(num) FROM SHboard WHERE ok=1 and $segm2 and $sear LIKE '%$search%' $order";
$query2 = "SELECT num,id,id2,email,title,cost,file_img,sign_date,ref,tnum,bid,comment FROM SHboard WHERE ok=1 and $segm2 and $sear LIKE '%$search%' $order";
}
***************** 1. query1,2의 끝에 각각 comment를 추가했음 *****************
$result0 = mysql_query($query1,$dbconn);
if(!$result0) {
err("잠시후 다시 이용해 주십시오.1");
exit;
}
$total_record = mysql_result($result0,0,0);
$result = mysql_query($query2,$dbconn);
if(!$result) {
err("잠시후 다시 이용해 주십시오.2");
exit;
}
if($total_record <= $num_page){
$first=0;
$last=$total_record;
}else {
$first=$num_page*($page-1);
$last=$num_page*$page;
if($last > $total_record){
$last=$total_record;
}
}
####################################################
for($i = $first; $i < $last; $i++) {
$db_num=mysql_result($result,$i,0);
$db_id=mysql_result($result,$i,1);
$db_id2=mysql_result($result,$i,2);
$db_email=mysql_result($result,$i,3);
$dc_title=explode("|",mysql_result($result,$i,4));
$db_cost=mysql_result($result,$i,5);
$db_file_img=mysql_result($result,$i,6);
$db_sign_date=mysql_result($result,$i,7);
$db_ref=mysql_result($result,$i,8);
$db_tnum=mysql_result($result,$i,9);
$board=mysql_result($result,$i,10);
$db_comment=mysql_result($result,$i,11); ***************** 2. 여기에 한즐 추가했음 *****************
$db_title=$dc_title[0];
$db_icon=$dc_title[1];
if($db_icon=="h"){
$db_icon="hot";
}else if($db_icon=="e"){
$db_icon="event";
}else if($db_icon=="19"){
$db_icon="19";
}else if($db_icon=="u"){
$db_icon="up";
}else if($db_icon=="n"){
$db_icon="new";
}else if($db_icon=="r"){
$db_icon="recom";
}
$re_board= "SHboard_reply";
$re_count = mysql_result(mysql_query("SELECT count(num) FROM $re_board where re_num='$db_num' and re_tnum='$db_tnum'"),0,0);
if($db_icon!=""){
$new_script = " <img src=skin/$Bskin/img/icon_".$db_icon.".gif border=0 align=absmiddle>";
}else{
$new_script = "";
}
$today_date = mktime(0,0,0,date('m',time()),date('d',time()),date('Y',time()))-60*60*24;
if($db_sign_date > $today_date){
$new_script.= " <img src=skin/$Bskin/img/icon_new.gif border=0>";
}else{
$new_script.="";
}
$db_r=mysql_fetch_array(mysql_query("select level,open from SHmember where id='+ '+ '$db_id'"));
$open=$db_r[1];
$db_level=$db_r[0];
$db_ref=explode("|",$db_ref);
$refx=count($db_ref);
if($db_level==""){
$db_level='0';
}
if($open=='1'){
$name[]="<img src=member_icon/".$db_level.".gif align=absmiddle> <a href=# onclick="window.open('message_send.php?to_id=$db_id','message','width=420,height=400,scrollbars=yes')" onfocus='this.blur()'>".$db_id2."</a>";
}else{
$name[]="<img src=member_icon/".$db_level.".gif align=absmiddle> ".$db_id2;
}
$num[]=$db_num;
$tnum[]=$db_tnum;
$cost[]=$db_cost;
$tlen=strlen($db_title);
if($tlen > $Ptitle_len){
$db_title=substr($db_title,0,$Ptitle_len);
}
$db_title = "<img src=skin/$Bskin/img/icon_dot.gif width=4 height=4 align=absmiddle border=0> ".$db_title." ".$new_script;
if($re_count==0){
$db_title=$db_title;
}else{
$db_title=$db_title."<font color=#666666 class=fon11> [".$re_count."]</font>";
}
################ 링크시작
$link="board_view.php?board=$board&num=$db_num&tnum=$db_tnum&page=$page&sear=$sear&search=$search";
if($db_cost > 0){
if($ssh_id == "" or $ssh_id2 == ""){
//$db_title=$alert_login;
$link="# onclick="alert('$alert_login')"";
}else{
$link="# onclick="canfirm('$link','유료글입니다. 지불하시겠습니까? 자신이 올린 자료이거나 이미 구입하신 타인의 자료는 중복과금되지 않습니다.');"";
}
}
if($Baccess[1] > 0){
if($ssh_id == "" or $ssh_id2 == ""){
//$db_title=$alert_login;
$link="# onclick="alert('$alert_login')"";
}else{
if($Baccess[1] > $your_level){
$link="# onclick="alert('$alert_level');return false"";
}
}
}
***************** 3. rel='balloon' 적용 ****************
$title[]="<a href=$link onfocus='this.blur()' rel='balloon'>$db_title</a>";
$sign_date[]=date("Y.m.d",$db_sign_date);
$ref[]=$refx;
$board_n=mysql_result(mysql_query("select name from SHadmin_table where id='$board'"),0,0);
$board_name[]=$board_n;
}
##########################
include "skin/$Pskin/page.inc";
?>
<script>
function canfirm(dire,msge){
als = confirm(msge);
if(als == true){
document.location=dire;
}else{
return true;
}
}
</script>
<?
include "skin/$Pskin/header.inc";
include "skin/$Bskin/list.htm";
include "skin/$Pskin/footer.inc";
?>
***************** 4. 이햐 미리보기창 *****************
<div id=balloon class=balloonstyle style='padding:3;'>
<table width=100% height=30 valign=top cellpadding=5 cellspacing=0 style='border:1;'+ '><tr><td width=15%>올린이</td><td width=30%><?=$db_id2?></td><td width=15%>가격</td><td width=30%><?=$db_cost?></td></tr><tr><td width=100% colspan=4>내용 : <?=$db_comment?></td></tr></table></div>