[WontAdd] review

aref younessi
Topics: 6
Replies: 12
Joined: 03/01/2013



i try show review similar https://clients.no-half-pixels.com/index.php


add cod in homepage.tpl but not work:

{foreach from=$reviews.reviews|@array_reverse item=review name=reviewloop}
            <p>{if $review.pname}<strong>{$review.pname}</strong><br/>{/if}{foreach from=$review.rating item=star}<i class="icon icon-star"></i> {/foreach}</p>
            <p><em class="textsmall">{if $review.msg != '' && $review.msg != '<br>'}"{$review.msg|trim:'<br>'}"<br/>{/if}<strong>{$review.client}</strong> - {$review.created}</em></p>
            {if !$smarty.foreach.reviewloop.last}<hr/>{/if}

help me please 


12/05/2015 18:04:58

Lee Mason
Topics: 174
Replies: 407

hello iwhost,


sorry for the delay, would of seen this earlier if you had put it in the general area for the theme as i only visit this area when making an update.


this is the code we use in our /tpl_overrides/homepage.tpl file:


<div id="homepage-reviews">
    <h2 class="styled subheader textcenter">See what our clients are saying</h2>
    <div class="row">
        <div class="span12">
            <div id="home-slider-reviews" class="carousel slide">
                <div class="carousel-inner">
                        $reviews = whmcs_reviews_getreviews(false, false, false, true);
                        $i = 0;
                        foreach( $reviews as $review ){
                            if(strip_tags($review['msg']) == ''){continue;}
                            $first = ($i == 0) ? ' active' : '';
                            echo '<div class="item textcenter'.$first.'">';
                                echo '<p>';
                                    foreach($review['rating'] as $r){
                                        echo '<i class="icon icon-star"></i> ';
                                echo '</p>';
                                $name = ( $review['pname'] != '' ) ? ' - ' . $review['pname'] : '';
                                echo '<p class="lead"><strong>'.$review['client'].'</strong>'.$name.'</p>';
                                echo '<p class="lead">"'.strip_tags($review['msg']).'"</p>';
                            echo '</div>';
                <a class="left carousel-control" href="#home-slider-reviews" data-slide="prev">‹</a>
                <a class="right carousel-control" href="#home-slider-reviews" data-slide="next">›</a>
            {if $loggedin}<p class="textcenter"><a href="index.php?m=whmcs_reviews&type=general" title="Submit a Review" class="btn btn-large btn-primary">Submit a Review</a></p>{/if}
        </div><!-- .span12 -->
    </div><!-- .row -->

Director at No Half Pixels Ltd.

22/05/2015 12:13:41