mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +01:00
Reformat code.
This commit is contained in:
parent
7cd0aec39e
commit
9349d245a0
19 changed files with 1558 additions and 834 deletions
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
define('IN_PONEPASTE', 1);
|
||||
require_once(__DIR__ . '/../includes/common.php');
|
||||
require_once(__DIR__ . '/../includes/common.php');
|
||||
|
||||
$row = $conn->querySelectOne('SELECT user, pass FROM admin LIMIT 1');
|
||||
$adminid = $row['user'];
|
||||
|
|
|
@ -39,6 +39,6 @@ class DatabaseHandle {
|
|||
public function queryInsert(string $query, array $params = null) : int {
|
||||
$this->query($query, $params);
|
||||
|
||||
return (int)$this->conn->lastInsertId();
|
||||
return (int) $this->conn->lastInsertId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
class NonRetardedSSP {
|
||||
public static function run(DatabaseHandle $conn, array $request, string $countQuery, string $query) {
|
||||
/* Some of these parameters might not be passed; zero is an OK default */
|
||||
|
|
|
@ -6,7 +6,7 @@ class Tag {
|
|||
public string $slug;
|
||||
|
||||
public function __construct(array $row) {
|
||||
$this->id = (int)$row['id'];
|
||||
$this->id = (int) $row['id'];
|
||||
$this->name = $row['name'];
|
||||
$this->slug = $row['slug'];
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ function captcha($color, $mode, $mul, $allowed) : array {
|
|||
}
|
||||
|
||||
if (!function_exists('hex2rgb')) {
|
||||
function hex2rgb($hex_str) : array | null {
|
||||
function hex2rgb($hex_str) : array|null {
|
||||
$hex_str = preg_replace("/[^0-9A-Fa-f]/", '', $hex_str); // Gets a proper hex string
|
||||
|
||||
if (strlen($hex_str) == 6) {
|
||||
|
|
|
@ -37,10 +37,12 @@ function getreports($conn, $count = 10) {
|
|||
}
|
||||
|
||||
|
||||
function tagsToHtml(string | array $tags) : string {
|
||||
function tagsToHtml(string|array $tags) : string {
|
||||
$output = "";
|
||||
if (is_array($tags)) {
|
||||
$tagsSplit = array_map(function($tag) { return $tag['name']; }, $tags);
|
||||
$tagsSplit = array_map(function ($tag) {
|
||||
return $tag['name'];
|
||||
}, $tags);
|
||||
} else {
|
||||
$tagsSplit = explode(",", $tags);
|
||||
}
|
||||
|
@ -85,7 +87,7 @@ function linkify($value, $protocols = array('http', 'mail'), array $attributes =
|
|||
}, $value);
|
||||
|
||||
// Extract text links for each protocol
|
||||
foreach ((array)$protocols as $protocol) {
|
||||
foreach ((array) $protocols as $protocol) {
|
||||
$value = match ($protocol) {
|
||||
'http', 'https' => preg_replace_callback('~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i', function ($match) use ($protocol, &$links, $attr) {
|
||||
if ($match[1]) $protocol = $match[1];
|
||||
|
|
|
@ -120,12 +120,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
|
||||
$p_encrypt = $_POST['encrypted'];
|
||||
if ($p_encrypt == "" || $p_encrypt == null) {
|
||||
$p_encrypt = "0";
|
||||
} else {
|
||||
$p_encrypt = "0";
|
||||
} else {
|
||||
// Encrypt option
|
||||
$p_encrypt = "1";
|
||||
$p_content = openssl_encrypt($p_content, PP_ENCRYPTION_ALGO, PP_ENCRYPTION_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
// Set expiry time
|
||||
$expires = calculatePasteExpiry($p_expiry);
|
||||
|
@ -133,7 +133,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
// Edit existing paste or create new?
|
||||
if ($editing) {
|
||||
if ($current_user &&
|
||||
$current_user->user_id === (int)$conn->querySelectOne('SELECT user_id FROM pastes WHERE id = ?', [$_POST['paste_id']])['user_id']) {
|
||||
$current_user->user_id === (int) $conn->querySelectOne('SELECT user_id FROM pastes WHERE id = ?', [$_POST['paste_id']])['user_id']) {
|
||||
$paste_id = intval($_POST['paste_id']);
|
||||
|
||||
$conn->query(
|
||||
|
|
|
@ -47,7 +47,7 @@ if (isset($_POST['forgot'])) {
|
|||
}
|
||||
} elseif (isset($_POST['signin'])) { // Login process
|
||||
if (!empty($_POST['username']) && !empty($_POST['password'])) {
|
||||
$remember_me = (bool)$_POST['remember_me'];
|
||||
$remember_me = (bool) $_POST['remember_me'];
|
||||
$username = trim($_POST['username']);
|
||||
$row = $conn->query("SELECT id, password, banned FROM users WHERE username = ?", [$username])
|
||||
->fetch();
|
||||
|
@ -72,7 +72,7 @@ if (isset($_POST['forgot'])) {
|
|||
$error = $lang['banned'];
|
||||
} else {
|
||||
// Login successful
|
||||
$_SESSION['user_id'] = (string)$user_id;
|
||||
$_SESSION['user_id'] = (string) $user_id;
|
||||
|
||||
if ($remember_me) {
|
||||
$remember_token = pp_random_token();
|
||||
|
@ -81,7 +81,7 @@ if (isset($_POST['forgot'])) {
|
|||
$conn->query('INSERT INTO user_sessions (user_id, token, expire_at) VALUES (?, ?, FROM_UNIXTIME(?))', [$user_id, $remember_token, $expire_at->format('U')]);
|
||||
|
||||
setcookie(User::REMEMBER_TOKEN_COOKIE, $remember_token, [
|
||||
'expires' => (int)$expire_at->format('U'),
|
||||
'expires' => (int) $expire_at->format('U'),
|
||||
'secure' => !empty($_SERVER['HTTPS']), /* Local dev environment is non-HTTPS */
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax'
|
||||
|
|
14
paste.php
14
paste.php
|
@ -62,12 +62,12 @@ $paste = [
|
|||
'tags' => getPasteTags($conn, $paste_id)
|
||||
];
|
||||
|
||||
$p_member = $row['member'];
|
||||
$p_content = $row['content'];
|
||||
$p_visible = $row['visible'];
|
||||
$p_expiry = $row['expiry'];
|
||||
$p_password = $row['password'];
|
||||
$p_encrypt = (bool) $row['encrypt'];
|
||||
$p_member = $row['member'];
|
||||
$p_content = $row['content'];
|
||||
$p_visible = $row['visible'];
|
||||
$p_expiry = $row['expiry'];
|
||||
$p_password = $row['password'];
|
||||
$p_encrypt = (bool) $row['encrypt'];
|
||||
|
||||
|
||||
$is_private = $row['visible'] === '2';
|
||||
|
@ -85,7 +85,7 @@ $password_candidate = '';
|
|||
if ($password_required) {
|
||||
if (!empty($_POST['mypass'])) {
|
||||
$password_candidate = $_POST['mypass'];
|
||||
} else if (!empty($_GET['password'])) {
|
||||
} elseif (!empty($_GET['password'])) {
|
||||
$password_candidate = @base64_decode($_GET['password']);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#archive").dataTable({
|
||||
rowReorder: { selector: 'td:nth-child(2)'},
|
||||
rowReorder: {selector: 'td:nth-child(2)'},
|
||||
responsive: true,
|
||||
processing: true,
|
||||
language: {processing: '<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i><span class="sr-only">Loading...</span> '},
|
||||
|
|
|
@ -16,7 +16,7 @@ $start = $time;
|
|||
<!DOCTYPE html>
|
||||
<html lang="<?php echo basename($default_lang, ".php"); ?>">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>
|
||||
|
@ -33,9 +33,9 @@ $start = $time;
|
|||
<meta name="description" content="<?= pp_html_escape($global_site_info['description']) ?>"/>
|
||||
<meta name="keywords" content="<?= pp_html_escape($global_site_info['keywords']) ?>"/>
|
||||
<link rel="shortcut icon" href="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/img/favicon.ico">
|
||||
<link href="//<?= $baseurl ?>/theme/bulma/css/paste.css" rel="stylesheet" />
|
||||
<link href="//<?= $baseurl ?>/theme/bulma/css/table-responsive.css" rel="stylesheet" />
|
||||
<link href="//<?= $baseurl ?>/theme/bulma/css/table-row-orders.css" rel="stylesheet" />
|
||||
<link href="//<?= $baseurl ?>/theme/bulma/css/paste.css" rel="stylesheet"/>
|
||||
<link href="//<?= $baseurl ?>/theme/bulma/css/table-responsive.css" rel="stylesheet"/>
|
||||
<link href="//<?= $baseurl ?>/theme/bulma/css/table-row-orders.css" rel="stylesheet"/>
|
||||
<script src="//<?= $baseurl ?>/theme/bulma/js/jquery.min.js"></script>
|
||||
<script src="//<?= $baseurl ?>/theme/bulma/js/jquery-ui.min.js"></script>
|
||||
<script src="//<?= $baseurl ?>/theme/bulma/js/paste.js"></script>
|
||||
|
@ -54,7 +54,7 @@ $start = $time;
|
|||
class="navbar-item mx-1"><?php echo $site_name; ?></a>
|
||||
<div class="theme-switch-wrapper">
|
||||
<label class="theme-switch" for="checkbox">
|
||||
<input type="checkbox" id="checkbox" />
|
||||
<input type="checkbox" id="checkbox"/>
|
||||
<div class="slider round"></div>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -355,7 +355,6 @@ CONTENT HERE!
|
|||
</footer>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
const whenReady = (callback) => {
|
||||
if (document.readyState !== 'loading') {
|
||||
|
|
2153
theme/bulma/css/jquery-ui.css
vendored
2153
theme/bulma/css/jquery-ui.css
vendored
File diff suppressed because it is too large
Load diff
|
@ -4,11 +4,13 @@ table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty {
|
|||
cursor: default !important;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.child:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > th.child:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dataTables_empty:before {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
|
||||
position: relative;
|
||||
|
@ -16,10 +18,11 @@ table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
|
|||
padding-top: 25px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
|
||||
top: 50%;
|
||||
left: 5px;
|
||||
left: 5px;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin-top: -9px;
|
||||
|
@ -30,20 +33,23 @@ table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
|
|||
box-sizing: content-box;
|
||||
text-align: center;
|
||||
text-indent: 0 !important;
|
||||
font-family: 'Font Awesome\ 5 Free';
|
||||
font-family: 'Font Awesome\ 5 Free';
|
||||
font-weight: 900;
|
||||
line-height: 1em;
|
||||
content:"\f054";
|
||||
content: "\f054";
|
||||
color: #3298dc;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
|
||||
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
|
||||
content:"\f078";
|
||||
content: "\f078";
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td.dtr-control,
|
||||
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th.dtr-control {
|
||||
padding-left: 27px;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td.dtr-control:before,
|
||||
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th.dtr-control:before {
|
||||
left: 4px;
|
||||
|
@ -53,6 +59,7 @@ table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th.dtr-control:befor
|
|||
line-height: 14px;
|
||||
text-indent: 3px;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-column > tbody > tr > td.dtr-control,
|
||||
table.dataTable.dtr-column > tbody > tr > th.dtr-control,
|
||||
table.dataTable.dtr-column > tbody > tr > td.control,
|
||||
|
@ -60,12 +67,13 @@ table.dataTable.dtr-column > tbody > tr > th.control {
|
|||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-column > tbody > tr > td.dtr-control:before,
|
||||
table.dataTable.dtr-column > tbody > tr > th.dtr-control:before,
|
||||
table.dataTable.dtr-column > tbody > tr > td.control:before,
|
||||
table.dataTable.dtr-column > tbody > tr > th.control:before {
|
||||
top: 50%;
|
||||
left: 5px;
|
||||
left: 5px;
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin-top: -9px;
|
||||
|
@ -76,45 +84,54 @@ table.dataTable.dtr-column > tbody > tr > th.control:before {
|
|||
box-sizing: content-box;
|
||||
text-align: center;
|
||||
text-indent: 0 !important;
|
||||
font-family: 'Font Awesome\ 5 Free';
|
||||
font-family: 'Font Awesome\ 5 Free';
|
||||
font-weight: 900;
|
||||
line-height: 1em;
|
||||
content:"\f054";
|
||||
content: "\f054";
|
||||
color: #3298dc;
|
||||
}
|
||||
|
||||
table.dataTable.dtr-column > tbody > tr.parent td.dtr-control:before,
|
||||
table.dataTable.dtr-column > tbody > tr.parent th.dtr-control:before,
|
||||
table.dataTable.dtr-column > tbody > tr.parent td.control:before,
|
||||
table.dataTable.dtr-column > tbody > tr.parent th.control:before {
|
||||
content:"\f078";
|
||||
content: "\f078";
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child {
|
||||
padding: 0.5em 1em;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child:hover {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details {
|
||||
display: inline-block;
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details > li {
|
||||
border-bottom: 1px solid #efefef;
|
||||
padding: 0.5em 0;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details > li:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child ul.dtr-details > li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
table.dataTable > tbody > tr.child span.dtr-title {
|
||||
display: inline-block;
|
||||
min-width: 75px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div.dtr-modal {
|
||||
position: fixed;
|
||||
box-sizing: border-box;
|
||||
|
@ -125,6 +142,7 @@ div.dtr-modal {
|
|||
z-index: 100;
|
||||
padding: 10em 1em;
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-display {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
@ -142,10 +160,12 @@ div.dtr-modal div.dtr-modal-display {
|
|||
border-radius: 0.5em;
|
||||
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-content {
|
||||
position: relative;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-close {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
|
@ -159,9 +179,11 @@ div.dtr-modal div.dtr-modal-close {
|
|||
cursor: pointer;
|
||||
z-index: 12;
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-close:hover {
|
||||
background-color: #eaeaea;
|
||||
}
|
||||
|
||||
div.dtr-modal div.dtr-modal-background {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
@ -171,6 +193,7 @@ div.dtr-modal div.dtr-modal-background {
|
|||
z-index: 101;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
div.dtr-modal div.dtr-modal-display {
|
||||
width: 95%;
|
||||
|
|
|
@ -6,13 +6,16 @@ table.dt-rowReorder-float {
|
|||
outline-offset: -2px;
|
||||
z-index: 2001;
|
||||
}
|
||||
|
||||
tr.dt-rowReorder-moving {
|
||||
outline: 2px solid #555;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
body.dt-rowReorder-noOverflow {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
table.dataTable td.reorder {
|
||||
text-align: center;
|
||||
cursor: move;
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
<form action="" method="post">
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
<input type="hidden" name="id" value="<?php echo $paste_id; ?>" />
|
||||
<input type="hidden" name="id" value="<?php echo $paste_id; ?>"/>
|
||||
<input type="password" class="input" name="mypass"
|
||||
placeholder="<?php echo $lang['enterpwd']; ?>" />
|
||||
placeholder="<?php echo $lang['enterpwd']; ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" name="submit" class="button is-info">Submit</button>
|
||||
|
|
|
@ -2,29 +2,29 @@
|
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
||||
<script src="theme/bulma/js/bulma-tagsinput.min.js"></script>
|
||||
<script>
|
||||
function setupTagsInput() {
|
||||
function setupTagsInput() {
|
||||
const tagsInput = document.getElementById('tags-with-source');
|
||||
new BulmaTagsInput(tagsInput, {
|
||||
allowDuplicates: false,
|
||||
caseSensitive: false,
|
||||
clearSelectionOnTyping: false,
|
||||
closeDropdownOnItemSelect: true,
|
||||
delimiter: ',',
|
||||
freeInput: true,
|
||||
highlightDuplicate: true,
|
||||
highlightMatchesString: true,
|
||||
itemText: 'name',
|
||||
maxTags: 10,
|
||||
maxChars: 40,
|
||||
minChars: 1,
|
||||
noResultsLabel: 'No results found',
|
||||
placeholder: '10 Tags Maximum"',
|
||||
removable: true,
|
||||
searchMinChars: 1,
|
||||
searchOn: 'text',
|
||||
selectable: true,
|
||||
tagClass: 'is-info',
|
||||
trim: true,
|
||||
allowDuplicates: false,
|
||||
caseSensitive: false,
|
||||
clearSelectionOnTyping: false,
|
||||
closeDropdownOnItemSelect: true,
|
||||
delimiter: ',',
|
||||
freeInput: true,
|
||||
highlightDuplicate: true,
|
||||
highlightMatchesString: true,
|
||||
itemText: 'name',
|
||||
maxTags: 10,
|
||||
maxChars: 40,
|
||||
minChars: 1,
|
||||
noResultsLabel: 'No results found',
|
||||
placeholder: '10 Tags Maximum"',
|
||||
removable: true,
|
||||
searchMinChars: 1,
|
||||
searchOn: 'text',
|
||||
selectable: true,
|
||||
tagClass: 'is-info',
|
||||
trim: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -191,12 +191,12 @@ function setupTagsInput() {
|
|||
<select data-live-search="true" name="format">
|
||||
<?php
|
||||
foreach (PP_HIGHLIGHT_FORMATS as $code => $name) {
|
||||
if (isset($_POST['format'])) {
|
||||
$sel = ($_POST['format'] == $code) ? 'selected="selected"' : ''; // Pre-populate if we come here on an error
|
||||
} else {
|
||||
$sel = ($code == "markdown") ? 'selected="selected"' : '';
|
||||
}
|
||||
echo '<option ' . $sel . ' value="' . $code . '">' . $name . '</option>';
|
||||
if (isset($_POST['format'])) {
|
||||
$sel = ($_POST['format'] == $code) ? 'selected="selected"' : ''; // Pre-populate if we come here on an error
|
||||
} else {
|
||||
$sel = ($code == "markdown") ? 'selected="selected"' : '';
|
||||
}
|
||||
echo '<option ' . $sel . ' value="' . $code . '">' . $name . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
@ -329,7 +329,7 @@ function setupTagsInput() {
|
|||
<div class="column">
|
||||
<input type="text" class="input" name="pass" id="pass"
|
||||
placeholder="<?php echo $lang['pwopt']; ?>"
|
||||
value="<?php echo (isset($_POST['pass'])) ? pp_html_escape($_POST['pass']) : ''; ?>" />
|
||||
value="<?php echo (isset($_POST['pass'])) ? pp_html_escape($_POST['pass']) : ''; ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<button disabled type="submit" name="Gen_key" class="button is-info">Generate New Key</button>
|
||||
<button disabled type="submit" name="Gen_key" class="button is-info">Generate New Key
|
||||
</button>
|
||||
<br>
|
||||
<small>Coming soon</small>
|
||||
</div>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#archive").dataTable({
|
||||
rowReorder: { selector: 'td:nth-child(2)'},
|
||||
responsive: true,
|
||||
rowReorder: {selector: 'td:nth-child(2)'},
|
||||
responsive: true,
|
||||
pageLength: 50,
|
||||
autoWidth: false,
|
||||
initComplete: function () {
|
||||
|
@ -19,23 +19,23 @@
|
|||
</script>
|
||||
<?php if ($current_user) { ?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#favs").dataTable({
|
||||
rowReorder: { selector: 'td:nth-child(2)'},
|
||||
responsive: true,
|
||||
pageLength: 50,
|
||||
autoWidth: false,
|
||||
initComplete: function () {
|
||||
var search = new URLSearchParams(window.location.search);
|
||||
var query = search.get('q');
|
||||
if (query) {
|
||||
$("#archive_filter input")
|
||||
.val(query)
|
||||
.trigger("input");
|
||||
$(document).ready(function () {
|
||||
$("#favs").dataTable({
|
||||
rowReorder: {selector: 'td:nth-child(2)'},
|
||||
responsive: true,
|
||||
pageLength: 50,
|
||||
autoWidth: false,
|
||||
initComplete: function () {
|
||||
var search = new URLSearchParams(window.location.search);
|
||||
var query = search.get('q');
|
||||
if (query) {
|
||||
$("#archive_filter input")
|
||||
.val(query)
|
||||
.trigger("input");
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
<main class="bd-main">
|
||||
|
@ -232,7 +232,7 @@
|
|||
' . strtoupper($p_code) . '
|
||||
</td>
|
||||
<td class="td-center">
|
||||
<a href="' . $protocol . $baseurl . '/' . $p_delete_link . '" title="' . $title . '" onClick="return confirm(' . $p_delete_message. ')"><i class="far fa-trash-alt fa-lg" aria-hidden="true"></i></a>
|
||||
<a href="' . $protocol . $baseurl . '/' . $p_delete_link . '" title="' . $title . '" onClick="return confirm(' . $p_delete_message . ')"><i class="far fa-trash-alt fa-lg" aria-hidden="true"></i></a>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
@ -264,7 +264,9 @@
|
|||
$f_dateui = $f_date->format("d F Y");
|
||||
$Recent_update = new DateTime($row['updated_at']);
|
||||
$Recent_update_u = date_format($Recent_update, 'U');
|
||||
$tagArray2 = array_map(function ($tag) { return $tag['name'];}, getPasteTags($conn, $f_id));
|
||||
$tagArray2 = array_map(function ($tag) {
|
||||
return $tag['name'];
|
||||
}, getPasteTags($conn, $f_id));
|
||||
$f_tags = implode(',', $tagArray2);
|
||||
//$p_link = ($mod_rewrite == '1') ? "$f_id" : "paste.php?favdel=$fu_id";
|
||||
//$f_delete_link = ($mod_rewrite == '1') ? "user.php?favdel&user=$profile_username&fid=$f_id" : "user.php?favdel&user=$profile_username&fid=$f_id";
|
||||
|
@ -289,13 +291,13 @@
|
|||
|
||||
</td>
|
||||
<td class="td-left">';
|
||||
if (strlen($f_tags) > 0) {
|
||||
foreach ($tagArray2 as $tags) {
|
||||
echo '<a href="' . $protocol . $baseurl . '/user.php?user=' . $profile_username . '&q=' . $tags . '"><span class="tag is-info">' . trim($tags) . '</span></a>';
|
||||
}
|
||||
} else {
|
||||
echo ' <span class="tag is-warning">No tags</span>';
|
||||
}
|
||||
if (strlen($f_tags) > 0) {
|
||||
foreach ($tagArray2 as $tags) {
|
||||
echo '<a href="' . $protocol . $baseurl . '/user.php?user=' . $profile_username . '&q=' . $tags . '"><span class="tag is-info">' . trim($tags) . '</span></a>';
|
||||
}
|
||||
} else {
|
||||
echo ' <span class="tag is-warning">No tags</span>';
|
||||
}
|
||||
|
||||
|
||||
echo '</td>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<link rel="stylesheet" href="theme/bulma/css/bulma-tagsinput.min.css"/>
|
||||
<script src="theme/bulma/js/bulma-tagsinput.min.js"></script>
|
||||
<script>
|
||||
function setupTagsInput() {
|
||||
function setupTagsInput() {
|
||||
const tagsInput = document.getElementById('tags-with-source');
|
||||
|
||||
if (tagsInput) {
|
||||
|
@ -68,7 +68,7 @@ function setupTagsInput() {
|
|||
});
|
||||
</script>
|
||||
<?php if ($using_highlighter): ?>
|
||||
<link rel="stylesheet" href="/vendor/scrivo/highlight.php/styles/default.css" />
|
||||
<link rel="stylesheet" href="/vendor/scrivo/highlight.php/styles/default.css"/>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$protocol = paste_protocol();
|
||||
|
@ -212,7 +212,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
|||
} else {
|
||||
echo 'paste.php?embed&id=';
|
||||
}
|
||||
echo $paste_id . '"></script>'; ?>' readonly />
|
||||
echo $paste_id . '"></script>'; ?>' readonly/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -245,7 +245,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
|||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div id="paste" style="line-height:1!important;"><?= $p_content ?></div>
|
||||
<div id="paste" style="line-height:1!important;"><?= $p_content ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<!-- Guests -->
|
||||
|
@ -295,7 +295,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
|||
<p class="control has-icons-left">
|
||||
<input type="text" class="input" name="title"
|
||||
placeholder="<?= $paste['title'] ?>"
|
||||
value="<?= $paste['title'] ?>" />
|
||||
value="<?= $paste['title'] ?>"/>
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa fa-font"></i>
|
||||
</span>
|
||||
|
@ -308,8 +308,8 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
|||
<select data-live-search="true" name="format">
|
||||
<?php // Show popular GeSHi formats
|
||||
foreach (PP_HIGHLIGHT_FORMATS as $code => $name) {
|
||||
$sel = ($paste['code'] == $code) ? 'selected="selected"' : ' ';
|
||||
echo '<option ' . $sel . ' value="' . $code . '">' . $name . '</option>';
|
||||
$sel = ($paste['code'] == $code) ? 'selected="selected"' : ' ';
|
||||
echo '<option ' . $sel . ' value="' . $code . '">' . $name . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
@ -346,8 +346,8 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
|||
$inputtags = $paste['tags'];
|
||||
foreach ($inputtags as $tag) {
|
||||
$tagsName = ucfirst(pp_html_escape($tag['name']));
|
||||
echo ','.$tagsName.'';
|
||||
}?>">
|
||||
echo ',' . $tagsName . '';
|
||||
} ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -412,7 +412,7 @@ $selectedloader = "$bg[$i]"; // set variable equal to which random filename was
|
|||
<div class="columns">
|
||||
<div class="column">
|
||||
<input type="text" class="input" name="pass" id="pass" value=""
|
||||
placeholder="<?php echo $lang['pwopt']; ?>" />
|
||||
placeholder="<?php echo $lang['pwopt']; ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue