Jump to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

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.

Помощь с кодом

Featured Replies

Posted

Парни,выручайте. В рнр я ноль ,ну может 0.1,не более. 

Есть код

     {{$location = $row != NULL ? $row : ($row->post != NULL ? $row->post : $row);}}
     {{$field_content = $row->post == NULL ? 'field_'.$location->database()->field_content : $row->post; $field_content = $row->post == NULL ? $location->$field_content : $field_content;}}
{{if \preg_match( '#<fileStore.core_Attachment>\S+(?:jpg|jpeg|png|webp)#', $field_content, $image_url )}}
       {{$image_url = \str_replace('<fileStore.core_Attachment>', \IPS\File::getClass('core_Attachment')->baseUrl(), $image_url[0]);}}
        {{if settings.lazy_load_enabled}}                 
			<a href="{$row->url( "getPrefComment" )}" title="{lang="read_more_about" sprintf="$row->_title"}" >
			<img class='ipsImage' src='{expression="\IPS\Text\Parser::blankImage()"}' alt='{wordbreak="$row->_title"}' data-src='{file="$image_url" extension="core_Attachment"}'>
			</a>
			{{else}}
			<a href="{$row->url( "getPrefComment" )}" title="{lang="read_more_about" sprintf="$row->_title"}" >
			<img class='ipsImage' alt='{wordbreak="$row->_title"}' src='{file="$image_url" extension="core_Attachment"}'>
			</a>                     
		{{endif}}
{{endif}}

Работает в Страницах: entry и recordRow / и Форумах: topicRow и topicRowSnnipet.

Но ни в какую не хотит фурыкать в файле forums/global/row

P.S Автор кода молчит...

  • Author
2 минуты назад, Desti сказал:

попробуй поменять $row на $topic

здесь у меня подозрение на строку 

     {{$field_content = $row->post == NULL ? 'field_'.$location->database()->field_content : $row->post; $field_content = $row->post == NULL ? $location->$field_content : $field_content;}}

потому что без этой строки ошибки нету,но и сам код не работает как надо.

50 минут назад, AHristich сказал:

потому что без этой строки ошибки нету, но и сам код не работает как надо.

А вам не приходит в голову, что немного совсем наоборот? :) Переменной $row нет в вашем шаблоне, чего вы хотите получить-то? В последний шаблон передается переменная $topic, ее и надо использовать.

 

  • Author
3 минуты назад, Desti сказал:

А вам не приходит в голову, что немного совсем наоборот? :) Переменной $row нет в вашем шаблоне, чего вы хотите получить-то? В последний шаблон передается переменная $topic, ее и надо использовать.

 

Я в курсе что $row нету,поэтому использовал $topic (до создания темы о помощи) 

{{$location = $topic != NULL ? $topic : ($row->post != NULL ? $row->post : $row);}}
{{$field_content = $row->post == NULL ? 'field_'.$location->database()->field_content : $row->post; $field_content = $row->post == NULL ? $location->$field_content : $field_content;}}
{{if \preg_match( '#https://ipbmafia.ru/uploads\S+(?:jpg|jpeg|png|webp)#', $field_content, $image_url )}}
{{$image_url = \str_replace('https://ipbmafia.ru/uploads', \IPS\File::getClass('core_Attachment')->baseUrl(), $image_url[0]);}}
{{if settings.lazy_load_enabled}}                 
<a href="{$topic->url( "getPrefComment" )}" title="{lang="read_more_about" sprintf="$topic->_title"}" >
<img class='ipsImage' src='{expression="\IPS\Text\Parser::blankImage()"}' alt='{wordbreak="$topic->_title"}' data-src='{file="$image_url" extension="core_Attachment"}'></a>
{{else}}
<a href="{$topic->url( "getPrefComment" )}" title="{lang="read_more_about" sprintf="$topic->_title"}" >
<img class='ipsImage' alt='{wordbreak="$topic->_title"}' src='{file="$image_url" extension="core_Attachment"}'></a>                     
{{endif}}
{{endif}}

или я что-то не так делаю?

даже пробывал полностью все $row в этом коде заменить на $topic,бесполезно.

  • Author
46 минут назад, Exception сказал:

где у тебя этот табличный шаблон выводится?

Пытаюсь вывести в пользовательских блоках,там подключается этот шаблон.

Тесть создаю блок в Страницах,затем шаблон блока Лента тем форумов,вот там и подключается этот шаблон.

forums/global/row.html

  • Author
1 час назад, Desti сказал:

Все $row заменить на $topic. У вас даже в первой строке пара $row, реально не видите???

Это здесь не ту редакцию показал,менял абсолютно все $row

можно первый пост загрузить с темы

{{$post = $topic->topic_firstpost ? \IPS\forums\Topic\Post::load($topic->topic_firstpost)->post : NULL;}}
{{if $post AND \preg_match( '#<fileStore.core_Attachment>\S+(?:jpg|jpeg|png|webp)#', $post, $image_url )}}
  {{$image_url = \str_replace('<fileStore.core_Attachment>', \IPS\File::getClass('core_Attachment')->baseUrl(), $image_url[0]);}}
  {{if settings.lazy_load_enabled}}                 
  <a href="{$topic->url( "getPrefComment" )}" title="{lang="read_more_about" sprintf="$topic->_title"}" >
    <img class='ipsImage' src='{expression="\IPS\Text\Parser::blankImage()"}' alt='{wordbreak="$topic->_title"}' data-src='{file="$image_url" extension="core_Attachment"}'></a>
  {{else}}
  <a href="{$topic->url( "getPrefComment" )}" title="{lang="read_more_about" sprintf="$topic->_title"}" >
    <img class='ipsImage' alt='{wordbreak="$topic->_title"}' src='{file="$image_url" extension="core_Attachment"}'></a>                     
  {{endif}}
{{endif}}

 

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
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.

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.