diff --git a/src/Settings.php b/src/Settings.php index 00d562d..5b7edb7 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -28,6 +28,7 @@ $mmessage = 'Мы тут шаманим немного. Скоро всё буд $mbname = 'www.rock.ru'; # The name of your forum. $language = 'russian'; # The default language file set for the forum. $boardurl = 'http://192.168.201.100/forum'; # URL to your forum's folder. (without the trailing /!) +$staticurl = 'http://192.168.201.102/forum'; # URL to your forum's folder. (without the trailing /!) $boarddir = '/var/www/rock/forum'; $sourcedir = '/var/www/rock/forum/Sources'; $webmaster_email = 'noreply@rock.ru'; # Email address to send emails from. (like noreply@yourdomain.com.) diff --git a/src/Sources/Load.php b/src/Sources/Load.php index 61d834f..c1a985c 100644 --- a/src/Sources/Load.php +++ b/src/Sources/Load.php @@ -514,7 +514,7 @@ function loadMemberContext($user) global $themeUser, $user_profile, $txt, $scripturl, $user_info; global $context, $modSettings, $ID_MEMBER; global $board_info, $settings, $db_prefix; - global $boardurl; + global $staticurl; static $dataLoaded = array(); // If this person's data is already loaded, skip it. @@ -622,8 +622,8 @@ function loadMemberContext($user) 'posts' => $profile['posts'] > 100000 ? $txt[683] : ($profile['posts'] == 1337 ? 'leet' : comma_format($profile['posts'])), 'avatar' => array( 'name' => &$profile['avatar'], - 'image' => $profile['avatar'] == '' ? ($profile['ID_ATTACH'] > 0 && !empty($modSettings['avatar_allow_upload']) ? '' : '') : '' , - 'href' => $profile['avatar'] == '' ? ($profile['ID_ATTACH'] > 0 && !empty($modSettings['avatar_allow_upload']) ? $boardurl . '/' . $__avatar : '') : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar']), + 'image' => $profile['avatar'] == '' ? ($profile['ID_ATTACH'] > 0 && !empty($modSettings['avatar_allow_upload']) ? '' : '') : '' , + 'href' => $profile['avatar'] == '' ? ($profile['ID_ATTACH'] > 0 && !empty($modSettings['avatar_allow_upload']) ? $staticurl . '/' . $__avatar : '') : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar']), 'url' => $profile['avatar'] == '' ? '' : (stristr($profile['avatar'], 'http://') ? $profile['avatar'] : $modSettings['avatar_url'] . '/' . $profile['avatar']) ), 'last_login' => empty($profile['lastLogin']) ? $txt['never'] : timeformat($profile['lastLogin']), diff --git a/src/Sources/Subs.php b/src/Sources/Subs.php index f2d508c..5472b12 100644 --- a/src/Sources/Subs.php +++ b/src/Sources/Subs.php @@ -1916,6 +1916,7 @@ function setupThemeContext() { global $modSettings, $user_info, $scripturl, $context, $settings, $options, $txt, $maintenance; global $db_prefix; // Grudge's Mod + global $staticurl; // Get some news... $context['news_lines'] = explode("\n", str_replace("\r", '', trim(addslashes($modSettings['news'])))); @@ -1967,7 +1968,7 @@ function setupThemeContext() { $__avatar = glob('attachments/avatar_'.$context['user']['id'].'.{jpg,png,gif}', GLOB_BRACE); if (!empty($__avatar)) $__avatar = $__avatar[0]; - $context['user']['avatar']['href'] = 'http://img.rock.ru/forum/'.$__avatar; + $context['user']['avatar']['href'] = $staticurl . '/'.$__avatar; } } // Full URL?