Guest User

4archive Archive Snippet

a guest
May 7th, 2015
7,443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.99 KB | None | 0 0
  1. <?php
  2. for($i = $lastReplyPos; $i < $replyCount; $i++) {
  3.     $reply = $replies[$i];
  4.    
  5.     $postID = isset($reply["no"]) ? $reply["no"] : null;
  6.     $subject = isset($reply["sub"]) ? $reply["sub"] : null;
  7.     $name = isset($reply["name"]) ? $reply["name"] : "";
  8.     $posterId = isset($reply["id"]) ? $reply["id"] : null;
  9.     $tripCode = isset($reply["trip"]) ? $reply["trip"] : null;
  10.     $capCode = isset($reply["capcode"]) ? $reply["capcode"] : null;
  11.     $postTimestamp = isset($reply["time"]) ? $reply["time"] : null;
  12.    
  13.     $postBody = isset($reply["com"]) ? $reply["com"] : null;
  14.     $imageName = null;
  15.     $imageSize = 0;
  16.     $thumbWidth = 0;
  17.     $thumbHeight = 0;
  18.     $imageWidth = 0;
  19.     $imageHeight = 0;
  20.     $imageUrl = null;
  21.     $originalImageName = null;
  22.     $imageDeleteHash = null;
  23.    
  24.     $chanImageName = isset($reply["tim"]) ? $reply["tim"] : null;
  25.    
  26.     if($chanImageName !== null) {
  27.         $chanImageName .= $reply["ext"];
  28.         $imgLink = "http://i.4cdn.org/" . $board . "/src/" . $chanImageName;
  29.         $thumbWidth = $reply["tn_w"];
  30.         $thumbHeight = $reply["tn_h"];
  31.         $imageWidth = $reply["w"];
  32.         $imageHeight = $reply["h"];
  33.         $originalImageName = $reply["filename"] . $reply["ext"];
  34.         $imageSize = $reply["fsize"];
  35.  
  36.     /* ... SNIP ... */
  37.     /* ... SNIP ... */
  38.     /* ... SNIP ... */
  39.  
  40.     $postsToAdd[] = array(
  41.         "chan_id" => $postID,
  42.         "threads_id" => $threadId,
  43.         "body" => $postBody,
  44.         "subject" => $subject,
  45.         "name" => $name,
  46.         "chan_image_name" => $chanImageName,
  47.         "thumb_dimensions" => $thumbWidth . 'x'. $thumbHeight,
  48.         "image_dimensions" => $imageWidth . 'x'. $imageHeight,
  49.         "image_url" => $imageUrl,
  50.         "original_image_name" => $originalImageName,
  51.         "chan_user_id" => $posterId,
  52.         "tripcode" => $tripCode,
  53.         "capcode" => $capCode,
  54.         "chan_post_date" => Database::fromUnix($postTimestamp),
  55.         "available" => 1
  56.     );
Advertisement
Add Comment
Please, Sign In to add comment