• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[Help] Some codes for recentNews

#1
Hi everyone!

I put some codes in recentNews like this:

Code:
<xen:require css="message_user_info.css" />
<xen:require css="bb_code.css" />
<xen:require css="EWRblock_RecentNews.css" />
<div id="recentNews">
    <xen:foreach loop="$RecentNews" value="$news">
        <div class="section sectionMainportal recentNews" id="{$news.thread_id}">
            <div class="primaryContentportal {xen:if {$option.leftdate}, 'leftDate'}">
                <div class="subHeadingportal">
                    <div style="float: right; white-space: nowrap;">
                        <a href="{xen:link threads, $news}"></a>
                        <xen:if is="{$visitor.permissions.EWRporta.canPromote}">
                            &nbsp; (<a href="{xen:link 'threads/edit', $news}" class="OverlayTrigger">{xen:phrase edit}</a>)
                        </xen:if>
                    </div>
                    <a href="{xen:link threads, $news}" class="newsTitle">{$news.title}</a>
                </div>
                <div class="messageContent baseHtml">
                    <div class="postedBy">
                        <span class="posted">
                                                        bởi <a href="{xen:link members, $news}" class="username">{$news.username}</a>,
                            vào <a href="{xen:link threads, $news}">{xen:datetime $news.promote_date}</a></span>
                                                        <span class="views"><a href="{xen:link threads, $news}">{$news.view_count} {xen:phrase views}</a></span>
                  
                    </div>
  
                <xen:if is="{$news.promote_icon} != 'disabled'">
                <xen:if hascontent="true">
                                <div class="image_preview">
                            <xen:contentcheck>
                            <xen:if is="{$news.attach}">
                                <a href="{xen:link threads, $news}"><img src="{xen:link attachments, $news.attach}" alt="{$news.attach.filename}"  }/></a>
                            <xen:elseif is="{$news.medio}" />
                                <div style="background: url('{xen:helper medio, $news.medio}') no-repeat;">
                                    <a href="{xen:link 'full:media/popout', $news.medio}" class="OverlayTrigger"><img src="styles/8wayrun/EWRmedio_play.png" width="180" height="90" /></a>
                                </div>
                            <xen:elseif is="{$news.image}" />
                                <a href="{xen:link threads, $news}"><img src="{$news.image}" alt="{$news.image}" title="Nhấp chuột vào đây để xem chi tiết"  /></a>
                            <xen:else />
                                <xen:avatar user="$news" size="m" itemprop="photo" />
                            </xen:if>
                            </xen:contentcheck>
                                </div>
                </xen:if>
                </xen:if>
                    <div class="newsText">{xen:helper stripHTML, {xen:raw $news.messageHtml}}</div>
                    <div class="clearFix"></div>
                </div>
                <div class="sectionFooterportal">
  
                    <div class="continue">
                        <a href="{xen:link threads, $news}" style="background: transparent url('@imagePath/xenforo/icons/redirect.png') no-repeat left bottom; padding-left: 20px;">
                            {xen:phrase continue_reading}
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </xen:foreach>
    <xen:if hascontent="true">
    <div class="section sectionFooterporta">
        <xen:contentcheck>
        <xen:if is="{$option.pagenav} && {$option.count} > {$option.limit}">
            <xen:if is="{$category}">
                <xen:pagenav link="articles" linkdata="{$category}" page="{$page}" perpage="{$option.limit}" total="{$option.count}" />
            <xen:else />
                <xen:pagenav link="portal" page="{$page}" perpage="{$option.limit}" total="{$option.count}" />
            </xen:if>
        </xen:if>
        </xen:contentcheck>
    </div>
    </xen:if>
</div>
the code above allows to put image and some information to the Home page.

my site: removed

Please help me to add new codes that do:

if the user who create new thread is belong to administrative, moderating group or administrator, moderator --> do the job bellow:

Code:
<xen:if is="{$news.promote_icon} != 'disabled'">
                <xen:if hascontent="true">
                                <div class="image_preview">
                            <xen:contentcheck>
                            <xen:if is="{$news.attach}">
                                <a href="{xen:link threads, $news}"><img src="{xen:link attachments, $news.attach}" alt="{$news.attach.filename}"  }/></a>
                            <xen:elseif is="{$news.medio}" />
                                <div style="background: url('{xen:helper medio, $news.medio}') no-repeat;">
                                    <a href="{xen:link 'full:media/popout', $news.medio}" class="OverlayTrigger"><img src="styles/8wayrun/EWRmedio_play.png" width="180" height="90" /></a>
                                </div>
                            <xen:elseif is="{$news.image}" />
                                <a href="{xen:link threads, $news}"><img src="{$news.image}" alt="{$news.image}" title="Nhấp chuột vào đây để xem chi tiết"  /></a>
                            <xen:else />
                                <xen:avatar user="$news" size="m" itemprop="photo" />
                            </xen:if>
                            </xen:contentcheck>
                                </div>
                </xen:if>
                </xen:if>
                    <div class="newsText">{xen:helper stripHTML, {xen:raw $news.messageHtml}}</div>
                    <div class="clearFix"></div>
                </div>
else: just create new thread like normal

Thanks in advanced!
 
Last edited by a moderator: