mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 14:40:09 +01:00
fix siteprivate, delete unused templates
This commit is contained in:
parent
6f40bebfc2
commit
40cc43ab24
8 changed files with 17 additions and 481 deletions
|
@ -262,7 +262,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkbox checkbox-primary">
|
<div class="checkbox checkbox-primary">
|
||||||
<input <?php if ($siteprivate == "on") echo 'checked="true"'; ?>
|
<input <?php if ($site_is_private) echo 'checked="true"'; ?>
|
||||||
type="checkbox" name="siteprivate" id="siteprivate">
|
type="checkbox" name="siteprivate" id="siteprivate">
|
||||||
<label for="siteprivate">
|
<label for="siteprivate">
|
||||||
Make site private (no Recent Pastes or Archives)
|
Make site private (no Recent Pastes or Archives)
|
||||||
|
|
4
fav.php
4
fav.php
|
@ -22,5 +22,5 @@ if ($current_user && !empty($_POST['fid'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Theme
|
// Theme
|
||||||
require_once('theme/' . $default_theme . '/header.php');
|
$page_template = 'report';
|
||||||
require_once('theme/' . $default_theme . '/report.php');
|
require_once('theme/' . $default_theme . '/common.php');
|
||||||
|
|
|
@ -117,12 +117,14 @@ $default_theme = $lang_and_theme['theme'];
|
||||||
// site permissions
|
// site permissions
|
||||||
$site_permissions = $site_info['permissions'];
|
$site_permissions = $site_info['permissions'];
|
||||||
|
|
||||||
|
// $siteprivate, $privatesite
|
||||||
|
// $disableguest, $noguests
|
||||||
if ($site_permissions) {
|
if ($site_permissions) {
|
||||||
$siteprivate = $site_permissions['private'];
|
$site_is_private = (bool) $site_permissions['private'];
|
||||||
$disableguest = $site_permissions['disable_guest'];
|
$site_disable_guest = (bool) $site_permissions['disable_guest'];
|
||||||
} else {
|
} else {
|
||||||
$siteprivate = 'off';
|
$site_is_private = false;
|
||||||
$disableguest = 'off';
|
$site_disable_guest = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// CAPTCHA configuration
|
// CAPTCHA configuration
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
There are <strong><?php echo $total_untagged ?></strong> pastes that still need to be tagged.
|
There are <strong><?php echo $total_untagged ?></strong> pastes that still need to be tagged.
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
<?php if ($privatesite == "on") { // Site permissions
|
<?php if ($site_is_private) { // Site permissions
|
||||||
?>
|
?>
|
||||||
<h1 class="title is-5"><?php echo $lang['siteprivate']; ?></h1>
|
<h1 class="title is-5"><?php echo $lang['siteprivate']; ?></h1>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php }
|
<?php }
|
||||||
if ($privatesite != "on") {
|
if (!$site_is_private) {
|
||||||
require_once('theme/' . $default_theme . '/sidebar.php');
|
require_once('theme/' . $default_theme . '/sidebar.php');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/* prevent inclusion of arbitrary files */
|
/* prevent inclusion of arbitrary files */
|
||||||
$template_candidates = scandir(__DIR__);
|
$template_candidates = scandir(__DIR__);
|
||||||
if (!in_array($page_template . '.php', $template_candidates)) {
|
if (!in_array($page_template . '.php', $template_candidates)) {
|
||||||
|
@ -67,7 +66,7 @@ $start = $time;
|
||||||
<div class="navbar-end">
|
<div class="navbar-end">
|
||||||
<div class="navbar-item">
|
<div class="navbar-item">
|
||||||
<?php if ($current_user !== null) {
|
<?php if ($current_user !== null) {
|
||||||
if (!isset($privatesite) || $privatesite !== "on") {
|
if (!$site_is_private) {
|
||||||
if (PP_MOD_REWRITE) {
|
if (PP_MOD_REWRITE) {
|
||||||
echo ' <a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/">
|
echo ' <a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/">
|
||||||
<span class="icon has-text-info">
|
<span class="icon has-text-info">
|
||||||
|
@ -131,7 +130,7 @@ $start = $time;
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<?php
|
<?php
|
||||||
if (!isset($privatesite) || $privatesite != "on") {
|
if (!$site_is_private) {
|
||||||
if (PP_MOD_REWRITE) {
|
if (PP_MOD_REWRITE) {
|
||||||
echo '<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/archive">
|
echo '<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/archive">
|
||||||
<span class="icon has-text-info">
|
<span class="icon has-text-info">
|
||||||
|
@ -284,7 +283,7 @@ CONTENT HERE!
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<?php require_once($page_template . '.php'); ?>
|
<?php require_once(__DIR__ . '/' . $page_template . '.php'); ?>
|
||||||
|
|
||||||
|
|
||||||
<footer class="footer has-background-white" style="border-top: 1px solid #ebeaeb">
|
<footer class="footer has-background-white" style="border-top: 1px solid #ebeaeb">
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<!-- Start Row -->
|
<!-- Start Row -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- Start Panel -->
|
<!-- Start Panel -->
|
||||||
<?php if ($privatesite == "on") { // Site permissions ?>
|
<?php if ($site_is_private) { // Site permissions ?>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="panel panel-default" style="padding-bottom: 100px;">
|
<div class="panel panel-default" style="padding-bottom: 100px;">
|
||||||
<div class="error-pages">
|
<div class="error-pages">
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
if (!isset($privatesite) || $privatesite != "on") { ?>
|
if (!$site_is_private) { ?>
|
||||||
<div class="notification is-warning">
|
<div class="notification is-warning">
|
||||||
<strong id="headline">Entries Deadline</strong>
|
<strong id="headline">Entries Deadline</strong>
|
||||||
<div id="countdown">
|
<div id="countdown">
|
||||||
|
@ -216,7 +216,7 @@
|
||||||
|
|
||||||
<!-- End Panel -->
|
<!-- End Panel -->
|
||||||
<?php }
|
<?php }
|
||||||
if ($privatesite != "on") {
|
if (!$site_is_private) {
|
||||||
return;
|
return;
|
||||||
} elseif (isset($site_ads)) {
|
} elseif (isset($site_ads)) {
|
||||||
echo $site_ads['ads_2'];
|
echo $site_ads['ads_2'];
|
||||||
|
|
|
@ -1,142 +0,0 @@
|
||||||
<footer class="footer has-background-white" style="border-top: 1px solid #ebeaeb">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="columns">
|
|
||||||
|
|
||||||
<div class="column">
|
|
||||||
<hr>
|
|
||||||
<div class="columns is-mobile is-centered">
|
|
||||||
<h5 class="title is-5">Support PonePaste</h5>
|
|
||||||
</div>
|
|
||||||
<a href='https://liberapay.com/Ponepaste/donate' target='_blank'><img src='../img/lib.png'/></a>
|
|
||||||
<a href='https://ko-fi.com/V7V02K3I2' target='_blank'><img src='../img/kofi.png'/></a>
|
|
||||||
</div>
|
|
||||||
<div class="column">
|
|
||||||
<hr>
|
|
||||||
<div class="columns is-mobile is-centered">
|
|
||||||
<h5 class="title is-5">Links</h5>
|
|
||||||
</div>
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column">
|
|
||||||
<ul>
|
|
||||||
<li><a href="/page/rules" target="_blank">Site Rules</a></li>
|
|
||||||
<li><a href="/page/privacy" target="_blank">Privacy Policy</a></li>
|
|
||||||
<li><a href="mailto:admin@ponepaste.org">Contact</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="column">
|
|
||||||
<ul>
|
|
||||||
<li><a href="/page/tags" target="_blank">Tag Guide</a></li>
|
|
||||||
<li><a href="/page/transparency " target="_blank">Transparency</a></li>
|
|
||||||
<li><a href="https://liberapay.com/Ponepaste" target="_blank">Donate </a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="column">
|
|
||||||
<hr>
|
|
||||||
<div class="columns is-mobile is-centered">
|
|
||||||
<h5 class="title is-5">Stats</h5>
|
|
||||||
</div>
|
|
||||||
<div class="columns">
|
|
||||||
<div class="column">
|
|
||||||
<ul>
|
|
||||||
<li> <?php
|
|
||||||
$endtime = microtime();
|
|
||||||
$time = explode(' ', $endtime);
|
|
||||||
$time = $time[1] + $time[0];
|
|
||||||
$finish = $time;
|
|
||||||
$total_time = round(($finish - $start), 4);
|
|
||||||
echo 'Page load: ' . $total_time . 's';
|
|
||||||
?>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<?php echo 'Page Hits Today: ' . $total_page_views . ''; ?>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<?php echo 'Unique Visitors Today: ' . $total_unique_views . ''; ?>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<?php echo 'Total Pastes: ' . $total_pastes . ''; ?>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
|
|
||||||
$notification = $delete.parentNode;
|
|
||||||
|
|
||||||
$delete.addEventListener('click', () => {
|
|
||||||
$notification.parentNode.removeChild($notification);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- Tabs function for pop up login-->
|
|
||||||
<script>
|
|
||||||
function openTab(evt, tabName) {
|
|
||||||
var i, x, tablinks;
|
|
||||||
x = document.getElementsByClassName("content-tab");
|
|
||||||
for (i = 0; i < x.length; i++) {
|
|
||||||
x[i].style.display = "none";
|
|
||||||
}
|
|
||||||
tablinks = document.getElementsByClassName("tab");
|
|
||||||
for (i = 0; i < x.length; i++) {
|
|
||||||
tablinks[i].className = tablinks[i].className.replace(" is-active", "");
|
|
||||||
}
|
|
||||||
document.getElementById(tabName).style.display = "block";
|
|
||||||
evt.currentTarget.className += " is-active";
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!--Notification -->
|
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
(document.querySelectorAll('.notification .delete') || []).forEach(($delete) => {
|
|
||||||
var $notification = $delete.parentNode;
|
|
||||||
|
|
||||||
$delete.addEventListener('click', () => {
|
|
||||||
$notification.parentNode.removeChild($notification);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!--Data Tables -->
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/js/modal-fx.min.js"></script>
|
|
||||||
|
|
||||||
<!-- Hamburger menu -->
|
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
|
||||||
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
|
|
||||||
if ($navbarBurgers.length > 0) {
|
|
||||||
$navbarBurgers.forEach(el => {
|
|
||||||
el.addEventListener('click', () => {
|
|
||||||
const target = el.dataset.target;
|
|
||||||
const $target = document.getElementById(target);
|
|
||||||
el.classList.toggle('is-active');
|
|
||||||
$target.classList.toggle('is-active');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Additional Scripts -->
|
|
||||||
<?php echo $additional_scripts; ?>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
|
@ -1,323 +0,0 @@
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
* Paste <https://github.com/jordansamuel/PASTE> - Bulma theme
|
|
||||||
* Theme by wsehl <github.com/wsehl> (January, 2021)
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 3
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License in GPL.txt for more details.
|
|
||||||
*/
|
|
||||||
$date = time();
|
|
||||||
$statrttime = microtime();
|
|
||||||
$time = explode(' ', $statrttime);
|
|
||||||
$time = $time[1] + $time[0];
|
|
||||||
$start = $time;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
|
|
||||||
<html lang="<?php echo basename($default_lang, ".php"); ?>">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>
|
|
||||||
<?php if (isset($paste_title)) {
|
|
||||||
echo $paste_title . ' - ';
|
|
||||||
}
|
|
||||||
echo $title;
|
|
||||||
?>
|
|
||||||
</title>
|
|
||||||
<meta name="description" content="<?php echo $des; ?>"/>
|
|
||||||
<meta name="keywords" content="<?php echo $keyword; ?>"/>
|
|
||||||
<link rel="shortcut icon" href="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/img/favicon.ico">
|
|
||||||
<link href="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/css/paste.css" rel="stylesheet"
|
|
||||||
type="text/css"/>
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/js/jquery.min.js"></script>
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/js/jquery-ui.min.js"></script>
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/js/paste.js"></script>
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/js/modal-fx.min.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/js/datatables.min.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/js/table-responsive.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/js/table-reorder.js"></script>
|
|
||||||
<link href="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/css/table-responsive.css" rel="stylesheet"
|
|
||||||
type="text/css"/>
|
|
||||||
<link href="<?php echo '//' . $baseurl . '/theme/' . $default_theme; ?>/css/table-row-orders.css" rel="stylesheet"
|
|
||||||
type="text/css"/>
|
|
||||||
<?php
|
|
||||||
if (isset($ges_style)) {
|
|
||||||
echo $ges_style;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<nav id="navbar" class="bd-navbar navbar is-spaced">
|
|
||||||
<div class="container">
|
|
||||||
<div class="navbar-brand">
|
|
||||||
<a style="font-size: 24px;"
|
|
||||||
href="<?php echo '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); ?>"
|
|
||||||
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"/>
|
|
||||||
<div class="slider round"></div>
|
|
||||||
</div>
|
|
||||||
<div id="navbarBurger" class="navbar-burger burger" data-target="navMenuDocumentation">
|
|
||||||
<span></span><span></span><span></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="navMenuDocumentation" class="navbar-menu">
|
|
||||||
<div class="navbar-end">
|
|
||||||
<div class="navbar-item">
|
|
||||||
<?php if ($current_user !== null) {
|
|
||||||
if (!isset($privatesite) || $privatesite !== "on") {
|
|
||||||
if (PP_MOD_REWRITE) {
|
|
||||||
echo ' <a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-clipboard" aria-hidden="true"></i>
|
|
||||||
</span><span>New Paste</span>
|
|
||||||
</a><a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/archive">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-book" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Archive</span></a>
|
|
||||||
<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/discover">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-compass" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Discover</span></a>
|
|
||||||
<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/event">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-calendar" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Events</span></a>';
|
|
||||||
} else {
|
|
||||||
echo '
|
|
||||||
</span>
|
|
||||||
<span>Archive</span></a>
|
|
||||||
<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/archive">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-book" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Lightmode</span>
|
|
||||||
</a>
|
|
||||||
<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/discover">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-book" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Lightmode</span>
|
|
||||||
</a>
|
|
||||||
<span>Discover</span></a>
|
|
||||||
<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/event">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-calendar" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Events</span></a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo '<div class="navbar-item has-dropdown is-hoverable">
|
|
||||||
<a class="navbar-link" role="presentation">' . pp_html_escape($current_user->username) . '</a>
|
|
||||||
<div class="navbar-dropdown">';
|
|
||||||
if (PP_MOD_REWRITE) {
|
|
||||||
echo '<a class="navbar-item" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/user/' . urlencode($current_user->username) . '">Pastes</a>';
|
|
||||||
echo '<a class="navbar-item" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/profile">Settings</a>';
|
|
||||||
} else {
|
|
||||||
echo '<a class="navbar-item" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/user.php?user=' . urlencode($current_user->username) . '">Pastes</a>';
|
|
||||||
echo '<a class="navbar-item" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/profile.php">Settings</a>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<hr class="navbar-divider"/>
|
|
||||||
<form action="../logout.php" method="POST">
|
|
||||||
<input class="button navbar-link" type="submit" value="Logout"
|
|
||||||
style="border:none;padding: 0.375rem 1rem;"/>
|
|
||||||
</form>
|
|
||||||
<?php } else { ?>
|
|
||||||
<div class="buttons">
|
|
||||||
<?php
|
|
||||||
if (!isset($privatesite) || $privatesite != "on") {
|
|
||||||
if (PP_MOD_REWRITE) {
|
|
||||||
echo '<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/archive">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-book" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Archive</span></a>
|
|
||||||
|
|
||||||
<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/discover">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-compass" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Discover</span></a>
|
|
||||||
<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/event">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-calendar" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Events</span>';
|
|
||||||
} else {
|
|
||||||
echo '<a class="button" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/discover.php">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-book" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Archive</span>
|
|
||||||
</a>
|
|
||||||
<a class="button navbar-item mx-2" href="' . '//' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/event.php">
|
|
||||||
<span class="icon has-text-info">
|
|
||||||
<i class="fa fa-calendar" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Events</span>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<a class="button is-info modal-button" data-target="#signin">Sign In</a>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div id="#signin" class="modal modal-fx-fadeInScale">
|
|
||||||
<div class="modal-background"></div>
|
|
||||||
<div class="modal-content modal-card is-tiny">
|
|
||||||
<header class="modal-card-head">
|
|
||||||
<nav class="tabs" style="margin-bottom: -1.25rem;flex-grow:1;">
|
|
||||||
<div class="container">
|
|
||||||
<ul>
|
|
||||||
<li class="tab is-active" onclick="openTab(event,'logid')"><a>Login</a></li>
|
|
||||||
<li class="tab" onclick="openTab(event,'regid')"><a>Register</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<button class="modal-button-close delete" aria-label="close"></button>
|
|
||||||
</header>
|
|
||||||
<div id="logid" class="content-tab">
|
|
||||||
<section class="modal-card-body">
|
|
||||||
<form method="POST" action="../login.php">
|
|
||||||
<div class="field">
|
|
||||||
<label class="label"><?php echo $lang['username']; ?></label>
|
|
||||||
<div class="control has-icons-left has-icons-right">
|
|
||||||
<input type="text" class="input" name="username" autocomplete="on"
|
|
||||||
placeholder="<?php echo $lang['username']; ?>">
|
|
||||||
<span class="icon is-small is-left">
|
|
||||||
<i class="fas fa-user"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label class="label"><?php echo $lang['curpwd']; ?></label>
|
|
||||||
<div class="control has-icons-left has-icons-right">
|
|
||||||
<input type="password" class="input" name="password" autocomplete="on"
|
|
||||||
placeholder="<?php echo $lang['curpwd']; ?>">
|
|
||||||
<span class="icon is-small is-left">
|
|
||||||
<i class="fas fa-key"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<input class="button is-link is-fullwidth my-4" type="submit" name="signin" value="Login"
|
|
||||||
value="<?php echo md5($date . $ip); ?>">
|
|
||||||
<div class="checkbox checkbox-primary">
|
|
||||||
<input id="rememberme" name="remember_me" type="checkbox" checked="">
|
|
||||||
<label for="rememberme">
|
|
||||||
<?php echo $lang['rememberme']; ?>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</section>
|
|
||||||
<footer class="modal-card-foot">
|
|
||||||
<a href="../login.php?forgotpassw">Forgot Password?</a>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
<div id="regid" class="content-tab" style="display:none">
|
|
||||||
<section class="modal-card-body">
|
|
||||||
<form method="POST" action="../login.php?register">
|
|
||||||
<div class="field">
|
|
||||||
<label class="label"><?php echo $lang['username']; ?></label>
|
|
||||||
<div class="control has-icons-left has-icons-right">
|
|
||||||
<input type="text" class="input" name="username"
|
|
||||||
placeholder="<?php echo $lang['username']; ?>">
|
|
||||||
<span class="icon is-small is-left">
|
|
||||||
<i class="fas fa-user"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label class="label"><?php echo $lang['newpwd']; ?></label>
|
|
||||||
<div class="control has-icons-left has-icons-right">
|
|
||||||
<input type="password" class="input" name="password"
|
|
||||||
placeholder="<?php echo $lang['newpwd']; ?>">
|
|
||||||
<span class="icon is-small is-left">
|
|
||||||
<i class="fas fa-key"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<div class="checkbox checkbox-primary">
|
|
||||||
<input required id="agecheck" name="agecheck" type="checkbox">
|
|
||||||
<label for="agecheck">
|
|
||||||
I'm over 18.
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<div class="notification">
|
|
||||||
<span class="tags are-large"><?php echo '<img src="' . $_SESSION['captcha']['image_src'] . '" alt="CAPTCHA" class="imagever">'; ?></span>
|
|
||||||
<input type="text" class="input" name="scode" value=""
|
|
||||||
placeholder="<?php echo $lang['entercode']; ?>">
|
|
||||||
<p class="is-size-6 has-text-grey-light has-text-left mt-2">and press
|
|
||||||
"Enter"</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<input class="button is-link is-fullwidth my-4" type="submit" name="signup" value="Register"
|
|
||||||
value="<?php echo md5($date . $ip); ?>">
|
|
||||||
<div class="field">
|
|
||||||
<p style="float:left;">By signing up you agree to our <a href="page/privacy">Privacy policy </a>
|
|
||||||
and <a href="page/rules">Site rules</a>. This site may contain material not sutible for
|
|
||||||
under 18's</p>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script nonce="D4rkm0d3">
|
|
||||||
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
|
|
||||||
const currentTheme = localStorage.getItem('theme');
|
|
||||||
|
|
||||||
if (currentTheme) {
|
|
||||||
document.documentElement.setAttribute('data-theme', currentTheme);
|
|
||||||
|
|
||||||
if (currentTheme === 'dark') {
|
|
||||||
toggleSwitch.checked = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function switchTheme(e) {
|
|
||||||
if (e.target.checked) {
|
|
||||||
document.documentElement.setAttribute('data-theme', 'dark');
|
|
||||||
localStorage.setItem('theme', 'dark');
|
|
||||||
} else {
|
|
||||||
document.documentElement.setAttribute('data-theme', 'light');
|
|
||||||
localStorage.setItem('theme', 'light');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleSwitch.addEventListener('change', switchTheme, false);
|
|
||||||
</script>
|
|
Loading…
Add table
Reference in a new issue