Перейти к содержанию
View in the app

A better way to browse. Learn more.

Форум VAOZ.RU

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Аналог {image-x} для дололнительного поля

Featured Replies

Опубликовано

Иногда приходилось делать подобное, чтобы оптимизировать загрузку и кастомизировать вывод кадров на фильмах, которые загружены в дополнительное поле.

Итак. для создания тегов аналогичных {image- {fullimage-, но только для доп поля, делаем следующее.

1. В файле show.full.php перед:

$category_id = $row['category'];
$tpl->compile( 'content' );

добавить

  if (stripos ( $tpl->copy_template, "{xfimage-" ) !== false || stripos ( $tpl->copy_template, "{xfimageLarge-" ) !== false ) {
            $xfieldsdata = xfieldsdataload( $row['xfields'] );
            $images = array();
            preg_match_all('/(img|src)=("|\')[^"\'>]+/i', $xfieldsdata['screens'], $media);
            $data=preg_replace('/(img|src)("|\'|="|=\')(.*)/i',"$3",$media[0]);
  
            foreach($data as $url) {
                $info = pathinfo($url);
                if (isset($info['extension'])) {
                    if ($info['filename'] == "spoiler-plus" OR $info['filename'] == "spoiler-minus" ) continue;
                    $info['extension'] = strtolower($info['extension']);
                    if (($info['extension'] == 'jpg') || ($info['extension'] == 'jpeg') || ($info['extension'] == 'gif') || ($info['extension'] == 'png')) array_push($images, $url);
                }
            }
  
            if ( count($images) ) {
                $i=0;
                foreach($images as $url) {
                    $i++;
                    $tpl->copy_template = str_replace( '{xfimage-'.$i.'}', $url, $tpl->copy_template );
                    $tpl->copy_template = str_replace( '[xfimage-'.$i.']', "", $tpl->copy_template );
                    $tpl->copy_template = str_replace( '[/xfimage-'.$i.']', "", $tpl->copy_template );
                    $tpl->copy_template = str_replace( '{xfimagelarge-'.$i.'}', str_replace('thumbs/','',$url), $tpl->copy_template );  
                    $tpl->copy_template = str_replace( '[xfimagelarge-'.$i.']', "", $tpl->copy_template );
                    $tpl->copy_template = str_replace( '[/xfimagelarge-'.$i.']', "", $tpl->copy_template );
                }
  
            }
  
            $tpl->copy_template = preg_replace( "#\[xfimage-(.+?)\](.+?)\[/xfimage-(.+?)\]#is", "", $tpl->copy_template );
            $tpl->copy_template = preg_replace( "#\\{xfimage-(.+?)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
            $tpl->copy_template = preg_replace( "#\[xfimagelarge-(.+?)\](.+?)\[/xfimagelarge-(.+?)\]#is", "", $tpl->copy_template );
            $tpl->copy_template = preg_replace( "#\\{xfimagelarge-(.+?)\\}#i", "{THEME}/dleimages/no_image.jpg", $tpl->copy_template );
  
        }

где screens меняет на название своего доп поля, где у нас загружены картинки.
2. В шаблоне fullstory.tpl прописываем код аналогичный этому:

[xfimage-1]<a href="{xfimagelarge-1}" rel="highslide" class="highslide"><img src="{poster src='{xfimagelarge-1}' width='187' height='143'}" alt='{title}' title='{title}'  /></a>[/xfimage-1][xfimage-2]<a href="{xfimagelarge-2}" rel="highslide" class="highslide"><img src="{poster src='{xfimagelarge-2}' width='187' height='143'}" alt='{title}' title='{title}'  /></a>[/xfimage-2][xfimage-3]<a href="{xfimagelarge-3}" rel="highslide" class="highslide"><img src="{poster src='{xfimagelarge-3}' width='187' height='143'}" alt='{title}' title='{title}' /></a>[/xfimage-3]

Проверено на 11.0-11.3

Для публикации сообщений создайте учётную запись или авторизуйтесь

Рейтинг@Mail.ru Яндекс.Метрика

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.