Uncaught Error: Call to undefined function call_integration_hook()...

Started by PrimalPrime, September 29, 2023, 09:17:33 AM

Previous topic - Next topic

PrimalPrime

Hi, I am running SMF 2.14 but with a fair number of mods and custom work. Is this perhaps related to file caching? My site is set to level one file based caching but I have tried memcached and SQLLite3 in the past seeking better performance and tried level two caching but it cached too much. I cannot reproduce the error. I would super appreciate some help. Thank you.

[29-Sep-2023 03:02:11 America/Detroit] PHP Fatal error:  Uncaught Error: Call to undefined function call_integration_hook() in /home/mysite/public_html/index.php:110
Stack trace:
#0 [internal function]: {closure}('SMF\\Cache\\APIs\\...')
#1 /home/mysite/public_html/Sources/Load.php(3807): class_exists('SMF\\Cache\\APIs\\...')
#2 /home/mysite/public_html/Sources/Load.php(42): loadCacheAccelerator()
#3 /home/mysite/public_html/index.php(140): reloadSettings()
#4 {main}
  thrown in /home/mysite/public_html/index.php on line 110

Lines 109-140 of index.php

// Do any third-party scripts want in on the fun?
    call_integration_hook('integrate_autoload', array(&$classMap));

    foreach ($classMap as $prefix => $dirName)
    {
        // does the class use the namespace prefix?
        $len = strlen($prefix);
        if (strncmp($prefix, $class, $len) !== 0)
        {
            continue;
        }

        // get the relative class name
        $relativeClass = substr($class, $len);

        // replace the namespace prefix with the base directory, replace namespace
        // separators with directory separators in the relative class name, append
        // with .php
        $fileName = $dirName . strtr($relativeClass, '\\', '/') . '.php';

        // if the file exists, require it
        if (file_exists($fileName = $sourcedir . '/' . $fileName))
        {
            require_once $fileName;

            return;
        }
    }
});

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();

Kindred

seriously, you should consider switching to mySQL....

as for the rest, I'll have to defer to some server folks.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PrimalPrime

Hey, Kindred. You mean as opposed to Maria? Back a long time ago, I migrated to a new host and it was never even mentioned to me that the database was switched to Maria. My limited understanding was that a switch could or would be problematic since compatibility is not 100%. Do you think otherwise? I am grateful.

Kindred

MariaDB works the same as mySQL,for the most part....   I believe that we added Mariadb support in 2.1 as well
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PrimalPrime

Do you think turning off file caching could resolve the issue? It most likely happens outside the forum in the CMS or gallery or something.

Kindred

How would SMF code processing be happening outside of SMF?
I don't think there's anything to do with caching -- but try turning it off, sure...

How are you running SMF?  Inside a windows in a CMS?
Are you sharing a database between SMF and other scripts?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PrimalPrime

They are mods but with custom work done on them. I remember my developer ran into errors early when we turned caching on saying he needed to do a few things to make it work right. I'm thinking he didn't get it done right or a subsequent migration or server change or code change elsewhere impacted it. Just a wild guess really though. But the cache system wasn't really built to apply outside the forum, right? Yes, it's all using the same database.

Thank you

Kindred

Well, THAT is a recipe for disaster -- having the forum and other things sharing the database...

but sure - try turning caching off...  see if it helps
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."


Doug Heffernan

Quote from: PrimalPrime on September 29, 2023, 04:01:42 PMYes, it's all using the same database.

What is all that is using the same database? What scripts are we talking about?

You can use the same database in theory to install multiple scripts as long as they have different prefixes. However, personally I think that it is best to avoid it as it clutters things and it has an impact on the performance as well.

PrimalPrime

The forum, cms, gallery, and chatrooms all share the same database. Isn't this the normal way mods work with SMF?

Doug Heffernan

Quote from: PrimalPrime on September 29, 2023, 04:36:35 PMThe forum, cms, gallery, and chatrooms all share the same database. Isn't this the normal way mods work with SMF?

Yes, that is correct. I thought that you were talking about standalone scripts.

What was the latest change done to the forum prior to the error happening?

Sesquipedalian

This discussion is difficult to follow. The error reported in the original post doesn't appear to have anything to do with caching or interacting with the database.

Regarding the reported error message, that should normally be impossible unless you have seriously hacked up your SMF files.

The call_integration_hook function is defined in Subs.php. If the function doesn't exist when called from inside the autoloader function in index.php, that means that Subs.php hasn't been loaded by the time the autoloader was called.

