Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getMany($messages = array(), $start = null)
- {
- if (!empty($start) && is_numeric($start))
- {
- $start = ($start * 20)-1;
- if (count($messages) > 20)
- {
- $length = count($messages);
- $length = (($length-20)>$start)?$length-20:$length-$start;
- $messages = array_slice($messages,$start,$length);
- }
- else
- {
- return array();
- }
- }
- $return = array();
- $threading = false;
- if ($this->userData && $this->userData['threading'] == 1)
- {
- $threading = true;
- }
- if (($messages) AND (is_array($messages))) {
- foreach ($messages as $message)
- {
- if ($message)
- {
- $return[] = $this->getOne($message);
- if ($threading && !empty($message['reply_to']))
- {
- foreach($this->getMany($this->prefixReplies($message['reply_to'])) as $replyid)
- {
- $return[]['replies'][] = $this->getOne($replyid);
- }
- }
- }
- }
- }
- return $return;
- }
Add Comment
Please, Sign In to add comment