주소에서 http:// 없애는 방법좀 ... 정보
그누보드 주소에서 http:// 없애는 방법좀 ...본문
<?if ($link[$i][link1]) {?>
<a href='<?=$link[$i][link_href1]?>' title='<?=$list[$i][subject]?>' target=_blank>
<?=set_http(get_text(cut_str($link[$i][link2], 45)))?>
</a>
<?}?>
링크2주소를 링크1의 주소로 이동하게끔 했는데요.
메인화면에서 주소가 http://www.sir.co.kr 이런식으로 보이는데....
좀더 깔끔하게하려구 http:// <---- 이부분을 없애구 싶은데 어떻게 해야되죠?
<a href='<?=$link[$i][link_href1]?>' title='<?=$list[$i][subject]?>' target=_blank>
<?=set_http(get_text(cut_str($link[$i][link2], 45)))?>
</a>
<?}?>
링크2주소를 링크1의 주소로 이동하게끔 했는데요.
메인화면에서 주소가 http://www.sir.co.kr 이런식으로 보이는데....
좀더 깔끔하게하려구 http:// <---- 이부분을 없애구 싶은데 어떻게 해야되죠?
댓글 전체
다행입니다... 휴~
즐거운 날 되세요... ^^
즐거운 날 되세요... ^^
오장원님 정말 감사합니다. 포기하고 그냥 쓸까 했는데....
<?=substr($link[$i][link2],7,45)?> <----- 이렇게 하니깐 되네요....^^
<?=substr($link[$i][link2],7,45)?> <----- 이렇게 하니깐 되네요....^^
또는
<?=substr($link[$i][link2],7,45)?>
<?=substr($link[$i][link2],7,45)?>
아 죄송합니다...
<?=get_text(substr($link[$i][link2],7,45))?> 이렇게 해보세요...
음...
제발 성공하시기를....이궁...
<?=get_text(substr($link[$i][link2],7,45))?> 이렇게 해보세요...
음...
제발 성공하시기를....이궁...
gblist.skin.php파일이구요.
<?=get_text(sub_str($link[$i][link2],7,45))?> 이걸루 하니깐 아래의 에러가 뜹니다.
Fatal error: Call to undefined function: sub_str() in e:\rio\cart\bbs\skin\board\cart\gblist.skin.php on line 72
gblist.skin.php파일이구요.
<?
$user_max_img=$width-20; // 이미지 가로폭 최대 크기
$king_secret="<font color=#9EB8CC>이 글은 비밀글 입니다. </font>"; // 비밀글일때 표시할 내용.
$cmt_width=$width-150; //코멘트 테이블크기
?>
<style>.wings {padding:5 5 0 5; line-height:19px; }</style>
<table width='<?=$width?>' align=center border=0 cellpadding=0 cellspacing=0>
<tr>
<td width="190" valign="top">
<!------ 좌측 소분류 + 글쓰기 시작 ---------->
<table width="190" border="0" cellpadding="0" cellspacing="0">
<form name=fcategory method=get action='<?="./"?>'>
<input type=hidden name=doc value='<?=$doc?>'>
<tr>
<td width="190" height=600 valign="top" background='http://localhost/cart/bbs/skin/board/cart/main_left_bg.gif'>
<br><br>
<?
if ($is_category) {
echo "<input type=hidden name=ca_id>";
echo get_category_list("$cfg[write_table_prefix]$bo_table",$category_location);
}
?>
</td>
</form>
</tr>
<TR><TD>
<? if ($admin_href) { echo "<a href='$admin_href'>a</a> "; } ?>
<? if ($write_href) { echo "<a href='$write_href'>w</a> "; } ?>
</TD></TR>
</table>
<!------ 좌측 소분류 + 글쓰기 끝 ---------->
</td>
<td width="4"></td>
<td width=1 background="http://localhost/index_images/right_block.gif"></td>
<td valign="top">
<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td height=1 background="http://localhost/index_images/right_block.gif"></td></tr></table>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=sselect value='<?=$sselect?>'>
<input type=hidden name=stext value='<?=$stext?>'>
<input type=hidden name=section value='<?=$section?>'>
<input type=hidden name=page value='<?=$page?>'>
<? for ($i=0; $i<count($list); $i++) { // 리스트 반복 시작 ?>
<? include "$board_skin/_set.php"; ?>
<tr>
<td>
<!------ 수정 + 삭제 + 게시물내용 시작------>
<TABLE width=100% height=70 border=0 cellpadding=0 cellspacing=0 style='table-layout:fixed;'>
<TR><TD width=90></TD><TD width=1></TD><TD align=right>
<? if ($update_href) { echo "<a href=\"$update_href\">m</a> ";} ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\">d</a> ";} ?>
</TD></TR>
<TR>
<TD width=90 class=wings>
<?if ($link[$i][link1]) {?>
<a href='<?=$link[$i][link_href1]?>' target=_blank>
<span><?=$list[$i][subject]?></span>
</a>
<?}?>
</TD>
<td width=1 background="http://localhost/index_images/right_block.gif"></td>
<TD valign="top" class=wings>
######################## 이부분입니다 .######################
<?if ($link[$i][link1]) {?>
<a href='<?=$link[$i][link_href1]?>' title='<?=$list[$i][subject]?>' target=_blank>
<?=get_text(sub_str($link[$i][link2],7,45))?>
</a>
<?}?>
<br>
<?
$it_is_secret=0; // 지금문서가..비밀글인지..
if( $list[$i][file_image1] ) // 이미지가 있을때..크기 설정
{
$size=GetImageSize($list[$i][file_image1]);
$img_x_size=$size[0];
$img_y_size=$size[1];
$per=1;
if( $img_x_size > $user_max_img )
{
$per = $user_max_img / $img_x_size;
$img_x_size=$user_max_img;
$img_y_size=$img_y_size*$per;
$size = "width = $img_x_size height = $img_y_size";
}
}
if($list[$i][wr_secret]&&!$is_admin) //관리자는 내용이 바로 보이게
$it_is_secret=1;
?>
<?
if($it_is_secret) echo $king_secret;
else
{
if($list[$i][file_image1])
echo "<a href=\"javascript:;\" OnClick=\"popupImage('{$list[$i][file_image1]}')\" onFocus=\"this.blur();\"><img src='{$list[$i][file_image1]}' $size style='border-color:#333333;' border=1></a><p>";
echo "<span class='tt'>{$list[$i][content]}</span><br>";
}
?>
</TD>
</TR>
</TABLE>
<!------ 수정 + 삭제 + 게시물내용 끝------>
</td>
</tr>
<tr><td height=1 background="http://localhost/index_images/right_block.gif" colspan=3></td></tr>
<? } // 리스트 반복 끝 ?>
</table>
<table width=100%>
<tr><td align=left>
<? if ($prev_section_href) { echo "<a href='$prev_section_href'>이전검색</a>"; } ?>
<?=$write_pages?>
<? if ($next_section_href) { echo "<a href='$next_section_href'>다음검색</a>"; } ?>
</td></tr>
</table>
<? if ($stext) { ?>
<script language='JavaScript'>
if ('<?=$sselect?>' == 'ca_id') {
document.fcategory.ca_id.value = '<?=$stext?>';
document.fsearch.stext.value = '';
} else {
document.fsearch.sselect.value = '<?=$sselect?>';
}
</script>
<? } ?>
</td>
<td width=1 background="http://localhost/index_images/right_block.gif"></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=yes,width=100,height=100,top=100,left=50");
imageHandle.document.write("<title>Image View</title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+9,this.height+28);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
function show_cmt_write(name, id) {
var layer = document.getElementById(name+id);
layer.style.display = (layer.style.display == "none")? "block" : "none";
}
</script>
<?=get_text(sub_str($link[$i][link2],7,45))?> 이걸루 하니깐 아래의 에러가 뜹니다.
Fatal error: Call to undefined function: sub_str() in e:\rio\cart\bbs\skin\board\cart\gblist.skin.php on line 72
gblist.skin.php파일이구요.
<?
$user_max_img=$width-20; // 이미지 가로폭 최대 크기
$king_secret="<font color=#9EB8CC>이 글은 비밀글 입니다. </font>"; // 비밀글일때 표시할 내용.
$cmt_width=$width-150; //코멘트 테이블크기
?>
<style>.wings {padding:5 5 0 5; line-height:19px; }</style>
<table width='<?=$width?>' align=center border=0 cellpadding=0 cellspacing=0>
<tr>
<td width="190" valign="top">
<!------ 좌측 소분류 + 글쓰기 시작 ---------->
<table width="190" border="0" cellpadding="0" cellspacing="0">
<form name=fcategory method=get action='<?="./"?>'>
<input type=hidden name=doc value='<?=$doc?>'>
<tr>
<td width="190" height=600 valign="top" background='http://localhost/cart/bbs/skin/board/cart/main_left_bg.gif'>
<br><br>
<?
if ($is_category) {
echo "<input type=hidden name=ca_id>";
echo get_category_list("$cfg[write_table_prefix]$bo_table",$category_location);
}
?>
</td>
</form>
</tr>
<TR><TD>
<? if ($admin_href) { echo "<a href='$admin_href'>a</a> "; } ?>
<? if ($write_href) { echo "<a href='$write_href'>w</a> "; } ?>
</TD></TR>
</table>
<!------ 좌측 소분류 + 글쓰기 끝 ---------->
</td>
<td width="4"></td>
<td width=1 background="http://localhost/index_images/right_block.gif"></td>
<td valign="top">
<table width=100% border=0 cellpadding=0 cellspacing=0><tr><td height=1 background="http://localhost/index_images/right_block.gif"></td></tr></table>
<table width=100% border=0 cellpadding=0 cellspacing=0>
<input type=hidden name=bo_table value='<?=$bo_table?>'>
<input type=hidden name=sselect value='<?=$sselect?>'>
<input type=hidden name=stext value='<?=$stext?>'>
<input type=hidden name=section value='<?=$section?>'>
<input type=hidden name=page value='<?=$page?>'>
<? for ($i=0; $i<count($list); $i++) { // 리스트 반복 시작 ?>
<? include "$board_skin/_set.php"; ?>
<tr>
<td>
<!------ 수정 + 삭제 + 게시물내용 시작------>
<TABLE width=100% height=70 border=0 cellpadding=0 cellspacing=0 style='table-layout:fixed;'>
<TR><TD width=90></TD><TD width=1></TD><TD align=right>
<? if ($update_href) { echo "<a href=\"$update_href\">m</a> ";} ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\">d</a> ";} ?>
</TD></TR>
<TR>
<TD width=90 class=wings>
<?if ($link[$i][link1]) {?>
<a href='<?=$link[$i][link_href1]?>' target=_blank>
<span><?=$list[$i][subject]?></span>
</a>
<?}?>
</TD>
<td width=1 background="http://localhost/index_images/right_block.gif"></td>
<TD valign="top" class=wings>
######################## 이부분입니다 .######################
<?if ($link[$i][link1]) {?>
<a href='<?=$link[$i][link_href1]?>' title='<?=$list[$i][subject]?>' target=_blank>
<?=get_text(sub_str($link[$i][link2],7,45))?>
</a>
<?}?>
<br>
<?
$it_is_secret=0; // 지금문서가..비밀글인지..
if( $list[$i][file_image1] ) // 이미지가 있을때..크기 설정
{
$size=GetImageSize($list[$i][file_image1]);
$img_x_size=$size[0];
$img_y_size=$size[1];
$per=1;
if( $img_x_size > $user_max_img )
{
$per = $user_max_img / $img_x_size;
$img_x_size=$user_max_img;
$img_y_size=$img_y_size*$per;
$size = "width = $img_x_size height = $img_y_size";
}
}
if($list[$i][wr_secret]&&!$is_admin) //관리자는 내용이 바로 보이게
$it_is_secret=1;
?>
<?
if($it_is_secret) echo $king_secret;
else
{
if($list[$i][file_image1])
echo "<a href=\"javascript:;\" OnClick=\"popupImage('{$list[$i][file_image1]}')\" onFocus=\"this.blur();\"><img src='{$list[$i][file_image1]}' $size style='border-color:#333333;' border=1></a><p>";
echo "<span class='tt'>{$list[$i][content]}</span><br>";
}
?>
</TD>
</TR>
</TABLE>
<!------ 수정 + 삭제 + 게시물내용 끝------>
</td>
</tr>
<tr><td height=1 background="http://localhost/index_images/right_block.gif" colspan=3></td></tr>
<? } // 리스트 반복 끝 ?>
</table>
<table width=100%>
<tr><td align=left>
<? if ($prev_section_href) { echo "<a href='$prev_section_href'>이전검색</a>"; } ?>
<?=$write_pages?>
<? if ($next_section_href) { echo "<a href='$next_section_href'>다음검색</a>"; } ?>
</td></tr>
</table>
<? if ($stext) { ?>
<script language='JavaScript'>
if ('<?=$sselect?>' == 'ca_id') {
document.fcategory.ca_id.value = '<?=$stext?>';
document.fsearch.stext.value = '';
} else {
document.fsearch.sselect.value = '<?=$sselect?>';
}
</script>
<? } ?>
</td>
<td width=1 background="http://localhost/index_images/right_block.gif"></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=yes,width=100,height=100,top=100,left=50");
imageHandle.document.write("<title>Image View</title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+9,this.height+28);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
function show_cmt_write(name, id) {
var layer = document.getElementById(name+id);
layer.style.display = (layer.style.display == "none")? "block" : "none";
}
</script>
<?=get_text(sub_str($link[$i][link2],7,45))?> 이렇게 하는 방법도....있을것 같네요...
지금 수정하고 계신 파일이 어떤건가요???
http:// 이거 뺐고 했는데요...안됩니다..
링크 2에 주소 적으실때 http:// 포함하셨죠?
그거 빼고 적으시면 됩니다..ㅎㅎㅎ
그거 빼고 적으시면 됩니다..ㅎㅎㅎ
먼저 답변 감사하구요...
그렇게 했는데.....안되네요...
그렇게 했는데.....안되네요...
<?=set_http(get_text(cut_str($link[$i][link2], 45)))?> 부분을
<?=get_text(cut_str($link[$i][link2], 45))?> 이렇게 바꾸시면 됩니다... ^^
<?=get_text(cut_str($link[$i][link2], 45))?> 이렇게 바꾸시면 됩니다... ^^