But index.php loads Sub.php before it even defines the autoloader function, which means that it is impossible to call the autoloader before call_integration_hook has been defined.

Since that is no longer true on your system, then either your index.php and/or your Subs.php has been altered significantly, or else there is something more going on that you haven't told us yet.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

PrimalPrime

QuoteSince that is no longer true on your system, then either your index.php and/or your Subs.php has been altered significantly.
Yes, this is true. However, subs.php is still being called before the autoloader function in index.php, no?

// Without those we can't go anywhere
require_once($sourcedir . '/QueryString.php');
require_once($sourcedir . '/Subs.php');
require_once($sourcedir . '/Subs-Auth.php');
require_once($sourcedir . '/Errors.php');
require_once($sourcedir . '/Load.php');
require_once($sourcedir . '/Security.php');
require_once('SSI.php');
// Ensure we don't trip over disabled internal functions
if (version_compare(PHP_VERSION, '8.0.0', '>='))
    require_once($sourcedir . '/Subs-Compat.php');

// If $maintenance is set specifically to 2, then we're upgrading or something.
if (!empty($maintenance) &&  2 === $maintenance)
{
    display_maintenance_message();
}

// Create a variable to store some SMF specific functions in.
$smcFunc = array();

// Initiate the database connection and define some database functions to use.
loadDatabase();

/**
 * An autoloader for certain classes.
 *
 * @param string $class The fully-qualified class name.
 */
spl_autoload_register(function ($class) use ($sourcedir)
{
    $classMap = array(
        'ReCaptcha\\' => 'ReCaptcha/',
        'MatthiasMullie\\Minify\\' => 'minify/src/',
        'MatthiasMullie\\PathConverter\\' => 'minify/path-converter/src/',
        'SMF\\Cache\\' => 'Cache/',
    );

    // Do any third-party scripts want in on the fun?
    call_integration_hook('integrate_autoload', array(&$classMap));

    foreach ($classMap as $prefix => $dirName)
    {
        // does the class use the namespace prefix?
        $len = strlen($prefix);
        if (strncmp($prefix, $class, $len) !== 0)
        {
            continue;
        }

        // get the relative class name
        $relativeClass = substr($class, $len);

        // replace the namespace prefix with the base directory, replace namespace
        // separators with directory separators in the relative class name, append
        // with .php
        $fileName = $dirName . strtr($relativeClass, '\\', '/') . '.php';

        // if the file exists, require it
        if (file_exists($fileName = $sourcedir . '/' . $fileName))
        {
            require_once $fileName;

            return;
        }
    }
});

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();

Sesquipedalian

Quote from: PrimalPrime on September 29, 2023, 05:34:41 PMrequire_once('SSI.php');

There's at least one major problem right there. You definitely should not include SSI.php in index.php. All sorts of weird stuff can happen if you do that.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PrimalPrime

I removed that line on the test site and it seemed ok but I'm wary of making the change on the live site without a broader view by you SMF experts. Could you take a look here at the home page for me, please? It's a menu basically where you can choose a specific chatroom or forum entering as a guest or logging in while selecting your destination.

<?php
/**
 * This, as you have probably guessed, is the crux on which SMF functions.
 * Everything should start here, so all the setup and security is done
 * properly.  The most interesting part of this file is the action array in
 * the smf_main() function.  It is formatted as so:
 *  'action-in-url' => array('Source-File.php', 'FunctionToCall'),
 *
 * Then, you can access the FunctionToCall() function from Source-File.php
 * with the URL index.php?action=action-in-url.  Relatively simple, no?
 *
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines https://www.simplemachines.org
 * @copyright 2023 Simple Machines and individual contributors
 * @license https://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.1.4
 */

// Get everything started up...
define('SMF'1);
define('SMF_VERSION''2.1.4');
define('SMF_FULL_VERSION''SMF ' SMF_VERSION);
define('SMF_SOFTWARE_YEAR''2023');

define('JQUERY_VERSION''3.6.3');
define('POSTGRE_TITLE''PostgreSQL');
define('MYSQL_TITLE''MySQL');
define('SMF_USER_AGENT''Mozilla/5.0 (' php_uname('s') . ' ' php_uname('m') . ') AppleWebKit/605.1.15 (KHTML, like Gecko)  SMF/' strtr(SMF_VERSION' ''.'));

if (!
defined('TIME_START'))
    
define('TIME_START'microtime(true));

// If anything goes wrong loading Settings.php, make sure the admin knows it.
error_reporting(E_ALL);

// This makes it so headers can be sent!
ob_start();

