if (!$error) { $manga->setData($inputData); if ($inputData['posturl']) { $threadId = extract_threadid_from_url($inputData['posturl']); $threadInfo = fetch_threadinfo($threadId); if ($threadInfo['forumid'] == $manga->getForumId()) { $manga->setThreadId($threadInfo['threadid'])->setPostId($threadInfo['firstpostid'])->setPosterId($threadInfo['postuserid']); } elseif ($threadInfo['forumid'] == $manga->getOnlineForumId()) { $manga->setPosterId($threadInfo['postuserid']); } } $manga->save(); $messagetype = "success"; switch ($currentAction) { case 'add': $posterId = $manga->getPosterId(); $posterInfo = fetch_userinfo($posterId); $message = construct_phrase($vbphrase['yrms_msg_success_newmanga'], $posterInfo['username'], $manga->getMangaTitle(), $vbulletin->options['yrms_vietsubmanga_yun_newproject'], $manga->getMangaId()); break; case 'edit': $message = construct_phrase($vbphrase['yrms_msg_success_general'], $vbphrase['yrms_edit'], $vbphrase['yrms_manga'], $manga->getMangaTitle()); break; case 'reward': $message = construct_phrase($vbphrase['yrms_msg_success_general'], $vbphrase['yrms_reward'], $vbphrase['yrms_manga'], $manga->getMangaTitle()); break; } $contenttemplatename = 'yrms_message'; } else { $messagetype = "error"; $message = nl2br(construct_phrase($vbphrase['yrms_msg_error_head'], $vbphrase['yrms_mangaadd']) . "\n" . $error); }