示例#1
0
                                                                        <!-- AddThis Button BEGIN -->
                                                                        <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
                                                                        <a class="addthis_button_preferred_1"></a>
                                                                        <a class="addthis_button_preferred_2"></a>
                                                                        <a class="addthis_button_preferred_3"></a>
                                                                        <a class="addthis_button_preferred_4"></a>
                                                                        <a class="addthis_button_compact"></a>
                                                                        <a class="addthis_counter addthis_bubble_style"></a>
                                                                        </div>
                                                                        <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
                                                                        <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-52c3c0ab12a08176"></script>
                                                                        <!-- AddThis Button END -->
                                                                    </div>
                                                                </div>
                                                                <?php 
if (count_post_comment($postid)) {
    ?>
                                                                
                                                                <h3>Recent Comments</h3>
                                                                <?php 
    function print_comments($id)
    {
        $children = query($id);
        if (!empty($children)) {
            foreach ($children as $child) {
                $catsingle = fetch_single_val(POST_COMMENT, "`slno`='{$child['id']}'");
                ?>
                                                                             
                                                                              <!--start media-->  
                                                                              <div class="media">
                                                                                    <a href="javascript:;" class="pull-left">
function show_post($postid)
{
    $posrarr = get_the_post($postid);
    $postuser = get_the_user($posrarr["userid"]);
    //$posrarr["type"]="rss";
    ?>
<!--Post Header Start----> 
<div class="portlet light ">
    <?php 
    if ($posrarr["type"] != "rss") {
        ?>
    <div class="portlet-title">
            <div class="caption custom-caption-1">
                    <span class="caption-subject bold font-grey-gallery ">
                        
                        <img class="user-pic border-radius-100" src="<?php 
        echo BASEURL;
        ?>
croplive.php?url=<?php 
        echo get_user_thumb($posrarr["userid"]);
        ?>
&size=41">    
                        <?php 
        echo get_user_meta($posrarr["userid"], "display_name");
        ?>
                        <small><br><?php 
        echo get_user_meta($posrarr["userid"], "occupation");
        ?>
</small>
                        
                    </span>

            </div>
            <div class="tools">
                <?php 
        if ($posrarr["userid"] != $_SESSION["userid"]) {
            ?>
                <button 
                    type="button" 
                    class="btn btn-circle btn-default custom-button-1 tooltips"
                    href="ajax-send-msg-html.php?from=<?php 
            echo $_SESSION["userid"];
            ?>
&to=<?php 
            echo $posrarr["userid"];
            ?>
" 
                    data-target="#model_send_msg" 
                    data-toggle="modal"
                    >
                    <i class="icon-envelope"></i>
                    <span>Send Message</span>
                </button>
                <?php 
            if (!is_follow($_SESSION["userid"], $posrarr["userid"])) {
                ?>
                <button type="button" class="btn btn-circle btn-default custom-button-1 tooltips" onclick="dofollow(<?php 
                echo $_SESSION["userid"];
                ?>
,<?php 
                echo $posrarr["userid"];
                ?>
,$(this))"><i class="icon-user-follow"></i><span>Follow <?php 
                echo get_user_meta($posrarr["userid"], "display_name");
                ?>
</span></button>
                <?php 
            } else {
                ?>
                <button type="button" class="btn btn-circle btn-default custom-button-1 tooltips" onclick="dofollow(<?php 
                echo $_SESSION["userid"];
                ?>
,<?php 
                echo $posrarr["userid"];
                ?>
,$(this))"><i class="icon-user-following"></i><span>Follow <?php 
                echo get_user_meta($posrarr["userid"], "display_name");
                ?>
</span></button>
                <?php 
            }
            ?>
                
                
               
                <?php 
        } else {
            ?>
                <div class="btn-group hidden">
                        <button class="btn btn-circle green-haze btn-sm dropdown-toggle" type="button" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                        Actions <i class="fa fa-angle-down"></i>
                        </button>
                        <ul class="dropdown-menu pull-right" role="menu">
                                <li>
                                        <a href="javascript:;">Unpublish </a>
                                </li>
                                <li>
                                        <a href="javascript:;">Edit Post </a>
                                </li>
                                <li>
                                        <a href="javascript:;">Delete Psot </a>
                                </li>
                        </ul>
                </div>
                <?php 
        }
        ?>
            </div>
    </div>
    <?php 
    }
    ?>
    <div class="portlet-body blog-<?php 
    echo $posrarr["type"];
    ?>
">
        <div class="row">
<!--Post Header End---->     
    
<?php 
    if ($posrarr["type"] == "standard") {
        ?>
 
<!--Starndard post start----> 

            <div class="col-md-5 blog-img blog-tag-data">
                    <img src="<?php 
        echo BASEURL;
        ?>
images/featured_image/<?php 
        echo $posrarr["image"];
        ?>
" alt="" class="img-responsive">

            </div>
            <div class="col-md-7 blog-article">
                    <h3>
                    <a href="<?php 
        echo BASEURL;
        ?>
post/<?php 
        echo $posrarr["parmalink"];
        ?>
"  class="substr">
                    <?php 
        echo $posrarr["name"];
        ?>
</a>
                    </h3>
                    <p>
                      <?php 
        if (trim($posrarr["short_description"]) == "") {
            echo string_sorter(strip_tags($posrarr["description"]), 460);
        } else {
            echo nl2br(string_sorter(strip_tags($posrarr["short_description"]), 460));
        }
        ?>
                    </p>
            </div>
            
<!--Starndard post end---->    
<?php 
    }
    if ($posrarr["type"] == "video") {
        ?>
 
<!--Video post start----> 
            <div class="col-md-12 col-sm-8 col-md-offset-0 col-sm-offset-2 blog-img blog-tag-data">
                    <img src="<?php 
        echo $posrarr["image"];
        ?>
" alt="" class="img-responsive">
                    <div class="videofrm">
                        <img src="<?php 
        echo BASEURL;
        ?>
images/play_icon.png" />
                    </div>
            </div>
            <div class="col-md-12 blog-article">
                    <h3>
                    <a href="<?php 
        echo BASEURL;
        ?>
post/<?php 
        echo $posrarr["parmalink"];
        ?>
"  class="substr">
                    <?php 
        echo $posrarr["name"];
        ?>
</a>
                    </h3>
                    <p>
                      <?php 
        if (trim($posrarr["short_description"]) == "") {
            echo string_sorter(strip_tags($posrarr["description"]), 460);
        } else {
            echo nl2br(string_sorter(strip_tags($posrarr["short_description"]), 460));
        }
        ?>
                    </p>
            </div>
            
<!--Video post end---->    
<?php 
    }
    if ($posrarr["type"] == "link") {
        ?>
 
<!--Link post start----> 
    <div class="col-md-12 newscover">
        <div class="row">
            <?php 
        $desccol = 12;
        if (trim($posrarr["image"]) != "") {
            ?>
            <div class="col-md-5 col-sm-5 col-xs-5 blog-img blog-tag-data">
                    <img src="<?php 
            echo $posrarr["image"];
            ?>
" alt="" class="img-responsive">

            </div>
            <?php 
            $desccol = 7;
        }
        ?>
            <div class="col-md-<?php 
        echo $desccol;
        ?>
 col-sm-<?php 
        echo $desccol;
        ?>
 col-xs-<?php 
        echo $desccol;
        ?>
 blog-article">
                    <h3>
                    <a href="<?php 
        echo BASEURL;
        ?>
post/<?php 
        echo $posrarr["parmalink"];
        ?>
"  class="substr">
                    <?php 
        echo $posrarr["name"];
        ?>
</a>
                    </h3>
                    <p>
                      <?php 
        if (trim($posrarr["short_description"]) == "") {
            echo string_sorter(strip_tags($posrarr["description"]), 160);
        } else {
            echo nl2br(string_sorter(strip_tags($posrarr["short_description"]), 160));
        }
        ?>
                    </p>
                    <p class="font-grey-cascade">
                        <?php 
        $imgmeta = get_post_meta($postid, "source_url");
        $urlarr = parse_url($imgmeta);
        echo $urlarr["host"];
        ?>
                    </p>
            </div>
        </div>
    </div>
<!--Link post end---->      
<?php 
    }
    if ($posrarr["type"] == "gallery") {
        ?>
 
<!--Gallery post start----> 
            <div class="col-md-2 col-sm-2 col-xs-2 text-center">
                    <a class="btn btn-circle btn-default control-left" href="#blog-gallery<?php 
        echo $postid;
        ?>
" role="button" data-slide="prev">
                      <i class="fa fa-angle-left"></i>
                    </a>
            </div>
            <div class="col-md-8 col-sm-8 col-xs-8 blog-img blog-tag-data">
                
                
                
                    <div id="blog-gallery<?php 
        echo $postid;
        ?>
" class="carousel slide" data-ride="carousel">
                        <!-- Wrapper for slides -->
                        <div class="carousel-inner" role="listbox">
                          <?php 
        $imgmeta = get_post_meta($postid, "imgdata");
        $imgmetaarr = explode("[/]", $imgmeta);
        $arr1 = explode("[:]", $imgmetaarr[0]);
        $arr2 = explode("[:]", $imgmetaarr[1]);
        $arr3 = explode("[:]", $imgmetaarr[2]);
        ?>
  
                          <?php 
        for ($i = 0; $i < count($arr1); $i++) {
            ?>
  
                          <div class="item <?php 
            if (!$i) {
                echo "active";
            }
            ?>
">
                            <img src="<?php 
            echo BASEURL;
            ?>
croplive.php?url=images/gallery_post/<?php 
            echo $arr1[$i];
            ?>
&size=500" alt="...">
                            <div class="carousel-caption">
                                <h2><?php 
            echo $arr2[$i];
            ?>
</h2>
                                <p><?php 
            echo string_sorter($arr3[$i], 130);
            ?>
</p>
                            </div>
                          </div>
                          <?php 
        }
        ?>
                        </div>
                      </div>
            </div>
            <div class="col-md-2 col-sm-2 col-xs-2 text-center">
                 <a class="btn btn-circle btn-default control-right" href="#blog-gallery<?php 
        echo $postid;
        ?>
" role="button" data-slide="next">
                     <i class="fa fa-angle-right"></i>
                </a>  
            </div>
            <div class="col-md-12 blog-article">
                    <h3>
                    <a href="<?php 
        echo BASEURL;
        ?>
post/<?php 
        echo $posrarr["parmalink"];
        ?>
"  class="substr">
                    <?php 
        echo $posrarr["name"];
        ?>
</a>
                    </h3>
                    <p>
                      <?php 
        if (trim($posrarr["short_description"]) == "") {
            echo substr(strip_tags($posrarr["description"]), 0, 460);
        } else {
            echo nl2br(substr(strip_tags($posrarr["short_description"]), 0, 460));
        }
        ?>
                    </p>
            </div>
<!--Gallery post end---->    
<?php 
    }
    if ($posrarr["type"] == "rss") {
        ?>
<!--RSS post start----> 
<div class="col-md-12 margin-bottom-10 ">
    <div class="rss-news clearfix">
      <h2 class="no-margin"><?php 
        echo $posrarr["name"];
        ?>
</h2>
      <div class="feeds-div scroller">
      <?php 
        $resfeed = mysql_query("SELECT * FROM `" . POST_META . "` WHERE `post_id`='{$postid}' AND `meta_name`='feed'");
        while ($feed = mysql_fetch_array($resfeed)) {
            $feeddata = $feed["meta_desc"];
            $feedarr = explode("[:]", $feeddata);
            ?>
      <div class="media media-feed list-group-item">
            <a class="pull-left" href="javascript:;">
                <img class="media-object" src="<?php 
            echo $feedarr[3];
            ?>
" style="width: 80px; height: auto;"/>
            </a>
            <div class="media-body">
                    <h4 class="media-heading"><a href="<?php 
            echo $feedarr[1];
            ?>
" target="_blank"><?php 
            echo $feedarr[0];
            ?>
</a></h4>
                    <?php 
            echo string_sorter($feedarr[2], 155);
            ?>
<br>
            </div>
        </div>
      <?php 
        }
        ?>
      </div>
    </div>
</div>

<!--RSS post start----> 
<?php 
    }
    ?>
<div class="col-md-12">
    <?php 
    if ($posrarr["type"] != "rss") {
        ?>
                <ul class="list-inline font-grey-cascade">
                        <li> 
                              
                              <?php 
        if (!post_like_check($_SESSION["userid"], $postid)) {
            ?>
                              <a href="javascript:void()" onclick="dolike(<?php 
            echo $postid;
            ?>
,<?php 
            echo $_SESSION["userid"];
            ?>
,$(this))"  >Like</a>
                              <?php 
        } else {
            ?>
                              <a href="javascript:void()" onclick="dounlike(<?php 
            echo $postid;
            ?>
,<?php 
            echo $_SESSION["userid"];
            ?>
,$(this))"  >Unlike</a>
                              <?php 
        }
        ?>
                              <i class="fa fa-circle" style="font-size: 4px;  vertical-align: text-bottom;"></i>
                              <a href="<?php 
        echo BASEURL;
        ?>
post/<?php 
        echo $posrarr["parmalink"];
        ?>
#postcomment">
                                  Comment
                              </a>
                              &nbsp;&nbsp;
                        </li>
                        
                        <li title="<?php 
        echo date("F j, Y, g:i a", strtotime($posrarr["last_update"]));
        ?>
">
                                <i class="fa fa-calendar"></i><?php 
        echo dateDiff($posrarr["last_update"]);
        ?>
 ago
                        </li>
                        <li>
                                <i class="fa fa-eye"></i> <?php 
        echo count_post_viewer($postid);
        ?>
 Views
                        </li>
                        <li>
                                <i class="fa fa-comments"></i>
                                
                                <?php 
        echo count_post_comment($postid);
        ?>
 Comments </a>
                        </li>
                        <li>
                              <i class="fa fa-thumbs-up"></i> <span id="like<?php 
        echo $postid;
        ?>
"><?php 
        echo count_post_like($postid);
        ?>
</span> Likes
                        </li>
                </ul>
    <?php 
    } else {
        $rsslink = get_post_meta($postid, "rss_link");
        ?>
    <p class="font-grey-cascade no-margin">
        <i class="fa fa-rss"></i> <?php 
        echo $posrarr["name"];
        ?>
 &nbsp;&nbsp;
        <i class="fa fa-calendar"></i> <?php 
        echo dateDiff($posrarr["last_update"]);
        ?>
        <span class="pull-right"><a href="<?php 
        echo $rsslink;
        ?>
">See More</a></span>
    </p>
    <?php 
    }
    ?>
            </div> 
    </div>
</div>
</div>
<?php 
}