mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 06:30:07 +01:00
Small bit of code cleanup.
This commit is contained in:
parent
8f940d718d
commit
3b9d09ef7b
32 changed files with 98 additions and 163 deletions
|
@ -65,4 +65,3 @@ require('ssp.pastes.php');
|
|||
echo json_encode(
|
||||
SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns, $columns2)
|
||||
);
|
||||
?>
|
|
@ -1,9 +1,7 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION['login'])) {
|
||||
// Do nothing
|
||||
} else {
|
||||
if (!isset($_SESSION['login'])) {
|
||||
header("Location: .");
|
||||
exit();
|
||||
}
|
||||
|
@ -65,4 +63,3 @@ require('ssp.reports.php');
|
|||
echo json_encode(
|
||||
SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns, $columns2)
|
||||
);
|
||||
?>
|
|
@ -54,4 +54,4 @@ if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") {
|
|||
header("Location: http://ponepaste.org/SVOtaKqJZh4nT9Z");
|
||||
die();
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
*/
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION['login'])) {
|
||||
// Do nothing
|
||||
} else {
|
||||
if (!isset($_SESSION['login'])) {
|
||||
header("Location: .");
|
||||
exit();
|
||||
}
|
||||
|
@ -57,9 +55,7 @@ while ($row = mysqli_fetch_array($result)) {
|
|||
}
|
||||
|
||||
if ($last_ip == $ip) {
|
||||
if ($last_date == $date) {
|
||||
|
||||
} else {
|
||||
if ($last_date != $date) {
|
||||
$query = "INSERT INTO admin_history (last_date,ip) VALUES ('$date','$ip')";
|
||||
mysqli_query($con, $query);
|
||||
}
|
||||
|
@ -192,8 +188,7 @@ if ($last_ip == $ip) {
|
|||
$fname = explode('.php', $files1[$loop]);
|
||||
$fname = $fname[0];
|
||||
$ffname = $files1[$loop];
|
||||
if ($ffname == "index.php") {/* we don't want index.php showing */
|
||||
} else {
|
||||
if ($ffname != "index.php") {
|
||||
echo '<option value="' . $ffname . '">' . $fname . '</option>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
*/
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION['login'])) {
|
||||
// Do nothing
|
||||
} else {
|
||||
if (!isset($_SESSION['login'])) {
|
||||
header("Location: .");
|
||||
exit();
|
||||
}
|
||||
|
@ -57,9 +55,7 @@ while ($row = mysqli_fetch_array($result)) {
|
|||
}
|
||||
|
||||
if ($last_ip == $ip) {
|
||||
if ($last_date == $date) {
|
||||
|
||||
} else {
|
||||
if ($last_date != $date) {
|
||||
$query = "INSERT INTO admin_history (last_date,ip) VALUES ('$date','$ip')";
|
||||
mysqli_query($con, $query);
|
||||
}
|
||||
|
@ -97,7 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' || isset($_GET['banip'])) {
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($_GET{'delete'})) {
|
||||
if (isset($_GET['delete'])) {
|
||||
$delete = htmlentities(Trim($_GET['delete']));
|
||||
$query = "DELETE FROM ban_user WHERE id=$delete";
|
||||
$result = mysqli_query($con, $query);
|
||||
|
@ -237,8 +233,8 @@ if (isset($_GET{'delete'})) {
|
|||
$rec_count = Trim($row[0]);
|
||||
|
||||
|
||||
if (isset($_GET{'page'})) { // Current page
|
||||
$page = $_GET{'page'} + 1;
|
||||
if (isset($_GET['page'])) { // Current page
|
||||
$page = $_GET['page'] + 1;
|
||||
$offset = $rec_limit * $page;
|
||||
} else {
|
||||
// Show first set of results
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
-------------------------------------------------------------------------------------------
|
||||
|
||||
</pre><div style="display:none"></body> */
|
||||
include "assets/posteddata.php"; ?>
|
||||
include "assets/posteddata.php";
|
||||
|
|
|
@ -18,28 +18,27 @@ require_once('common.php');
|
|||
updateAdminHistory($conn);
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if (isset($_POST{'editme'})) {
|
||||
if (isset($_POST['editme'])) {
|
||||
$edit_me_id = htmlentities(Trim($_POST['editme']));
|
||||
$page_name = Trim($_POST['page_name']);
|
||||
$page_title = Trim($_POST['page_title']);
|
||||
$page_content = $_POST['data'];
|
||||
|
||||
$query = "UPDATE pages SET last_date='$date', page_name='$page_name', page_title='$page_title', page_content='$page_content' WHERE id='$edit_me_id'";
|
||||
mysqli_query($con, $query);
|
||||
} else {
|
||||
$page_name = Trim($_POST['page_name']);
|
||||
$page_title = Trim($_POST['page_title']);
|
||||
$page_content = $_POST['data'];
|
||||
|
||||
$query = "INSERT INTO pages (last_date,page_name,page_title,page_content) VALUES ('$date','$page_name','$page_title','$page_content')";
|
||||
mysqli_query($con, $query);
|
||||
}
|
||||
mysqli_query($con, $query);
|
||||
$page_name = "";
|
||||
$page_title = "";
|
||||
$page_content = "";
|
||||
}
|
||||
|
||||
if (isset($_GET{'edit'})) {
|
||||
if (isset($_GET['edit'])) {
|
||||
|
||||
$page_id = trim($_GET['edit']);
|
||||
$sql = "SELECT * FROM pages where id='$page_id'";
|
||||
|
@ -120,7 +119,7 @@ if (isset($_GET{'edit'})) {
|
|||
</div>
|
||||
<br/>
|
||||
<?php
|
||||
if (isset($_GET{'edit'})) {
|
||||
if (isset($_GET['edit'])) {
|
||||
echo '<input type="hidden" value=' . $_GET['edit'] . 'id="editme" name="editme" />';
|
||||
}
|
||||
?>
|
||||
|
@ -151,7 +150,7 @@ if (isset($_GET{'edit'})) {
|
|||
<th>Delete</th>
|
||||
|
||||
<?php
|
||||
if (isset($_GET{'delete'})) {
|
||||
if (isset($_GET['delete'])) {
|
||||
$delete = htmlentities(Trim($_GET['delete']));
|
||||
$query = "DELETE FROM pages WHERE id=$delete";
|
||||
$result = mysqli_query($con, $query);
|
||||
|
|
|
@ -395,4 +395,3 @@ class SSP {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -395,4 +395,3 @@ class SSP {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -399,4 +399,3 @@ if ($_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest") {
|
|||
header("Location: http://ponepaste.org/SVOtaKqJZh4nT9Z");
|
||||
die();
|
||||
}
|
||||
?>
|
|
@ -14,9 +14,7 @@
|
|||
*/
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION['login'])) {
|
||||
// Do nothing
|
||||
} else {
|
||||
if (!isset($_SESSION['login'])) {
|
||||
header("Location: .");
|
||||
exit();
|
||||
}
|
||||
|
|
|
@ -43,4 +43,3 @@ require('ssp.pastes.php');
|
|||
echo json_encode(
|
||||
SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns, $columns2)
|
||||
);
|
||||
?>
|
|
@ -281,8 +281,7 @@ class SSP {
|
|||
} catch (PDOException $e) {
|
||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||
}
|
||||
$result = $stmt->fetchAll();
|
||||
return $result;
|
||||
return $stmt->fetchAll();
|
||||
}
|
||||
|
||||
static function Ssql_exec($db, $bindings, $sql = null) {
|
||||
|
@ -389,4 +388,3 @@ class SSP {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -308,8 +308,7 @@ class SSP {
|
|||
} catch (PDOException $e) {
|
||||
self::fatal("An SQL error occurred: " . $e->getMessage());
|
||||
}
|
||||
$result = $stmt->fetchAll();
|
||||
return $result;
|
||||
return $stmt->fetchAll();
|
||||
}
|
||||
|
||||
static function Ssql_exec($db, $bindings, $sql = null) {
|
||||
|
@ -341,7 +340,7 @@ class SSP {
|
|||
$result[$loop]['id'] = $arr['id'];
|
||||
$result[$loop]['member'] = $arr['member'];
|
||||
$result[$loop]['tagsys'] = sandwitch($arr['tagsys']);
|
||||
$date_time = strtotime(isset($arr['date']) ? $arr['date'] : '0');
|
||||
$date_time = strtotime($arr['date'] ?? '0');
|
||||
$result[$loop]['date'] = date("d F Y", $date_time);
|
||||
$myid = $arr['id'];
|
||||
$mytitle = $arr['title'];
|
||||
|
|
|
@ -33,4 +33,3 @@ $p_title = $lang['archive']; // "Pastes Archive";
|
|||
require_once('theme/' . $default_theme . '/header.php');
|
||||
require_once('theme/' . $default_theme . '/archive.php');
|
||||
require_once('theme/' . $default_theme . '/footer.php');
|
||||
?>
|
|
@ -29,4 +29,3 @@ $p_title = $lang['archive']; // "Pastes Archive";
|
|||
require_once('theme/' . $default_theme . '/header.php');
|
||||
require_once('theme/' . $default_theme . '/event.php');
|
||||
require_once('theme/' . $default_theme . '/footer.php');
|
||||
?>
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
function captcha($color, $mode, $mul, $allowed) {
|
||||
|
||||
use JetBrains\PhpStorm\ArrayShape;
|
||||
|
||||
#[ArrayShape(['code' => "mixed|string", 'image_src' => "string"])]
|
||||
function captcha($color, $mode, $mul, $allowed) : array {
|
||||
|
||||
$bg_path = dirname(__FILE__) . '/captchabg/';
|
||||
$font_path = dirname(__FILE__) . '/fonts/';
|
||||
|
@ -100,10 +104,10 @@ function captcha($color, $mode, $mul, $allowed) {
|
|||
|
||||
$_SESSION['_CAPTCHA']['config'] = serialize($captcha_config);
|
||||
|
||||
return array(
|
||||
return [
|
||||
'code' => $captcha_config['code'],
|
||||
'image_src' => $image_src
|
||||
);
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -68,14 +68,13 @@ function updatePageViews(PDO $conn) : void {
|
|||
$last_date = $last_page_view['date'];
|
||||
|
||||
if ($last_date == $date) {
|
||||
if (str_contains($data_ip, $ip)) {
|
||||
$last_tpage = intval($last_page_view['tpage']) + 1;
|
||||
$last_tpage = intval($last_page_view['tpage']) + 1;
|
||||
|
||||
if (str_contains($data_ip, $ip)) {
|
||||
// IP already exists, Update view count
|
||||
$statement = $conn->prepare("UPDATE page_view SET tpage = ? WHERE id = ?");
|
||||
$statement->execute([$last_tpage, $last_page_view['id']]);
|
||||
} else {
|
||||
$last_tpage = intval($last_page_view['tpage']) + 1;
|
||||
$last_tvisit = intval($last_page_view['tvisit']) + 1;
|
||||
|
||||
// Update both tpage and tvisit.
|
||||
|
|
|
@ -13,19 +13,6 @@
|
|||
* GNU General Public License in GPL.txt for more details.
|
||||
*/
|
||||
|
||||
|
||||
function timer() {
|
||||
static $start;
|
||||
|
||||
if (is_null($start)) {
|
||||
$start = microtime(true);
|
||||
} else {
|
||||
$diff = round((microtime(true) - $start), 4);
|
||||
$start = null;
|
||||
return $diff;
|
||||
}
|
||||
}
|
||||
|
||||
function getUserFavs(PDO $conn, string $user_id) : array {
|
||||
$query = $conn->prepare(
|
||||
"SELECT pins.f_time, pastes.id, pastes.title, pastes.created_at, pastes.tagsys
|
||||
|
@ -100,21 +87,16 @@ function linkify($value, $protocols = array('http', 'mail'), array $attributes =
|
|||
|
||||
// Extract text links for each protocol
|
||||
foreach ((array)$protocols as $protocol) {
|
||||
switch ($protocol) {
|
||||
case 'http':
|
||||
case 'https':
|
||||
$value = preg_replace_callback('~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i', function ($match) use ($protocol, &$links, $attr) {
|
||||
if ($match[1]) $protocol = $match[1];
|
||||
$link = $match[2] ?: $match[3];
|
||||
return '<' . array_push($links, "<a $attr href=\"$protocol://$link\">$protocol://$link</a>") . '>';
|
||||
}, $value);
|
||||
break;
|
||||
default:
|
||||
$value = preg_replace_callback('~' . preg_quote($protocol, '~') . '://([^\s<]+?)(?<![\.,:])~i', function ($match) use ($protocol, &$links, $attr) {
|
||||
return '<' . array_push($links, "<a $attr href=\"$protocol://{$match[1]}\">$protocol://{$match[1]}</a>") . '>';
|
||||
}, $value);
|
||||
break;
|
||||
}
|
||||
$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];
|
||||
$link = $match[2] ?: $match[3];
|
||||
return '<' . array_push($links, "<a $attr href=\"$protocol://$link\">$protocol://$link</a>") . '>';
|
||||
}, $value),
|
||||
default => preg_replace_callback('~' . preg_quote($protocol, '~') . '://([^\s<]+?)(?<![\.,:])~i', function ($match) use ($protocol, &$links, $attr) {
|
||||
return '<' . array_push($links, "<a $attr href=\"$protocol://{$match[1]}\">$protocol://{$match[1]}</a>") . '>';
|
||||
}, $value),
|
||||
};
|
||||
}
|
||||
|
||||
// Insert all link
|
||||
|
@ -213,7 +195,7 @@ function getRecent($conn, $count) {
|
|||
}
|
||||
|
||||
function getRecentadmin($conn, $count = 5) {
|
||||
$query = $conn->prepare('SELECT id, ip title, date, now_time, views, member FROM pastes ORDER BY id DESC LIMIT 0, ?');
|
||||
$query = $conn->prepare('SELECT id, ip, title, date, now_time, views, member FROM pastes ORDER BY id DESC LIMIT 0, ?');
|
||||
$query->execute([$count]);
|
||||
|
||||
return $query->fetchAll();
|
||||
|
@ -255,8 +237,8 @@ LIMIT 0 , ?");
|
|||
|
||||
function getUserPastes(PDO $conn, $user_id) : array {
|
||||
$query = $conn->prepare(
|
||||
"SELECT id, title, visible,code,created_at,tagsys,user_id from pastes WHERE user_id= ?
|
||||
ORDER by pastes.id DESC");
|
||||
"SELECT id, title, visible, code, created_at, tagsys, user_id, views from pastes WHERE user_id = ?
|
||||
ORDER by pastes.id DESC");
|
||||
$query->execute([$user_id]);
|
||||
return $query->fetchAll();
|
||||
}
|
||||
|
@ -350,8 +332,7 @@ function conTime($secs) {
|
|||
$ret[] = 'ago';
|
||||
|
||||
$val = join(' ', $ret);
|
||||
if (str_conntains($val, "week")) {
|
||||
} else {
|
||||
if (!str_conntains($val, "week")) {
|
||||
$val = str_replace("and", "", $val);
|
||||
}
|
||||
if (Trim($val) == "ago") {
|
||||
|
@ -404,7 +385,7 @@ function truncatetag($input, $maxWords, $maxChars) {
|
|||
$truncated1[] = $fragment;
|
||||
}
|
||||
|
||||
$result = implode($truncated1, ' ');
|
||||
$result = implode(' ', $truncated1);
|
||||
|
||||
return $result . ($input == $result ? '' : '...');
|
||||
}
|
||||
|
@ -414,11 +395,9 @@ function doDownload($paste_id, $p_title, $p_member, $p_conntent, $p_code) {
|
|||
if ($p_code) {
|
||||
// Figure out extensions.
|
||||
$ext = "txt";
|
||||
switch ($p_code) {
|
||||
default:
|
||||
$ext = 'txt';
|
||||
break;
|
||||
}
|
||||
$ext = match ($p_code) {
|
||||
default => 'txt',
|
||||
};
|
||||
|
||||
// Download
|
||||
$p_title = stripslashes($p_title);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
// Turn off all error reporting - uh no?
|
||||
//error_reporting(0);
|
||||
?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* GeSHi - Generic Syntax Highlighter
|
||||
|
@ -864,7 +864,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function enable_classes($flag = true) {
|
||||
$this->use_classes = ($flag) ? true : false;
|
||||
$this->use_classes = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1011,7 +1011,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function set_keyword_group_highlighting($key, $flag = true) {
|
||||
$this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['KEYWORDS'][$key] = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1051,7 +1051,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function set_comments_highlighting($key, $flag = true) {
|
||||
$this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['COMMENTS'][$key] = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1080,7 +1080,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function set_escape_characters_highlighting($flag = true) {
|
||||
$this->lexic_permissions['ESCAPE_CHAR'] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['ESCAPE_CHAR'] = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1116,7 +1116,7 @@ class GeSHi {
|
|||
* @deprecated In favour of set_symbols_highlighting
|
||||
*/
|
||||
public function set_brackets_highlighting($flag) {
|
||||
$this->lexic_permissions['BRACKETS'] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['BRACKETS'] = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1152,7 +1152,7 @@ class GeSHi {
|
|||
*/
|
||||
public function set_symbols_highlighting($flag) {
|
||||
// Update lexic permissions for this symbol group
|
||||
$this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['SYMBOLS'] = (bool)$flag;
|
||||
|
||||
// For backward compatibility
|
||||
$this->set_brackets_highlighting($flag);
|
||||
|
@ -1184,7 +1184,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function set_strings_highlighting($flag) {
|
||||
$this->lexic_permissions['STRINGS'] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['STRINGS'] = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1233,7 +1233,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function set_numbers_highlighting($flag) {
|
||||
$this->lexic_permissions['NUMBERS'] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['NUMBERS'] = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1264,7 +1264,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function set_methods_highlighting($flag) {
|
||||
$this->lexic_permissions['METHODS'] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['METHODS'] = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1295,7 +1295,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function set_regexps_highlighting($key, $flag) {
|
||||
$this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false;
|
||||
$this->lexic_permissions['REGEXPS'][$key] = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1306,7 +1306,7 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public function set_case_sensitivity($key, $case) {
|
||||
$this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false;
|
||||
$this->language_data['CASE_SENSITIVE'][$key] = (bool)$case;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1406,7 +1406,7 @@ class GeSHi {
|
|||
* @todo Rewrite with array traversal
|
||||
*/
|
||||
public function enable_highlighting($flag = true) {
|
||||
$flag = $flag ? true : false;
|
||||
$flag = (bool)$flag;
|
||||
foreach ($this->lexic_permissions as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $k => $v) {
|
||||
|
@ -1781,7 +1781,7 @@ class GeSHi {
|
|||
* @since 1.0.2
|
||||
*/
|
||||
public function enable_important_blocks($flag) {
|
||||
$this->enable_important_blocks = ($flag) ? true : false;
|
||||
$this->enable_important_blocks = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1791,7 +1791,7 @@ class GeSHi {
|
|||
* @since 1.0.2
|
||||
*/
|
||||
public function enable_ids($flag = true) {
|
||||
$this->add_ids = ($flag) ? true : false;
|
||||
$this->add_ids = (bool)$flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3192,14 +3192,11 @@ class GeSHi {
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected function change_case($instr) {
|
||||
switch ($this->language_data['CASE_KEYWORDS']) {
|
||||
case GESHI_CAPS_UPPER:
|
||||
return strtoupper($instr);
|
||||
case GESHI_CAPS_LOWER:
|
||||
return strtolower($instr);
|
||||
default:
|
||||
return $instr;
|
||||
}
|
||||
return match ($this->language_data['CASE_KEYWORDS']) {
|
||||
GESHI_CAPS_UPPER => strtoupper($instr),
|
||||
GESHI_CAPS_LOWER => strtolower($instr),
|
||||
default => $instr,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3445,8 +3442,7 @@ class GeSHi {
|
|||
foreach (array_keys($this->language_data['KEYWORDS']) as $k) {
|
||||
if (!$this->use_classes) {
|
||||
$attributes = ' style="' .
|
||||
(isset($this->language_data['STYLES']['KEYWORDS'][$k]) ?
|
||||
$this->language_data['STYLES']['KEYWORDS'][$k] : "") . '"';
|
||||
($this->language_data['STYLES']['KEYWORDS'][$k] ?? "") . '"';
|
||||
} else {
|
||||
$attributes = ' class="kw' . $k . '"';
|
||||
}
|
||||
|
@ -4126,7 +4122,7 @@ class GeSHi {
|
|||
$footer = $this->footer_content;
|
||||
if ($footer) {
|
||||
if ($this->header_type == GESHI_HEADER_PRE) {
|
||||
$footer = str_replace("\n", '', $footer);;
|
||||
$footer = str_replace("\n", '', $footer);
|
||||
}
|
||||
$footer = $this->replace_keywords($footer);
|
||||
|
||||
|
@ -4377,20 +4373,12 @@ class GeSHi {
|
|||
// or the appropriate key is given.
|
||||
foreach ($this->link_styles as $key => $style) {
|
||||
if ($style != '') {
|
||||
switch ($key) {
|
||||
case GESHI_LINK:
|
||||
$stylesheet .= "{$selector}a:link {{$style}}\n";
|
||||
break;
|
||||
case GESHI_HOVER:
|
||||
$stylesheet .= "{$selector}a:hover {{$style}}\n";
|
||||
break;
|
||||
case GESHI_ACTIVE:
|
||||
$stylesheet .= "{$selector}a:active {{$style}}\n";
|
||||
break;
|
||||
case GESHI_VISITED:
|
||||
$stylesheet .= "{$selector}a:visited {{$style}}\n";
|
||||
break;
|
||||
}
|
||||
$stylesheet .= match ($key) {
|
||||
GESHI_LINK => "{$selector}a:link {{$style}}\n",
|
||||
GESHI_HOVER => "{$selector}a:hover {{$style}}\n",
|
||||
GESHI_ACTIVE => "{$selector}a:active {{$style}}\n",
|
||||
GESHI_VISITED => "{$selector}a:visited {{$style}}\n",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -236,4 +236,3 @@ OutPut:
|
|||
require_once('theme/' . $default_theme . '/header.php');
|
||||
require_once('theme/' . $default_theme . '/main.php');
|
||||
require_once('theme/' . $default_theme . '/footer.php');
|
||||
?>
|
|
@ -117,4 +117,4 @@ $lang['profile-total-pri'] = "Total private pastes:";
|
|||
$lang['profile-total-views'] = "Total views of all your pastes:";
|
||||
$lang['embed-hosted-by'] = "hosted by";
|
||||
$lang['view-raw'] = "Покажи в необработен текст";
|
||||
?>
|
||||
|
||||
|
|
|
@ -118,4 +118,4 @@ $lang['profile-total-pri'] = "Numero de pastes privados:";
|
|||
$lang['profile-total-views'] = "Numero de visualizações nos seus pastes:";
|
||||
$lang['embed-hosted-by'] = "hospedado por";
|
||||
$lang['view-raw'] = "Ver texto bruto";
|
||||
?>
|
||||
|
||||
|
|
|
@ -119,4 +119,4 @@ $lang['profile-total-pri'] = "Total private Pastes:";
|
|||
$lang['profile-total-views'] = "Total Ansichten all deiner Pastes:";
|
||||
$lang['embed-hosted-by'] = "gehostet von";
|
||||
$lang['view-raw'] = "Zeige Raw";
|
||||
?>
|
||||
|
||||
|
|
|
@ -130,4 +130,4 @@ $lang['pastfavs-total'] = "Total Favorites of your pastes:";
|
|||
$lang['yourfavs-total'] = "Total Favorites by you:";
|
||||
$lang['embed-hosted-by'] = "hosted by";
|
||||
$lang['view-raw'] = "View Raw";
|
||||
?>
|
||||
|
||||
|
|
|
@ -117,4 +117,4 @@ $lang ['perfil-total-pri'] = "Total de pegados privados:";
|
|||
$lang ['profile-total-views'] = "Total de vistas de todos sus pegados:";
|
||||
$lang ['embed-hosted-by'] = "alojado por";
|
||||
$lang ['view-raw'] = "Ver crudo";
|
||||
?>
|
||||
|
||||
|
|
|
@ -119,4 +119,3 @@ $lang['profile-total-views'] = "Nombre total de vues :";
|
|||
$lang['embed-hosted-by'] = "hébergé par";
|
||||
$lang['view-raw'] = "Voir les données brutes";
|
||||
|
||||
?>
|
|
@ -119,4 +119,4 @@ $lang['profile-total-pri'] = "Prywatne wklejki:";
|
|||
$lang['profile-total-views'] = "Wyświetlenia wszystkich wklejek:";
|
||||
$lang['embed-hosted-by'] = "przechowywane na";
|
||||
$lang['view-raw'] = "Surowy plik";
|
||||
?>
|
||||
|
||||
|
|
|
@ -5,4 +5,3 @@
|
|||
|
||||
$lang = array();
|
||||
|
||||
?>
|
|
@ -75,8 +75,7 @@
|
|||
?>
|
||||
</div>
|
||||
<?php }
|
||||
if ($privatesite == "on") { // Remove sidebar if site is private
|
||||
} else {
|
||||
if ($privatesite != "on") {
|
||||
require_once('theme/' . $default_theme . '/sidebar.php');
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -69,8 +69,7 @@
|
|||
<?php } else { ?>
|
||||
|
||||
<?php }
|
||||
if (isset($privatesite) && $privatesite == "on") { // Remove 'recent pastes' if site is private
|
||||
} else { ?>
|
||||
if (!isset($privatesite) || $privatesite != "on") { ?>
|
||||
<div class="notification is-warning">
|
||||
<strong id="headline">Entries Deadline</strong>
|
||||
<div id="countdown">
|
||||
|
@ -217,8 +216,9 @@
|
|||
|
||||
<!-- End Panel -->
|
||||
<?php }
|
||||
if ($privatesite == "on") { // Remove sidebar if site is private
|
||||
if ($privatesite != "on") {
|
||||
return;
|
||||
} elseif (isset($site_ads)) {
|
||||
echo $site_ads['ads_2'];
|
||||
}
|
||||
}// Remove sidebar if site is private
|
||||
?>
|
||||
|
|
|
@ -174,28 +174,22 @@ $protocol = paste_protocol();
|
|||
<?php
|
||||
foreach ($profile_pastes as $row) {
|
||||
$title = Trim($row['title']);
|
||||
$p_id = Trim($row['id']);
|
||||
$p_id = $row['id'];
|
||||
$p_code = Trim($row['code']);
|
||||
$p_date = new DateTime($row['created_at']);
|
||||
$p_dateui = $p_date->format("d F Y");
|
||||
$p_views = Trim($row['views']);
|
||||
$p_visible = Trim($row['visible']);
|
||||
$p_visible = intval($row['visible']);
|
||||
$p_tags = Trim($row['tagsys']);
|
||||
$tagArray = explode(',', $p_tags);
|
||||
$tagArray = array_filter($tagArray);
|
||||
|
||||
|
||||
switch ($p_visible) {
|
||||
case 0:
|
||||
$p_visible = $lang['public'];
|
||||
break;
|
||||
case 1:
|
||||
$p_visible = $lang['unlisted'];
|
||||
break;
|
||||
case 2:
|
||||
$p_visible = $lang['private'];
|
||||
break;
|
||||
}
|
||||
$p_visible = match ($p_visible) {
|
||||
0 => $lang['public'],
|
||||
1 => $lang['unlisted'],
|
||||
2 => $lang['private']
|
||||
};
|
||||
$p_link = ($mod_rewrite == '1') ? "$p_id" : "paste.php?id=$p_id";
|
||||
$p_delete_link = ($mod_rewrite == '1') ? "user.php?del&user=$profile_username&id=$p_id" : "user.php?del&user=$profile_username&id=$p_id";
|
||||
$p_tag_link = ($mod_rewrite == '1') ? "user.php?user=$profile_username&q=$p_tags" : "user.php?user=$profile_username&q=$tags";
|
||||
|
@ -206,7 +200,7 @@ $protocol = paste_protocol();
|
|||
if ($row['visible'] == 0) {
|
||||
echo '<tr>
|
||||
<td>
|
||||
<a href="' . $protocol . $baseurl . '/' . $p_link . '" title="' . $title . '">' . ($title) . '</a>
|
||||
<a href="' . urlForPaste($p_id) . '" title="' . $title . '">' . ($title) . '</a>
|
||||
</td>
|
||||
<td data-sort="' . $p_date->format('U') . '" class="td-center">
|
||||
<span>' . $p_dateui . '</span>
|
||||
|
@ -218,10 +212,10 @@ $protocol = paste_protocol();
|
|||
if (strlen($p_tags) > 0) {
|
||||
foreach ($tagArray as $key => $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>
|
||||
|
@ -305,10 +299,10 @@ $protocol = paste_protocol();
|
|||
if (strlen($f_tags) > 0) {
|
||||
foreach ($ftagArray as $key => $ftags) {
|
||||
echo '<span class="tag is-info">' . trim($ftags) . '</span>';
|
||||
};
|
||||
}
|
||||
} else {
|
||||
echo ' <span class="tag is-warning">No tags</span>';
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
echo '</td>
|
||||
|
|
Loading…
Add table
Reference in a new issue