Jump to content

[Skinbox] Warrior 3.3.x


Recommended Posts

Название: [skinbox] Warrior 3.3.x

Добавил: Respected

Добавлен: 20 Apr 2012

Категория: Стили IP.Board 3.3.x

Стиль Warrior для IP.Board 3.3.x от skinbox.net! Замечательный тёмный стиль с кучей всяких возможностей и дополнений!

Link to comment
Share on other sites

  • 4 weeks later...

При прокручивании списка форумов фон тоже прокручивается, хотя на более старых версиях такого не было. Как можно это поправить?

Link to comment
Share on other sites

Открываем стиль skinbox.css скина, в нём находим:


#background, #background-above {
position: absolute;
top: 0;
left: 0;
z-index: -10;
width: 100%;
height: 100%;
background-repeat: no-repeat;

}
Заменить на:

#background, #background-above {
position: fixed;
top: 0;
left: 0;
z-index: -10;
width: 100%;
height: 100%;
background-repeat: no-repeat;

}
[/code]

Link to comment
Share on other sites

  • 4 weeks later...

А там ещё есть закомментированный параметр


<h3>Or put your own</h3>

<div id="putyourown">

  <form>

   <input type="text" class="input_text" size="40" name="url" placeholder="URL of your background..." />

   <input type="submit" class="input_submit" value="Set" />

  </form>

</div>

, позволяющий вставить свое фоновое изображение. ТОлько вот дальше одной страницы оно не живёт. Как это изправить?

И как установить для маленьких размеров фона повтор по горизонтали и вертикали?

Link to comment
Share on other sites

Файл skin_platform_global.php. Находится в Папке форум/cache/skin_cache/cacheid_**номер папки с кэшем темы

Link to comment
Share on other sites

Файл skin_platform_global.php. Находится в Папке форум/cache/skin_cache/cacheid_**номер папки с кэшем темы

Эээ, вы чего делаете! Скин редактируется в Админ-Центре в разделе Внешний вид!

Откройте там шаблон globalTemplate в этом стиле и уже изменяйте, что вам надо. Напрямую файлы редактировать нельзя!

Link to comment
Share on other sites

позволяющий вставить свое фоновое изображение. ТОлько вот дальше одной страницы оно не живёт. Как это изправить?

В этом виноват кеш браузера! Нужно его удалить..

И как установить для маленьких размеров фона повтор по горизонтали и вертикали?

Примерно так:

background: url (URL до изображения);

background-repeat: repeat;

Link to comment
Share on other sites

Эээ, вы чего делаете! Скин редактируется в Админ-Центре в разделе Внешний вид!

Откройте там шаблон globalTemplate в этом стиле и уже изменяйте, что вам надо. Напрямую файлы редактировать нельзя!

В globalTemplate нет того содержимого, имеющегося в файле skin_platform_global.php. Или это я не прав?

1 - В этом виноват кеш браузера! Нужно его удалить..

2 - Примерно так:

background: url (URL до изображения);

background-repeat: repeat;

1 - Там нет вины кэша браузера. Это видимо отладочная строка. Чтобы вставив ссылку на изображение можно было подогнать дизайн. Но если там дописать нужные функции, то возможно будет запоминать на сессию.

2 - У меня оно всеравно одиночное (100х100). В каком параметре CSS это нужно указать?

Link to comment
Share on other sites

В архиве стиля есть инструкция по добавлению своих бэкграундов. Закачиваешь его в папку _bgs и для повтора в skinbox.css найти:


#background, #background-above {
position: absolute;
top: 0;
left: 0;
z-index: -10;
width: 100%;
height: 100%;
background-repeat: no-repeat;
}
[/CODE]

Параметр background-repeat: no-repeat; замени на background-repeat: repeat;

Сам скрипт находится по адресу _php/Platform/Backgrounds.php

Link to comment
Share on other sites

