Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_attach($attachments, $n = 0)
- {
- $count = count($attachments);
- for ($i = 0; $i < $count; $i++) {
- $attach = "";
- switch ($attachments[$i]->type) {
- case "photo":
- break;
- case "video":
- break;
- case "audio":
- break;
- case "doc":
- break;
- case "wall":
- $attachment = $attachments[$i]->wall;
- $wall["id"] = $attachment->id;
- $wall["from_id"] = $attachment->from_id;
- $wall["to_id"] = $attachment->to_id;
- $wall["date"] = $attachment->date;
- $wall["post_type"] = $attachment->post_type;
- $wall["text"] = $attachment->text;
- $wall["attachments"] = $attachment->attachments;
- $wall["attach"] = $attachment_text;
- if ($wall["attachments"] != null && $n < 5) {
- $n++;
- $wall["attach"] .= "<span class='attachment'>" . get_attach($attachments[$i]->attachments, $n) . "</span>";
- }
- $attach .= $wall["attach"];
- break;
- case "wall_reply":
- break;
- case "sticker":
- break;
- case "link":
- break;
- case "gift":
- break;
- case "market":
- break;
- case "market_album":
- break;
- }
- }
- return $attach;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement