示例#1
0
 public function build_headpost()
 {
     global $vbulletin, $vbphrase;
     //set id
     $headpost['forumid'] = $vbulletin->options['yrms_vietsubmanga_id_truyendich'];
     $headpost['threadid'] = $this->threadid;
     $headpost['postid'] = $this->postid;
     $headpost['prefixid'] = $vbulletin->options['yrms_vietsubmanga_prefixid_type' . $this->type];
     //thread title
     $headpost['title'] = "";
     if (!empty($this->fansubname)) {
         $headpost['title'] .= "[{$this->fansubname}] ";
     }
     if ($this->type == 3 && !empty($this->originalcomposition)) {
         $headpost['title'] .= "[{$this->originalcomposition}] ";
     }
     $headpost['title'] .= $this->mangatitle;
     if ($this->numberofchapter == 0) {
         $numberofchapter = '??';
     } else {
         $numberofchapter = $this->numberofchapter;
     }
     //reformat fansubmember
     $linkformat = $this->build_linkformat();
     if ($linkformat === false) {
         $linkformat = $vbphrase['yrms_tobeupdated'];
     }
     $fansubmember = '[B]' . $vbphrase['yrms_translator'] . ':[/B] ' . get_username_massively($this->fansubmember['translator']) . "\n";
     $fansubmember .= '[B]' . $vbphrase['yrms_proofreader'] . ':[/B] ' . get_username_massively($this->fansubmember['proofreader']) . "\n";
     $fansubmember .= '[B]' . $vbphrase['yrms_mangaeditor'] . ':[/B] ' . get_username_massively($this->fansubmember['editor']) . "\n";
     $fansubmember .= '[B]' . $vbphrase['yrms_qualitychecker'] . ':[/B] ' . get_username_massively($this->fansubmember['qualitychecker']) . "\n";
     $fansubmember .= '[B]' . $vbphrase['yrms_uploader'] . ':[/B] ' . get_username_massively($this->fansubmember['uploader']) . "\n";
     //build link format
     $headpost['pagetext'] = construct_phrase($vbphrase['yrms_postformat_vietsubmanga'], $this->illustration, $this->mangatitle, $this->author, $this->genre, $numberofchapter, $vbphrase["yrms_projectstatus{$this->status}"], $this->summary, $this->fansubname, $fansubmember, $this->fansubsite, $this->fansubnote, $linkformat);
     //other setting
     $headpost['allowsmilie'] = 1;
     $headpost['visible'] = 1;
     $headpost['parseurl'] = 1;
     return $headpost;
 }
示例#2
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();
 }