• How can I convert this function to make $path a subdomain.
    Right now it’s outputting

    https://blog.mysite.com/static/plugins/translator/image_map.png

    I need it to be:

    https://static.mysite.com/plugins/translator/image_map.png

    Can anyone help me with this? My plugin folder is in a subdomain now, and the translator plugin stopped working, so I’m trying to make this plugin work now. Thanks in advance.

    function gltr_get_flag_image_path($language) {
      return dirname(__file__) . '/flag_' . $language . '.png';
    }
    
    function gltr_get_flag_image($language) {
      //thanks neanton!
      $path = strstr(realpath(dirname(__file__)), 'static');
      $path = str_replace('\\', '/', $path);
      return get_settings('siteurl') . '/' . $path . '/flag_' . $language . '.png';
    }
    
    function gltr_get_flags_image() {
      $path = strstr(realpath(dirname(__file__)), 'static');
      $path = str_replace('\\', '/', $path);
      return get_settings('siteurl') . '/' . $path . '/image_map.png';
    }
  • The topic ‘Need help with this function..’ is closed to new replies.