예제 #1
0
 public function threadSave()
 {
     //region Set_thread_main_Info
     $postInfo['prefixid'] = $this->_vbulletin->options['yrms_vietsubmanga_prefixid_type' . $this->_type];
     if (!empty($this->_fansubName)) {
         $postInfo['title'] .= "[{$this->_fansubName}] ";
     }
     if ($this->_type == 3 && !empty($this->_originalComposition)) {
         $postInfo['title'] .= "[{$this->_originalComposition}] ";
     }
     $postInfo['title'] .= $this->_mangaTitle;
     $postInfo['allowsmilie'] = 1;
     $postInfo['visible'] = 1;
     $postInfo['parseurl'] = 1;
     //endregion
     //region Manga_info
     if ($this->_numberOfChapter == 0) {
         $numberOfChapter = '??';
     } else {
         $numberOfChapter = $this->_numberOfChapter;
     }
     $mangaInfo = construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_mangatitle'], $this->_mangaTitle) . "\n";
     if ($this->_otherTitle) {
         $mangaInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_othertitle'], $this->_otherTitle) . "\n";
     }
     $mangaInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_author'], $this->_author) . "\n" . construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_genre'], $this->_genre) . "\n" . construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_numberofchapter'], $numberOfChapter) . "\n" . construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_projectstatus'], $this->_vbphrase["yrms_projectstatus{$this->_status}"]) . "\n";
     $fansubInfo = '';
     if (!empty($this->_fansubMember['translator'])) {
         $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_translator'], get_username_massively($this->_fansubMember['translator'])) . "\n";
     }
     if (!empty($this->_fansubMember['proofreader'])) {
         $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_proofreader'], get_username_massively($this->_fansubMember['proofreader'])) . "\n";
     }
     if (!empty($this->_fansubMember['editor'])) {
         $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_mangaeditor'], get_username_massively($this->_fansubMember['editor'])) . "\n";
     }
     if (!empty($this->_fansubMember['qualitychecker'])) {
         $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_qualitychecker'], get_username_massively($this->_fansubMember['qualitychecker'])) . "\n";
     }
     if (!empty($this->_fansubMember['uploader'])) {
         $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_uploader'], get_username_massively($this->_fansubMember['uploader'])) . "\n";
     }
     $fansubInfo .= construct_phrase($this->_vbphrase['yrms_postformat_highlightvalue'], $this->_vbphrase['yrms_fansub_website'], $this->_fansubSite);
     //endregion
     $linkformat = false;
     if ($linkformat === false) {
         $linkformat = $this->_vbphrase['yrms_tobeupdated'];
     }
     //build post
     $postInfo['pagetext'] = construct_phrase($this->_vbphrase['yrms_postformat_vietsubmanga'], $this->_vbulletin->options['yrms_main_illustrationwidth'], $this->_illustration, $mangaInfo, $this->_summary, $this->_fansubName, $fansubInfo, $this->_fansubNote, $linkformat);
     $thread = new ForumPost('thread');
     $thread->setForumId($this->_forumId)->setThreadId($this->_threadId)->setPostInfo($postInfo)->setYrmspost(1)->setPosterId($this->_posterId)->save();
     $this->_threadId = $thread->getThreadId();
     $this->_postId = $thread->getPostId();
 }