$extattr .= "AND cast(ausg_product_price.price AS DECIMAL(10,2)) BETWEEN '{$_POST['product_price_from']}' AND '{$_POST['product_price_to']}'"; } //Filter Status if (isset($_POST['product_status']) && $_POST['product_status'] != "") { $extattr .= " AND " . POST . ".status = '{$_POST['product_status']}'"; } $rs_vw = "SELECT " . POST . ".slno AS pid FROM " . POST . "," . POST_CATEGORY . " WHERE \n " . POST . ".slno=" . POST_CATEGORY . ".post_id AND\n " . POST . ".status!='deleted' {$extattr} GROUP BY " . POST . ".slno"; $resd = mysql_query($rs_vw); $resultu = mysql_query($rs_vw . " LIMIT {$_POST['iDisplayStart']},{$_POST['iDisplayLength']}"); ?> {"aaData":[ <?php $i = 1; while ($data1 = mysql_fetch_array($resultu)) { $data = get_the_post($data1['pid']); $views = $data['views']; $comments = $data['comments']; $catarr = get_cat_arr_name($data['slno']); $catstr = implode(", ", $catarr); if ($i != 1) { echo ","; } ?> [ "<input type='checkbox' name='id[]' value='<?php echo $data['slno']; ?> '>", <?php echo $data['slno'];
<?php include "config/config.php"; include "admin/include/function.php"; include "include/post-templete.php"; sleep(1); $start = $_GET["start"]; $limit = $_GET["limit"]; $extsql = ""; if ($_GET["category"] != "0") { $extsql .= " AND `" . POST . "`.`slno`=`" . POST_CATEGORY . "`.`post_id` "; $extsql .= " AND `" . POST_CATEGORY . "`.`category_id`='{$_GET['category']}'"; } if ($_GET["search"] != "0") { $extsql .= " AND `" . POST . "`.`name` LIKE '%{$_GET['search']}%'"; } $sql = "SELECT `" . POST . "`.`slno` AS 'slno' FROM `" . POST . "`,`mchp_post_to_categories` \n WHERE `" . POST . "`.`status`='publish' AND `" . POST . "`.`verified`='yes' {$extsql}\n GROUP BY `" . POST . "`.`slno` \n ORDER BY `" . POST . "`.`slno` DESC \n LIMIT {$start},{$limit}"; $result = mysql_query($sql); while ($data = mysql_fetch_array($result)) { $posrarr = get_the_post($data["slno"]); show_post($data["slno"]); } if (!mysql_num_rows($result)) { echo "0"; }
<div class="col-md-12"> <?php $products = explode(",", $productarr['suggestive_products']); ?> <select multiple="multiple" class="multi-select" id="my_multi_select11" name="my_multi_select11[]" onchange="selectval()" > <?php $catsxarr = array(); $resultxx = mysql_query("SELECT * FROM `" . POST_CATEGORY . "` WHERE `post_id`='{$_GET['id']}'"); while ($datax1 = mysql_fetch_array($resultxx)) { array_push($catsxarr, $datax1['category_id']); } $catsxarr = implode(",", $catsxarr); $result = mysql_query("SELECT " . POST_CATEGORY . ".post_id AS pid FROM " . POST . "," . POST_CATEGORY . " WHERE " . POST . ".slno=" . POST_CATEGORY . ".post_id AND " . POST_CATEGORY . ".category_id IN ({$catsxarr}) AND " . POST . ".slno='{$_GET['id']}' GROUP BY " . POST_CATEGORY . ".post_id"); while ($data = mysql_fetch_array($result)) { $parrx = get_the_post($data['pid']); ?> <option value="<?php echo $parrx['slno']; ?> " <?php if (in_array($parrx['slno'], $products)) { echo "selected"; } ?> ><?php echo $parrx['name']; ?> </option> <?php }
$format = "2"; } if (isset($_GET["format3"])) { $format = "3"; } if (isset($_GET["format4"])) { $format = "4"; } if (isset($_GET["format5"])) { $format = "5"; } } else { $format = "1"; } if (isset($_GET["edit"])) { $editpostarr = get_the_post($_GET["edit"]); if ($editpostarr["type"] == "standard") { $format = "1"; } if ($editpostarr["type"] == "link") { $format = "5"; } if ($editpostarr["type"] == "video") { $format = "2"; } if ($editpostarr["type"] == "gallery") { $format = "3"; } } $fedit = isset($_GET["edit"]) ? TRUE : FALSE; if (isset($_POST['post_gallery'])) {
function savePosts($status) { $dataSet = array(); while (have_posts()) { the_post(); $text = get_the_excerpt(); $htmlText = $text == "" ? get_the_post() : $text; $singleData = new stdClass(); $singleData->status = $status; $singleData->title = get_the_title(); $singleData->htmlText = $htmlText; $singleData->url = get_the_permalink(); $singleData->hasUrl = true; $singleData->imageLocation = "img/cd-icon-location.svg"; $dataSet['id' . get_the_ID()] = $singleData; } return $dataSet; }
include "config/config.php"; include "admin/include/function.php"; include "include/common-scripts.php"; global $postid; $postid = post_name_to_id($_GET["post"]); $posturl = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; if (isset($_POST["add_comment"])) { $name = mysql_real_escape_string(stripcslashes($_POST["name"])); $email = mysql_real_escape_string(stripcslashes($_POST["email"])); $message = mysql_real_escape_string(stripcslashes($_POST["message"])); $parent = mysql_real_escape_string(stripcslashes($_POST["parent"])); $form_data = array('post_id' => $postid, 'parent' => $parent, 'user_id' => $_SESSION["userid"], 'name' => $name, 'email' => $email, 'message' => $message, 'date' => date("Y-m-d H:i:s"), 'status' => "active"); InsertData(POST_COMMENT, $form_data); header("location:{$posturl}?success"); } $posrarr = get_the_post($postid); $postuser = get_the_user($posrarr["userid"]); html("START"); ?> <!-- BEGIN HEAD --> <head> <?php common_head("META"); put_seo(array("title" => $posrarr["name"], "desc" => "", "author" => "", "keywords" => "", "image" => "")); common_style("MANDATORY_STYLES"); page_style("POST"); common_style("THEME_STYLES"); common_head("FAVICON"); ?> <?php
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> </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"]; ?> <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 }