Skip to content

Commit

Permalink
fix php8 error on undefined const
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen-MLR committed Mar 12, 2023
1 parent 9ef3938 commit 7601038
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions 404.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
define("NAME", "");
define("TITLE", "");
define("WEB_URL", "");
require_once("template.php");
if (!file_exists("config.php"))
{
Expand Down
15 changes: 7 additions & 8 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@
define("WEB_URL", $db->getSetting($mysqli,"url"));
define("MAILER_NAME", $db->getSetting($mysqli,"mailer"));
define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email"));

define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli,"subscribe_email"));
define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli,"subscribe_telegram"));
define("TG_BOT_USERNAME", $db->getSetting($mysqli,"tg_bot_username"));
define("TG_BOT_API_TOKEN", $db->getSetting($mysqli,"tg_bot_api_token"));
define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli,"google_recaptcha"));
define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli,"google_recaptcha_sitekey"));
define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli,"google_recaptcha_secret"));
define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli,"subscribe_email") ?: "");
define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli,"subscribe_telegram") ?: "");
define("TG_BOT_USERNAME", $db->getSetting($mysqli,"tg_bot_username") ?: "");
define("TG_BOT_API_TOKEN", $db->getSetting($mysqli,"tg_bot_api_token") ?: "");
define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli,"google_recaptcha") ?: "");
define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli,"google_recaptcha_sitekey") ?: "");
define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli,"google_recaptcha_secret") ?: "");
$offset = 0;

if (isset($_GET['ajax']))
Expand Down
7 changes: 4 additions & 3 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public static function render_header($page_name, $admin = false){
if ( 'admin' == $str_url ) {
$strSubsMenu = '';
} else {
if (SUBSCRIBE_EMAIL || SUBSCRIBE_TELEGRAM ) {
$strSubsMenu = '';
if (defined('SUBSCRIBE_EMAIL') || defined('SUBSCRIBE_TELEGRAM') ) {
// Subscriber menu is to be shown...
$strSubsMenu = '<ul class="nav navbar-nav mr-auto">';
// If subscriber is not logged on, display subscriber menus
Expand Down Expand Up @@ -56,7 +57,7 @@ public static function render_header($page_name, $admin = false){
<html lang="en">
<head>
<?php
if(!admin){
if(defined('admin') && !admin){
$headfile = fopen("head.txt", "r") or die("Unable to open head.txt!");
$head_additionalcode = fread($versionfile,filesize("head.txt"));
fclose($headfile);
Expand Down Expand Up @@ -237,7 +238,7 @@ public static function render_footer($admin = false)
<?php }?>
<script src="<?php echo WEB_URL;?>/js/vendor/bootstrap.min.js"></script>
<script src="<?php echo WEB_URL;?>/js/main.js"></script>
<?php if ( GOOGLE_RECAPTCHA ) { ?><script src='https://www.google.com/recaptcha/api.js'></script><?php }?>
<?php if ( defined('GOOGLE_RECAPTCHA') ) { ?><script src='https://www.google.com/recaptcha/api.js'></script><?php }?>
</body>
</html>
<?php
Expand Down

0 comments on commit 7601038

Please sign in to comment.