묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
본문내용 불러들일 수가 없습니다 (왕초보)
2007.05.31 16:50
http://www.uccenglish.tv/question.gif위 첨부그림파일(http://www.uccenglish.tv)을 보시면 게시판 리스트 화면에서 balloontip 소스를 이용해 미리보기 창을 띄우는 것은 성공했으나 정작 목적인 본문을 불러들이지 못했습니다. 짐작컨데 제목인 <?=db_title?>이 아래에 정의되어 있어 뜨는 것 같은데 본문인 <?=db_comment?>는 그렇지 않아서 그런것 같습니다만 까막눈이라 전혀 알 수 가 없습니다. 참고로 본문 보여주는 파일인 board_view.php 파일에 설치하여 보았더니 되더군요. 하지만 목적은 게시판 리스트에서 제목에 마우스를 들이대면 본문내용이 보여지는 것입니다. 고수님들 답변부탁드립니다. 제발요......^^
<?
include "connect.inc";
?>
1. 여기보아주세요****************************************************************
<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 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 FROM SHboard WHERE ok=1 and $segm2 and $sear LIKE '%$search%' $order";
}
$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_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"";
}
}
}
2. 여기보아주세요********************************** 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";
?>
3. 여기보아주세요**********************************
<div id=balloon class=balloonstyle><?=$db_id?><br><?=$db_id2?><br><?=$db_email?><br><?=$db_cost?><br><?=$db_title?><br><?=$db_comment?></div>
<?
include "connect.inc";
?>
1. 여기보아주세요****************************************************************
<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 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 FROM SHboard WHERE ok=1 and $segm2 and $sear LIKE '%$search%' $order";
}
$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_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"";
}
}
}
2. 여기보아주세요********************************** 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";
?>
3. 여기보아주세요**********************************
<div id=balloon class=balloonstyle><?=$db_id?><br><?=$db_id2?><br><?=$db_email?><br><?=$db_cost?><br><?=$db_title?><br><?=$db_comment?></div>
댓글 2
-
조민
2007.05.31 17:51
-
서상기
2007.05.31 19:48
감사합니다 덕분에 성공했습니다..
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";
}
위 query2에 각각 comment를 추가해주고,
말씀하신
$db_comment=mysql_result($result,$i,10); 를
$db_comment=mysql_result($result,$i,11); 로 해봤더니 드뎌 떴습니다. 감사합니다. 조민님! 꾸벅 ^^
위에 소스밑에
$db_comment=mysql_result($result,$i,10);
이런식으로 삽입을 해 보세요..