File name: welboard2/view.wel (7,201 bytes) Text file viewer v1.2
    1 : #!/bin/wel¢Ò
    2 : ¢Ò
    3 : /* file: view.wel¢Ò
    4 : ¢Ò
    5 :    °Ô½ÃÆÇ ³»¿ë º¸±â ÇÁ·Î±×·¥ (author: ¼­±¤Çö)¢Ò
    6 : ¢Ò
    7 :    Copyright (c) 2001/03/25 by Wesoft¢Ò
    8 :    All Rights Reserved.¢Ò
    9 : */¢Ò
   10 : ¢Ò
   11 : htmlquery("GET");¢Ò
   12 : break_on= 0;¢Ò
   13 : if(nt!="y") view_form= "view.fom";¢Ò
   14 :  else¢Ò
   15 :   {¢Ò
   16 :       prg_title= "°øÁö»çÇ×";¢Ò
   17 :       view_form= "noticeview.fom";¢Ò
   18 :   }¢Ò
   19 : if(include("include/board.inc")!=OK) return;¢Ò
   20 : ¢Ò
   21 : no= val(no);¢Ò
   22 : if(no<1)¢Ò
   23 :  {¢Ò
   24 :     MSG1= "ÀÚ·á¹øÈ£ ¿À·ù";¢Ò
   25 :     MSG2= "ÀÚ·á ¹øÈ£°¡ ¾ø°Å³ª À߸øµÇ¾ú½À´Ï´Ù." ~ BACK_BUTTON;¢Ò
   26 :     formdump(message_form);¢Ò
   27 :     return disconnect();¢Ò
   28 :  }¢Ò
   29 : ¢Ò
   30 : qstr= "select * from " ~ mytable ~ " where selno=" ~ no;¢Ò
   31 : if( (rt=mysql_getrecord(qstr,"")) < 1 )¢Ò
   32 :  {¢Ò
   33 :     if(rt==0)¢Ò
   34 :      {¢Ò
   35 :         MSG1= "ÀÚ·á°¡ ¾ø½À´Ï´Ù!";¢Ò
   36 :         MSG2= no ~ "¹øÀÇ °Ô½Ã¹°ÀÌ »èÁ¦µÇ¾ú°Å³ª ¾ø½À´Ï´Ù!" ~ BACK_BUTTON;¢Ò
   37 :         formdump(message_form);¢Ò
   38 :      }¢Ò
   39 :     return disconnect();¢Ò
   40 :  }¢Ò
   41 : readcnt= val(readcnt);¢Ò
   42 : if(val(nc)!=1)¢Ò
   43 :  {¢Ò
   44 :     ++readcnt;¢Ò
   45 :     qstr= "update " ~ mytable ~ " set readcnt=readcnt+1 where selno=" ~ no;¢Ò
   46 :     mysql_query(mysql, qstr); // Á¶È¸¼ö Áõ°¡¢Ò
   47 :  }¢Ò
   48 : focus_line= selno;¢Ò
   49 : fileseq= val(fileseq);¢Ò
   50 : wdtime= mid(insert_week(wdtime),3);¢Ò
   51 : mdtime= mid(insert_week(mdtime),3);¢Ò
   52 : depth= len(answer);¢Ò
   53 : if(depth==0) kind= "°Ô½Ã±Û";¢Ò
   54 :  else¢Ò
   55 :   {¢Ò
   56 :      kind= "´äº¯±Û";¢Ò
   57 :      if(depth>1) kind~= "-" ~ depth;¢Ò
   58 :   }¢Ò
   59 : if(depth>=20) answer_button= 0; else answer_button= 1;¢Ò
   60 : answer_len= len(answer);¢Ò
   61 : cond= "grpno=" ~ grpno ~ " and substring(answer,1," ~ answer_len ~ ")='"¢Ò
   62 :     ~ answer ~ "' and length(answer)> " ~ answer_len;¢Ò
   63 : answer_cnt= get_recount(mytable, cond);¢Ò
   64 : if(answer_cnt>0)¢Ò
   65 :  {¢Ò
   66 :     answer_desc= " ´äº¯¼ö( <font color=#f00000>" ~ answer_cnt ~ "</font> )";¢Ò
   67 :  }¢Ò
   68 : if(wid==ckid || us_class=="A")¢Ò
   69 :  {¢Ò
   70 :     if(read_only==0 || write_answer==1 && depth>0) mflag= 1;¢Ò
   71 :  }¢Ò
   72 : if(attfile=="")¢Ò
   73 :   {¢Ò
   74 :      icon= "";¢Ò
   75 :      if(viewboard_flag!="") include("include/extension.var");¢Ò
   76 :   }¢Ò
   77 :  else¢Ò
   78 :   {¢Ò
   79 :      ext= 0;¢Ò
   80 :      for(i=len(attfile); i>=1; i--)¢Ò
   81 :       {¢Ò
   82 :          if(mid(attfile, i, 1)==".") { ext= i + 1; break; }¢Ò
   83 :       }¢Ò
   84 :      IconFile= "unknown.gif", IconRemark= "¾Ë¼ö¾ø´Â ÆÄÀÏ";¢Ò
   85 :      if(ext>0)¢Ò
   86 :       {¢Ò
   87 :          include("include/extension.var");¢Ò
   88 :          extension= tolower(mid(attfile, ext)); // ÆÄÀÏÀÇ È®ÀåÀÚ ¾ò±â¢Ò
   89 :          NewIcon= parser("ext_"~extension,-1); // È®Àå¸í¿¡ ´ëÇÑ ¾ÆÀÌÄÜ¢Ò
   90 :          NewRemark= parser("remark_" ~ extension,-1); // È®Àå¸í ¼³¸í¢Ò
   91 :          if(NewIcon!="") IconFile= NewIcon, IconRemark= NewRemark;¢Ò
   92 :       }¢Ò
   93 :      downicon= "<img src='icon/" ~ IconFile ~ "' title='" ~ IconRemark ~ "'>";¢Ò
   94 :   }¢Ò
   95 : content_fch= "\n", content_rch= "\n<br>";¢Ò
   96 : if(accept_html!=1)¢Ò
   97 :  {¢Ò
   98 :     content_fch~= "|" ~ html_fch, content_rch~= "|" ~ html_rch;¢Ò
   99 :     if(accept_html==2)¢Ò
  100 :      {¢Ò
  101 :         content_fch= "<&|" ~ content_fch;¢Ò
  102 :         content_rch= "<|" ~ content_rch;¢Ò
  103 :      }¢Ò
  104 :  }¢Ò
  105 : red_keyword= "<font color=red>" ~ k ~ "</font>";¢Ò
  106 : if(cc==1 && k!="")¢Ò
  107 :  {¢Ò
  108 :     content_fch~= "|" ~ k;¢Ò
  109 :     content_rch~= "|" ~ red_keyword;¢Ò
  110 :  }¢Ò
  111 : if(accept_html!=2) content= strchange(content, content_fch, content_rch);¢Ò
  112 :   else content=strchange(content,content_fch,content_rch,"[HTML]","[/HTML]");¢Ò
  113 : writer= strchange(wname, html_fch, html_rch);¢Ò
  114 : if(wemail!="")¢Ò
  115 :  {¢Ò
  116 :     writer= "<a href=\"javascript:gomail2('" ~ wname ~ "','" ~ wemail¢Ò
  117 :           ~ "')\" title=\"" ~ wemail ~ " \">" ~ writer ~ "</a>";¢Ò
  118 :  }¢Ò
  119 : writer= "ÀÛ¼º: " ~ writer;¢Ò
  120 : write_info= wdtime ~ " (" ~ wip ~ ") " ~ whost;¢Ò
  121 : if(mdtime!="")¢Ò
  122 :  {¢Ò
  123 :     modifier= strchange(mname, html_fch, html_rch);¢Ò
  124 :     if(memail!="")¢Ò
  125 :      {¢Ò
  126 :        modifier= "<a href=\"javascript:gomail2('" ~ mname ~ "','" ~ memail¢Ò
  127 :                ~ "')\" title=\"" ~ memail ~ " \">" ~ modifier ~ "</a>";¢Ò
  128 :      }¢Ò
  129 :     modifier= "<br>¼öÁ¤: " ~ modifier;¢Ò
  130 :     modify_info= "<br>" ~ mdtime ~ " (" ~ mip ~ ") " ~ mhost;¢Ò
  131 :  }¢Ò
  132 : wemail= strchange(wemail, html_fch, html_rch);¢Ò
  133 : memail= strchange(memail, html_fch, html_rch);¢Ò
  134 : edit_subject= strchange(subject, html_fch, html_rch);¢Ò
  135 : ¢Ò
  136 : if(attfile!="")¢Ò
  137 :  {¢Ò
  138 :     if(fileseq==0) real_attfile= attfile;¢Ò
  139 :       else real_attfile= fileseq ~ "-" ~ attfile; // ÀúÀåµÈ ½ÇÁ¦ ÆÄÀϸí¢Ò
  140 :     download_file= "upload/" ~ db ~ "/" ~ real_attfile;¢Ò
  141 :     if(!fexist(download_file)) fsize= "";¢Ò
  142 :      else fsize= bytes_str(fsizeof(download_file), 2);¢Ò
  143 :  }¢Ò
  144 : if(cn+cs+cc==0) cn= 0, cs= cc= 1; // À̸§(x), Á¦¸ñ(o), ³»¿ë(o)¢Ò
  145 : cond= "";¢Ò
  146 : if(k!="")¢Ò
  147 :  {¢Ò
  148 :     kk= strchange(k, fch, rch);¢Ò
  149 :     if(cn==1) cond= "wname like '%" ~ kk ~ "%'";¢Ò
  150 :     if(cs==1)¢Ò
  151 :      {¢Ò
  152 :         if(cond!="") cond~= " or ";¢Ò
  153 :         cond~= "subject like '%" ~ kk ~ "%'";¢Ò
  154 :      }¢Ò
  155 :     if(cc==1)¢Ò
  156 :      {¢Ò
  157 :         if(cond!="") cond~= " or ";¢Ò
  158 :         cond~= "content like '%" ~ kk ~ "%'";¢Ò
  159 :      }¢Ò
  160 :  }¢Ò
  161 : now_recnt= get_recount(mytable, cond);¢Ò
  162 : tot_page= now_recnt / pagerec;¢Ò
  163 : if(now_recnt%pagerec>0) tot_page++;¢Ò
  164 : vno= vn= val(vn), now_start= now_recnt - vno;¢Ò
  165 : pg= tot_page - (now_recnt - vno) / pagerec;¢Ò
  166 : prev_vno= vno + 1, prev_start= now_start - 1;¢Ò
  167 : next_vno= vno - 1, next_start= now_start + 1;¢Ò
  168 : if(prev_vno>now_recnt) prev_vno= 0;¢Ò
  169 : next_qstr= prev_qstr= "select selno,answer,subject from " ~ mytable;¢Ò
  170 : if(cond!="")¢Ò
  171 :  {¢Ò
  172 :     prev_qstr~= " where " ~ cond;¢Ò
  173 :     next_qstr~= " where " ~ cond;¢Ò
  174 :  }¢Ò
  175 : order= " order by grpno desc, answer asc limit ";¢Ò
  176 : prev_qstr~= order ~ prev_start ~ ",1";¢Ò
  177 : next_qstr~= order ~ next_start ~ ",1";¢Ò
  178 : ¢Ò
  179 : prev_selno= "";¢Ò
  180 : prev_kind= next_kind= spc= "&nbsp;";¢Ò
  181 : if(prev_vno>0)¢Ò
  182 :  {¢Ò
  183 :     qstr= prev_qstr;¢Ò
  184 :     if( (rt=mysql_getrecord(qstr,"prev_")) < 0 ) return;¢Ò
  185 :     if(rt>0)¢Ò
  186 :      {¢Ò
  187 :         depth= len(prev_answer);¢Ò
  188 :         if(depth==0) prev_indent= "", prev_kind= "°Ô½Ã±Û";¢Ò
  189 :          else¢Ò
  190 :           {¢Ò
  191 :              prev_indent= strep(spc,depth*4-4) ~ "<img src='icon/tag.gif'>";¢Ò
  192 :              prev_kind= "´äº¯±Û";¢Ò
  193 :              if(depth>1) prev_kind~= "-" ~ depth;¢Ò
  194 :           }¢Ò
  195 :         prev_subject= strchange(prev_subject, html_fch, html_rch);¢Ò
  196 :         if(cs==1&&k!="") prev_subject= strchange(prev_subject,k,red_keyword);¢Ò
  197 :      }¢Ò
  198 :  }¢Ò
  199 : ¢Ò
  200 : next_selno= "";¢Ò
  201 : if(next_vno>0)¢Ò
  202 :  {¢Ò
  203 :     qstr= next_qstr;¢Ò
  204 :     if( (rt=mysql_getrecord(qstr,"next_")) < 0 ) return;¢Ò
  205 :     if(rt>0)¢Ò
  206 :      {¢Ò
  207 :         depth= len(next_answer);¢Ò
  208 :         if(depth==0) next_indent= "", next_kind= "°Ô½Ã±Û";¢Ò
  209 :          else¢Ò
  210 :           {¢Ò
  211 :              next_indent= strep(spc,depth*4-4) ~ "<img src='icon/tag.gif'>";¢Ò
  212 :              next_kind= "´äº¯±Û";¢Ò
  213 :              if(depth>1) next_kind~= "-" ~ depth;¢Ò
  214 :           }¢Ò
  215 :         next_subject= strchange(next_subject, html_fch, html_rch);¢Ò
  216 :         if(cs==1&&k!="") next_subject= strchange(next_subject,k,red_keyword);¢Ò
  217 :      }¢Ò
  218 :  }¢Ò
  219 : if(viewboard_flag!="")¢Ò
  220 :   {¢Ò
  221 :      view_cpright= logo_img= "&nbsp;";¢Ò
  222 :      home_link= back_link= "";¢Ò
  223 :   }¢Ò
  224 :  else¢Ò
  225 :   {¢Ò
  226 :      view_cpright= cpright;¢Ò
  227 :      logo_img= "<img src='icon/logo.gif' border=0>";¢Ò
  228 :      if(back_url!="")¢Ò
  229 :       {¢Ò
  230 :          back_link= "<a href='"~back_url~"'";¢Ò
  231 :          if(back_target!="") back_link~= " target='"~back_target ~ "'";¢Ò
  232 :          back_link~= " onMouseover=\"onoff('back','icon/back1.gif')\""¢Ò
  233 :                    ~ " onMouseout=\"onoff('back')\">"¢Ò
  234 :                    ~ "<img src='icon/back0.gif' border=0 name='back'></a>";¢Ò
  235 :       }¢Ò
  236 :      if(home_url!="")¢Ò
  237 :       {¢Ò
  238 :          home_link= "<a href='"~home_url~"'";¢Ò
  239 :          if(home_target!="") home_link~= " target='"~home_target ~ "'";¢Ò
  240 :          home_link~= " onMouseover=\"onoff('home','icon/home1.gif')\""¢Ò
  241 :                    ~ " onMouseout=\"onoff('home')\">"¢Ò
  242 :                    ~ "<img src='icon/home0.gif' border=0 name='home'></a>";¢Ò
  243 :       }¢Ò
  244 :  }¢Ò
  245 : fm= formdump(skin~view_form);¢Ò
  246 : if(fm==FORM_OPENERR) return err_form(view_form);¢Ò
  247 : return disconnect();¢Ò
File name: welboard2/view.wel (7,201 bytes) Wesoft Corp. ¨Ï 2001 All rights reserved.