Jump to content

Class 'date_sys' not found


jordanwb

Recommended Posts

I have a class code "date_sys" (don't ask why it's called that I don't know), it has only two functions which are both marked as static so I call it like so "date_sys::". I didn't have this problem on Ubuntu which had Lamp installed but my XAMPP server in Windows XP doesn't want to work.

 

I have added my php.ini file just in case.

 

[attachment deleted by admin]

Link to comment
Share on other sites

Well how everything is included is kinda confusing.

 

/index.php includes /core/session.php

 

/core/session.php includes:

 

  • /core/settings.php
  • /core/core.php
  • /core/date.php
  • /core/sql.php
  • /core/cookie.php
  • /core/login.php
  • /core/menu.php
  • /core/usercp.php

 

Now after /index.php includes /core/session.php, it runs $sql->import_plugins() $sql is the instance of sql_handler which is in /core/sql.php It reads all the rows in the Mysql table "scm_plugins" and includes each plugin. At this point assume the includes work.

 

In the news class where the error occurs:

 

$datestamp_broken = date_sys::breakdown_int_timestamp($oldest_news_item['integer_date_stamp']);

 

The entire date_sys class:

 

<?php

class date_sys
{
    static function breakdown_int_timestamp ($timestamp)
    {
        $datestamp[0] = substr ($timestamp, 0, 4);
        $datestamp[1] = substr ($timestamp, 4, 2);
        $datestamp[2] = substr ($timestamp, 6, 2);
        $datestamp[3] = substr ($timestamp, 8, 2);
        $datestamp[4] = substr ($timestamp, 10, 2);
        $datestamp[5] = substr ($timestamp, 12, 2);
        
        return $datestamp;
    }
    
    static function month_from_int ($int)
    {
        $int = (int) $int;
        $months = array ("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
        return $months[$int];
    }
}

?>

 

[edit]

It is also noteworthy mentionning is that in /core/session.php right after I include all those files I called "date_sys::month_from_int (5);" and it said it couldn't find the class either

[/edit]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.