changing paste read output for API refactoring
This commit is contained in:
@@ -52,6 +52,10 @@ class model_paste extends model_abstract
|
||||
$this->_data->meta->formatter = $this->_conf->getKey('defaultformatter');
|
||||
}
|
||||
}
|
||||
$this->_data->comments = array_values($this->getComments());
|
||||
$this->_data->comment_count = count($this->_data->comments);
|
||||
$this->_data->comment_offset = 0;
|
||||
$this->_data->{'@context'} = 'js/paste.jsonld';
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
|
||||
@@ -339,9 +339,7 @@ class zerobin
|
||||
$paste = $this->_model->getPaste($dataid);
|
||||
if ($paste->exists())
|
||||
{
|
||||
// The paste itself is the first in the list of encrypted messages.
|
||||
$messages = array_merge(array($paste->get()), $paste->getComments());
|
||||
$this->_data = json_encode($messages);
|
||||
$this->_data = json_encode($paste->get());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -359,7 +357,7 @@ class zerobin
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_return_message(0, $dataid, array('messages' => $messages));
|
||||
$this->_return_message(0, $dataid, json_decode($this->_data, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ class zerobin_db extends zerobin_abstract
|
||||
$comments[$i]->meta->nickname = $row['nickname'];
|
||||
if (array_key_exists('vizhash', $row))
|
||||
$comments[$i]->meta->vizhash = $row['vizhash'];
|
||||
$comments[$i]->meta->postdate = $i;
|
||||
$comments[$i]->meta->postdate = (int) $row['postdate'];
|
||||
$comments[$i]->meta->commentid = $row['dataid'];
|
||||
$comments[$i]->meta->parentid = $row['parentid'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user