// Do some cleaning, just in case.
foreach (array('db_character_set''cachedir') as $variable)
    unset(
$GLOBALS[$variable]);

// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');

// Devs want all error messages, but others don't.
error_reporting(!empty($db_show_debug) ? E_ALL E_ALL & ~E_DEPRECATED);

// Ensure there are no trailing slashes in these variables.
foreach (array('boardurl''boarddir''sourcedir''packagesdir''tasksdir''cachedir') as $variable)
    if (!empty(
$GLOBALS[$variable]))
        
$GLOBALS[$variable] = rtrim($GLOBALS[$variable], "\\/");

// Make absolutely sure the cache directory is defined and writable.
if (empty($cachedir) || !is_dir($cachedir) || !is_writable($cachedir))
{
    if (
is_dir($boarddir '/cache') && is_writable($boarddir '/cache'))
        
$cachedir $boarddir '/cache';

    else
    {
        
$cachedir sys_get_temp_dir() . '/smf_cache_' md5($boarddir);

        @
mkdir($cachedir0750);
    }
}

// Without those we can't go anywhere
require_once($sourcedir '/QueryString.php');
require_once(
$sourcedir '/Subs.php');
require_once(
$sourcedir '/Subs-Auth.php');
require_once(
$sourcedir '/Errors.php');
require_once(
$sourcedir '/Load.php');
require_once(
$sourcedir '/Security.php');
require_once(
'SSI.php');
// Ensure we don't trip over disabled internal functions
if (version_compare(PHP_VERSION'8.0.0''>='))
    require_once(
$sourcedir '/Subs-Compat.php');

// If $maintenance is set specifically to 2, then we're upgrading or something.
if (!empty($maintenance) &&  === $maintenance)
{
    
display_maintenance_message();
}

// Create a variable to store some SMF specific functions in.
$smcFunc = array();

// Initiate the database connection and define some database functions to use.
loadDatabase();

/**
 * An autoloader for certain classes.
 *
 * @param string $class The fully-qualified class name.
 */
spl_autoload_register(function ($class) use ($sourcedir)
{
    
$classMap = array(
        
'ReCaptcha\\' => 'ReCaptcha/',
        
'MatthiasMullie\\Minify\\' => 'minify/src/',
        
'MatthiasMullie\\PathConverter\\' => 'minify/path-converter/src/',
        
'SMF\\Cache\\' => 'Cache/',
    );

    
// Do any third-party scripts want in on the fun?
    
call_integration_hook('integrate_autoload', array(&$classMap));

    foreach (
$classMap as $prefix => $dirName)
    {
        
// does the class use the namespace prefix?
        
$len strlen($prefix);
        if (
strncmp($prefix$class$len) !== 0)
        {
            continue;
        }

        
// get the relative class name
        
$relativeClass substr($class$len);

        
// replace the namespace prefix with the base directory, replace namespace
        // separators with directory separators in the relative class name, append
        // with .php
        
$fileName $dirName strtr($relativeClass'\\''/') . '.php';

        
// if the file exists, require it
        
if (file_exists($fileName $sourcedir '/' $fileName))
        {
            require_once 
$fileName;

            return;
        }
    }
});

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();

// Clean the request variables, add slashes, etc.
cleanRequest();

// Seed the random generator.
if (empty($modSettings['rand_seed']) || mt_rand(1250) == 69)
    
smf_seed_generator();

// And important includes.
require_once($sourcedir '/Session.php');
require_once(
$sourcedir '/Logging.php');
require_once(
$sourcedir '/Class-BrowserDetect.php');


// If a Preflight is occurring, lets stop now.
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'OPTIONS')
{
    
send_http_status(204);
    die;
}

// Before we get carried away, are we doing a scheduled task? If so save CPU cycles by jumping out!
if (isset($_GET['scheduled']))
{
    require_once(
$sourcedir '/ScheduledTasks.php');
    
AutoTask();
}

// Check if compressed output is enabled, supported, and not already being done.
if (!empty($modSettings['enableCompressedOutput']) && !headers_sent())
{
    
// If zlib is being used, turn off output compression.
    
if (ini_get('zlib.output_compression') >= || ini_get('output_handler') == 'ob_gzhandler')
        
$modSettings['enableCompressedOutput'] = '0';

    else
    {
        
ob_end_clean();
        
ob_start('ob_gzhandler');
    }
}

// Register an error handler.
set_error_handler('smf_error_handler');

// Start the session. (assuming it hasn't already been.)
loadSession();

