Community Forum

Please read the intro before joining/posting. Thank you.

If you have questions about our software, chances are this forum has the answers.

You'll need to register before you can post on the forum to ask your question or to answer another one. A reply will be posted to each and every question that is asked so there is no need to double post or bump your post. We'll do our best to answer promptly, but in some cases it may take a day or two. If you bump your post, it may be removed. Bear with us and we'll get your question answered quickly.

Here are a few tips to help you to get your questions answered more rapidly.

IMPORTANT: Posts in English only. We don't employ translators and we'll be unable to understand your message properly and will probably delete it.
SOFTWARE: Each software has it's own forum. Software here is NOT supported. Posts about this software will be deleted. Supported software questions ONLY please.
SEARCH: Use the search option to see if your question has been answered on the forum before now or if there is an answer in the documentation of your software.
PERSONAL SUPPORT: If you have purchased a commercial version of any software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
LINKS: Any links posted are not clickable (to deter spammers) and must be copied / pasted into your browser address bar.

            

You are not logged in.

404 Folder Error BugPosts in the Maian Events forum by SayWhatAgain
SayWhatAgain
28-04-2018 18:16:40

Hi again,

if I try to accessa an invented folder like:

https://www.example.com/events/INVENTED_FOLDER

instead of the 404 web, I get this error:

Notice: Undefined variable: DT in /(censured)/(censured)/vhosts/(censured)/httpdocs/events/control/system/global.php on line 111

Fatal error: Uncaught Error: Call to a member function date() on null in /(censured)/(censured)/vhosts/(censured)/httpdocs/events/control/system/global.php:111 Stack trace: #0 /(censured)/(censured)/vhosts/(censured)/httpdocs/events/control/system/headers/404.php(9): include() #1 /(censured)/(censured)/vhosts/(censured)/httpdocs/events/control/classes/system/class.rewrite.php(148): include('/(censured)/(censured)/vhosts...') #2 /(censured)/(censured)/vhosts/(censured)/httpdocs/events/control/controllers.php(105): modrw->parser() #3 /(censured)/(censured)/vhosts/(censured)/httpdocs/events/control/system/init.php(52): include('/(censured)/(censured)/vhosts...') #4 /(censured)/(censured)/vhosts/(censured)/httpdocs/events/index.php(30): include('/(censured)/(censured)/vhosts...') #5 {main} thrown in /(censured)/(censured)/vhosts/(censured)/httpdocs/events/control/system/global.php on line 111

errors.log shows no error at all

SayWhatAgain
30-04-2018 16:33:26

Well, I still have it, and found a 'solution'

In control/system/global.php find:

for ($i=$DT->date('Y', $DT->ts()); $i<($DT->date('Y', $DT->ts()) + $SETTINGS->yearshow); $i++) {
      $tpl->assign('NAV_EVENTS_' . $i, (isset($HTML) && method_exists($HTML, 'navyears') ? $HTML->navyears(array('yr' => $i, 'cal' => $msw_calendar, 'cal2' => $msw_calendar2)) : ''));
      $offCanvasState['y' . $i] = (isset($sspanel) && $sspanel == 'y' . $i ? ' in' : '');
    }

and replace it with:

if (isset($DT) && method_exists($DT, 'ts')) {
    for ($i=$DT->date('Y', $DT->ts()); $i<($DT->date('Y', $DT->ts()) + $SETTINGS->yearshow); $i++) {
      $tpl->assign('NAV_EVENTS_' . $i, (isset($HTML) && method_exists($HTML, 'navyears') ? $HTML->navyears(array('yr' => $i, 'cal' => $msw_calendar, 'cal2' => $msw_calendar2)) : ''));
      $offCanvasState['y' . $i] = (isset($sspanel) && $sspanel == 'y' . $i ? ' in' : '');
    }
}

Now the 404 error page appears. Hope my 'solution' it's OK with the other parts of the script

100% Free SoftwareSoftware Versions, Development, Docs & UpgradesHostingNewsletter
Made with in the U.K & Hong Kong

Free PHP Scripts / Responsive PHP Scripts / Lightweight PHP Scripts / White Label PHP Scripts