문의드립니다. 채택완료
아래 사진과같이 글쓰기에서 단어가 겹치면 박스처리해서 텍스트를 입력할수있게 만들었습니다.
그런데 type란 단어만 들어가면 다른박스까지 속성이 다보이네요
뿌려질때 input type 이 type이란 정답하고 겹쳐서 그런것같은데 방법이 없을까요

아래는 소스 입니다.
view.skin.php
에
$question = $view[wr_8]; if($view[wr_9]) { $len = strlen($view[wr_9]); ?>
$question = str_replace(trim($view[wr_9]), "", $question)?>
}?>
if($view[wr_10]) { $len = strlen($view[wr_10]); ?>
$question = str_replace(trim($view[wr_10]), "", $question)?>
}?>
if($view[wr_11]) { $len = strlen($view[wr_11]); ?>
$question = str_replace(trim($view[wr_11]), "", $question)?>
}?>
if($view[wr_12]) { $len = strlen($view[wr_12]); ?>
$question = str_replace(trim($view[wr_12]), "", $question)?>
}?>
if($view[wr_13]) { $len = strlen($view[wr_13]); ?>
$question = str_replace(trim($view[wr_13]), "", $question)?>
}
echo $question;
?>
------------write.skin.php에----------------
답변 3개
따옴표가 제대로 닫히지 않았거나 하는 코딩오류가 있었을것 같네요.
한번 꺽쇠가 제대로 닫혔는지, 따옴표가 제대로 닫혔는지등을 보시면 해결이 될 것 같네요.
해당 코드를 올려주시면 봐드리겠습니다.
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
</p><p>$question = str_replace(trim($view[wr_13]), "<input type=text name=anwser5 id=anwser5 size=$len>", $question) </p><p>
요 구문에 문제가 있는것 같습니다.
str_replace(찾을문자, 변경할문자, 원본 문자)
이런것인데
str_replace('type', '
이런형식이 되어버리면
</p><p><input type=text ...></p><p><input type=text ...></p><p>
이런 문자열들은
</p><p><input <input <input type=text ...>>> </p><p>
이런식으로 되어버립니다.
저 구문을 좀 수정하셔야겠네요.
댓글을 작성하려면 로그인이 필요합니다.
view.skin.php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$level = Array();
$level[1]['level'] = "초급";
$level[2]['level'] = "초중급";
$level[3]['level'] = "중급";
$level[4]['level'] = "중고급";
$level[5]['level'] = "고급";
$level[1]['link'] = $g4[path]."/images/1btn9.gif";
$level[2]['link'] = $g4[path]."/images/1btn10.gif";
$level[3]['link'] = $g4[path]."/images/1btn11.gif";
$level[4]['link'] = $g4[path]."/images/1btn12.gif";
$level[5]['link'] = $g4[path]."/images/1btn13.gif";
$category = Array();
$category['n'] = "News";
$category['be'] = "Business&Economy";
$category['et'] = "Entertainment";
$category['it'] = "IT&New Technology";
$category['cl'] = "Culture&Life";
$category['se'] = "Science&Ecology";
$category['t'] = "Travel";
$category['is'] = "Interview&Speech";
?>
.view { width:=$width?>px; }
.view td.movie-holder { width:=$width?>px; }
.movie-holder .movie { width:395px; height:339px; float:left; }
.movie-holder .movie-desc { width:418px; height:339px; margin-left:14px; float:left; }
.movie-holder .movie-desc .caption-tab-holder { width:418px; height:35px; }
.caption-tab { width:96px; height:35px; float:left; }
.movie-holder .movie-desc .caption-tab-content-holder { width:418px; height:300px; overflow:hidden; border-top:2px solid #838383; border-bottom:2px solid #838383; }
.caption-tab-content-holder .caption-tab-content { width:418px; height:300px; display:none; }
.caption-tab-content-holder .caption-tab-content .cation { width:378px; height:270px; background:red; line-height:20px; position:relative; margin-left:20px; }
.view td.lab-holder { width:=$width?>px; }
.view td.lab-holder .lab-tab-holder { width:=$width?>px; height:35px; font-size:0; position:relative; top:1px; }
.lab-tab-holder .lab-tab { width:129px; height:35px; float:left; }
.view td.lab-holder .lab-tab-content-holder { width:=$width?>px; height:324px; border:1px solid #c0c0c0; }
.view td.lab-holder .lab-tab-content-holder .lab-tab-content { width:=$width?>px; height:324px; display:none; }
.view td.lab-holder .lab-tab-content-holder .lab-tab-content .lab-keypoint { width:787px; height:314px; margin-top:10px; margin-left:20px; }
.view td.lab-holder .lab-tab-content-holder .lab-tab-content .dictation { width:787px; height:116px; border-bottom:1px dotted #878787; margin-top:10px; margin-left:20px; }
.view td.lab-holder .lab-tab-content-holder .lab-tab-content .anwser-holder { width:787px; height:177px; font-size:12px; margin-top:10px; margin-left:20px; }
.view td.lab-holder .lab-tab-content-holder .lab-tab-content .anwser-holder #answer { width:787px; height:177px; line-height:30px; font-size:12px; font-weight:700; display:none; }
}?>
// 코멘트 입출력 //include_once("./view_comment.php"); ?>
=$link_buttons?>
}?>
|
function file_download(link, file) {
if ($board[bo_download_point] < 0) { ?>if (confirm("'"+decodeURIComponent(file)+"' 파일을 다운로드 하시면 포인트가 차감(=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))}?>
document.location.href=link;
}
window.onload=function() {
resizeBoardImage(=(int)$board[bo_image_width]?>);
drawFont();
var oBody = document.body;
var minHeight = 915; //document의 최소높이
var tmpHeight = oBody.scrollHeight; // + (oBody.offsetHeight-oBody.clientHeight);
if(tmpHeight < minHeight) tmpHeight = window.innerHeight;
if(tmpHeight < minHeight) tmpHeight = minHeight;
$("#page").css("height",tmpHeight+"px");
$("#left").css("height",tmpHeight+"px");
$("#wrap3").css("height",tmpHeight+"px");
}
-----write.skin.php-----------
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if ($is_dhtml_editor) {
include_once("$g4[path]/lib/cheditor4.lib.php");
echo "";
echo cheditor1('wr_content', '100%', '250');
echo cheditor1('wr_3', '100%', '100');
}
$title_msg = "동영상올리기";
?>
.write_head { height:30px; text-align:center; color:#8492A0; }
.field { border:1px solid #ccc; }
// 글자수 제한
var char_min = parseInt(=$write_min?>); // 최소
var char_max = parseInt(=$write_max?>); // 최대
with (document.fwrite)
{
if (typeof(wr_name) != "undefined")
wr_name.focus();
else if (typeof(wr_subject) != "undefined")
wr_subject.focus();
else if (typeof(wr_content) != "undefined")
wr_content.focus();
if (typeof(ca_name) != "undefined")
if (w.value == "u")
ca_name.value = "=$write[ca_name]?>";
}
function html_auto_br(obj)
{
if (obj.checked) {
result = confirm("자동 줄바꿈을 하시겠습니까?\n\n자동 줄바꿈은 게시물 내용중 줄바뀐 곳을 태그로 변환하는 기능입니다.");
if (result)
obj.value = "html2";
else
obj.value = "html1";
}
else
obj.value = "";
}
function fwrite_submit(f)
{
/*
var s = "";
if (s = word_filter_check(f.wr_subject.value)) {
alert("제목에 금지단어('"+s+"')가 포함되어있습니다");
return false;
}
if (s = word_filter_check(f.wr_content.value)) {
alert("내용에 금지단어('"+s+"')가 포함되어있습니다");
return false;
}
*/
if (document.getElementById('char_count')) {
if (char_min > 0 || char_max > 0) {
var cnt = parseInt(document.getElementById('char_count').innerHTML);
if (char_min > 0 && char_min > cnt) {
alert("내용은 "+char_min+"글자 이상 쓰셔야 합니다.");
return false;
}
else if (char_max > 0 && char_max < cnt) {
alert("내용은 "+char_max+"글자 이하로 쓰셔야 합니다.");
return false;
}
}
}
if (document.getElementById('tx_wr_content')) {
if (!ed_wr_content.outputBodyText()) {
alert('내용을 입력하십시오.');
ed_wr_content.returnFalse();
return false;
}
}
var subject = "";
var content = "";
$.ajax({
url: "=$board_skin_path?>/ajax.filter.php",
type: "POST",
data: {
"subject": f.wr_subject.value,
"content": f.wr_content.value
},
dataType: "json",
async: false,
cache: false,
success: function(data, textStatus) {
subject = data.subject;
content = data.content;
}
});
if (subject) {
alert("제목에 금지단어('"+subject+"')가 포함되어있습니다");
f.wr_subject.focus();
return false;
}
if (content) {
alert("내용에 금지단어('"+content+"')가 포함되어있습니다");
if (typeof(ed_wr_content) != "undefined")
ed_wr_content.returnFalse();
else
f.wr_content.focus();
return false;
}
if (!check_kcaptcha(f.wr_key)) {
return false;
}
document.getElementById('btn_submit').disabled = true;
document.getElementById('btn_list').disabled = true;
if ($g4[https_url])
echo "f.action = '$g4[https_url]/$g4[bbs]/write_update.php';";
else
echo "f.action = './write_update.php';";
?>
return true;
}
window.onload=function() {
drawFont();
var oBody = document.body;
var minHeight = 915; //document의 최소높이
var tmpHeight = oBody.scrollHeight; // + (oBody.offsetHeight-oBody.clientHeight);
if(tmpHeight < minHeight) tmpHeight = window.innerHeight;
if(tmpHeight < minHeight) tmpHeight = minHeight;
$("#page").css("height",tmpHeight+"px");
$("#left").css("height",tmpHeight+"px");
$("#wrap3").css("height",tmpHeight+"px");
}
echo "$(\"select[name=\'ca_name\']\").val('$write[ca_name]');";
}?>
if ($is_dhtml_editor) echo cheditor3('wr_content');
if ($is_dhtml_editor) echo cheditor3('wr_3'); //추가
?>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인




혹시몰라 전체소스를 답변에 넣어놓을게요 좀봐주시면 정말 감사합니다.ㅠㅠ