rss 리더 스킨 > 그누4 질문답변

그누4 질문답변

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

rss 리더 스킨 정보

rss 리더 스킨

본문

http://tteun.com/125/bbs/board.php?bo_table=01_5&sfl=&stx=&sst=wr_num%2C+wr_reply&sod=&spt=&page=1

이렇게 자료갱신하면 머같이 되네요 ㅠㅠ

誘멸뎅 이런식으로 글자가 ㅠㅠ

http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=24345&sca=&sfl=wr_subject&stx=rss&sop=and






http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=50520&sca=&sfl=wr_subject&stx=rss&sop=and

이거는 제목만 읽어와서 싫어용 ㅠㅠ 거기다 저같이 빌더 사용하는 사람은 일일이 아이프레임으로...
  • 복사

댓글 전체

write_update.skin2.php 에 아래 소스를 참고 하셔서 title, subject, content 를 iconv 해주세요^^


wirte_update.skin2.php 의 내용===================================

<?
$g4_path = "../../../";
include_once($g4_path."common.php");
include_once("../../../lib/trackback.lib.php");
 //**********************************************************/
//** http://lure.oolim.net
//** E-mail: *** 개인정보보호를 위한 이메일주소 노출방지 ***
//* copyright(c) LURE all rights reserved.
//**********************************************************/
require_once ("$board_skin_path/lib_rss.php");

$configFile1 = $board_skin_path."/rss_addr.php";
$configFile2 = $board_skin_path."/rss_passwd.php";
$configFile4 = $board_skin_path."/rss_latest.php";

// 주소록 읽어오기
$data = @file($configFile1);
$data[0] = str_replace("?>", "", str_replace("<?", "", $data[0]));
$src_url = explode("|", $data[0]);

// 패스워드 읽어오기
$data = @file($configFile2);
$data[0] = str_replace("?>", "", str_replace("<?", "", $data[0]));
$passwd = trim($data[0]);

// 최근에 읽어온 게시물의 시간 읽어옴
$data = @file($configFile4);
for($i=0; $i<count($data); $i++) {
if($data[$i]) {
$tmp = explode("|", $data[$i]);
$ltime[$i][url] = $tmp[0];
$ltime[$i][time] = $tmp[1];
}
}

if(count($src_url) && $passwd) {

      $write_table = $g4[write_prefix] . $bo_table; // 게시판 테이블 전체이름

$sql = " select * from $g4[board_table] where bo_table = '$bo_table' ";
$bo = sql_fetch($sql);

for($i=0, $j=0; $i<count($src_url); $i++) {

  $tmp_date = 0;

    $rss = $rss_array = rss_array(trim($src_url[$i]));

$channel = $rss_array['channel']['title'];              // 채널 제목 추출
// $description = $rss_array['channel']['description'];    // 채널 내용 추출
//    $lastBuildDate = $rss_array['channel']['lastBuildDate'];    // 채널 날자 추출
// $img_title = $rss_array['image']['title'];                      // 로고 추출
// $img_url = $rss_array['image']['url'];                      // 로고 추출
//    $img_link = $rss_array['image']['link'];                    // 로고 추출
//echo "<p>";
// 웹사이트 로고가 있다면 보여 주세요
//    if ($rss_array['image']['url'] != '') {
//        echo "<a href=\"$img_link\" target='_blank' title=\"$img_title\" ><img src=\"$img_url\" vspace=\"1\" border=\"0\" /></a><br />\n";
//        }
// echo "<B><FONT COLOR=#0099CC>CHANNEL:<a title='$description'> $channel </a></FONT></B>\n<br />";
//  if ($rss_array['channel']['lastBuildDate'] != '') {
// echo "<font color=#0099CC> $lastBuildDate </font>\n<br />";
//    }
// echo "<table width=100%  border=0 cellspacing=5 cellpadding=5><tr><td>";

//  $i = 0;

foreach ($rss_array['items'] as $item) {

################### Setup  ###########################################################################

// $item_limit = '0';  ############# 추출할 글 수 설정 0이면 제한 없고( 4096 바이트읽음 주르르 나옴)

define("DATE_FORMAT", "Y-m-d H:i:s"); // 날자형식정의

#######################################################################################################
//   if ($i < $item_limit || $item_limit == 0) { // Item 카운터 조건

$url = $item['link'];

  if($item["dcdate"])
        $item[date] = $item["dcdate"];
  else if($item["pubdate"])
        $item[date] = $item["pubdate"];
        $st = strtotime($item[date]);
        $item[date] = @date(DATE_FORMAT, $st);

$date = $item[date];

$title = iconv("UTF-8", "EUC-KR", $item['title']);
$name = $item['author'];
// $category = $item['category'];

// $content = strip_tags($item['description']);
// $content = $item['description'];
    //$item['description'] 내부에 링크 교정
  if($item['description']){
    $item['description'] = parse_description($item['description']);
$content = iconv("UTF-8", "EUC-KR", $item['description']); }

// echo "<li><a href=\"$href\" target='_blank'><U><B><font color=#0099CC>$date</font> $title  </B></U></a><br/>\n $content\n <font color=#0099CC>$name</font></li>";

if($date > $tmp_date) $tmp_date = $date;
  $title = addslashes($title);
          $sql = "select count(*) from $write_table where wr_subject='$title' and wr_link1='$url' and wr_name='$name'";
  $row = sql_fetch($sql);

if(!$row[0] && $ltime[$i][time] < $date) {
$list[$j][site] = $site;
$list[$j][title] = $title;
$list[$j][url] = $url;
$list[$j][content] = $content;
$list[$j][creator] = $name;
$list[$j++][date] = $date;
} // $row[0]

//   $i++;  // Item 카운터
//   }  //카운터
} //foreach (

  $latest_date .= $url."|".$tmp_date."\n";
  unset($rss);
// echo "</td></tr></table>";

//////////////////////////////////////////////////////////////
if( $title && $date ) {
for($j=count($list)-1; $j>=0; $j--) {
update_board($channel,$list[$j][site], $list[$j][title], $list[$j][content], $list[$j][url], $list[$j][name], $list[$j][date]);
      }
}
////////////////////////////////////////////////////////////////
// 읽어온 게시물중 최근시간 저장
if($latest_date) {
$fp = fopen($configFile4, "w");
fwrite($fp, $latest_date);
fclose($fp);
}
///////////////////////////////////////////////////////////

  } //for($i=0, $j=0; $i<count($src_url); $i++) {

 }  //if(count($src_url) && $passwd) {

