아래 내용은 rss업데이터 모듈 안에 있는 입력관련된 부분입니다. 


 

        // 최종 업데이트 일 이후에 작성된 글을 대상 게시판에 추가
        foreach(array_reverse($items,true) as $item)
        {
            if ($last_updatedate > $item->get_date('U') )
            continue;
            $obj = null;
            $obj->title = htmlspecialchars_decode($item->get_title());
            
            // item link 를 가져오지 못할 경우 불가피하게 RSS 주소 사용
            if($item->get_link())
            $link = $item->get_link();
            
        
    $obj->content =  "<br> 원문출처 : <a href='" . $item->get_link() . "' target='_blank'>" . $item->get_link() . "</a>";
            $obj->module_srl = $rssboard->module_srl;
            $obj->member_srl = $this->admin_info->member_srl;
            $obj->user_id =  $this->admin_info->user_id;
            $obj->user_name =  $this->admin_info->user_name;
            $obj->nick_name =  $this->admin_info->nick_name;
            $obj->email_address =  $this->admin_info->email_address;
            $obj->regdate = $item->get_date('YmdHis');
            $obj->category_srl = $rssboard->category_srl;
            $obj->allow_comment = 'Y';
    
            $output=$oDocumentController->insertDocument($obj,true);
        }

 

입력대상 게시판의 모듈명이 news1 이라면, news2라면, new3이라면..이런식으로 조건을 위 빨간색 컨텐츠입력내용을 다르게 해주고 싶은데요. 어떻게 명령어를 줘야 하나요? 도와주세용~ ^^

 

 

  • profile

    $mid값으로 구분해야 한다면 mid명을 가져와야 합니다.

     

    $output 위에 넣어주시면 될것 같습니다.

    $_oModuleModel = &getModel('module');
    $_this_module_mid = $_oModuleModel->getModuleInfoByModuleSrl($obj->module_srl)->mid
    
    if ($_this_module_mid =='news1')
    {
    $obj->content =  "~~~~~~1.이러쿵 저러쿵~~~~~~";
    
    }elseif ($_this_module_mid =='news2')
    {
    $obj->content =  "~~~~~~2.이러쿵 저러쿵~~~~~~";
    
    }elseif ($_this_module_mid =='news3')
    {
    $obj->content =  "~~~~~~3.이러쿵 저러쿵~~~~~~";
    
    }else
    {
    $obj->content =  "<br> 원문출처 : <a href='" . $item->get_link() . "' target='_blank'>" . $item->get_link() . "</a>";
    
    }

     

  • profile profile
    아~~~~ 착한인연님 감사합니다. 좋은 주말 되세요~