최신글에서 링크 1..로 바로 이동?? > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

최신글에서 링크 1..로 바로 이동?? 정보

최신글에서 링크 1..로 바로 이동??

본문

안녕하세요...  최신글에서 바로.... 링크 1..로 가게 할려고 하는데 ..조언 부탁합니다..
<A HREF='<?=$list[$i][wr_link1]?>' target='_blank'><?=$imgTag;?></A> 을..적용했으나 되질 않네요...

아래의 소스에 문제가 있는것 같은데...고수님들의 조언을 부탁합니다...

<?
for ($i=0; $i<count($list); $i++) {
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file]) $img = "$latest_skin_path/img/noimage.gif";
$imgTag ="<img src='".$img."' width='".$img_width."' height='".$img_height."' border='0' align='absmiddle' alt='".$title."'>";
 
?>                 
    leftrightslide[<?=$i;?>] = "<A HREF='<?=$list[$i][wr_link1]?>' target='_blank'><?=$imgTag;?></A>&nbsp;";
<?
}
?>
  • 복사

댓글 전체

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$cols  = 3; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h  = 10; // 이미지 상하 간격
$image_w  = 10; // 이미지 상하 간격
$col_width = (int)(99 / $cols);

$img_width = 80; //썸네일 가로길이
$img_height = 70; //썸네일 세로길이
$img_quality = 100; //퀼리티 100이하로 설정

if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb105'; //썸네일 이미지 생성 디렉토리

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

?>
<?  for ($i=0; $i<count($list); $i++) {
    if ($i>0 && $i%$cols==0) { echo "<td colspan='$cols' height='$image_h'></td><tr>"; }
    $img = "<img src='$g4_path/img/noimage.gif' border=1 width='$img_width' height='$img_height' title='이미지 없음' align=left style='margin-right:5px; border:0 #222222 solid;'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    // 썸네일 이미지가 존재하지 않는다면
    if (!file_exists($thumb)) {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];

        // 업로드된 파일이 이미지라면
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
else if ($size[2] == 4)
                $src = imagecreatefrombmp($file);
            else
                break;
  if (preg_match("/\.(bmp)$/i", $file) && file_exists($file)) {
      $imgTmp = imagecreatefrombmp($file);
      imagegif($imgTmp,$file);
      }
 
            $rate = $img_width / $size[0];
            $height = (int)($size[1] * $rate);

            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
            if ($height < $img_height)
                // 계산된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $height);
            else
                // 설정된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $img_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
            imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=1 align=left style='margin-right:5px; border:0 #222222 solid;'>";
?>

<?
 $a_img="<a href='{$list[$i][href]}'>$img</a>";
?>

<?=$a_img?>

이런 형식이지 싶습니다만..
현재 사용중인 소스는 아래와 같습니다...
클릭하면..새창으로 뜨긴 하는데...링크 1로는 가질 않네요..,,ㅠㅠ..


<style>
table { background-color: transparent; } td { background-color: transparent; }
</style>
<?
// 블루비 소스 이용. 아래는 블루비 스크립 소스
//http://www.blueb.co.kr/bbs.php?table=JS_01&where=ALL&search_step=1&category=%EC%8A%AC%EB%9D%BC%EC%9D%B4%EB%93%9C%EC%87%BC&query=view&uid=303&p=1

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$img_width = "108"; // 이미지 가로사이즈
$img_height = "85"; // 이미지 세로사이즈
?>

<script type="text/javascript">
var sliderwidth="350px"  //스크롤 가로 사이즈
var sliderheight="<?=($img_height + 5);?>px"  //스크롤 세로 사이즈
var slidespeed="1" 
slidebgcolor="transparent"  // 배경색을 주시려면 #99cc00 등과 같이 바꾸시면 됩니다 !

var leftarrowimage = "<?=$latest_skin_path?>/img/left.gif";
var rightarrowimage = "<?=$latest_skin_path?>/img/right.gif";

var leftrightslide=new Array()
var finalslide=''

<?
for ($i=0; $i<count($list); $i++) {
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);
if (!file_exists($img) || !$list[$i][file][0][file]) $img = "$latest_skin_path/img/noimage.gif";

$imgTag ="<img src='".$img."' width='".$img_width."' height='".$img_height."' border='0' align='absmiddle' alt='".$title."'>";
?>                           
    leftrightslide[<?=$i;?>] = "<a href='<?=$list[$i][wr_link1]?>' target='_blank'><?=$imgTag;?></A>&nbsp;"; 
<?
}
?>
                                   

