Перейти к содержанию

chegun

Новичок
  • Постов

    3
  • Зарегистрирован

  • Посещение

Сообщения, опубликованные chegun

  1. 2 часа назад, SlawkA сказал:

    очень похоже на вывод новостей как на даталайф движке)

    Я примерно знаю, что такую штуку можно реализовать через плагин Portal, но его скачать только через маркет можно, а сливы предыдущих версий портала давно устарели, как я понял((.

  2. Добрый день. Честно сказать, устал уже шерстить поиск, есть похожие темы, а ответов нет...
    Список наиболее близких к моей проблеме тем:
     

    Спойлер

     

    Моя задача такова:
     Создал страницу, настроил через конструктор чтобы выводились последние темы и сообщения. Но проблема следующая...
    Когда я вывожу в ленту новые темы, всё отлично но не отображается контент, ни видео, впрочем ничего... А когда вывожу последние сообщения, то всё тоже хорошо, но на странице появляются все сообщения во всех темах, поэтому бардак...

    Мне нужно, чтобы в ленте отображались последние темы, картинка или видео в заданных мною размерах и определённое количество символов из сообщения этой темы.
    Плагин Super Grid не работает как я понял. Пробовал и через базу данных и блоками, и через pages... Единственный для меня видимый вариант, это делать через блоки и БД, но! Там есть PHP код, который нужно как-то подправить, а я вообще особо не понимаю. Поэтому, если я прав, не могли бы вы мне помочь с этим куском кода? Помогите)

    Вот код, выводящий все сообщения и второй выводящий список тем:
     

    Спойлер
    {{if !empty( $comments ) }}
        <h3 class='ipsType_reset ipsWidget_title'>{$title}</h3>
        {{if $orientation == 'vertical'}}
            <div class='ipsWidget_inner ipsPad_half'>
                <ul class='ipsDataList ipsDataList_reducedSpacing'>
                    {{foreach $comments as $comment}}
                        <li class='ipsDataItem'>
                            <div class='ipsDataItem_icon ipsPos_top'>
                                {template="userPhoto" group="global" app="core" params="$comment->author(), 'tiny'"}
                            </div>
                            <div class='ipsDataItem_main'>
                                <div class='ipsType_break ipsContained'><a href="{$comment->url()}" title='{lang="view_this_topic" sprintf="$comment->item()->title"}' class='ipsType_medium ipsTruncate ipsTruncate_line'>{{if $comment->item()->isSolved()}}<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="this_is_solved"}'><i class='fa fa-check'></i></span>{{endif}} {$comment->item()->title}</a></div>
                                <p class='ipsType_reset ipsType_light ipsType_medium ipsType_blendLinks'>{lang="byline_nodate" htmlsprintf="$comment->author()->link( NULL, NULL, $comment->isAnonymous() )"} &middot; <a href='{$comment->item()->url()->setQueryString( array( 'do' => 'findComment', 'comment' => $comment->pid ) )}' class='ipsType_blendLinks'>{$comment->dateLine()|raw}</a></p>
                                <div class='ipsType_medium ipsType_textBlock ipsType_richText ipsType_break ipsContained ipsSpacer_top ipsSpacer_half' data-ipsTruncate data-ipsTruncate-type='remove' data-ipsTruncate-size='{{if $orientation == 'vertical'}}6 lines{{else}}2 lines{{endif}}' data-ipsTruncate-watch='false'>
                                    {$comment->truncated( TRUE, NULL )|raw}
                                </div>
                            </div>
                        </li>
                    {{endforeach}}
                </ul>
            </div>
        {{else}}
            <div class='ipsWidget_inner'>
                <ul class='ipsList_reset ipsPadding sm:ipsPadding:half'>
                    {{foreach $comments as $comment}}
                        <li class='ipsBox ipsBox--child ipsClearfix ipsMargin_bottom'>
                            <div class='ipsComment_header ipsPhotoPanel ipsPhotoPanel_mini'>
                                {template="userPhoto" app="core" group="global" params="$comment->author(), 'mini', $comment->warningRef()"}
                                <div>
                                    <h3 class='ipsComment_author ipsType_blendLinks'>
                                        <strong class='ipsType_normal'>{template="userLink" app="core" group="global" params="$comment->author(), $comment->warningRef(), NULL, $comment->isAnonymous()"}</strong>
                                        {template="reputationBadge" group="global" app="core" params="$comment->author()"}
                                    </h3>
                                    <p class='ipsComment_meta ipsType_light ipsType_medium'>
                                        <a href='{$comment->item()->url()->setQueryString( array( 'do' => 'findComment', 'comment' => $comment->pid ) )}' class='ipsType_blendLinks'>{$comment->dateLine()|raw}</a>
                                        {{if $comment->editLine()}}
                                            ({lang="edited_lc"})
                                        {{endif}}
                                        {{if $comment->hidden()}}
                                            &middot; {$comment->hiddenBlurb()}
                                        {{endif}}
                                    </p>
                        
                                    {{if member.modPermission('mod_see_warn') and $comment->warning}}
                                        {template="commentWarned" group="global" app="core" params="$comment"}
                                    {{endif}}
                                </div>
                            </div>
    
                            <div class='ipsPadding_vertical sm:ipsPadding_vertical:half ipsPadding_horizontal ipsClearfix'>
                                <div class='ipsType_break ipsContained'><a href="{$comment->url()}" title='{lang="view_this_topic" sprintf="$comment->item()->title"}' class='ipsDataItem_title ipsTruncate ipsTruncate_line'>{{if $comment->item()->isSolved()}}<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="this_is_solved"}'><i class='fa fa-check'></i></span>{{endif}} {wordbreak="$comment->item()->title"}</a></div>
                                <div data-role='commentContent' class='ipsType_normal ipsType_richText ipsContained' data-controller='core.front.core.lightboxedImages'>
                                    {{if $comment->hidden() === 1 && $comment->author()->member_id == \IPS\Member::loggedIn()->member_id}}
                                        <strong class='ipsType_medium ipsType_warning'><i class='fa fa-info-circle'></i> {lang="comment_awaiting_approval"}</strong>
                                    {{endif}}
                                    {$comment->content()|raw}
                                    
                                    {{if $comment->editLine()}}
                                        {$comment->editLine()|raw}
                                    {{endif}}
                                </div>
                            </div>
                            <div class='ipsItemControls'>
                                <ul class='ipsComment_controls ipsClearfix ipsItemControls_left' data-role="commentControls">
                                    {{if $comment->canReportOrRevoke() === TRUE}}
                                        <li><a href='{$comment->url('report')}'  {{if member.member_id or \IPS\Helpers\Form\Captcha::supportsModal()}}data-ipsDialog data-ipsDialog-remoteSubmit data-ipsDialog-size='medium' data-ipsDialog-flashMessage='{lang="report_submit_success"}' data-ipsDialog-title="{lang="report"}"{{endif}} data-action='reportComment' title='{lang="report_content"}'>{lang="report"}</a></li>
                                    {{endif}}
                                </ul>
                                {{if $comment->hidden() !== 1 && \IPS\IPS::classUsesTrait( $comment, 'IPS\Content\Reactable' ) and settings.reputation_enabled}}
                                    {template="reputation" group="global" app="core" params="$comment"}
                                {{endif}}
                            </div>
                        </li>
                    {{endforeach}}
                </ul>
            </div>
        {{endif}}
    {{endif}}
    {{if !empty( $topics ) }}
    	<h3 class='ipsWidget_title ipsType_reset'>{$title}</h3>
    
    	{{if $orientation == 'vertical'}}
    		<div class='ipsPad_half ipsWidget_inner'>
    			<ul class='ipsDataList ipsDataList_reducedSpacing'>
    				{{foreach $topics as $topic}}
    					<li class='ipsDataItem {{if $topic->hidden()}} ipsModerated{{endif}}'>
    						<div class='ipsDataItem_icon ipsPos_top'>
    							{template="userPhoto" group="global" app="core" params="$topic->author(), 'tiny'"}
    						</div>
    						<div class='ipsDataItem_main cWidgetComments'>
    							<div class="ipsCommentCount ipsPos_right {{if ( $topic->posts - 1 ) === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="replies_number" pluralize="$topic->posts - 1"}'>{expression="\IPS\Member::loggedIn()->language()->formatNumber( $topic->posts - 1 )"}</div>
    							
    							<div class='ipsType_break ipsContained'>
    								{{if $topic->mapped('featured') || $topic->hidden() === -1 || $topic->hidden() === 1 || $topic->isSolved()}}
    									{{if $topic->hidden() === -1}}
    										<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$topic->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span></span>
    									{{elseif $topic->hidden() === 1}}
    										<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span>
    									{{endif}}
    									{{if $topic->mapped('featured')}}
    										<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span>
    									{{endif}}
    									{{if $topic->isSolved()}}
    										<span><span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="this_is_solved"}'><i class='fa fa-check'></i></span></span>
    									{{endif}}
    								{{endif}}							
    								<a href="{$topic->url( "getPrefComment" )}" title='{lang="view_this_topic" sprintf="$topic->title"}' class='ipsDataItem_title'>{$topic->title}</a>
    							</div>
    							<p class='ipsType_reset ipsType_medium ipsType_blendLinks ipsContained'>
    								<span>{lang="byline_nodate" htmlsprintf="$topic->author()->link( NULL, NULL, $topic->isAnonymous() )"}</span><br>
    								<span class='ipsType_light'>{lang="topic_started_date" htmlsprintf="\IPS\DateTime::ts( $topic->mapped('date') )->html()"}</span>
    							</p>
    						</div>
    					</li>
    				{{endforeach}}
    			</ul>
    		</div>
    	{{else}}
    		<div class='ipsWidget_inner'>
    			<ul class='ipsDataList'>
    				{{foreach $topics as $topic}}
    					{template="row" group="global" app="forums" location="front" params="NULL, NULL, $topic, FALSE"}
    				{{endforeach}}
    			</ul>
    		</div>
    	{{endif}}
    {{endif}}

     

×
×
  • Создать...