$inputData = $manga->getData(); //unset($inputData['vbphrase']); //unset($inputData['db']); //unset($inputData['vbulletin']); //print_pre($inputData); if (isPost()) { $inputData = getPost(); $error = findInputError($inputData); 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"; $message = construct_phrase($vbphrase['yrms_msg_success_general'], $vbphrase['yrms_edit'], $vbphrase['yrms_manga'], $manga->getMangaTitle()); $contenttemplatename = 'yrms_message'; } else { $messagetype = "error"; $message = nl2br(construct_phrase($vbphrase['yrms_msg_error_head'], $vbphrase['yrms_mangaadd']) . "\n" . $error); } } if (!isset($contenttemplatename)) { $contenttemplatename = 'yrms_vietsubmanga_manga_save'; }