Beispiel #1
0
 private static function fuukaFormat(Post $post) : array
 {
     $fuukaData = ['doc_id' => $post->getDocId(), 'num' => $post->getNo(), 'subnum' => 0, 'thread_num' => $post->getThreadId(), 'op' => $post->getNo() == $post->getThreadId() ? 1 : 0, 'fourchan_date' => $post->getChanTime(), 'timestamp' => $post->getTime(), 'name' => $post->name, 'name_processed' => $post->getName(), 'email' => $post->email, 'email_processed' => $post->getEmail(), 'trip' => $post->trip, 'trip_processed' => $post->getTripcode(), 'poster_hash_processed' => $post->getID(), 'poster_hash' => $post->id, 'comment_sanitized' => Yotsuba::toBBCode($post->getComment()), 'comment' => Yotsuba::toBBCode($post->getComment()), 'comment_processed' => $post->getComment(), 'title' => $post->sub, 'title_processed' => $post->getSubject()];
     if ($post->hasImage()) {
         $fuukaData['media'] = ['op' => $post->getThreadId() == $post->getNo() ? 1 : 0, 'preview_w' => $post->getThumbWidth(), 'preview_h' => $post->getThumbHeight(), 'media_filename' => $post->getFullFilename(), 'media_filename_processed' => $post->getFullFilename(), 'media_w' => $post->getWidth(), 'media_h' => $post->getHeight(), 'media_size' => $post->getFilesize(), 'media_hash' => base64_encode($post->getMD5Bin()), 'media_orig' => $post->getTim() . $post->getExtension(), 'media' => $post->getTim() . $post->getExtension(), 'preview_reply' => $post->getTim() . "s.jpg", 'remote_media_link' => $post->getImgUrl(), 'media_link' => $post->getImgUrl(), 'thumb_link' => $post->getThumbUrl()];
     } else {
         $fuukaData['media'] = null;
     }
     return $fuukaData;
 }