LPH
Well-known member
The getBoardUrl function works fine when Use Friendly URLs is ticked in the ACP. However, when not checked then the /index.php? gets in the way of the URL.
In some places, to get around this problem then I'm using the following code.
Is there an easier way (better way) to write this code? Is there a way to change 'canonical:index' so that the index.php? isn't present?
PHP:
public static function getBoardUrl() {
return XenForo_Application::get('options')->boardUrl;
}
In some places, to get around this problem then I'm using the following code.
PHP:
if ( XenForo_Link::useFriendlyUrls(false) == false ) {
$spritesheet_url = XenForo_Application::get('options')->boardUrl . '/styles/dark/ratings/spritesheet.png';
} else {
$spritesheet_url = XenForo_Link::buildPublicLink( 'canonical:index' . 'styles/dark/ratings/spritesheet.png' );
}
Is there an easier way (better way) to write this code? Is there a way to change 'canonical:index' so that the index.php? isn't present?