LPH
Well-known member
I'm trying to figure out how to call a site URL rather absolute path to initialize XenForo.
This is the what I have written.
When use_url is false and the xenword_option loaded is absolute path then everything is fine. The problem is in the use_url true part of the code.
I'm getting the error:
Line 95 is the require Autoloader.php.
The path http://www.lph.dev/community/library/XenForo/Autoloader.php is correct ... but it isn't opening.
Is there a reason that this code fails that I'm overlooking?
This is the what I have written.
PHP:
if ( $xenword_options['use_url'] == true ) {
$protocol = is_ssl() ? 'https://' : 'http://';
$host = $xenword_options['use_host'];
$path = $xenword_options['use_path'];
$fileDir = $protocol . $host . $path;
} else {
$fileDir = $xenword_options['absolute_path'];
}
if ( !class_exists( 'XenForo_Autoloader' ) ) {
require( $fileDir . "/library/XenForo/Autoloader.php");
// The rest of the initialize XenForo code from index.php
When use_url is false and the xenword_option loaded is absolute path then everything is fine. The problem is in the use_url true part of the code.
I'm getting the error:
Code:
Fatal error: require(): Failed opening required 'http://www.lph.dev/community/library/XenForo/Autoloader.php' (include_path='.:/Applications/MAMP/bin/php/php5.6.1/lib/php') in /Applications/MAMP/htdocs/wp-content/plugins/xenword-2.5.0.01/includes/class-xenword.php on line [I]95[/I]
Line 95 is the require Autoloader.php.
The path http://www.lph.dev/community/library/XenForo/Autoloader.php is correct ... but it isn't opening.
Is there a reason that this code fails that I'm overlooking?