分享个记录,在well_website_thread加了自定义字段,火车头入库修改

bluemaple2020-6-27 368

我已经在火车头入库文件intodb.php加了

$title_keywords = param('title_keywords');
    $orig_author = param('orig_author');
    $original_url= param('original_url');

这个也加了:

$thread = array('fid' => $fid, 'type' => $type, 'doctype' => $doctype, 'subject' => $subject, 'brief' => $brief, 'keyword' => $keyword, 'description' => $description, 'closed' => $closed, 'flags' => $flags, 'thumbnail' => $thumbnail, 'save_image' => $save_image, 'delete_pic' => $delete_pic, 'message' => $message, 'title_keywords' => $title_keywords, 'orig_author' => $orig_author, 'original_url' => $original_url,);

 

在well_thread_create函数里面的钩子model__thread_create_thread_after.php加

$title_keywords = array_value($arr, 'title_keywords');
    $orig_author = array_value($arr, 'orig_author');
    $original_url = array_value($arr, 'original_url');
    // 创建主题
    unset($thread);
    $thread = array('fid' => $fid, 'subject' => $subject, 'type' => $type, 'brief' => $brief, 'uid' => $uid, 'create_date' => $time, 'closed' => $closed, 'keyword' => $keyword, 'description' => $description, 'last_date' => $time, 'userip' => $longip, 'attach_on' => $conf['attach_on'], 'flags' => $flags, 'status' => $status, 'title_keywords' => $title_keywords, 'orig_author' => $orig_author, 'original_url' => $original_url);

 

如果是其他表增加自定义字段的,则需要修改well_thread__create函数,或者直接在intodb.php重写一个well_thread_create函数估计会更方便实现。

 

 

最新回复(2)
  • 燃烧的冰2020-6-28
    2
    擅用钩子,预留了大量的钩子
  • bluemaple2020-6-28
    3
    燃烧的冰 擅用钩子,预留了大量的钩子
    intodb.php直接改了,没钩子。
    后面的都是用钩子改的,看自己喜欢了,不升级的就随便改,哈哈
返回
发新帖