테스트 사이트 - 개발 중인 베타 버전입니다

php 구문 질문드립니다. 채택완료

갱쿤 8년 전 조회 2,122

에디터에 글내용이 없으면 내용을 입력해주십시오. 라고 경고창이 나오는데

 

여기에 번역문구 때문에 if문을 사용하고 싶은데 어떻게 적용을 해야하는지모르겠습니다.

 

위 코드를 밑에 코드 처럼 if문을 적용하고 싶은데 적용할수있는 php 구문? 이있을까요

 

 

</p><p>//  textarea 의 값이 비어 있는지 검사 hyun</p><p>function chk_editor_js($id, $is_dhtml_editor=true)</p><p>{</p><p>    if ($is_dhtml_editor) {</p><p>        return "</p><p><span class="Apple-tab-span" style="white-space:pre">		</span>var {$id}_editor_data_txt = {$id}_editor_data.toLowerCase();\n;</p><p><span class="Apple-tab-span" style="white-space:pre">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<p\>/gi, '');\n;</p><p><span class="Apple-tab-span" style="white-space:pre">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<br\>/gi, '');\n;</p><p><span class="Apple-tab-span" style="white-space:pre">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<\/p\>/gi, '');\n;</p><p><span class="Apple-tab-span" style="white-space:pre">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/ /gi, '');\n;</p><p><span class="Apple-tab-span" style="white-space:pre">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/ /gi, '');\n;</p><p> </p><p><span class="Apple-tab-span" style="white-space:pre">		</span>if (!{$id}_editor_data_txt || !{$id}_editor_data || jQuery.inArray({$id}_editor_data.toLowerCase(), [' ','  ','   ','<p> </p>','<p>  </p>','<p>   </p>','<p>    </p>','<p>
</p>','<p></p>','
']) != -1)<span style="color: rgb(255, 108, 0);"> <span style="color: rgb(0, 0, 0);">{</span><b> alert(\"내용을 입력해 주십시오.\");</b></span> oEditors.getById['{$id}'].exec('FOCUS'); return false; }\n";</p><p>    } else {</p><p>        return "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";</p><p>    }</p><p>}</p><p> </p><p>

 

 

 

</p><p style="font-size: 14.6667px;">//  textarea 의 값이 비어 있는지 검사 hyun</p><p style="font-size: 14.6667px;">function chk_editor_js($id, $is_dhtml_editor=true)</p><p style="font-size: 14.6667px;">{</p><p style="font-size: 14.6667px;">    if ($is_dhtml_editor) {</p><p style="font-size: 14.6667px;">        return "</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;">		</span>var {$id}_editor_data_txt = {$id}_editor_data.toLowerCase();\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<p\>/gi, '');\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<br\>/gi, '');\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/\<\/p\>/gi, '');\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/ /gi, '');\n;</p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;">		</span>{$id}_editor_data_txt = {$id}_editor_data_txt.replace(/ /gi, '');\n;</p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;"><span class="Apple-tab-span" style="white-space: pre;">		</span>if (!{$id}_editor_data_txt || !{$id}_editor_data || jQuery.inArray({$id}_editor_data.toLowerCase(), [' ','  ','   ','<p> </p>','<p>  </p>','<p>   </p>','<p>    </p>','<p>
</p>','<p></p>','
']) != -1)<span style="color: rgb(255, 108, 0);"> <span style="color: rgb(0, 0, 0);">{</span><b> </b></span></p><p style="font-size: 14.6667px;"><span style="color: rgb(255, 108, 0);"><b>
</b></span></p><p style="font-size: 14.6667px;"><font color="#ff6c00"><b>if($text=="kr"){</b></font></p><p style="font-size: 14.6667px;"><b style="color: rgb(255, 108, 0); font-size: 14.6667px;">alert(\"내용을 입력해 주십시오.\");</b><font color="#ff6c00"><b>
</b></font></p><p style="font-size: 14.6667px;"><font color="#ff6c00"><b>}</b></font></p><p style="font-size: 14.6667px;"><b style="color: rgb(255, 108, 0); font-size: 14.6667px;">if($text=="en"){</b> </p><p style="font-size: 14.6667px;"><b style="color: rgb(255, 108, 0); font-size: 14.6667px;">alert(\"eeeee.\");</b><font color="#ff6c00"><b>
</b></font></p><p style="font-size: 14.6667px;"><font color="#ff6c00"><b>}</b></font></p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;"> oEditors.getById['{$id}'].exec('FOCUS'); return false; }\n";</p><p style="font-size: 14.6667px;">    } else {</p><p style="font-size: 14.6667px;">        return "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";</p><p style="font-size: 14.6667px;">    }</p><p style="font-size: 14.6667px;">}</p><p style="font-size: 14.6667px;"> </p><p style="font-size: 14.6667px;">

 

 

 

 

 

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

채택된 답변
+20 포인트
플라이
8년 전

번역문구를 어떻게 적용하기 원하시는건지  설명히 애매한 부분이 있어서 설명을 해주셔야 정확한 답변을 얻으실수 있을듯 합니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

해피정
8년 전

1. 브라우저가 실행되는 ip 대역의 국가를 비교해서 조건을 거는 방법

2. 브라우저 기본 언어를 확인해서 그것에 따라 조건을 거는 방법

3. 그외 ...

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

OrLl
8년 전

뭘물어보시는건지 잘...

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인