diff --git a/admin/ads.php b/admin/ads.php index 6544682..dab1b65 100644 --- a/admin/ads.php +++ b/admin/ads.php @@ -12,70 +12,33 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License in GPL.txt for more details. */ - -session_start(); -if (isset($_SESSION['login'])) { -// Do nothing +define('IN_ADMIN', 1); +require_once('common.php'); + +updateAdminHistory($conn); + +$row = $conn->query('SELECT text_ads, ads_1, ads_2 FROM ads LIMIT 1')->fetch(); + +if ($row) { + $text_ads = trim($row['text_ads']); + $ads_1 = trim($row['ads_1']); + $ads_2 = trim($row['ads_2']); } else { - header("Location: ."); - exit(); + $text_ads = ''; + $ads_1 = ''; + $ads_2 = ''; } -if (isset($_GET['logout'])) { - if (isset($_SESSION['login'])) - unset($_SESSION['login']); - - session_destroy(); - header("Location: ."); - exit(); -} +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $text_ads = trim($_POST['text_ads']); + $ads_1 = trim($_POST['ads_1']); + $ads_2 = trim($_POST['ads_2']); -$date = date('jS F Y'); -$ip = $_SERVER['REMOTE_ADDR']; -require_once('../config.php'); -$con = mysqli_connect($dbhost, $dbuser, $dbpassword, $dbname); - -if (mysqli_connect_errno()) { - $sql_error = mysqli_connect_error(); - die("Unable connect to database"); -} - -$query = "SELECT @last_id := MAX(id) FROM admin_history"; - -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $last_id = $row['@last_id := MAX(id)']; -} - -$query = "SELECT * FROM admin_history WHERE id=" . Trim($last_id); -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $last_date = $row['last_date']; - $last_ip = $row['ip']; -} - -if ($last_ip == $ip) { - if ($last_date == $date) { - - } else { - $query = "INSERT INTO admin_history (last_date,ip) VALUES ('$date','$ip')"; - mysqli_query($con, $query); - } -} else { - $query = "INSERT INTO admin_history (last_date,ip) VALUES ('$date','$ip')"; - mysqli_query($con, $query); -} - -$query = "SELECT * FROM ads WHERE id='1'"; -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); + $conn->prepare('UPDATE ads SET text_ads = ?, ads_1 = ?, ads_2 = ? WHERE id = 1')->execute([$text_ads, $ads_1, $ads_2]); + $msg = '
+ Ads saved +
'; } ?> @@ -117,29 +80,6 @@ while ($row = mysqli_fetch_array($result)) { - - - ' . mysqli_error($con) . ' - '; - - } else { - $msg = '
- Ads saved -
'; - } - } - ?> -
diff --git a/archive.php b/archive.php index 5252fa9..2d285b9 100644 --- a/archive.php +++ b/archive.php @@ -29,13 +29,6 @@ $total_untagged = intval($conn->query("SELECT COUNT(*) from pastes WHERE tagsys updatePageViews($conn); -// Ads -$site_ads_rows = $conn->query('SELECT * FROM ads WHERE id = 1'); -while ($row = $site_ads_rows->fetch()) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); -} $p_title = $lang['archive']; // "Pastes Archive"; diff --git a/discover.php b/discover.php index afae789..2119557 100644 --- a/discover.php +++ b/discover.php @@ -14,89 +14,15 @@ */ session_start(); -require_once('config.php'); +define('IN_PONEPASTE', 1); +require_once('includes/common.php'); require_once('includes/functions.php'); // UTF-8 header('Content-Type: text/html; charset=utf-8'); -$date = date('jS F Y'); -$ip = $_SERVER['REMOTE_ADDR']; -$data_ip = file_get_contents('tmp/temp.tdata'); -$con = mysqli_connect($dbhost, $dbuser, $dbpassword, $dbname); - -if (mysqli_connect_errno()) { - die("Unable to connect to database"); -} -$query = "SELECT * FROM site_info"; -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $title = Trim($row['title']); - $des = Trim($row['des']); - $baseurl = Trim($row['baseurl']); - $keyword = Trim($row['keyword']); - $site_name = Trim($row['site_name']); - $email = Trim($row['email']); - $twit = Trim($row['twit']); - $face = Trim($row['face']); - $gplus = Trim($row['gplus']); - $ga = Trim($row['ga']); - $additional_scripts = Trim($row['additional_scripts']); -} - -// Set theme and language -$query = "SELECT * FROM interface"; -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $default_lang = Trim($row['lang']); - $default_theme = Trim($row['theme']); -} - -require_once("langs/$default_lang"); - -$p_title = $lang['archive']; // "Pastes Archive"; - -// Check if IP is banned -if ( is_banned($con, $ip) ) die($lang['banned']); // "You have been banned from ".$site_name; - -// Site permissions -$query = "SELECT * FROM site_permissions where id='1'"; -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $siteprivate = Trim($row['siteprivate']); -} - -if ($_SERVER['REQUEST_METHOD'] == 'POST') { -} else { - if ($siteprivate =="on") { - $privatesite = "on"; - } -} - -// Logout -if (isset($_GET['logout'])) { - header('Location: ' . $_SERVER['HTTP_REFERER']); - unset($_SESSION['token']); - unset($_SESSION['oauth_uid']); - unset($_SESSION['username']); - session_destroy(); -} - - - -$query = "SELECT * FROM ads WHERE id='1'"; -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); - -} // Theme +$p_title = $lang['archive']; // "Pastes Archive"; require_once('theme/' . $default_theme . '/header.php'); require_once('theme/' . $default_theme . '/discover.php'); require_once('theme/' . $default_theme . '/footer.php'); diff --git a/event.php b/event.php index 60f40fe..6566943 100644 --- a/event.php +++ b/event.php @@ -14,7 +14,8 @@ */ session_start(); -require_once('config.php'); +define('IN_PONEPASTE', 1); +require_once('includes/common.php'); require_once('includes/functions.php'); // UTF-8 @@ -22,56 +23,9 @@ header('Content-Type: text/html; charset=utf-8'); $date = date('jS F Y'); $ip = $_SERVER['REMOTE_ADDR']; -$data_ip = file_get_contents('tmp/temp.tdata'); -$conn = new PDO( - "mysql:host=$db_host;dbname=$db_schema;charset=utf8", - $db_user, - $db_pass, - $db_opts -); - -$site_info_rows = $conn->query('SELECT * FROM site_info'); -while ($row = $site_info_rows->fetch()) { - $title = Trim($row['title']); - $des = Trim($row['des']); - $baseurl = Trim($row['baseurl']); - $keyword = Trim($row['keyword']); - $site_name = Trim($row['site_name']); - $email = Trim($row['email']); - $twit = Trim($row['twit']); - $face = Trim($row['face']); - $gplus = Trim($row['gplus']); - $ga = Trim($row['ga']); - $additional_scripts = Trim($row['additional_scripts']); -} - -// Set theme and language -$site_theme_rows = $conn->query('SELECT * FROM interface WHERE id="1"'); -while ($row = $site_theme_rows->fetch()) { - $default_lang = Trim($row['lang']); - $default_theme = Trim($row['theme']); -} -require_once("langs/$default_lang"); - $p_title = $lang['archive']; // "Pastes Archive"; -// Check if IP is banned -if ( is_banned($con, $ip) ) die($lang['banned']); // "You have been banned from ".$site_name; - -// Site permissions -$query = "SELECT * FROM site_permissions where id='1'"; -$result = mysqli_query($con, $query); - -// Logout -if (isset($_GET['logout'])) { - header('Location: ' . $_SERVER['HTTP_REFERER']); - unset($_SESSION['token']); - unset($_SESSION['oauth_uid']); - unset($_SESSION['username']); - session_destroy(); -} - // Theme require_once('theme/' . $default_theme . '/header.php'); require_once('theme/' . $default_theme . '/event.php'); diff --git a/includes/common.php b/includes/common.php index 8d6223e..1a5c377 100644 --- a/includes/common.php +++ b/includes/common.php @@ -15,6 +15,14 @@ function getSiteLangAndTheme($conn) { return $conn->query('SELECT lang, theme FROM interface LIMIT 1')->fetch(); } +function getSitePermissions($conn) { + return $conn->query('SELECT * FROM site_permissions LIMIT 1')->fetch(); +} + +function getSiteAds($conn) { + return $conn->query('SELECT text_ads, ads_1, ads_2 FROM ads LIMIT 1')->fetch(); +} + function updatePageViews($conn) { $ip = $_SERVER['REMOTE_ADDR']; $date = date('jS F Y'); @@ -86,6 +94,18 @@ if ($lang_and_theme) { $default_theme = 'bulma'; } +// site permissions +$site_permissions = getSitePermissions($conn); + +if ($site_permissions) { + $siteprivate = $site_permissions['siteprivate']; +} else { + $siteprivate = 'off'; +} + +$privatesite = $siteprivate; + + // Prevent a potential LFI (you never know :p) if (in_array($default_lang, scandir('langs/'))) { require_once("langs/$default_lang"); @@ -104,3 +124,5 @@ if (isset($_GET['logout'])) { unset($_SESSION['pic']); session_destroy(); } + +$site_ads = getSiteAds($conn); diff --git a/index.php b/index.php index af38ce7..b8ab1d6 100644 --- a/index.php +++ b/index.php @@ -69,14 +69,6 @@ header('Content-Type: text/html; charset=utf-8'); $date = date('jS F Y'); $ip = $_SERVER['REMOTE_ADDR']; -// Ads -$site_ads_rows = $conn->query('SELECT * FROM ads WHERE id="1"'); -while ($row = $site_ads_rows->fetch()) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); -} - // Sitemap $site_sitemap_rows = $conn->query('SELECT * FROM sitemap_options WHERE id="1"'); while ($row = $site_sitemap_rows->fetch()) { diff --git a/login.php b/login.php index 9c4be27..a00528c 100644 --- a/login.php +++ b/login.php @@ -19,7 +19,7 @@ require_once('includes/password.php'); session_start(); // Required functions -require_once('config.php'); +require_once('includes/common.php'); require_once('includes/functions.php'); require_once('mail/mail.php'); @@ -36,29 +36,7 @@ if (isset($_SESSION['token'])) { header("Location: ./"); } -// Database Connection -$conn = new PDO( - "mysql:host=$db_host;dbname=$db_schema;charset=utf8", - $db_user, - $db_pass, - $db_opts -); -// Get site info -$site_info_rows = $conn->query('SELECT * FROM site_info'); -while ($row = $site_info_rows->fetch()) { - $title = Trim($row['title']); - $des = Trim($row['des']); - $baseurl = Trim($row['baseurl']); - $keyword = Trim($row['keyword']); - $site_name = Trim($row['site_name']); - $email = Trim($row['email']); - $twit = Trim($row['twit']); - $face = Trim($row['face']); - $gplus = Trim($row['gplus']); - $ga = Trim($row['ga']); - $additional_scripts = Trim($row['additional_scripts']); -} $admin_mail = $email; $admin_name = $site_name; @@ -78,92 +56,11 @@ while ($row = $email_info_rows->fetch()) { } $mail_type = $smtp_protocol; -// Check if IP is banned -if ( is_banned($conn, $ip) ) die($lang['banned']); // "You have been banned from ".$site_name; - -// Set theme and language -$site_theme_rows = $conn->query('SELECT * FROM interface WHERE id="1"'); -while ($row = $site_theme_rows->fetch()) { - $default_lang = Trim($row['lang']); - $default_theme = Trim($row['theme']); -} -require_once("langs/$default_lang"); - - // Page title -$p_title = $lang['login/register']; //"Login/Register"; +$p_title = $lang['login/register']; // "Login/Register"; -// Ads -$site_ads_rows = $conn->query('SELECT * FROM ads WHERE id="1"'); -while ($row = $site_ads_rows->fetch()) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); -} +updatePageViews($conn); -// Logout -if (isset($_GET['logout'])) { - header('Location: ' . $_SERVER['HTTP_REFERER']); - unset($_SESSION['token']); - unset($_SESSION['oauth_uid']); - unset($_SESSION['username']); - session_destroy(); -} - -if (strpos($banned_ip, $ip) !== false) { - die($lang['banned']); //"You have been banned from ".$site_name -} - -// Page views -$site_view_rows = $conn->query("SELECT @last_id := MAX(id) FROM page_view"); -while ($row = $site_view_rows->fetch()) { - $last_id = $row['@last_id := MAX(id)']; -} - -while ($row = $site_view_rows->fetch()) { - $last_date = $row['date']; -} - -if ($last_date == $date) { - if (str_contains($data_ip, $ip)) { - $statement = $conn->prepare('SELECT * FROM page_view WHERE id = ?'); - $statement->execute([$last_id]); - while ($row = $statement->fetch()) { - $last_tpage = Trim($row['tpage']); - } - $last_tpage = $last_tpage + 1; - - // IP already exists, Update view count - $statement = $conn->prepare('UPDATE page_view SET tpage=? WHERE id=?;'); - $statement->execute([$last_tpage,$last_id]); - } else { - $statement = $conn->prepare('SELECT * FROM page_view WHERE id = ?'); - $statement->execute([$last_id]); - - while ($row = mysqli_fetch_array($result)) { - $last_tpage = Trim($row['tpage']); - $last_tvisit = Trim($row['tvisit']); - } - $last_tpage = $last_tpage + 1; - $last_tvisit = $last_tvisit + 1; - - // Update both tpage and tvisit. - $statement = $conn->prepare('UPDATE page_view SET tpage=?,tvisit=? WHERE id = ?'); - $statement->execute([$last_tpage,$last_tvisit,$last_id]); - file_put_contents('tmp/temp.tdata', $data_ip . "\r\n" . $ip); - } -} else { - // Delete the file and clear data_ip - unlink("tmp/temp.tdata"); - $data_ip = ""; - - // New date is created - $statement = $conn->prepare("INSERT INTO page_view (date,tpage,tvisit) VALUES (?,'1','1')"); - $statement->execute([$date]); - // Update the IP - file_put_contents('tmp/temp.tdata', $data_ip . "\r\n" . $ip); - -} if (isset($_GET['resend'])) { if (isset($_POST['email'])) { $email = htmlentities(trim($_POST['email'])); @@ -264,7 +161,7 @@ if (isset($_GET['forgot'])) { } } -if ($_SERVER['REQUEST_METHOD'] == POST) { +if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Check if logged in if (isset($_SESSION['token'])) { header("Location: ./"); diff --git a/pages.php b/pages.php index dc7a9d2..5ee5d94 100644 --- a/pages.php +++ b/pages.php @@ -133,18 +133,7 @@ if ($last_date == $date) { } -$query = "SELECT * FROM ads WHERE id='1'"; -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); - -} - - -if (isset($_GET{'page'})) { +if (isset($_GET['page'])) { $page_name = trim($_GET['page']); $page_name = Trim(htmlspecialchars($page_name)); $page_name = mysqli_real_escape_string($con, $page_name); diff --git a/paste.php b/paste.php index 552f490..9f4fe11 100644 --- a/paste.php +++ b/paste.php @@ -22,7 +22,7 @@ session_start(); header('Content-Type: text/html; charset=utf-8'); // Required functions -require_once('config.php'); +require_once('includes/common.php'); require_once('includes/geshi.php'); require_once('includes/functions.php'); @@ -48,128 +48,17 @@ if (isset($_GET['id'])) { // Prevent SQLInjection settype($paste_id, 'integer'); +updatePageViews($conn); -// Database Connection -$conn = new PDO( - "mysql:host=$db_host;dbname=$db_schema;charset=utf8", - $db_user, - $db_pass, - $db_opts -); - - -// Get site info -$site_info_rows = $conn->query('SELECT * FROM site_info'); -while ($row = $site_info_rows->fetch()) { - $title = Trim($row['title']); - $des = Trim($row['des']); - $baseurl = Trim($row['baseurl']); - $keyword = Trim($row['keyword']); - $site_name = Trim($row['site_name']); - $email = Trim($row['email']); - $twit = Trim($row['twit']); - $face = Trim($row['face']); - $gplus = Trim($row['gplus']); - $ga = Trim($row['ga']); - $additional_scripts = Trim($row['additional_scripts']); -} - -// Set theme and language -$site_theme_rows = $conn->query('SELECT * FROM interface WHERE id="1"'); -while ($row = $site_theme_rows->fetch()) { - $default_lang = Trim($row['lang']); - $default_theme = Trim($row['theme']); -} -require_once("langs/$default_lang"); - - -// Check if IP is banned -if ( is_banned($conn, $ip) ) die($lang['banned']); // "You have been banned from ".$site_name; - - -// Current date & user IP -$date = date('jS F Y'); -$ip = $_SERVER['REMOTE_ADDR']; -$data_ip = file_get_contents('tmp/temp.tdata'); - -// Ads -$site_ads_rows = $conn->query('SELECT * FROM ads WHERE id="1"'); -while ($row = $site_ads_rows->fetch()) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); -} - -// Logout -if (isset($_GET['logout'])) { - header('Location: ' . $_SERVER['HTTP_REFERER']); - unset($_SESSION['token']); - unset($_SESSION['oauth_uid']); - unset($_SESSION['username']); - session_destroy(); -} - -// Page views -$site_view_rows = $conn->query("SELECT @last_id := MAX(id) FROM page_view"); -while ($row = $site_view_rows->fetch()) { - $last_id = $row['@last_id := MAX(id)']; -} - -$site_view_last = $conn->query("SELECT * FROM page_view WHERE id=?"); -$site_view_last->execute([$last_id]); -while ($row = $site_view_last->fetch()) { - $last_date = $row['date']; -} - -if ($last_date == $date) { - if (str_contains($data_ip, $ip)) { - $statement = $conn->prepare("SELECT * FROM page_view WHERE id =?"); - $statement->execute([$last_id]); - while ($row = $statement->fetch()) { - $last_tpage = Trim($row['tpage']); - } - $last_tpage = $last_tpage + 1; - - // IP already exists, Update view count - $statement = $conn->prepare("UPDATE page_view SET tpage=? WHERE id=?"); - $statement->execute([$last_tpage,$last_id]); - } else { - $statement = $conn->prepare("SELECT * FROM page_view WHERE id =?"); - $statement->execute([$last_id]); - while ($row = $statement->fetch()) { - $last_tpage = Trim($row['tpage']); - $last_tvisit = Trim($row['tvisit']); - } - $last_tpage = $last_tpage + 1; - $last_tvisit = $last_tvisit + 1; - - // Update both tpage and tvisit. - $statement = $conn->prepare("UPDATE page_view SET tpage=?,tvisit=? WHERE id =?"); - $statement->execute([$last_tpage,$last_tvisit,$last_id]); - file_put_contents('tmp/temp.tdata', $data_ip . "\r\n" . $ip); - } -} else { - // Delete the file and clear data_ip - unlink("tmp/temp.tdata"); - $data_ip = ""; - - // New date is created - $statement = $conn->prepare("INSERT INTO page_view (date,tpage,tvisit) VALUES (?,'1','1')"); - $statement->execute([$date]); - // Update the IP - file_put_contents('tmp/temp.tdata', $data_ip . "\r\n" . $ip); - -} //Get fav count $get_fav_count = $conn->prepare("SELECT count(f_paste) as total FROM pins WHERE f_paste=?"); $get_fav_count->execute([$paste_id]); - while ($row = $get_fav_count->fetch()) { +while ($row = $get_fav_count->fetch()) { $fav_count = $row['total']; - } +} -//Get paste info - +// Get paste info $get_paste_details = $conn->prepare("SELECT * FROM pastes WHERE id=?"); $get_paste_details->execute([$paste_id]); if ($get_paste_details->fetchColumn() > 0) { diff --git a/profile.php b/profile.php index 663db09..a3feccb 100644 --- a/profile.php +++ b/profile.php @@ -18,7 +18,8 @@ require_once('includes/password.php'); session_start(); -require_once('config.php'); +define('IN_PONEPASTE', 1); +require_once('includes/common.php'); require_once('includes/functions.php'); // UTF-8 @@ -197,15 +198,6 @@ if ($last_date == $date) { } $total_pastes = getTotalPastes($con, $user_username); -$query = "SELECT * FROM ads WHERE id='1'"; -$result = mysqli_query($con, $query); - -while ($row = mysqli_fetch_array($result)) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); - -} // Theme require_once('theme/' . $default_theme . '/header.php'); require_once('theme/' . $default_theme . '/profile.php'); diff --git a/rules.php b/rules.php index c736a53..1180fc7 100644 --- a/rules.php +++ b/rules.php @@ -1,64 +1,15 @@ query('SELECT * FROM site_info'); -while ($row = $site_info_rows->fetch()) { - $title = Trim($row['title']); - $des = Trim($row['des']); - $baseurl = Trim($row['baseurl']); - $keyword = Trim($row['keyword']); - $site_name = Trim($row['site_name']); - $email = Trim($row['email']); - $twit = Trim($row['twit']); - $face = Trim($row['face']); - $gplus = Trim($row['gplus']); - $ga = Trim($row['ga']); - $additional_scripts = Trim($row['additional_scripts']); -} - -// Set theme and language -$site_theme_rows = $conn->query('SELECT * FROM interface WHERE id="1"'); -while ($row = $site_theme_rows->fetch()) { - $default_lang = Trim($row['lang']); - $default_theme = Trim($row['theme']); -} -require_once("langs/$default_lang"); - - $p_title = $lang['archive']; // "Pastes Archive"; -// Check if IP is banned -if ( is_banned($conn, $ip) ) die($lang['banned']); // "You have been banned from ".$site_name; - -// Site permissions -$query = "SELECT * FROM site_permissions where id='1'"; -$result = mysqli_query($con, $query); - -// Logout -if (isset($_GET['logout'])) { - header('Location: ' . $_SERVER['HTTP_REFERER']); - unset($_SESSION['token']); - unset($_SESSION['oauth_uid']); - unset($_SESSION['username']); - session_destroy(); -} - // Theme require_once('theme/' . $default_theme . '/header.php'); require_once('theme/' . $default_theme . '/rules.php'); diff --git a/theme/bulma/archive.php b/theme/bulma/archive.php index cb8e81c..4e21aaa 100644 --- a/theme/bulma/archive.php +++ b/theme/bulma/archive.php @@ -67,7 +67,12 @@ $(document).ready(function () { - + +
diff --git a/theme/bulma/event.php b/theme/bulma/event.php index a9567c9..6dcc77a 100644 --- a/theme/bulma/event.php +++ b/theme/bulma/event.php @@ -206,7 +206,7 @@ diff --git a/theme/bulma/login.php b/theme/bulma/login.php index 38d3806..745897a 100644 --- a/theme/bulma/login.php +++ b/theme/bulma/login.php @@ -74,10 +74,11 @@
- - - - +
@@ -165,10 +166,11 @@
- - - - +
@@ -227,10 +229,11 @@
- - - - +
@@ -257,10 +260,11 @@
- - - - +
@@ -276,10 +280,11 @@
- - - - +
diff --git a/theme/bulma/main.php b/theme/bulma/main.php index df6551e..96ac934 100644 --- a/theme/bulma/main.php +++ b/theme/bulma/main.php @@ -329,11 +329,13 @@
- - - - - + +
diff --git a/theme/bulma/oauth.php b/theme/bulma/oauth.php index 3466d29..68041ff 100644 --- a/theme/bulma/oauth.php +++ b/theme/bulma/oauth.php @@ -63,7 +63,11 @@
- +
diff --git a/theme/bulma/pages.php b/theme/bulma/pages.php index 9c07c02..1710c26 100644 --- a/theme/bulma/pages.php +++ b/theme/bulma/pages.php @@ -27,8 +27,11 @@ } else { echo '

' . $lang['notfound'] . '

'; } + + if (isset($site_ads)) { + echo $site_ads['ads_2']; + } ?> - diff --git a/theme/bulma/user_profile.php b/theme/bulma/user_profile.php index 0544be5..ecf0d10 100644 --- a/theme/bulma/user_profile.php +++ b/theme/bulma/user_profile.php @@ -315,7 +315,11 @@ $(document).ready(function () { - + diff --git a/theme/bulma/view.php b/theme/bulma/view.php index 8315348..5053d21 100644 --- a/theme/bulma/view.php +++ b/theme/bulma/view.php @@ -429,7 +429,11 @@ overflow: hidden !important;
- + diff --git a/user.php b/user.php index e7a9d0e..2bcd043 100644 --- a/user.php +++ b/user.php @@ -14,7 +14,8 @@ */ session_start(); -require_once('config.php'); +define('IN_PONEPASTE', 1); +require_once('includes/common.php'); require_once('includes/functions.php'); // UTF-8 @@ -222,13 +223,7 @@ if ($last_date == $date) { } -$query = "SELECT * FROM ads WHERE id='1'"; -$result = mysqli_query($con, $query); -while ($row = mysqli_fetch_array($result)) { - $text_ads = Trim($row['text_ads']); - $ads_1 = Trim($row['ads_1']); - $ads_2 = Trim($row['ads_2']); -} + if ( isset($_GET['del']) ) { if ( $_SESSION['token'] ) { // Prevent unauthorized deletes