function update_board($ca_name,$site, $subject, $content, $url, $name, $date) {

  global $g4, $bo_table, $write_table, $wr_notice, $passwd, $HTTP_SERVER_VARS;

$wr_num = get_next_num($write_table, $wr_notice);

$content = addslashes($content);
$ca_name = str_replace("|","-",$ca_name); //###add
$ca_name = str_replace("&","-",$ca_name); //###add
$ca_name = str_replace("+","-",$ca_name); //###add
    $sql = " insert into $write_table
                set wr_num = '$wr_num',
                    wr_reply = '$wr_reply',
                    wr_comment = 0,
                    ca_name = '$ca_name',
                    wr_option = 'html2,$secret,$mail',
                    wr_subject = '$subject',
                    wr_content = '$content',
                    wr_link1 = '$url',
                    wr_link2 = '$wr_link2',
                    wr_link1_hit = 0,
                    wr_link2_hit = 0,
                    wr_trackback = '$wr_trackback',
                    wr_hit = 0,
                    wr_good = 0,
                    wr_nogood = 0,
                    mb_id = '$member[mb_id]',
                    wr_password = password('$passwd'),
                    wr_name = '$name',
                    wr_email = '$wr_email',
                    wr_homepage = '$wr_homepage',
                    wr_datetime = '$date',
                    wr_ip = '$_SERVER[REMOTE_ADDR]',
                    wr_1 = '$site',
                    wr_2 = '$wr_2',
                    wr_3 = '$wr_3',
                    wr_4 = '$wr_4',
                    wr_5 = '$wr_5',
                    wr_6 = '$wr_6',
                    wr_7 = '$wr_7',
                    wr_8 = '$wr_8',
                    wr_9 = '$wr_9',
                    wr_10 = '$wr_10' ";
    sql_query($sql);

    $wr_id = mysql_insert_id();

    // 부모 아이디에 UPDATE
    sql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' ");

    // 새글 INSERT
//    sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '$bo_table', '$wr_id', '$wr_id', '$g4[time_ymdhis]' ) ");

    // 게시글 1 증가


$cas = sql_fetch(" select bo_category_list from $g4[board_table] where bo_table = '$bo_table' and bo_category_list like '%$ca_name%' ");
if ($cas[bo_category_list]) {
//있음
//} else {
//없음
$ncas = sql_fetch(" select bo_category_list from $g4[board_table] where bo_table = '$bo_table'");
$ncas=$ncas[bo_category_list]."|".$ca_name;
    sql_query("update $g4[board_table] set bo_category_list ='".$ncas."' where bo_table = '$bo_table'");

}


    sql_query("update $g4[board_table] set bo_count_write = bo_count_write + 1 where bo_table = '$bo_table'");


}

//////////////////////////////////////////////

// description 교정
function parse_description($body) {
        $current = array(
                        "<a href="
                        );
        $target = array(
                        "<a target='_blank' href="
                        );
        $body = str_replace($current, $target, $body);
        return $body;
  }

////글쓴후 목록으로////////////////////////////////////////////////////////////////////
goto_url("../../../bbs/board.php?bo_table=$bo_table" . $qstr);
?>
© SIRSOFT
현재 페이지 제일 처음으로