SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Oct 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Really need help with Strict Standards

    Hello all,

    An anticipated thank you for your responses. I am getting a lot of strict standards error and i am kinda out of know-how on this. Please any helpful suggestion will be appreciated.

    Strict Standards: Non-static method languages::getcurrent() should not be called statically in C:\xampp\htdocs\Maluu\include\include.php on line 61

    The code is below. Thanks

    PHP Code:
    <?php 
    $path
    =dirname(__FILE__); 
    global 
    $minimal
    if(!
    file_exists($path.'/../config.php')) header("Location: install/"); 
    require_once(
    $path.'/../config.php'); 
    if(!isset(
    $config_abs_path) || !isset($config_live_site))  header("Location: install/"); 
    require_once(
    $config_abs_path.'/include/tables.php'); 
    require_once(
    $config_abs_path.'/classes/mysql.php'); 
    require_once(
    $config_abs_path.'/include/form.php'); 
    require_once(
    $config_abs_path.'/classes/languages.php'); 
    require_once(
    $config_abs_path.'/classes/common.php'); 
    require_once(
    $config_abs_path.'/classes/settings.php'); 
    require_once(
    $config_abs_path.'/include/seo.php'); 
    require_once 
    $config_abs_path."/include/vars.php"

    if(!
    $minimal) { 
    require_once(
    $config_abs_path.'/include/util.php'); 
    require_once(
    $config_abs_path.'/classes/listings.php'); 
    require_once(
    $config_abs_path.'/classes/auth.php'); 
    require_once(
    $config_abs_path.'/classes/categories.php'); 
    require_once(
    $config_abs_path.'/classes/fields.php'); 
    require_once(
    $config_abs_path.'/classes/depending_fields.php'); 
    require_once(
    $config_abs_path.'/classes/fieldsets.php'); 
    require_once(
    $config_abs_path.'/classes/banners.php'); 


    global 
    $db
    $db = new db_mysql(); 

    if(
    $db->error!=''header("Location: $config_live_site/offline.php"); 

    global 
    $crt_lang
    global 
    $crt_lang_name
    global 
    $crt_lang_flag


    // set main domain  
    global $main_domain
    $main_domain str_replace("http://www."""$config_live_site); 
    $main_domain str_replace("http://"""$main_domain); 
    if( (!
    strstr($main_domain".co.uk") && substr_count($main_domain".")>=2) || (strstr($main_domain".co.uk") && substr_count($main_domain".")>=3)) { 
        
    $arr explode("."$main_domain2); 
        
    $main_domain $arr[1]; 

    if(
    substr_count($main_domain"/")>=1) { 
        
    $arr explode("/",$main_domain,2); 
        
    $main_domain $arr[0]; 


    // set language using GET method 
    if(isset($_GET['lang'])) { 
        
    $get_lang escape(urldecode($_GET['lang'])); 
        if(
    $get_lang != $_COOKIE['default_lang']) { 
            
    $expire time() + 60*60*24*365
            
    setcookie("default_lang"$get_lang$expire"/"".".$main_domain); 
            
    $crt_lang $get_lang
        } 


    // get current language 
    $crt_lang languages::getCurrent(); 
    $lang=$config_abs_path.'/lang/'.$crt_lang.'.php'
    if(
    $crt_lang) { 
        
    $lang_arr languages::getLanguage($crt_lang); 
        
    $crt_lang_name $lang_arr['name']; 
        
    $crt_lang_flag $lang_arr['image']; 


    // get modules list 
    global $modules_array
    $modules_array common::getModulesList(); 

    require_once 
    $config_abs_path."/add_hooks.php"

    // get settings 
    global $appearance_settings$ads_settings$settings$seo_settings
    $appearance_settings=settings::getAppearance(); 
    $ads_settings=settings::getAdsSettings(); 
    $settings=settings::getSettings(); 
    $seo_settings settings::getSeoSettings(); 

    // current location 
    if($settings['enable_locations']) { 
        require_once(
    $config_abs_path.'/classes/locations.php'); 
        
    $lclass = new locations(); 
        
    $lclass->init(); 


    // set default timezone 
    if($appearance_settings['timezone'] && function_exists('date_default_timezone_set')) 
        
    date_default_timezone_set($appearance_settings['timezone']); 

    // include language file 
    require_once($lang); 

    // do include actions 
    do_action("include"); 

    // ******** simulate scheduler ********** 
    // run once a day, first time when the script is accessed 
    // and the value of LAST_DAY in last.php is not today date. 
    // 
    if($settings['cron_simulator']) { 

    require_once(
    $config_abs_path.'/last.php'); 

    $day=date('d'); 
    if(
    LAST_DAY!=$day

        
    write_last($day); 
        require_once(
    $config_abs_path.'/periodic.php'); 




    ?>

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,219
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Can you show us your Language class?

    As the notice is stating your getcurrent() method is not marked as a static method. Which means you shouldn't use the syntax language::getcurrent(), but rather use
    PHP Code:
    $lang = new language();
    $crt_lang $lang::getCurrent(); 

  3. #3
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I believe you mean to use $crt_lang = $lang->getCurrent(); No, cpradio? :P
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  4. #4
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    If I were you, I'd start by removing all global variables and learning about auto loading to remove those nasty require once statements.

  5. #5
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,219
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    I believe you mean to use $crt_lang = $lang->getCurrent(); No, cpradio? :P
    *sigh*, yes, I got distracted while writing that (kids do that to you, I guess...).


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •