묻고답하기

안녕하세요.


현재 XE의 RSS 기능은

'통합 피드 관리' 관리자 메뉴의

'한 페이지당 글 수'를 통해

최신 글 부터 글 수만큼의 글을 보여주게 되어 있습니다.


제가 필요한 기능은 예~전 글 부터 또는 아예 처음 글 부터

메타블로그 등에 등록을 하고 싶은데

글이 5천개 정도 되니

'한 페이지당 글 수'를 5천을 잡으면 아예 등록 자체가 안되고

아무리 크게 잡아도 500 이상은 등록이 되지 않더라구요.


그래서 생각해본게

최신글 부터를 특정 시점, 기간 부터 지정 글 수 만큼

뿌려지도록 소스를 수정하면 되지 않을까 생각해봤습니다.


아마도 modules/rss 폴더 밑에

rss.view.php 를 수정하면 될 것 같은데

이래저래 해봐도 잘 모르겠네요.


혹시 고수님 계시면 도와주세요~~


감사합니다!


첨부 : rss.view.php 소스


<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
/**
 * The view class of the rss module
 *
 * @author NAVER (developers@xpressengine.com)
 */
class rssView extends rss
{
 /**
  * Initialization
  *
  * @return void
  */
 function init()
 {
 }

 /**
  * Feed output.
  * When trying to directly print out the RSS, the results variable can be directly specified through $oRssView->rss($document_list)
  *
  * @param Object $document_list Document list
  * @param string $rss_title Rss title
  * @param string $add_description Add description
  */
 function rss($document_list = null, $rss_title = null, $add_description = null)
 {
  $oDocumentModel = getModel('document');
  $oModuleModel = getModel('module');
  $oModuleController = getController('module');
  // Get the content and information for the current requested module if the method is not called from another module
  if(!$document_list)
  {
   $site_module_info = Context::get('site_module_info');
   $site_srl = $site_module_info->site_srl;
   $mid = Context::get('mid'); // The target module id, if absent, then all
   $start_date = (int)Context::get('start_date');
   $end_date = (int)Context::get('end_date');

   $module_srls = array();
   $rss_config = array();
   $total_config = '';
   $total_config = $oModuleModel->getModuleConfig('rss');
   // If one is specified, extract only for this mid
   if($mid)
   {
    $module_srl = $this->module_info->module_srl;
    $config = $oModuleModel->getModulePartConfig('rss', $module_srl);
    if($config->open_rss && $config->open_rss != 'N')
    {
     $module_srls[] = $module_srl;
     $open_rss_config[$module_srl] = $config->open_rss;
    }
    // If mid is not selected, then get all
   }
   else
   {
    if($total_config->use_total_feed != 'N')
    {
     $rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl);
     if($rss_config)
     {
      foreach($rss_config as $module_srl => $config)
      {
       if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N')
       {
        $module_srls[] = $module_srl;
        $open_rss_config[$module_srl] = $config->open_rss;
       }
      }
     }
    }
   }

   if(!count($module_srls) && !$add_description) return $this->dispError();

   $info = new stdClass;
   $args = new stdClass;

   if($module_srls)
   {
    $args->module_srl = implode(',',$module_srls);
    //$module_list = $oModuleModel->getMidList($args); //perhaps module_list varialbles not use

    $args->search_target = 'is_secret';
    $args->search_keyword = 'N';
    $args->page = (int)Context::get('page');
    $args->list_count = 15;
    if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count;
    if(!$args->page || $args->page < 1) $args->page = 1;
    if($start_date || $start_date != 0) $args->start_date = $start_date;
    if($end_date || $end_date != 0) $args->end_date = $end_date;
    if($start_date == 0) unset($start_date);
    if($end_date == 0) unset($end_date);

    $args->sort_index = 'list_order';
    $args->order_type = 'asc';
    $output = $oDocumentModel->getDocumentList($args);
    $document_list = $output->data;
    // Extract the feed title and information with Context::getBrowserTitle
    if($mid)
    {
     $info->title = Context::getBrowserTitle();
     $oModuleController->replaceDefinedLangCode($info->title);

     $info->title = str_replace('\'', '&apos;',$info->title);
     if($config->feed_description)
     {
      $info->description = str_replace('\'', '&apos;', htmlspecialchars($config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
     }
     else
     {
      $info->description = str_replace('\'', '&apos;', htmlspecialchars($this->module_info->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
     }
     $info->link = getUrl('','mid',$mid);
     $info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($feed_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
     if(!$info->feed_copyright)
     {
      $info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
     }
    }
   }
  }

  if(!$info->title)
  {
   if($rss_title) $info->title = $rss_title;
   else if($total_config->feed_title) $info->title = $total_config->feed_title;
   else
   {
    $site_module_info = Context::get('site_module_info');
    $info->title = $site_module_info->browser_title;
   }

   $oModuleController->replaceDefinedLangCode($info->title);
   $info->title = str_replace('\'', '&apos;', htmlspecialchars($info->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
   $info->description = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
   $info->link = Context::getRequestUri();
   $info->feed_copyright = str_replace('\'', '&apos;', htmlspecialchars($total_config->feed_copyright, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
  }
  if($add_description) $info->description .= "\r\n".$add_description;

  if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', '&apos;', htmlspecialchars($total_config->image, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
  switch(Context::get('format'))
  {
   case 'atom':
    $info->date = date('Y-m-d\TH:i:sP');
    if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
    else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); }
    break;
   case 'rss1.0':
    $info->date = date('Y-m-d\TH:i:sP');
    break;
   default:
    $info->date = date("D, d M Y H:i:s").' '.$GLOBALS['_time_zone'];
    break;
  }

  if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
  else $proctcl = 'http://';

  $temp_link = explode('/', $info->link);
  if($temp_link[0]=='' && $info->link)
  {
   $info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link;
  }

  $temp_id = explode('/', $info->id);
  if($temp_id[0]=='' && $info->id)
  {
   $info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id;
  }

  $info->language = Context::getLangType();
  // Set the variables used in the RSS output
  Context::set('info', $info);
  Context::set('feed_config', $config);
  Context::set('open_rss_config', $open_rss_config);
  Context::set('document_list', $document_list);
  // Force the result output to be of XMLRPC
  Context::setResponseMethod("XMLRPC");
  // Perform the preprocessing function of the editor component as the results are obtained
  $path = $this->module_path.'tpl/';
  //if($args->start_date || $args->end_date) $file = 'xe_rss';
  //else $file = 'rss20';
  switch (Context::get('format'))
  {
   case 'xe':
    $file = 'xe_rss';
    break;
   case 'atom':
    $file = 'atom10';
    break;
   case 'rss1.0':
    $file = 'rss10';
    break;
   default:
    $file = 'rss20';
    break;
  }

  $oTemplate = new TemplateHandler();

  $content = $oTemplate->compile($path, $file);
  Context::set('content', $content);
  // Set the template file
  $this->setTemplatePath($path);
  $this->setTemplateFile('display');
 }

 /**
  * ATOM output
  *
  * @return Object
  */
 function atom()
 {
  Context::set('format', 'atom');
  $this->rss();
 }

 /**
  * Error output
  *
  * @return Object
  */
 function dispError()
 {
  // Prepare the output message
  $this->rss(null, null, Context::getLang('msg_rss_is_disabled') );
 }

 /**
  * Additional configurations for a service module
  * Receive the form for the form used by rss
  *
  * @param string $obj Will be inserted content in template
  * @return Object
  */
 function triggerDispRssAdditionSetup(&$obj)
 {
  $current_module_srl = Context::get('module_srl');
  $current_module_srls = Context::get('module_srls');

  if(!$current_module_srl && !$current_module_srls)
  {
   // Get information of the selected module
   $current_module_info = Context::get('current_module_info');
   $current_module_srl = $current_module_info->module_srl;
   if(!$current_module_srl) return new Object();
  }
  // Get teh RSS configurations for the selected module
  $oRssModel = getModel('rss');
  $rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
  Context::set('rss_config', $rss_config);
  // Set the template file
  $oTemplate = &TemplateHandler::getInstance();
  $tpl = $oTemplate->compile($this->module_path.'tpl', 'rss_module_config');
  $obj .= $tpl;

  return new Object();
 }
}
/* End of file rss.view.php */
/* Location: ./modules/rss/rss.view.php */

태그 연관 글
  1. [2017/03/21] 묻고답하기 RSS 읽어오기가 안됩니다. ㅜㅜ by 늘같이
  2. [2015/04/03] 묻고답하기 atom10.html에서.... by 컴박살 *2
  3. [2014/12/26] 묻고답하기 피드가 발행이 안되는데 이유를 모르겠습니다. by 가을풍경 *2
  4. [2014/06/23] 묻고답하기 RSS에 권한을 줄수 있나요? by Lin-e *3
  5. [2014/03/13] 묻고답하기 게시판에서 특정기간 게시물만 선택해서 출력할 수 있을까요? by :DunhillBoy *4