mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +01:00
Format
This commit is contained in:
parent
f1742c65d9
commit
e7ad8bdde1
12 changed files with 97 additions and 72 deletions
|
@ -157,67 +157,81 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
action="<?= $_SERVER['PHP_SELF']; ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_name">Site Name</label>
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_name">Site
|
||||
Name</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="site_info[site_name]" id="site_info_name"
|
||||
<input type="text" class="form-control" name="site_info[site_name]"
|
||||
id="site_info_name"
|
||||
placeholder="The name of your site"
|
||||
value="<?= pp_html_escape($current_site_info['site_name']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_title">Site Title</label>
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_title">Site
|
||||
Title</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="site_info[title]" id="site_info_title"
|
||||
<input type="text" class="form-control" name="site_info[title]"
|
||||
id="site_info_title"
|
||||
placeholder="Site title tag"
|
||||
value="<?= pp_html_escape($current_site_info['title']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_baseurl">Domain name</label>
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_baseurl">Domain
|
||||
name</label>
|
||||
<div class="col-sm-1" style="padding:5px;">
|
||||
<span class="badge">
|
||||
<?= !empty($_SERVER['HTTPS']) ? 'https://' : 'http://' ?>;
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" name="site_info[baseurl]" id="site_info_baseurl"
|
||||
<input type="text" class="form-control" name="site_info[baseurl]"
|
||||
id="site_info_baseurl"
|
||||
placeholder="eg: ponepaste.org (no trailing slash)"
|
||||
value="<?= pp_html_escape($current_site_info['baseurl']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_description">Site Description</label>
|
||||
<label class="col-sm-2 control-label form-label"
|
||||
for="site_info_description">Site Description</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="site_info[description]" id="site_info_description"
|
||||
<input type="text" class="form-control" name="site_info[description]"
|
||||
id="site_info_description"
|
||||
placeholder="Site description"
|
||||
value="<?= pp_html_escape($current_site_info['description']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_keywords">Site Keywords</label>
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_keywords">Site
|
||||
Keywords</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="site_info[keywords]" id="site_info_keywords"
|
||||
<input type="text" class="form-control" name="site_info[keywords]"
|
||||
id="site_info_keywords"
|
||||
placeholder="Keywords (separated by a comma)"
|
||||
value="<?= pp_html_escape($current_site_info['keywords']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_email">Admin Email</label>
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_email">Admin
|
||||
Email</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" name="site_info[email]" placeholder="Email" id="site_info_email"
|
||||
<input type="text" class="form-control" name="site_info[email]"
|
||||
placeholder="Email" id="site_info_email"
|
||||
value="<?= pp_html_escape($current_site_info['email']); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label form-label" for="site_info_additional_scripts">Additional Site
|
||||
<label class="col-sm-2 control-label form-label"
|
||||
for="site_info_additional_scripts">Additional Site
|
||||
Scripts</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="additional_scripts" id="site_info_additional_scripts"
|
||||
<textarea class="form-control" id="additional_scripts"
|
||||
id="site_info_additional_scripts"
|
||||
name="site_info[additional_scripts]"
|
||||
rows="8"><?= pp_html_escape($current_site_info['title']); ?></textarea>
|
||||
</div>
|
||||
|
@ -274,7 +288,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
action="<?= $_SERVER['PHP_SELF']; ?>">
|
||||
|
||||
<div class="checkbox checkbox-primary">
|
||||
<input <?php if ($current_captcha['enabled']) echo 'checked="true"'; ?> type="checkbox"
|
||||
<input <?php if ($current_captcha['enabled']) echo 'checked="true"'; ?>
|
||||
type="checkbox"
|
||||
name="captcha[enabked]"
|
||||
id="captcha_enabled">
|
||||
<label for="captcha_enabled">Enable Captcha</label>
|
||||
|
@ -282,7 +297,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
<br/>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="captcha_mode" class="col-sm-1 col-form-label">Captcha Type</label>
|
||||
<label for="captcha_mode" class="col-sm-1 col-form-label">Captcha
|
||||
Type</label>
|
||||
<select id="captcha_mode" class="selectpicker" name="captcha[mode]">
|
||||
<?php
|
||||
if ($current_captcha['mode'] == "Easy") {
|
||||
|
@ -311,7 +327,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
Internal Captcha Settings:
|
||||
</div>
|
||||
<div class="checkbox checkbox-primary">
|
||||
<input <?php if ($current_captcha['multiple']) echo 'checked="checked"'; ?> type="checkbox"
|
||||
<input <?php if ($current_captcha['multiple']) echo 'checked="checked"'; ?>
|
||||
type="checkbox"
|
||||
name="captcha[multiple]"
|
||||
id="captcha_multiple">
|
||||
<label for="captcha_multiple">Enable multiple backgrounds</label>
|
||||
|
@ -322,7 +339,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
Characters</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="captcha_allowed" name="captcha[allowed]"
|
||||
placeholder="Allowed Characters" value="<?php echo $current_captcha['allowed']; ?>">
|
||||
placeholder="Allowed Characters"
|
||||
value="<?php echo $current_captcha['allowed']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -331,7 +349,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
Colour</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="captcha_colour" name="captcha[colour]"
|
||||
placeholder="Captcha Text Colour" value="<?= $current_captcha['colour']; ?>">
|
||||
placeholder="Captcha Text Colour"
|
||||
value="<?= $current_captcha['colour']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ function sandwitch($str) {
|
|||
|
||||
|
||||
function getevent($conn, $event_name, $count) {
|
||||
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member, tagsys FROM pastes WHERE visible='1' AND tagsys LIKE '%?%'
|
||||
$query = $conn->prepare("SELECT id, visible, title, date, now_time, views, member FROM pastes WHERE visible='1' AND tagsys LIKE '%?%'
|
||||
ORDER BY RAND () LIMIT 0, ?");
|
||||
$query->execute([$event_name, $count]);
|
||||
return $query->fetchAll();
|
||||
|
|
|
@ -39,7 +39,7 @@ $fav_count = intval($query->fetch(PDO::FETCH_NUM)[0]);
|
|||
|
||||
// Get paste info
|
||||
$row = $conn->querySelectOne(
|
||||
'SELECT title, content, visible, code, expiry, pastes.password AS password, created_at, updated_at, encrypt, views, tagsys, users.username AS member, users.id AS user_id
|
||||
'SELECT title, content, visible, code, expiry, pastes.password AS password, created_at, updated_at, encrypt, views, users.username AS member, users.id AS user_id
|
||||
FROM pastes
|
||||
INNER JOIN users ON users.id = pastes.user_id
|
||||
WHERE pastes.id = ?', [$paste_id]);
|
||||
|
|
|
@ -124,7 +124,9 @@
|
|||
<div class="list-widget pagination-content">
|
||||
<?php
|
||||
$res = getrandom($conn, 10);
|
||||
foreach ($res as $index => $row) {
|
||||
foreach ($res
|
||||
|
||||
as $index => $row) {
|
||||
$title = Trim($row['title']);
|
||||
$titlehov = ($row['title']);
|
||||
$p_member = Trim($row['member']);
|
||||
|
@ -242,8 +244,10 @@
|
|||
<div class="field">
|
||||
<label class="label">Tags</label>
|
||||
<div class="control">
|
||||
<input id="tags-with-source" name="tag_input" class="input" data-max-tags="10"
|
||||
data-max-chars="40" type="text" data-item-text="name" data-item-value="name"
|
||||
<input id="tags-with-source" name="tag_input" class="input"
|
||||
data-max-tags="10"
|
||||
data-max-chars="40" type="text" data-item-text="name"
|
||||
data-item-value="name"
|
||||
data-case-sensitive="false" placeholder="10 Tags Maximum"
|
||||
value="<?php echo (isset($_POST['tag_input'])) ? $_POST['tag_input'] : ''; // Pre-populate if we come here on an error" ?>">
|
||||
</div>
|
||||
|
|
|
@ -179,7 +179,9 @@ $protocol = paste_protocol();
|
|||
$p_dateui = $p_date->format("d F Y");
|
||||
$p_views = Trim($row['views']);
|
||||
$p_visible = intval($row['visible']);
|
||||
$tagArray = array_map(function($tag) { return $tag['name']; }, getPasteTags($conn, $p_id));
|
||||
$tagArray = array_map(function ($tag) {
|
||||
return $tag['name'];
|
||||
}, getPasteTags($conn, $p_id));
|
||||
$p_tags = implode(',', $tagArray);
|
||||
|
||||
|
||||
|
@ -262,7 +264,7 @@ $protocol = paste_protocol();
|
|||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($profile_favs as $index => $row) {
|
||||
foreach ($profile_favs as $row) {
|
||||
$ftitle = Trim($row['title']);
|
||||
$f_id = Trim($row['paste_id']);
|
||||
$f_date = new DateTime($row['f_time']);
|
||||
|
|
Loading…
Add table
Reference in a new issue