Add a checkbox to don't show the paste on the main page
This commit is contained in:
parent
ca8b5a0c3e
commit
8bb7bbb519
@ -104,11 +104,11 @@ else
|
|||||||
|
|
||||||
<label for="content">Contenu :</label><br>
|
<label for="content">Contenu :</label><br>
|
||||||
<textarea id="content" name="content"><?php
|
<textarea id="content" name="content"><?php
|
||||||
echo htmlentities(utf8_decode($paste->content));
|
echo htmlentities($paste->content);
|
||||||
?></textarea><br><br>
|
?></textarea><br><br>
|
||||||
|
|
||||||
<label for="crypt" style="font-style: italic;">Mot de passe :</label>
|
<label for="crypt" style="font-style: italic;">Mot de passe :</label>
|
||||||
<input type="text" maxlength="64" size="25" id="crypt" name="crypt">
|
<input type="text" maxlength="64" size="20" id="crypt" name="crypt">
|
||||||
|
|
||||||
<label for="lang">Langage :</label>
|
<label for="lang">Langage :</label>
|
||||||
<select id="lang" name="lang">
|
<select id="lang" name="lang">
|
||||||
@ -142,6 +142,9 @@ else
|
|||||||
if (!empty($paste->fileref))
|
if (!empty($paste->fileref))
|
||||||
echo '<input type="hidden" name="ref" value="'.$paste->fileref.'">';
|
echo '<input type="hidden" name="ref" value="'.$paste->fileref.'">';
|
||||||
?>
|
?>
|
||||||
|
<input type="checkbox" id="hide" name="hide" value="1">
|
||||||
|
<label for="hide">Invisible</label>
|
||||||
|
|
||||||
<input type="submit" value="Envoyer">
|
<input type="submit" value="Envoyer">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
@ -37,10 +37,10 @@ if ($dh = opendir(DESTINATION))
|
|||||||
if ($i > 23)
|
if ($i > 23)
|
||||||
{
|
{
|
||||||
$GT = $GA = $GL = "";
|
$GT = $GA = $GL = "";
|
||||||
if (!empty($srch_title)) $GR = "&title=".$srch;
|
if (!empty($srch_title)) $GT = "&title=".$srch;
|
||||||
if (!empty($srch_author)) $GR = "&author=".$srch;
|
if (!empty($srch_author)) $GA = "&author=".$srch;
|
||||||
if (!empty($srch_lang)) $GR = "&lang=".$srch;
|
if (!empty($srch_lang)) $GL = "&lang=".$srch;
|
||||||
print '<li><a href="./?s='.(intval($_GET["s"])+23).$GR.'#list">Plus anciens ...</a></li>';
|
print '<li><a href="./?s='.(intval($_GET["s"])+23).$GT.$GA.$GL.'#list">Plus anciens ...</a></li>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,6 +3,15 @@ require_once("../common.php");
|
|||||||
|
|
||||||
if (!empty($_POST["content"]))
|
if (!empty($_POST["content"]))
|
||||||
{
|
{
|
||||||
|
if (!isset($_POST["title"]))
|
||||||
|
$_POST["title"] = "";
|
||||||
|
if (!isset($_POST["author"]))
|
||||||
|
$_POST["author"] = "";
|
||||||
|
if (!isset($_POST["lang"]))
|
||||||
|
$_POST["lang"] = "";
|
||||||
|
if (!isset($_POST["hide"]))
|
||||||
|
$_POST["hide"] = 0;
|
||||||
|
|
||||||
$paste = new Paste();
|
$paste = new Paste();
|
||||||
$paste->create($_POST);
|
$paste->create($_POST);
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class Paste
|
|||||||
}
|
}
|
||||||
//If the file already exists, find another name if the content is different
|
//If the file already exists, find another name if the content is different
|
||||||
while(is_file(Paste::get_path($filename))
|
while(is_file(Paste::get_path($filename))
|
||||||
&& Paste::speed_cmp(Paste::get_path($filename), $hash));
|
&& Paste::speed_cmp(Paste::get_path($filename), $this->hash));
|
||||||
}
|
}
|
||||||
$this->filename = $filename;
|
$this->filename = $filename;
|
||||||
|
|
||||||
@ -211,6 +211,7 @@ class Paste
|
|||||||
$this->title = $dict["title"];
|
$this->title = $dict["title"];
|
||||||
$this->author = $dict["author"];
|
$this->author = $dict["author"];
|
||||||
$this->language = $dict["lang"];
|
$this->language = $dict["lang"];
|
||||||
|
$this->private = intval($dict["hide"]);
|
||||||
$this->date = time();
|
$this->date = time();
|
||||||
$this->ip = $_SERVER["REMOTE_ADDR"];
|
$this->ip = $_SERVER["REMOTE_ADDR"];
|
||||||
if (isset($dict["ref"]))
|
if (isset($dict["ref"]))
|
||||||
@ -286,17 +287,9 @@ class Paste
|
|||||||
*/
|
*/
|
||||||
function get_diff($diff)
|
function get_diff($diff)
|
||||||
{
|
{
|
||||||
require_once("geshi/geshi.php");
|
|
||||||
require_once("simplediff.php");
|
require_once("simplediff.php");
|
||||||
|
|
||||||
$geshi = new GeSHi(htmlDiff($diff->content, $this->content),
|
return nl2br(htmlDiff($diff->content, $this->content));
|
||||||
$this->language);
|
|
||||||
|
|
||||||
return str_replace("<ins>", "<ins>",
|
|
||||||
str_replace("</ins>", "</ins>",
|
|
||||||
str_replace("<del>", "<del>",
|
|
||||||
str_replace("</del>", "</del>",
|
|
||||||
$geshi->parse_code()))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_answer($ref)
|
function add_answer($ref)
|
||||||
|
Reference in New Issue
Block a user