2016-06-08 22:15:30 +01:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-body">
|
2017-04-02 12:49:39 +01:00
|
|
|
<?php
|
|
|
|
$edit_mode = false;
|
|
|
|
if(isset($_GET['page']) && $_GET['page']=='edit'){
|
|
|
|
$edit_mode = true;
|
|
|
|
printf('You are editing paste '.$_GET['id']);
|
|
|
|
printf('<form role="form" method="post" action="../post.php" onsubmit="document.getElementById(\'submit\').disabled=true;document.getElementById(\'submit\').value=\'Please wait...\';">');
|
|
|
|
}else printf('<form role="form" method="post" action="post.php" onsubmit="document.getElementById(\'submit\').disabled=true;document.getElementById(\'submit\').value=\'Please wait...\';">');
|
|
|
|
?>
|
2016-06-08 22:15:30 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="title">Paste title:</label>
|
2017-04-02 12:49:39 +01:00
|
|
|
<?php
|
|
|
|
if($edit_mode == true){
|
|
|
|
printf('<input type="title" class="form-control" value="'.$row['title'].'" id="title" name="title">');
|
|
|
|
} else printf('<input type="title" class="form-control" id="title" name="title">');
|
|
|
|
?>
|
2016-06-08 22:15:30 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="text">New paste:</label>
|
2017-04-02 12:49:39 +01:00
|
|
|
<?php
|
|
|
|
if($edit_mode == true){
|
2017-04-29 20:16:49 +01:00
|
|
|
echo '<textarea class="form-control" rows="5" id="text" name="text">'.$row['text'].'</textarea>';
|
2017-04-02 12:49:39 +01:00
|
|
|
} else printf('<textarea class="form-control" rows="5" id="text" name="text"></textarea>');
|
|
|
|
?>
|
2016-06-08 22:15:30 +01:00
|
|
|
</div>
|
2017-04-02 12:49:39 +01:00
|
|
|
<?php
|
|
|
|
if($edit_mode == true){
|
|
|
|
printf("<input type='hidden' name='type' value='edit_paste'></input>");
|
|
|
|
printf("<input type='hidden' name='uid' value='".$row['uid']."'></input>");
|
|
|
|
} else printf("<input type='hidden' name='type' value='paste'></input>");
|
|
|
|
?>
|
2016-06-11 21:03:17 +01:00
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
2016-06-12 16:32:25 +01:00
|
|
|
<!-- Posting as guest -->
|
|
|
|
<div class="checkbox">
|
2017-04-02 12:49:39 +01:00
|
|
|
<label><input type="checkbox" name="asguest">Post as guest</label>
|
2016-06-12 16:32:25 +01:00
|
|
|
</div>
|
2016-06-11 21:03:17 +01:00
|
|
|
<!-- Submit -->
|
|
|
|
<button type="submit" class="btn btn-default">Submit</button>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<!-- Expiry -->
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="expire">Expiration:</label>
|
|
|
|
<select class="form-control" id="expire" name="expire">
|
|
|
|
<option>Never</option>
|
|
|
|
<option value="600">10 Minutes</option>
|
|
|
|
<option value="3600">1 Hour</option>
|
|
|
|
<option value="86400">1 Day</option>
|
2016-06-16 16:33:16 +01:00
|
|
|
<option value="2592000">1 Month</option>
|
2016-06-11 21:03:17 +01:00
|
|
|
</select>
|
2016-06-13 16:17:14 +01:00
|
|
|
</div>
|
|
|
|
<!-- Syntax Highlight -->
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="syntax">Syntax Highlight:</label>
|
2016-06-13 17:27:46 +01:00
|
|
|
<select data-placeholder="None" class="form-control chosen-select" id="syntax" name="syntax">
|
2017-04-02 12:49:39 +01:00
|
|
|
<?php
|
|
|
|
if($edit_mode == true)
|
|
|
|
print '<option value="'.$row['highlight'].'">Current ('.$row['highlight'].')</option>';
|
|
|
|
?>
|
2016-06-13 17:27:46 +01:00
|
|
|
<option value="plain">Plain</option>
|
|
|
|
<option value="applescript">AppleScript</option>
|
|
|
|
<option value="as3">ActionScript3 (AS3)</option>
|
|
|
|
<option value="bash">Bash</option>
|
|
|
|
<option value="cf">ColdFusion</option>
|
|
|
|
<option value="cpp">C++</option>
|
|
|
|
<option value="csharp">C#</option>
|
|
|
|
<option value="css">CSS</option>
|
|
|
|
<option value="delphi">Delphi</option>
|
|
|
|
<option value="diff">Diff</option>
|
|
|
|
<option value="erlang">Erlang</option>
|
|
|
|
<option value="groovy">Groovy</option>
|
|
|
|
<option value="java">Java</option>
|
|
|
|
<option value="javafx">JavaFX</option>
|
|
|
|
<option value="jscript">JScript</option>
|
|
|
|
<option value="perl">Perl</option>
|
|
|
|
<option value="php">Php</option>
|
|
|
|
<option value="powershell">PowerShell</option>
|
|
|
|
<option value="python">Python</option>
|
|
|
|
<option value="ruby">Ruby</option>
|
|
|
|
<option value="sass">Sass</option>
|
|
|
|
<option value="scala">Scala</option>
|
|
|
|
<option value="sql">Sql</option>
|
|
|
|
<option value="vb">VB</option>
|
|
|
|
<option value="xml">Xml</option>
|
2016-06-13 16:17:14 +01:00
|
|
|
</select>
|
2016-06-11 21:03:17 +01:00
|
|
|
</div>
|
2016-06-12 16:32:25 +01:00
|
|
|
<!-- Type -->
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="exposure">Type:</label>
|
|
|
|
<select class="form-control" id="exposure" name="exposure">
|
2017-04-02 12:49:39 +01:00
|
|
|
<?php
|
|
|
|
print '<option value="0">Public</option>';
|
|
|
|
if($edit_mode == true && $row['exposure'] == 1)
|
|
|
|
print '<option selected="selected" value="1">Unlisted</option>';
|
|
|
|
else print '<option value="1">Unlisted</option>';
|
2016-06-12 16:32:25 +01:00
|
|
|
include_once "includes/user.php";
|
|
|
|
$userID = -1;
|
|
|
|
if(isset($_COOKIE["pp_sid"]) && isset($_COOKIE["pp_skey"]))
|
|
|
|
$userID = GetUsersIDBySession($_COOKIE["pp_sid"],$_COOKIE["pp_skey"]);
|
|
|
|
if($userID==-1)
|
|
|
|
print '<option value="2" disabled>Private (Members only)</option>';
|
2017-04-02 12:49:39 +01:00
|
|
|
else {
|
|
|
|
if($edit_mode === true && $row['exposure'] === 2)
|
|
|
|
print '<option selected="selected" value="2" >Private</option>';
|
|
|
|
else print '<option value="2" >Private</option>';
|
|
|
|
}
|
2016-06-12 16:32:25 +01:00
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<!-- END Type -->
|
2016-06-11 21:03:17 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-06-08 22:15:30 +01:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|