var imagegap=""
var slideshowgap=0

var copyspeed=slidespeed
    leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all||document.getElementById
    if (iedom)
        document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')

var actualwidth=''
var cross_slide, ns_slide
var righttime,lefttime

function fillup(){
    if (iedom){
        cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
        cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
        cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
        actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
        cross_slide2.style.left=actualwidth+slideshowgap+"px"
    }
    else if (document.layers){
        ns_slide=document.ns_slidemenu.document.ns_slidemenuorange
        ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
        ns_slide.document.write(leftrightslide)
        ns_slide.document.close()
        actualwidth=ns_slide.document.width
        ns_slide2.left=actualwidth+slideshowgap
        ns_slide2.document.write(leftrightslide)
        ns_slide2.document.close()
    }
    lefttime=setInterval("slideleft()",30)
}
window.onload=fillup

function slideleft(){
    if (iedom){
    if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
        cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
    else
        cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
    if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
        cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
    else
        cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"
    }
    else if (document.layers){
    if (ns_slide.left>(actualwidth*(-1)+8))
        ns_slide.left-=copyspeed
    else
        ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
    if (ns_slide2.left>(actualwidth*(-1)+8))
        ns_slide2.left-=copyspeed
    else
        ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
    }
}

function slideright(){
    if (iedom){
    if (parseInt(cross_slide.style.left)<(actualwidth+8))
        cross_slide.style.left=parseInt(cross_slide.style.left)+copyspeed+"px"
    else
        cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth*(-1)+slideshowgap+"px"
    if (parseInt(cross_slide2.style.left)<(actualwidth+8))
        cross_slide2.style.left=parseInt(cross_slide2.style.left)+copyspeed+"px"
    else
        cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth*(-1)+slideshowgap+"px"
    }
    else if (document.layers){
    if (ns_slide.left>(actualwidth*(-1)+8))
        ns_slide.left-=copyspeed
    else
        ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
    if (ns_slide2.left>(actualwidth*(-1)+8))
        ns_slide2.left-=copyspeed
    else
        ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
    }
}

function right(){
    if(lefttime){
        clearInterval(lefttime)
        clearInterval(righttime)
        righttime=setInterval("slideright()",30) 
    }
}

function left(){
    if(righttime){
        clearInterval(lefttime)
        clearInterval(righttime)
        lefttime=setInterval("slideleft()",30) 
    }
}
    document.write('<table width='+sliderwidth+' border="0" cellspacing="0" cellpadding="0">');
    document.write('<tr><td align=center valign=middle width=20><img src='+leftarrowimage+' onMouseover="left(); copyspeed=2" onMouseout="copyspeed=1" style="cursor:hand"></td>')


    if (iedom||document.layers){
        with (document){
            document.write('<td>')
    if (iedom){
        write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
        write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=1">')
        write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
        write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
        write('</div></div>')
    }
    else if (document.layers){
        write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
        write('<layer name="ns_slidemenuorange" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
        write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
        write('</ilayer>')
    }
    document.write('</td>')
    }
}

document.write('<td width="20" align=center valign=middle><img src='+rightarrowimage+' onMouseover="right();copyspeed=2" onMouseout="copyspeed=1" style="cursor:hand"></td></tr></table>')

</script>
© SIRSOFT
현재 페이지 제일 처음으로