не стаёт... ну то не смертельно. Так же ещё в папке _config (форум/public/style_images/warrior/_config) есть файлик backgrounds.ini, Я его оформил так:


[bg1]

thumbnail=auto

image=bg1.jpg

[bg2]

thumbnail=auto

image=bg2.jpg

[bg3]

thumbnail=auto

image=bg3.jpg

[bg4]

thumbnail=auto

image=bg4.jpg

default=on

[bg5]

thumbnail=auto

image=bg0.jpg

[bg6]

thumbnail=auto

image=bg5.jpg

а вот повтор, то он в _php/Platform/Backgrounds.php находится. там нужно параметр
{ $background['repeat'] = false; }
заменить на
{ $background['repeat'] = true; }[/code]
. [/b]и будут повторы. У меня изображение в состоянии position: fixed. так больше нравится...

Весь код с изменённым парамеиром:


[spoiler]

[code] <?php class Platform_Backgrounds { public $selector = '#background'; public $put_your_own = false; public $put_your_own_icon = true; protected $_container_type; protected $_trigger_type; protected $_thumbnails = 100; protected $_output; protected $_css; public function __construct() { $this->_thumbnails = Platform::general()->background_picker_thumb_width(); } public function load_backgrounds() { if( $this->_css !== null || $this->_output !== null ) { return; } $settings = Platform::general()->get_background_elements(); $this->selector = $settings['element']; $backgrounds = Platform::settings('backgrounds'); $selected_bg = Platform::client_preference('background'); $this->_output = array(); if( in_array(substr($selected_bg, 0, 7), array('__', 'https:/')) ) { if( $this->put_your_own === false || !Platform::feature('background_put_your_own') ) { $selected_bg = null; } else { if( !IPSText::xssCheckUrl($selected_bg) ) { $selected_bg = null; } else { $this->_css = $this->selector . ' { background-attachment: fixed; background-image: url(' . $selected_bg . '); }'; } } } foreach( $backgrounds as $id => $background ) { if( isset($background['enabled']) && $background['enabled'] == false ) { continue; } if( in_array(substr($background['image'], 0, 7), array('__', 'https:/')) ) { $url = $background['image']; if( $background['thumbnail'] == 'auto' ) { $path = $background['image']; } } else { $url = '{style_images_url}/_bgs/' . $background['image']; if( $background['thumbnail'] == 'auto' ) { $path = Platform::root() . '../_bgs/' . $background['image']; } } if( !isset($background['repeat']) ) { $background['repeat'] = true; } if( $background['repeat'] ) { $background['repeat'] = 'repeat'; } else { $background['repeat'] = 'no-repeat'; } if( !isset($background['fixed']) ) { $background['fixed'] = false; } if( $background['fixed'] ) { $attachment = 'background-attachment: fixed;'; $background['fixed'] = 'fixed'; } else { $attachment = ''; $background['fixed'] = 'scroll'; } if( (isset($background['default']) && $background['default'] && $selected_bg === null) || (('bg-' . $id) == $selected_bg) ) { $this->_css = $this->selector . ' { background-image: url(' . $url . '); ' . $attachment . ' background-repeat: ' . $background['repeat'] . '; }'; } if( $background['thumbnail'] == 'auto' ) { $thumburl = $this->_thumbnail($path); } else if( in_array(substr($background['thumbnail'], 0, 7), array('__', 'https:/')) ) { $thumburl = $background['thumbnail']; } else { $thumburl = '{style_images_url}/_bgs/' . $background['thumbnail']; } if( $thumburl !== null ) { $thumb = '<img src="' . $thumburl . '" />'; } else { $thumb = ''; } if( isset($background['tip']) ) { $background['tip'] = ' data-tip="' . $background['tip'] . '"'; } else { $background['tip'] = ''; } $this->_output[] = '<a id="bg-' . $id . '" href="' . $url . '" class="select_background" data-background data-background-repeat="' . $background['repeat'] . '" data-background-attachment="' . $background['fixed'] . '"' . $background['tip'] . '>' . $thumb . $background['description'] . '</a>'; } if( $this->put_your_own === true && $this->put_your_own_icon === true && Platform::feature('background_put_your_own') ) { $this->_output[] = '<a id="put-your-own" href="#" class="select_background" data-target-layer="putyourown" data-background data-background-attachment="fixed"><img src="{style_images_url}/_bgs/put_your_own.png" alt="Put your own" /></a>'; } if( !Platform::feature('background_picker') ) { $this->_output = array(); } } public function container_start($trigger_type = 'list-item', $label = 'Backgrounds') { if( $this->_container_type === null ) { $this->_container_type = 'dropdown'; if( Platform::feature('backgrounds_in_dropdown', true) ) { $this->_container_type = 'dropdown'; } else if( Platform::feature('backgrounds_in_balloon', true) ) { $this->_container_type = 'balloon'; } else if( Platform::feature('backgrounds_in_overlay', true) ) { $this->_container_type = 'overlay'; } } $this->_trigger_type = $trigger_type; $output = ''; if( $this->_trigger_type === 'list-item' ) { $output .= '<li id="nav_backgrounds" class="right"'; } else if( $this->_trigger_type === 'anchor' ) { $output .= '<a href="#"'; } if( $this->_container_type === 'dropdown' ) { $output .= ' data-dropdown="right"><span><a href="#">' . $label . '</a></span><ul><li id="ptBackgroundPicker">'; } else if( $this->_container_type === 'balloon' ) { $output .= ' data-target-domballoon="bgpicker"><a href="#">' . $label . '</a>' . ($this->_trigger_type === 'anchor' ? '' : '</li>'); $output .= '<div id="ptBackgroundPicker" data-domballoon="bgpicker"><div>'; } else if( $this->_container_type === 'overlay' ) { $output .= ' data-target-layer="bgpicker"><a href="#">' . $label . '</a>' . ($this->_trigger_type === 'anchor' ? '</a>' : '</li>'); $output .= '<div id="ptBackgroundPicker" data-layer="bgpicker"><div>'; } return $output; } public function container_end() { if( $this->_container_type === 'dropdown' ) { return '</li></ul>' . ($this->_trigger_type === 'anchor' ? '</a>' : '</li>'); } else { return '</div></div>'; } } public function backgrounds() { $this->load_backgrounds(); return $this->_output; } public function css() { $this->load_backgrounds(); return $this->_css; } public function js() { $settings = Platform::general()->get_background_elements(); return 'Platform.getCore().setOption('backgrounds', 'element', '' . $settings['element'] . '' );'; } protected function _thumbnail($path) { if( !file_exists($path) ) { return null; } $cacheKey = md5($path); $cachePath = Platform::root() . '../_cache/switcher.' . md5($path) . '.jpg'; if( file_exists($cachePath) ) { if( substr($path, 0, 4) == 'http' ) { if( (filemtime($cachePath) + (24*3600)) > time() ) { return '{style_images_url}/_cache/switcher.' . $cacheKey . '.jpg'; } } else { if( filemtime($cachePath) >= filemtime($path) ) { return '{style_images_url}/_cache/switcher.' . $cacheKey . '.jpg'; } } } $size = getimagesize($path); if( $size[2] == IMAGETYPE_PNG ) { $image = imagecreatefrompng($path); } else if( $size[2] == IMAGETYPE_GIF ) { $image = imagecreatefromgif($path); } else if( $size[2] == IMAGETYPE_JPEG ) { $image = imagecreatefromjpeg($path); } else { return null; } if( $size[0] < $size[1] ) { $coord = 0; } else { $coord = 1; } $thb = array(); $thb[0] = $this->_thumbnails; $thb[1] = $this->_thumbnails; $k = $size[abs($coord-1)] / $size[$coord]; $new = array(); $new[$coord] = $this->_thumbnails; $new[abs($coord-1)] = $this->_thumbnails * $k; $canvas = imagecreatetruecolor($new[0], $new[1]); imagecopyresampled($canvas, $image, 0, 0, 0, 0, $new[0], $new[1], $size[0], $size[1]); $ratio[0] = ($thb[0] / $new[0]); $ratio[1] = ($thb[1] / $new[1]); $canvas2 = imagecreatetruecolor($thb[0], $thb[1]); if( $new[0] > $new[1] ) { $crop[0] = round($new[0] * $ratio[1]); $crop[1] = $thb[1]; $src[0] = ceil(($new[0] / 2) - ($thb[0] / 2)); $src[1] = 0; } else if( $new[0] < $new[1] ) { $crop[1] = round($new[1] * $ratio[0]); $crop[0] = $thb[0]; $src[0] = 0; $src[1] = ceil(($new[1] / 2) - ($thb[1] / 2)); } else { $crop[0] = $thb[0]; $crop[1] = $thb[1]; $src[0] = 0; $src[1] = 0; } imagecopyresampled($canvas2, $canvas, 0 , 0 , $src[0], $src[1], $crop[0], $crop[1], $new[0], $new[1]); imagejpeg($canvas2, $cachePath); return '{style_images_url}/_cache/switcher.' . $cacheKey . '.jpg'; } } [/code]

