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

전체 최신글 질문좀 드릴게요..! 채택완료

pangb 8년 전 조회 4,092

우산님 전체최신글 팁자료실에 있는 내용을 latest_lib.php 아래부분에 넣어서 

최신글을 불러오게 되면 전체내용은 자세히 잘나오지만 

이상하게도 ico_new.gif의 경우에는 사진없으므로 나오네요 

 

1) 팁자료의 소스를  latest_lip.php 아래에다가 저렇게 넣는게 맞는지요?

적용후에 이미지 위치를 확인해보니 

보통 다른 latest 적용시에는  새글이렇게 위치가 

나오면서 사진이 잘나오는데요 !

 

 

전체최신글 적용시에는 엑박이 뜨면서 

새글 

이런식으로 경로가 이상하게 적용되는데요

 

스킨은 둘다 동일한 스킨을 적용하여도 이렇게 엑박이 나오네요 ..!

 

2)전체 최신글 적용시 기본basic 최신글로 썸네일적용시에도 따로 설정해줘야할게있나요?

 

'부디 초보를 위한 자세한 설명 부탁드릴게요..!

 

 

 

 

</p><p><?php</p><p>if (!defined('_GNUBOARD_')) exit;</p><p> </p><p>/* 다중게시판 최신글 추출 Latest */</p><p>/* 제작 : SIR 내컴퓨터 */</p><p>/* 버전 : 1.0.2 */</p><p>/* 마스타님께서 if (!G5_USE_CACHE || !file_exists($cache_file)) { 부분 이상 검출 */</p><p> </p><p>function latest($skin_dir='basic', $bo_table=false, $rows=10, $subject_len=40,$bo_title=false)</p><p>{</p><p>    global $g5;</p><p>    static $css = array();</p><p>    $bo_table = explode(';' , $bo_table);</p><p>    </p><p>    /* 모바일 스킨 디렉토리 */</p><p>    if(G5_IS_MOBILE) {</p><p>        $latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;</p><p>        $latest_skin_url  = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;</p><p>    }</p><p>    /* 데스크탑 스킨 디렉토리 */</p><p>    else {</p><p>        $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;</p><p>        $latest_skin_url  = G5_SKIN_URL.'/latest/'.$skin_dir;</p><p>    }</p><p>    </p><p>    /* Latest 케시파일 생성 */</p><p>    $cache_botable = "";</p><p>    $cache_time = date("Ymdhi");</p><p>    for($y=0;$y<count($bo_table);$y++){</p><p>        $cache_botable .= $bo_table[$y];</p><p>    }</p><p>    $cache_botable = md5($cache_botable);</p><p>    $cache_newfile = G5_DATA_PATH."/cache/latest-{$cache_botable}-{$skin_dir}-{$rows}-{$subject_len}-{$cache_time}.php";</p><p> </p><p>    /* 최근 1분간 새로 등록된 케시가 없을경우 DB에서 데이터 추출후 신규 케시 생성 */</p><p>    if (!G5_USE_CACHE || !file_exists($cache_newfile)) {</p><p>        /* 다중 게시판 게시물 추출 */</p><p>        $sql = "select a.* from ";</p><p>        for($y=0;$y<count($bo_table);$y++){</p><p>            if($y!=0) $sql .= "union all ";</p><p>            else $sql .= "( ";</p><p>            $tmp_write_table = $g5['write_prefix'] . $bo_table[$y]; // 게시판 테이블 전체이름</p><p>            $sql .= "select *,'{$bo_table[$y]}' as `bo_table` from {$tmp_write_table} "; // </p><p>            if($y+1==count($bo_table)) $sql .= ") ";</p><p>        }</p><p>        $sql .= "a where `wr_is_comment` = 0 order by `wr_datetime` DESC limit ".$rows." ";</p><p>        $result = sql_query($sql);</p><p>        </p><p>        /* 다중 게시판 게시물 리스트 추출 */</p><p>        $list = array();</p><p>        for ($i=0; $row = sql_fetch_array($result); $i++) {</p><p>            /* 추출된 게시물이 등록된 게시판 매칭 */</p><p>            for($y=0;$y<count($bo_table);$y++){</p><p>                if ($bo_table[$y]==$row['bo_table']){</p><p>                    $sql = "select * from `{$g5['board_table']}` where `bo_table` = '{$bo_table[$y]}' "; </p><p>                    $board = sql_fetch($sql);</p><p>                }</p><p>            }</p><p>            $list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);</p><p>        }</p><p>        </p><p>        /* 기존에 등록된 케시파일을 삭제 */</p><p>        $files = glob(G5_DATA_PATH."/cache/latest-{$cache_botable}-{$skin_dir}-{$rows}-{$subject_len}-*");</p><p>        if (is_array($files)) {</p><p>            $cnt=0;</p><p>            foreach ($files as $cache_oldfile) {</p><p>                $cnt++;</p><p>                unlink($cache_oldfile);</p><p>            }</p><p>        }</p><p>        </p><p>        /* 케시파일 신규 생성 */</p><p>        $handle = fopen($cache_newfile, 'w');</p><p>        $cache_content = "<?php\nif (!defined('_GNUBOARD_')) exit;\n\$bo_subject=\"".get_text($board['bo_subject'])."\";\n\$list=".var_export($list, true)."?>";</p><p>        fwrite($handle, $cache_content);</p><p>        fclose($handle);</p><p>    }</p><p>    </p><p>    /* 케시파일 로드 */</p><p>    include_once($cache_newfile);</p><p>    </p><p>    /* List에서 사용할 Board 데이터 추출 */</p><p>    $bo_table = $bo_table[0];</p><p>    if($bo_title) $bo_subject = $bo_title;</p><p>    </p><p>    /* 스킨연결 */</p><p>    ob_start();</p><p>    include $latest_skin_path.'/latest.skin.php';</p><p>    $content = ob_get_contents();</p><p>    ob_end_clean();</p><p>    </p><p>    return $content;</p><p>}</p><p> </p><p> </p><p><span style="color: rgb(255, 0, 0);">?></span></p><p> </p><p><span style="color: rgb(255, 0, 0);"><?php</span></p><p><span style="color: rgb(255, 0, 0);">function latest_all($skin_dir="", $rows=10, $subject_len=40, $contents_len=200, $category="", $orderby="") { </span></p><p><span style="color: rgb(255, 0, 0);">  global $config; </span></p><p><span style="color: rgb(255, 0, 0);">  global $g5; </span></p><p><span style="color: rgb(255, 0, 0);">  </span></p><p><span style="color: rgb(255, 0, 0);">  $list = array(); </span></p><p><span style="color: rgb(255, 0, 0);">  $limitrows = $rows; </span></p><p><span style="color: rgb(255, 0, 0);">  </span></p><p><span style="color: rgb(255, 0, 0);">  $sqlgroup = " select bo_table, bo_subject from $g5[board_table] where  bo_use_search=1 order by bo_use_search"; </span></p><p><span style="color: rgb(255, 0, 0);">  $rsgroup = sql_query($sqlgroup); </span></p><p><span style="color: rgb(255, 0, 0);">  //echo $sqlgroup; </span></p><p><span style="color: rgb(255, 0, 0);">  if ($skin_dir) </span></p><p><span style="color: rgb(255, 0, 0);">    $latest_skin_path = G5_PATH."/skin/latest/$skin_dir"; </span></p><p><span style="color: rgb(255, 0, 0);">  else </span></p><p><span style="color: rgb(255, 0, 0);">    $latest_skin_path = G5_PATH."/skin/latest/$config[cf_latest_skin]"; </span></p><p><span style="color: rgb(255, 0, 0);">  </span></p><p><span style="color: rgb(255, 0, 0);">  for ($j=0, $k=0; $rowgroup=sql_fetch_array($rsgroup); $j++) { </span></p><p><span style="color: rgb(255, 0, 0);">    $bo_table = $rowgroup[bo_table]; </span></p><p><span style="color: rgb(255, 0, 0);">    </span></p><p><span style="color: rgb(255, 0, 0);">    // 테이블 이름구함 </span></p><p><span style="color: rgb(255, 0, 0);">    $sql = " select * from {$g5[board_table]} where bo_table = '$bo_table'"; </span></p><p><span style="color: rgb(255, 0, 0);">    $board = sql_fetch($sql); </span></p><p><span style="color: rgb(255, 0, 0);">    </span></p><p><span style="color: rgb(255, 0, 0);">    $tmp_write_table = $g5[write_prefix] . $bo_table; // 게시판 테이블 실제이름 </span></p><p><span style="color: rgb(255, 0, 0);">    </span></p><p><span style="color: rgb(255, 0, 0);">    // 옵션에 따라 정렬 </span></p><p><span style="color: rgb(255, 0, 0);">    $sql = "select * from $tmp_write_table where wr_is_comment = 0 "; </span></p><p><span style="color: rgb(255, 0, 0);">    $sql .= (!$category) ? "" : " and ca_name = '$category' "; </span></p><p><span style="color: rgb(255, 0, 0);">    $sql .= (!$orderby) ? "  order by wr_id desc " : "  order by $orderby desc, wr_id desc "; </span></p><p><span style="color: rgb(255, 0, 0);">    $sql .= " limit $limitrows"; </span></p><p><span style="color: rgb(255, 0, 0);">    //echo $sql; </span></p><p><span style="color: rgb(255, 0, 0);">    $result = sql_query($sql); </span></p><p><span style="color: rgb(255, 0, 0);">    </span></p><p><span style="color: rgb(255, 0, 0);">    for ($i=0; $row = sql_fetch_array($result); $i++, $k++) { </span></p><p><span style="color: rgb(255, 0, 0);">      </span></p><p><span style="color: rgb(255, 0, 0);">      if(!$orderby) $op_list[$k] = $row[wr_datetime]; </span></p><p><span style="color: rgb(255, 0, 0);">      else  { </span></p><p><span style="color: rgb(255, 0, 0);">        $op_list[$k] = is_string($row[$orderby]) ? sprintf("%-256s", $row[$orderby]) : sprintf("%016d", $row[$orderby]); </span></p><p><span style="color: rgb(255, 0, 0);">        $op_list[$k] .= $row[wr_datetime]; </span></p><p><span style="color: rgb(255, 0, 0);">        $op_list[$k] .= $row[wr_name]; </span></p><p><span style="color: rgb(255, 0, 0);">        $op_list[$k] .= $row[wr_10]; </span></p><p><span style="color: rgb(255, 0, 0);">      } </span></p><p><span style="color: rgb(255, 0, 0);">      </span></p><p><span style="color: rgb(255, 0, 0);">      $list[$k] = get_list($row, $board, $latest_skin_path, $subject_len, $wr_name, $wr_10); </span></p><p><span style="color: rgb(255, 0, 0);">      </span></p><p><span style="color: rgb(255, 0, 0);">      $list[$k][bo_table] = $board[bo_table]; </span></p><p><span style="color: rgb(255, 0, 0);">      $list[$k][bo_subject] = $board[bo_subject]; </span></p><p><span style="color: rgb(255, 0, 0);">      $list[$k][wr_name] = $board[wr_name]; </span></p><p><span style="color: rgb(255, 0, 0);">      $list[$k][wr_10] = $board[wr_10]; </span></p><p><span style="color: rgb(255, 0, 0);">      </span></p><p><span style="color: rgb(255, 0, 0);">      $list[$k][bo_wr_subject] = cut_str($board[bo_subject] . $list[$k][wr_subject], $subject_len, $wr_name, $wr_10); </span></p><p><span style="color: rgb(255, 0, 0);">    } </span></p><p><span style="color: rgb(255, 0, 0);">  } </span></p><p><span style="color: rgb(255, 0, 0);">  </span></p><p><span style="color: rgb(255, 0, 0);">  if($k>0) array_multisort($op_list, SORT_DESC, $list); </span></p><p><span style="color: rgb(255, 0, 0);">  if($k>$rows) array_splice($list, $rows); </span></p><p> </p><p><span style="color: rgb(255, 0, 0);">  ob_start(); </span></p><p><span style="color: rgb(255, 0, 0);">  include $latest_skin_path.'/latest.skin.php'; </span></p><p><span style="color: rgb(255, 0, 0);">  $content = ob_get_contents(); </span></p><p><span style="color: rgb(255, 0, 0);">  ob_end_clean(); </span></p><p><span style="color: rgb(255, 0, 0);">  return $content; </span></p><p><span style="color: rgb(255, 0, 0);">} </span></p><p><span style="color: rgb(255, 0, 0);">?></span></p><div>
댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

경로상수 문제입니다.

 

= 도메인/(루트)

 

= 도메인/host/home2/홈페이지폴더/html

 

즉 URL 의 경우 현재 도메인의 루트폴더 이후부터 나오지만

PATH의 경우 전체경로가 모두 출력됩니다.

 

latest 스킨 안의 img 불러오는곳을 확인해보세요.

 

  

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

답변에 대한 댓글 1개

p
pangb
8년 전
소중한 답변 정말 감사드려요:)

정말 힘이되네요^^

오늘하루도 즐거운 주말되세요:0

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

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

로그인