// What function shall we execute? (done like this for memory's sake.)
call_user_func(Shoutbox_Load(smf_main()));

// Call obExit specially; we're coming from the main area ;).
obExit(nullnulltrue);







function 
baseurl(){
    
$host "";
    if(isset(
$_SERVER['HTTPS'])){
        
$protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" "http";
    }
    else{
        
$protocol 'http';
    }
    if(isset(
$_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST']!=""){
        
$host $_SERVER['HTTP_HOST'];
    }else{
        
$host $_SERVER['SERVER_NAME'];
    }
    return 
$protocol "://" $host;
}



 function 
smf_main()
{
global 
$modSettings$settings$user_info$board$topic;
    global 
$board_info$maintenance$sourcedir$should_log;
    global 
$context,$scripturl$modSettings$txt;
    global  
$smcFunc$cache_enable;
    global 
$is_mysite;
    
    
$current_url=$_SERVER['REQUEST_URI']; 
    
//echo "<pre/>";print_r($_SESSION);die;
    
if($current_url=='/index.php' || $current_url=='/') {
        
$memberid = (isset($_SESSION['rc']['id']) && $_SESSION['rc']['id']!="") ? $_SESSION['rc']['id'] : 0;
        if (!isset(
$_SESSION['USER_AGENT']) && (!isset($_GET['ssi_function']) || $_GET['ssi_function'] !== 'pollVote')){

            
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];
        }
        
createToken('login');
        
//echo "<pre>";print_r($context);die;
        //echo $_SESSION['USER_AGENT'];die;
        
echo "<!DOCTYPE html><html lang='en'><head><title>mysite</title><link rel='stylesheet' href='https://mysite/style/styles.css'>";
echo 
"<link rel='stylesheet' href='https://mysite.com/style/responsive.css'>";
echo 
"<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js'></script>";
echo 
'<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="mysite">
<meta property="og:site_name" content="mysite">
<meta property="og:title" content="mysite">
<meta name="keywords" content="mysite">
<meta property="og:description" content="mysite">
<meta property="og:type" content="website" >
<meta property="og:image" content="mysite">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="mysite">
<meta name="twitter:title" content="mysite">
<meta name="twitter:image" content="mysite">
<link rel="canonical" href="mysite" >

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "WebSite",
  "name": "mysite",
  "url": "mysite",
  "potentialAction": {
    "@type": "SearchAction",
    "target": "https://mysite/search/{search_term_string}",
    "query-input": "required name=search_term_string"
  }
}
</script>

</head><body>'
;


echo 
'<div>
        <!-- Header -->
        <div class="header">
        <a href="https://mysite/index.php?action=welcome"><img src="./assets/icons/mysite.webp" alt="mysite logo" style="width:50px !important; height:49px !important;"></a>
            <h1 class="heading-title">mysite Community Home</h1>
        </div>

        <!-- Main Screen -->
        <div class="main-screen">
            <div class="cols-span-3">
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/index.php?room=one">
                            <span>Room One</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/index.php?room=two">
                            <span>Room Two</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/index.php?room=three">
                            <span>Room Three</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/index.php?room=four">
                            <span>Room Four</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/index.php?room=five">
                            <span>Room Six</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/index.php?room=six">
                            <span>Room Six</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/index.php?room=seven">
                            <span>Room Seven</span>
                        </a>
                    </div>
                </div>
            </div>
            <div class="cols-span-6">
                <div class="login">

                    <span class="login-title">
                    Click desired chatroom or forum to enter as guest.
                    </span>


                    <form class="login" action="'
.baseurl().'/login2/" name="frmLogin" id="frmLogin" method="post" accept-charset="'$context['character_set'], '">';

                    
// Did they make a mistake last time?
                    
if (!empty($context['login_errors']))
                    echo 
'
                    <div class="errorbox">'
implode('<br>'$context['login_errors']), '</div>
                    <br>'
;

                    
// Or perhaps there's some special description for this time?
                    
if (isset($context['description']))
                    echo 
'
                    <div class="information">'
$context['description'], '</div>';

                  echo 
'<div class="login-main">
                  <div style="text-align: center"><h2 style="color: #ffffff">mysite Login</h2></div>
                            <div class="login-input">
                                <img src="assets/icons/mysite.png" width="16" height="16" alt="mysite Login">
                                <span class="hr"></span>
                                <input name="user" id="loginuser" type="text" placeholder="Username" required>
                            </div>
                            <div class="login-input">
                                <img src="assets/icons/mysite.png" width="16" height="16" alt="mysite Member Password">
                                <span class="hr"></span>
                                <input name="passwrd" id="loginpass" type="password" placeholder="Password" required>
                            </div>
                            <div class="login-input select-login">
                                <select name="cookielength" id="cookielength">'
;
                                    foreach (
$context['login_cookie_times'] as $cookie_time => $cookie_txt)
        echo 
'
                                <option value="'
$cookie_time'"'$modSettings['cookieTime'] == $cookie_time ' selected' '''>'$txt[$cookie_txt], '</option>';

    
          echo                      
'</select>
                            </div>'
;
                            if (!empty(
$modSettings['registration_method']) && $modSettings['registration_method'] == 1)
        echo 
'
                    <p class="smalltext">
                        '
sprintf($txt['welcome_guest_activate'], $scripturl), '
                    </p>'
;
    echo 
'
                    <input type="hidden" name="'
$_SESSION['session_var'], '" value="'$_SESSION['session_value'], '">
                    <input type="hidden" name="'
$_SESSION['token']['post-login'][0], '" value="'$_SESSION['token']['post-login'][3], '">
                    <script>
                        setTimeout(function() {
                            document.getElementById("'
, !empty($context['from_ajax']) ? 'ajax_' '', isset($context['default_username']) && $context['default_username'] != '' 'loginpass' 'loginuser''").focus();
                        }, 150);'
;

    if (!empty(
$context['from_ajax']) && ((empty($modSettings['allow_cors']) || empty($modSettings['allow_cors_credentials']) || empty($context['valid_cors_found']) || !in_array($context['valid_cors_found'], array('samel''subsite')))))
    {
        echo 
'
                        form = $("#frmLogin");
                        form.submit(function(e) {
                            e.preventDefault();
                            e.stopPropagation();

                            $.ajax({
                                url: form.prop("action") + ";ajax",
                                method: "POST",
                                headers: {
                                    "X-SMF-AJAX": 1
                                },
                                xhrFields: {
                                    withCredentials: typeof allow_xhjr_credentials !== "undefined" ? allow_xhjr_credentials : false
                                },
                                data: form.serialize(),
                                success: function(data) {'
;


        
// While a nice action is to replace the document body after a login, this may fail on CORS requests because the action may not be redirected back to the page they started the login process from.  So for these cases, we simply just reload the page.
        
if (empty($context['valid_cors_found']) || $context['valid_cors_found'] == 'same')
            echo 
'
                                    if (data.indexOf("<bo" + "dy") > -1) {
                                        document.open();
                                        document.write(data);
                                        document.close();
                                    }
                                    else
                                        form.parent().html($(data).find(".roundframe").html());'
;
        else
            echo 
'
                                    window.location.reload();'
;

        echo 
'
                                },
                                error: function(xhr) {
                                    var data = xhr.responseText;
                                    form.parent().html($(data).find(".roundframe").html());
                                }
                            });

                            return false;
                        });'
;
    }

    echo 
'
                    </script>
                            
                            <a href="'
.baseurl().'/reminder/" class="forgot">
                                Forgot your password?
                            </a>
                            <p style="font-size: 16px;text-decoration: none;color: #ffffff;display: block;margin-top: 26px;">
                                Choose your destination
                            </p>
                            <div class="login-input select-login">
                                <select  name="chatredirecturl" id="category-drop">
                                    <option value="'
.$scripturl.'?room=one">
                                    Chatroom One
                                    </option>
                                    <option value="'
.$scripturl.'?room=two">
                                    Chatroom Two
                                    </option>
                                    <option value="'
.$scripturl.'?room=three">
                                    Chatroom Three
                                    </option>
                                    <option value="'
.$scripturl.'?room=four">
                                    Chatroom Four
                                    </option>
                                    <option value="'
.$scripturl.'?room=five">
                                    Chatroom Five
                                    </option>
                                    <option value="'
.$scripturl.'?room=six">
                                    Chatroom Six
                                    </option>
                                    <option value="'
.$scripturl.'?room=seven">
                                    Chatroom Seven
                                    </option>

                                    <option value="'
.baseurl().'/b1/">
                                    Forum One
                                    </option>
                                    <option value="'
.baseurl().'/b11/">
                                    Forum Two
                                    </option>
                                    <option value="'
.baseurl().'/b8/">
                                    Forum Three
                                    </option>
                                    <option value="'
.baseurl().'/b7/">
                                    Forum Four
                                    </option>
                                    <option value="'
.baseurl().'/b10/">
                                    Forum Five
                                    </option>
                                    <option value="'
.baseurl().'/b5/">
                                    Forum Six
                                    </option>
                                    <option value="'
.baseurl().'/b12/">
                                    Forum Seven
                                    </option>

                                </select>'
;
                                echo 
'<script>
/*$(document).ready( function() { 
    $("#category-drop").change(function() {
      window.location = $(this).val();
    });
});*/
</script>'
;

                            echo 
'</div>
                          
                            <style>
                              a.login-title.login-btn.button {
                                    font-size: inherit;
                                    width: auto;
                                    margin-top: 8px;
                                }
                                .flx-divv{
                                    display: flex;
                                    justify-content: space-around;
                                    gap: 11px;
                                }
                                @media only screen and (max-width: 768px){
                                    .flx-divv{
                                        flex-direction: column
                                    }
                                }
                            </style>
                            <div class="flx-divv">
                                <div><input type="submit" value="Log in" class="login-btn button"></div>
                                <div>
                                    <a href="'
.baseurl().'/signup/" class="login-title login-btn button" >
                                        Register
                                    </a>
                                </div>
                            </div>
                            <p class="agenotice">Welcome</p>
                        </div>
                        
                    </form>
                    <script>
                    $( "#frmLogin" ).on( "submit", function( event ) {
                      
                      var memberid ='
$memberid.';
                      if(memberid !== null && memberid !== undefined && memberid !== 0){
                        event.preventDefault();
                        alert("You are already logged");
                      }
                    });
                    </script>
                </div>
            </div>
            <div class="cols-span-3">
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/b1/">
                            <span>Forum One</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                      <a href="'
.baseurl().'/b11/">
                            <span>Forum Two</span>
                      </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                      <a href="'
.baseurl().'/b8/">
                            <span>Forum Three</span>
                      </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/b7/">
                            <span>Forum Four</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/b10/">
                            <span>Forum Five</span>
                        </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                      <a href="'
.baseurl().'/b5/">
                            <span>Forum Six</span>
                      </a>
                    </div>
                </div>
                <div class="rooms">
                    <div class="rooms-inner">
                        <a href="'
.baseurl().'/b12/">
                            <span>Forum Seven</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>


        <!-- Footer -->
        <div class="footer">
            <nav class="nevigation">
                <ul>
                    <li>
    <a href="'
.$scripturl.'?page=mysite">
        About Us
    </a>
</li>
<li>
    <a href="'
.$scripturl.'?page=contact">
        Contact Us
    </a>
</li>
<li>
    <a href="'
.$scripturl.'?page=faq">
        FAQ
    </a>
</li>
<li>
    <a href="'
.$scripturl.'?page=mysite_policy">
        Privacy Policy
    </a>
</li>
<li>
    <a href="'
.$scripturl.'?page=rules">
        Rules
    </a>
</li>
<li>
    <a href="'
.baseurl().'/search/">
        Search
    </a>
</li>
                </ul>
            </nav>
            <div class="footer-logo">
                <img src="assets/icons/mysite.webp" alt="mysite">
                </a>
            </div>
        </div>
    </div> 
    </body>

</html>
    '
;
            exit;

    }

    global 
$modSettings$settings$user_info$board$topic;
    global 
$board_info$maintenance$sourcedir$should_log;

    
// Special case: session keep-alive, output a transparent pixel.
    
if (isset($_GET['action']) && $_GET['action'] == 'keepalive')
    {

        
header('content-type: image/gif');
        die(
"\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B");
    }

    
// We should set our security headers now.
    
frameOptionsHeader();

    
// Set our CORS policy.
    
corsPolicyHeader();

    
// Load the user's cookie (or set as guest) and load their settings.
    
loadUserSettings();

    
// Load the current board's information.
    
loadBoard();

    
// Load the current user's permissions.
    
loadPermissions();

    
// Attachments don't require the entire theme to be loaded.
    
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && empty($maintenance))
        
detectBrowser();
    
// Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
    
else
        
loadTheme();

    
// Check if the user should be disallowed access.
    
is_not_banned();

    
// If we are in a topic and don't have permission to approve it then duck out now.
    
if (!empty($topic) && empty($board_info['cur_topic_approved']) && !allowedTo('approve_posts') && ($user_info['id'] != $board_info['cur_topic_starter'] || $user_info['is_guest']))
        
fatal_lang_error('not_a_topic'false);

    
// Do some logging, unless this is an attachment, avatar, toggle of editor buttons, theme option, XML feed, popup, etc.
    
$no_stat_actions = array(
        
'about:unknown' => true,
        
'clock' => true,
        
'dlattach' => true,
        
'findmember' => true,
        
'helpadmin' => true,
        
'jsoption' => true,
        
'likes' => true,
        
'modifycat' => true,
        
'pm' => array('sa' => array('popup')),
        
'profile' => array('area' => array('popup''alerts_popup''download''dlattach')),
        
'requestmembers' => true,
        
'smstats' => true,
        
'suggest' => true,
        
'verificationcode' => true,
        
'viewquery' => true,
        
'viewsmfile' => true,
        
'xmlhttp' => true,
        
'.xml' => true,
    );
    
call_integration_hook('integrate_pre_log_stats', array(&$no_stat_actions));

    
$should_log = !is_filtered_request($no_stat_actions'action');
    if (
$should_log)
    {
        
// Log this user as online.
        
writeLog();

        
// Track forum statistics and hits...?
        
if (!empty($modSettings['hitStats']))
            
trackStats(array('hits' => '+'));
    }
    unset(
$no_stat_actions);

    
// Make sure that our scheduled tasks have been running as intended
    
check_cron();

    
// Is the forum in maintenance mode? (doesn't apply to administrators.)
    
if (!empty($maintenance) && !allowedTo('admin_forum'))
    {
        
// You can only login.... otherwise, you're getting the "maintenance mode" display.
        
if (isset($_REQUEST['action']) && (in_array($_REQUEST['action'], array('login2''logintfa''logout'))))
        {
            require_once(
$sourcedir '/LogInOut.php');
            return (
$_REQUEST['action'] == 'login2' 'Login2' : ($_REQUEST['action'] == 'logintfa' 'LoginTFA' 'Logout'));
        }
        
// Don't even try it, sonny.
        
else
            return 
'InMaintenance';
    }
    
// If guest access is off, a guest can only do one of the very few following actions.
    
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa''login''login2''logintfa''reminder''activate''help''helpadmin''smstats''verificationcode''signup''signup2'))))
        return 
'KickGuest';
    elseif (empty(
$_REQUEST['action']))
    {
        
// Go catch it boy! Catch it!
        
$cms_action cms_catch_action();
        if (
$cms_action)
            return 
$cms_action;

        
// Action and board are both empty... BoardIndex! Unless someone else wants to do something different.
        
if (empty($board) && empty($topic))
        {
            if (!empty(
$modSettings['integrate_default_action']))
            {
                
$defaultAction explode(','$modSettings['integrate_default_action']);

                
// Sorry, only one default action is needed.
                
$defaultAction $defaultAction[0];

                
$call call_helper($defaultActiontrue);

                if (!empty(
$call))
                    return 
$call;
            }

            
// No default action huh? then go to our good old BoardIndex.
            
else
            {
                require_once(
$sourcedir '/BoardIndex.php');

                if (isset(
$_REQUEST['action']) && $_REQUEST['action'] != 'forum')
                    
header("HTTP/1.0 404 Not Found");

                return 
'BoardIndex';
            }
        }

        
// Topic is empty, and action is empty.... MessageIndex!
        
elseif (empty($topic))
        {
            require_once(
$sourcedir '/MessageIndex.php');
            return 
'MessageIndex';
        }

        
// Board is not empty... topic is not empty... action is empty.. Display!
        
else
        {
            require_once(
$sourcedir '/Display.php');
            return 
'Display';
        }
    }

    
$actionArray = array(
        
'agreement' => array('Agreement.php''Agreement'),
        
'acceptagreement' => array('Agreement.php''AcceptAgreement'),
        
'activate' => array('Register.php''Activate'),
        
'admin' => array('Admin.php''AdminMain'),
        
'announce' => array('Post.php''AnnounceTopic'),
        
'attachapprove' => array('ManageAttachments.php''ApproveAttach'),
        
'buddy' => array('Subs-Members.php''BuddyListToggle'),
        
'calendar' => array('Calendar.php''CalendarMain'),
        
'clock' => array('Calendar.php''clock'),
        
'coppa' => array('Register.php''CoppaForm'),
        
'credits' => array('Who.php''Credits'),
        
'deletemsg' => array('RemoveTopic.php''DeleteMessage'),
        
'dlattach' => array('ShowAttachments.php''showAttachment'),
        
'editpoll' => array('Poll.php''EditPoll'),
        
'editpoll2' => array('Poll.php''EditPoll2'),
        
'findmember' => array('Subs-Auth.php''JSMembers'),
        
'forum' => array('BoardIndex.php''BoardIndex'),
        
'groups' => array('Groups.php''Groups'),
        
'help' => array('Help.php''ShowHelp'),
        
'helpadmin' => array('Help.php''ShowAdminHelp'),
        
'jsmodify' => array('Post.php''JavaScriptModify'),
        
'jsoption' => array('Themes.php''SetJavaScript'),
        
'likes' => array('Likes.php''Likes::call#'),
        
'lock' => array('Topic.php''LockTopic'),
        
'lockvoting' => array('Poll.php''LockVoting'),
        
'login' => array('LogInOut.php''Login'),
        
'login2' => array('LogInOut.php''Login2'),
        
'l

Kindred

That is bad bad bad...
Whoever hacked up index.php likec that had no idea what they were doing. It's a wonder that your site works at all
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PrimalPrime

Well, it does work. Very few problems actually. I'd love to fix any problems though and I would be willing to pay.

Doug Heffernan

Quote from: PrimalPrime on September 30, 2023, 12:06:28 PMWell, it does work. Very few problems actually. I'd love to fix any problems though and I would be willing to pay.

You can post at our Help Wanted (not for support), but make sure to read the sticky topics there first.

https://www.simplemachines.org/community/index.php?board=50.0

PrimalPrime

Oh, ok. I actually did some time back though and I guess no one is interested. Thanks

hungarianguy

I have modified the index.php file and I also got this error. It was an easy fix.


Sesquipedalian

Did you remove the require_once('SSI.php'); line from your index.php file yet?
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

PrimalPrime

Hey, I'm pretty nervous about it. I was hoping to get a comprehensive look at the page or deal with the specific errors I seem to get repeatedly, if rarely and seemingly randomly.But I asked my developer that made the page if there was a specific reason he put the line in there. It would help if you could explain a little bit, if you don't mind. And, are you sure it couldn't cause troubles on non-forum pages that might be visited (chatrooms)?

Thank you.

Kindred

We have told you... including ssi inside actual smf files is bad bad bad.
Smf already initializes everything and attempting to load ssi inside of it will cause problems, as it tries to reinitialize stuff...

Take it out.
Your developer was a hack and had no idea what they were doing. The rest of the edits to your index.php show the same lack of comprehension.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Doug Heffernan

Your index.php file needs to be cleaned up and have the custom stuff added properly.

PrimalPrime

I don't think you're being fair to my developer. He had never messed with SMF before. And it works. Three random errors that may be connected, right? He has done some good stuff for me, I think. But, you could be right. I have no way to judge really. He told me to listen to you, back up the file, and take out the line. So I did. We will see.

StephanKlark

Did the error occur after modifying the file? Index.php? If so, you need to think about never putting ssi in actual smf files in the future. You now need to properly clean up the Index.php file remembering some custom elements too.

Steve

Quote from: PrimalPrime on October 08, 2023, 08:52:23 AMI don't think you're being fair to my developer. He had never messed with SMF before.
I don't think anybody's intentionally being unfair to your developer. And @Kindred has always been and will always be very blunt so don't let the way he says what he means put you on the defensive. It's just that things are being pointed out to you on what you (or your developer) should do to make the forum run properly with no security risks.  :)


@StephanKlark - just a friendly fyi, all that has already been pointed out.  ;)
DO NOT pm me for support!

PrimalPrime

Sure, it's all good. I appreciate you guys helping. I'm just saying about the SMF experience. So far, so good but it will take time to tell if the errors are resolved. I think if I don't see them in two weeks, we can assume its fixed. Maybe a week.

Cheers

hungarianguy

Quote from: PrimalPrime on September 30, 2023, 12:13:08 PMOh, ok. I actually did some time back though and I guess no one is interested. Thanks

If you showed people the same attitude as you showed me of course no one will be interested in wasting their time with you.

Steve

DO NOT pm me for support!

hungarianguy

Quote from: Steve on October 22, 2023, 07:58:42 AM@hungarianguy - please be respectful towards other members. That goes for everyone.

I don't get it. All I said was my personal opinion without using any offensive words. Aren't we allowed to express ourselves anymore? Can you tell me what part of my posts is against the rules of smf?

PrimalPrime

What did I do? I tried to hire you but as I explained there was a problem with ftp access. Then you said now or never, so it's never. That was your choice. Let's chill out here.

Steve

DO NOT pm me for support!

PrimalPrime

It's been over two weeks since this error occurred. I am going to tentatively mark it solved. Thank you.

Advertisement: