|
||||
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= " ";¢Ò 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(" ",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= " ";¢Ò 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;¢Ò |
||||
|