[/spoiler]

Link to comment
Share on other sites

  • 3 weeks later...

Заменил картинки на свои(Расширение оставил такое же(2000х1091). Но почему отображаются до сих пор старые картинки?

Link to comment
Share on other sites

Вы вообще стиль вживую смотрели?

Там где кнопка Просмотр новых публикаций на форуме, есть кнопка смены фона.

Link to comment
Share on other sites

Название картинки должно быть bgX.jpg, где X - порядковый номер.

Затем в _config/backgrounds.ini добавьте новую секцию.

Вот мой backgrounds.ini:


[bg1]
thumbnail=auto
image=bg1.jpg
default=on
[bg2]
thumbnail=auto
image=bg2.jpg
[bg3]
thumbnail=auto
image=bg3.jpg
[/CODE]

Link to comment
Share on other sites

Специально ради интереса, удалил все картинки и обновил страницу в своем браузере, результат: все картинки опять же остались хоть я полностью очистил папку _bgs

Link to comment
Share on other sites

SiNTaKsIs, значит Ccleaner-ом очистить куки в браузере и после очистки обновить страницу.

А вообще, то шаги там простые...

0ede8df0ba6c.jpg- папка с данными скина. IPB332 - это корень твоего форума.

719fa0394a81.jpg-Папка с фонами. Фон может иметь любое имя. Лишь бы не кириллица и без пробелов.

5516e69c269d.jpgпапка, где нахоится файл backgrounds.ini. Тебе тока он и нужен, чтобы в него прописывать свои картинки.

Вот пример файла у меня:


[bg1]

thumbnail=auto

image=bg1.jpg

[bg2]

thumbnail=auto

image=bg2.jpg

default=on

[bg3]

thumbnail=auto

image=bg3.jpg

[bg4]

thumbnail=auto

image=bg4.jpg

[bg5]

thumbnail=auto

image=bg0.jpg

[bg6]

thumbnail=auto

image=bg5.jpg

[bg7]

thumbnail=auto

image=kamen-stena.jpg

Где фон bg2.jpg с параметром default=on задан по умолчанию. так жеэтот параметр можно применить к любому другому изображению, методом вырезки и вставки строки в текстовом редакторе.

cb50f9912814.jpg

Link to comment
Share on other sites

Нажатием на F5 обновите страницу браузера. Это удалить кэш и обновит страницу полностью.

Link to comment
Share on other sites

если речь идет про миниатюры, то:

public/style_images/warrior/_cache

и удалить оттуда картинки

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Ваша ссылка была автоматически строена.   Отображать как обычную ссылку

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...