File name: welboard2/include/board.sub (5,054 bytes) Text file viewer v1.2
    1 : /* file: board.sub
    2 : 
    3 :    게시판 부 프로그램 (author: 서광현)
    4 : 
    5 :    Copyright (c) 2001/03/25 by Wesoft
    6 :    All Rights Reserved.
    7 : */
    8 : 
    9 : if(cn+cs+cc==0) cn= 0, cs= cc= 1; // 이름(x), 제목(o), 내용(o)
   10 : if(cn==1) cn_chked= " checked"; // cn 은 이름으로 찾기 체크박스 변수
   11 : if(cs==1) cs_chked= " checked"; // cs 는 제목으로 찾기 체크박스 변수
   12 : if(cc==1) cc_chked= " checked"; // cc 는 내용으로 찾기 체크박스 변수
   13 : cnflag= csflag= ccflag= 0;
   14 : cond= "";
   15 : if(k!="")
   16 :  {
   17 :     kk= strchange(k, fch, rch);
   18 :     if(cn==1) cnflag= 1, cond= "wname like '%" ~ kk ~ "%'";
   19 :     if(cs==1)
   20 :      {
   21 :         csflag= 1;
   22 :         if(cond!="") cond~= " or ";
   23 :         cond~= "subject like '%" ~ kk ~ "%'";
   24 :      }
   25 :     if(cc==1)
   26 :      {
   27 :         ccflag= 1;
   28 :         if(cond!="") cond~= " or ";
   29 :         cond~= "content like '%" ~ kk ~ "%'";
   30 :      }
   31 :  }
   32 : 
   33 : keyword= k;
   34 : red_keyword= "<font color=red>" ~ keyword ~ "</font>";
   35 : k= queryencode(keyword);
   36 : fm= formopen(skin~"board.fom");
   37 : if(fm==FORM_OPENERR) return err_form("board.fom");
   38 : 
   39 : tot_recnt= get_recount(mytable, "");
   40 : if(tot_recnt<0)
   41 :  {
   42 :      MSG1= "게시판 명칭 오류";
   43 :      MSG2= "게시판 이름이 없거나 만들어지지 않았습니다!"
   44 :          ~ BACK_BUTTON;
   45 :      formdump(message_form);
   46 :      return disconnect();
   47 :  }
   48 : now_recnt= get_recount(mytable, cond);
   49 : 
   50 : tot_page= now_recnt / pagerec;
   51 : if(now_recnt%pagerec>0) tot_page++;
   52 : if(pg=="") view_page= tot_page; else view_page= val(pg);
   53 : if(view_page<1) view_page= 1;
   54 :  else if(view_page>tot_page) view_page= tot_page;
   55 : pg= view_page;
   56 : start_rec= (tot_page - view_page) * pagerec;
   57 : vno= now_recnt - start_rec;
   58 : 
   59 : qstr= "select selno,answer,subject,content,attfile,readcnt,downcnt,"
   60 :     ~ "wdtime,wname,wemail,mname,memail from " ~ mytable;
   61 : if(cond!="") qstr~= " where " ~ cond;
   62 : qstr~= " order by grpno desc, answer asc limit " ~ start_rec ~ "," ~ pagerec;
   63 : if( (rt=mysql_getrecord(qstr,"")) < 0 ) return;
   64 : fcontent_fch= "<&|[HTML]|[/HTML]";
   65 : fcontent_rch= "<||";
   66 : while(rt>0)
   67 :  {
   68 :     if(mname!="") wname= mname;
   69 :     if(memail!="") wemail= memail;
   70 :     wdtime= left(mid(wdtime, 3), 8);
   71 :     readcnt= val(readcnt);
   72 :     if(list_few_content==1)
   73 :      {
   74 :         temp= ltrim(left(content, 1024));
   75 :         if(accept_html==2) temp= strchange(temp, fcontent_fch, fcontent_rch);
   76 :         if(accept_html==0) fcontent= left(temp, 151) ~ " "; // 한글 깨짐 방지
   77 :           else fcontent= htmldeltag(temp, 151) ~ " "; // 한글 깨짐 방지
   78 :         if(len(fcontent)>150) fcontent= left(fcontent, 150, 1) ~ "...";
   79 :         fcontent= strchange(fcontent, "'", "`");
   80 :      }
   81 :     if(us_class!="A")
   82 :      {
   83 :         if(answer=="") IconFile= "posted.gif"; else IconFile= "answer.gif";
   84 :         IconRemark= vno ~ "번(등록번호: " ~ selno ~ ")";
   85 :         icon= "<img src='icon/"~IconFile~"' title='"~IconRemark~"'> ";
   86 :      }
   87 :     else
   88 :      {
   89 :         icon= "<a href='javascript:godel(" ~ selno ~ "," ~ vno
   90 :             ~ ")'><img src='icon/delete.gif' title='삭제하기' border=0></a> ";
   91 :      }
   92 :     if(attfile=="") downicon= downcnt= "&nbsp;";
   93 :      else
   94 :       {
   95 :          ext= 0;
   96 :          downcnt= val(downcnt);
   97 :          for(i=len(attfile); i>=1; i--)
   98 :           {
   99 :              if(mid(attfile, i, 1)==".") { ext= i + 1; break; }
  100 :           }
  101 :          IconFile= "unknown.gif", IconRemark= "알수없는 파일";
  102 :          if(ext>0)
  103 :           {
  104 :              extension= tolower(mid(attfile, ext)); // 파일의 확장자 얻기
  105 :              NewIcon= parser("ext_"~extension,-1); // 확장명에 대한 아이콘
  106 :              NewRemark= parser("remark_" ~ extension,-1); // 확장명 설명
  107 :              if(NewIcon!="") IconFile= NewIcon, IconRemark= NewRemark;
  108 :           }
  109 :          IconRemark~= ": " ~ strchange(attfile, "'", "`");
  110 :          downicon= "<a href='javascript:godown(" ~ selno ~ ")'>"
  111 :                  ~ "<img src='icon/" ~ IconFile ~ "' title='"
  112 :                  ~ IconRemark ~ " 다운받기' border=0></a>";
  113 :       }
  114 :     depth= len(answer);
  115 :     if(depth==0) indent= "";
  116 :      else indent= strep("&nbsp;",depth*4-4)~"<img src='icon/tag.gif'>";
  117 :     if(cnflag==0) edit_wname= wname;
  118 :       else
  119 :        {
  120 :           edit_wname= strchange(wname, html_fch, html_rch);
  121 :           edit_wname= strchange(edit_wname, keyword, red_keyword);
  122 :        }
  123 :     subject= strchange(subject, html_fch, html_rch);
  124 :     if(csflag==1) subject= strchange(subject, keyword, red_keyword);
  125 :     formmerge(0);
  126 :     vno--;
  127 :     if( (rt=mysql_nextrecord())==MYSQL_ERR ) return;
  128 :  }
  129 : vno= wdtime= readcnt= downicon= downcnt= "&nbsp;";
  130 : logo_img= "<img src='icon/logo.gif' border=0>";
  131 : if(back_url!="")
  132 :  {
  133 :     back_link= "<a href='"~back_url~"'";
  134 :     if(back_target!="") back_link~= " target='"~back_target ~ "'";
  135 :     back_link~= " onMouseover=\"onoff('back','icon/back1.gif')\""
  136 :               ~ " onMouseout=\"onoff('back')\">"
  137 :               ~ "<img src='icon/back0.gif' border=0 name='back'></a>";
  138 :  }
  139 : if(home_url!="")
  140 :  {
  141 :     home_link= "<a href='"~home_url~"'";
  142 :     if(home_target!="") home_link~= " target='"~home_target ~ "'";
  143 :     home_link~= " onMouseover=\"onoff('home','icon/home1.gif')\""
  144 :               ~ " onMouseout=\"onoff('home')\">"
  145 :               ~ "<img src='icon/home0.gif' border=0 name='home'></a>";
  146 :  }
  147 : formdump();
  148 : formclose();
  149 : return;
File name: welboard2/include/board.sub (5,054 bytes) Wesoft Corp. ⓒ 2001 All rights reserved.