Add a new tag to hide a paste on the main page
This commit is contained in:
parent
47372cf211
commit
a6a87b6f8a
5 changed files with 23 additions and 8 deletions
|
|
@ -12,6 +12,7 @@ class Paste
|
|||
var $date;
|
||||
var $content;
|
||||
var $ip;
|
||||
var $private = false;
|
||||
var $ref = NULL;
|
||||
var $hash;
|
||||
var $crypt = NULL;
|
||||
|
|
@ -82,6 +83,9 @@ class Paste
|
|||
else
|
||||
$this->hash = NULL;
|
||||
|
||||
if ($doc->getElementsByTagName("private")->length > 0)
|
||||
$this->private = true;
|
||||
|
||||
if ($doc->getElementsByTagName("crypt")->length > 0)
|
||||
$this->crypt = base64_decode($doc->getElementsByTagName("crypt")->item(0)->textContent);
|
||||
else
|
||||
|
|
@ -186,6 +190,10 @@ class Paste
|
|||
$xml_paste->appendChild(
|
||||
$xml->createElement("hash", $this->hash));
|
||||
|
||||
if ($this->is_private ())
|
||||
$xml_paste->appendChild(
|
||||
$xml->createElement("private"));
|
||||
|
||||
$xml->appendChild($xml_paste);
|
||||
|
||||
if ($xml->save(Paste::get_path($this->filename)))
|
||||
|
|
@ -316,6 +324,11 @@ class Paste
|
|||
}
|
||||
}
|
||||
|
||||
function is_private()
|
||||
{
|
||||
return $this->private;
|
||||
}
|
||||
|
||||
function export_to_file($fileto)
|
||||
{
|
||||
file_put_contents($fileto, $this->content);
|
||||
|
|
|
|||
Reference in a new issue