Guest User

syntax error

a guest
Apr 22nd, 2016
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 56.48 KB | None | 0 0
  1. <?php
  2. function pf_itemgrid2_func( $atts ) {
  3.   extract( shortcode_atts( array(
  4.     'listingtype' => '',
  5.     'itemtype' => '',
  6.     'conditions' => '',
  7.     'locationtype' => '',
  8.     'posts_in' => '',
  9.     'sortby' => 'ASC',
  10.     'orderby' => 'title',
  11.     'items' => 8,
  12.     'cols' => 4,
  13.     'features'=>array(),
  14.     'filters' => 'true',
  15.     'itemboxbg' => '',
  16.     'grid_layout_mode' => 'fitRows',
  17.     'featureditems'=>'',
  18.     'featureditemshide' => '',
  19.     'authormode'=>0,
  20.     'agentmode'=>0,
  21.     'author'=>'',
  22.     'manualargs' => '',
  23.     'hidden_output' => '',
  24.     'ne' => '',
  25.     'ne2' => '',
  26.     'sw' => '',
  27.     'sw2' => '',
  28.     'listingtypefilters'=>'',
  29.     'itemtypefilters'=>'',
  30.     'locationfilters'=>'',
  31.     'tag' => ''
  32.   ), $atts ) );
  33.  
  34.     $pfgrid = $pfg_ltype = $pfg_itype = $pfg_lotype = $pfitemboxbg = $pf1colfix = $pf1colfix2 ='';
  35.  
  36.     /* Get admin values */
  37.     $setup3_pointposttype_pt1 = PFSAIssetControl('setup3_pointposttype_pt1','','pfitemfinder');
  38.  
  39.     $setup3_pointposttype_pt4_check = PFSAIssetControl('setup3_pointposttype_pt4_check','','1');
  40.     $setup3_pointposttype_pt5_check = PFSAIssetControl('setup3_pointposttype_pt5_check','','1');
  41.     $setup3_pointposttype_pt6_check = PFSAIssetControl('setup3_pointposttype_pt6_check','','1');
  42.     $setup3_pt14_check = PFSAIssetControl('setup3_pt14_check','',0);
  43.    
  44.  
  45.     $setup22_searchresults_defaultppptype = PFSAIssetControl('setup22_searchresults_defaultppptype','','10');
  46.     $setup22_searchresults_defaultsortbytype = PFSAIssetControl('setup22_searchresults_defaultsortbytype','','ID');
  47.     $setup22_searchresults_defaultsorttype = PFSAIssetControl('setup22_searchresults_defaultsorttype','','ASC');
  48.  
  49.     $general_retinasupport = PFSAIssetControl('general_retinasupport','','0');
  50.     $setup3_pt14_check = PFSAIssetControl('setup3_pt14_check','',0);
  51.  
  52.     $setupsizelimitconf_general_gridsize1_width = PFSizeSIssetControl('setupsizelimitconf_general_gridsize1','width',440);
  53.     $setupsizelimitconf_general_gridsize1_height = PFSizeSIssetControl('setupsizelimitconf_general_gridsize1','height',330);
  54.  
  55.     $review_system_statuscheck = PFREVSIssetControl('setup11_reviewsystem_check','','0');
  56.  
  57.     $gridrandno_orj = PF_generate_random_string_ig();
  58.     $gridrandno = 'pf_'.$gridrandno_orj;
  59.  
  60.     $listingtype_x = PFEX_extract_type_ig($listingtype);
  61.     $itemtype_x = ($setup3_pointposttype_pt4_check == 1) ? PFEX_extract_type_ig($itemtype) : '' ;
  62.     $conditions_x = ($setup3_pt14_check == 1) ? PFEX_extract_type_ig($conditions) : '' ;
  63.     $locationtype_x = ($setup3_pointposttype_pt5_check == 1) ? PFEX_extract_type_ig($locationtype) : '' ;
  64.     $features_x = ($setup3_pointposttype_pt6_check == 1) ? PFEX_extract_type_ig($features) : '' ;
  65.  
  66.     $user_loggedin_check = is_user_logged_in();
  67.     $favtitle_text = esc_html__('Add to Favorites','pointfindert2d');
  68.  
  69.     $wpflistdata = "<div class='pflistgridview".$gridrandno_orj."-container pflistgridviewgr-container'>";
  70.  
  71.         /*Container & show check*/
  72.         $pfcontainerdiv = 'pflistgridview'.$gridrandno_orj.'';
  73.         $pfcontainershow = 'pflistgridviewshow'.$gridrandno_orj.'';
  74.  
  75.        
  76.         $pfheaderfilters = $filters;       
  77.  
  78.         $pfgetdata = array();
  79.         $pfgetdata['sortby'] = $sortby;
  80.         $pfgetdata['orderby'] = $orderby;
  81.         $pfgetdata['posts_in'] = $posts_in;
  82.         $pfgetdata['items'] = $items;
  83.         $pfgetdata['cols'] = $cols;
  84.         $pfgetdata['filters'] = $filters;
  85.         $pfgetdata['itemboxbg'] = $itemboxbg;
  86.         $pfgetdata['grid_layout_mode'] = $grid_layout_mode;
  87.         $pfgetdata['listingtype'] = $listingtype_x;
  88.         $pfgetdata['itemtype'] = $itemtype_x;
  89.         $pfgetdata['conditions'] = $conditions_x;
  90.         $pfgetdata['locationtype'] = $locationtype_x;
  91.         $pfgetdata['features'] = $features_x;  
  92.         $pfgetdata['featureditems'] = $featureditems;
  93.         $pfgetdata['featureditemshide'] = $featureditemshide;
  94.         $pfgetdata['authormode'] = $authormode;
  95.         $pfgetdata['agentmode'] = $agentmode;
  96.         $pfgetdata['author'] = $author;
  97.         $pfgetdata['listingtypefilters'] = $listingtypefilters;
  98.         $pfgetdata['itemtypefilters'] = $itemtypefilters;
  99.         $pfgetdata['locationfilters'] = $locationfilters;
  100.         $pfgetdata['tag'] = $tag;
  101.         $pfgetdata['manual_args'] = (!empty($manualargs))? maybe_unserialize(base64_decode($manualargs)): '';
  102.         $pfgetdata['hidden_output'] = (!empty($hidden_output))? maybe_unserialize(base64_decode($hidden_output)): '';
  103.  
  104.         if($pfgetdata['cols'] != ''){$pfgrid = 'grid'.$pfgetdata['cols'];}
  105.  
  106.         /*Get if sort/order/number values exist*/
  107.         if(isset($_GET['pfsearch-filter']) && $_GET['pfsearch-filter']!=''){$pfg_orderby = esc_attr($_GET['pfsearch-filter']);}else{$pfg_orderby = '';}
  108.         if(isset($_GET['pfsearch-filter-order']) && $_GET['pfsearch-filter-order']!=''){$pfg_order = esc_attr($_GET['pfsearch-filter-order']);}else{$pfg_order = '';}
  109.         if(isset($_GET['pfsearch-filter-number']) && $_GET['pfsearch-filter-number']!=''){$pfg_number = esc_attr($_GET['pfsearch-filter-number']);}else{$pfg_number = '';}
  110.         if(isset($_GET['pfsearch-filter-col']) && $_GET['pfsearch-filter-col']!=''){$pfgrid = esc_attr($_GET['pfsearch-filter-col']);}
  111.  
  112.         if(isset($_GET['pfsearch-filter-ltype']) && !empty($_GET['pfsearch-filter-ltype'])){$pfg_ltype = esc_attr($_GET['pfsearch-filter-ltype']);}
  113.         if(isset($_GET['pfsearch-filter-itype']) && !empty($_GET['pfsearch-filter-itype'])){$pfg_itype = esc_attr($_GET['pfsearch-filter-itype']);}
  114.         if(isset($_GET['pfsearch-filter-location']) && !empty($_GET['pfsearch-filter-location'])){$pfg_lotype = esc_attr($_GET['pfsearch-filter-location']);}
  115.  
  116.        
  117.        
  118.         if ( is_front_page() ) {
  119.             $pfg_paged = (esc_sql(get_query_var('page'))) ? esc_sql(get_query_var('page')) : 1;  
  120.         } else {
  121.             $pfg_paged = (esc_sql(get_query_var('paged'))) ? esc_sql(get_query_var('paged')) : 1;
  122.         }
  123.  
  124.         $args = array( 'post_type' => $setup3_pointposttype_pt1, 'post_status' => 'publish');
  125.        
  126.         if($pfgetdata['posts_in']!=''){
  127.             $args['post__in'] = pfstring2BasicArray($pfgetdata['posts_in']);
  128.  
  129.         }
  130.  
  131.  
  132.         if($pfgetdata['tag']!=''){
  133.             $args['tag_id'] = $pfgetdata['tag'];
  134.  
  135.         }
  136.  
  137.  
  138.         if($pfgetdata['authormode'] != 0){
  139.             if (!empty($pfgetdata['author'])) {
  140.                 $args['author'] = $pfgetdata['author'];
  141.             }
  142.         }
  143.  
  144.  
  145.         $st22srlinknw = PFSAIssetControl('st22srlinknw','','0');
  146.         $targetforitem = '';
  147.         if ($st22srlinknw == 1) {
  148.             $targetforitem = ' target="_blank"';
  149.         }
  150.        
  151.  
  152.         $grid_layout_mode = $pfgetdata['grid_layout_mode'];
  153.  
  154.  
  155.         if(isset($args['meta_query']) == false || isset($args['meta_query']) == NULL){
  156.             $args['meta_query'] = array();
  157.         }  
  158.  
  159.         if(isset($args['tax_query']) == false || isset($args['tax_query']) == NULL){
  160.             $args['tax_query'] = array();
  161.         }
  162.  
  163.  
  164.        
  165.         if(is_array($pfgetdata)){
  166.  
  167.             /* listing type*/
  168.             if($pfgetdata['listingtype'] != ''){
  169.                 $pfvalue_arr_lt = PFGetArrayValues_ld($pfgetdata['listingtype']);
  170.                 $fieldtaxname_lt = 'pointfinderltypes';
  171.                 $args['tax_query'][]=array(
  172.                     'taxonomy' => $fieldtaxname_lt,
  173.                     'field' => 'id',
  174.                     'terms' => $pfvalue_arr_lt,
  175.                     'operator' => 'IN'
  176.                 );
  177.             }
  178.  
  179.             if($setup3_pointposttype_pt5_check == 1){
  180.                 /* location type*/
  181.                 if($pfgetdata['locationtype'] != ''){
  182.                     $pfvalue_arr_loc = PFGetArrayValues_ld($pfgetdata['locationtype']);
  183.                     $fieldtaxname_loc = 'pointfinderlocations';
  184.                     $args['tax_query'][]=array(
  185.                         'taxonomy' => $fieldtaxname_loc,
  186.                         'field' => 'id',
  187.                         'terms' => $pfvalue_arr_loc,
  188.                         'operator' => 'IN'
  189.                     );
  190.                    
  191.                 }
  192.             }
  193.  
  194.             if($setup3_pointposttype_pt4_check == 1){
  195.                 /* item type*/
  196.                 if($pfgetdata['itemtype'] != ''){
  197.                     $pfvalue_arr_it = PFGetArrayValues_ld($pfgetdata['itemtype']);
  198.                     $fieldtaxname_it = 'pointfinderitypes';
  199.                     $args['tax_query'][]=array(
  200.                         'taxonomy' => $fieldtaxname_it,
  201.                         'field' => 'id',
  202.                         'terms' => $pfvalue_arr_it,
  203.                         'operator' => 'IN'
  204.                     );
  205.                 }
  206.             }
  207.  
  208.             /* Condition */
  209.                 $setup3_pt14_check = PFSAIssetControl('setup3_pt14_check','',0);
  210.                 if($setup3_pt14_check == 1){
  211.                     if($pfgetdata['conditions'] != ''){
  212.                         $pfvalue_arr_it = PFGetArrayValues_ld($pfgetdata['conditions']);
  213.                         $fieldtaxname_it = 'pointfinderconditions';
  214.                         $args['tax_query'][] = array(
  215.                             'taxonomy' => $fieldtaxname_it,
  216.                             'field' => 'id',
  217.                             'terms' => $pfvalue_arr_it,
  218.                             'operator' => 'IN'
  219.                         );
  220.                     }
  221.                 }
  222.  
  223.             if($setup3_pointposttype_pt6_check == 1){
  224.                 /* features type*/
  225.                 if($pfgetdata['features'] != ''){
  226.                     $pfvalue_arr_fe = PFGetArrayValues_ld($pfgetdata['features']);
  227.                     $fieldtaxname_fe = 'pointfinderfeatures';
  228.                     $args['tax_query'][]=array(
  229.                         'taxonomy' => $fieldtaxname_fe,
  230.                         'field' => 'id',
  231.                         'terms' => $pfvalue_arr_fe,
  232.                         'operator' => 'IN'
  233.                     );
  234.                 }
  235.             }
  236.  
  237.             if (empty($pfgetdata['itemboxbg'])) {
  238.                 $pfgetdata['itemboxbg'] = PFSAIssetControl('setup22_searchresults_background2','','');
  239.             }
  240.            
  241.             $pfitemboxbg = ' style="background-color:'.$pfgetdata['itemboxbg'].';"';
  242.             $pfheaderfilters = ($pfgetdata['filters']=='true') ? '' : 'false' ;
  243.  
  244.            
  245.             $meta_key_featured = 'webbupointfinder_item_featuredmarker';
  246.            
  247.             if ( !empty($pfg_ltype)) {
  248.                 $fieldtaxname_lt = 'pointfinderltypes';
  249.                 $args['tax_query'][]=array(
  250.                     'taxonomy' => $fieldtaxname_lt,
  251.                     'field' => 'id',
  252.                     'terms' => $pfg_ltype,
  253.                     'operator' => 'IN'
  254.                 );
  255.             }
  256.  
  257.  
  258.             if ( !empty($pfg_itype) && $setup3_pointposttype_pt4_check == 1) {
  259.                 $fieldtaxname_it = 'pointfinderitypes';
  260.                 $args['tax_query'][]=array(
  261.                     'taxonomy' => $fieldtaxname_it,
  262.                     'field' => 'id',
  263.                     'terms' => $pfg_itype,
  264.                     'operator' => 'IN'
  265.                 );
  266.             }
  267.  
  268.             if ( !empty($pfg_lotype) && $setup3_pointposttype_pt5_check == 1) {
  269.                 $fieldtaxname_loc = 'pointfinderlocations';
  270.                 $args['tax_query'][]=array(
  271.                     'taxonomy' => $fieldtaxname_loc,
  272.                     'field' => 'id',
  273.                     'terms' => $pfg_lotype,
  274.                     'operator' => 'IN'
  275.                 );
  276.             }
  277.  
  278.  
  279.             if($pfg_orderby != ''){
  280.                 if($pfg_orderby == 'date' || $pfg_orderby == 'title'){
  281.                    
  282.                     $args['orderby'] = array('meta_value_num' => 'DESC' , $pfg_orderby => $pfg_order);
  283.                     $args['meta_key'] = $meta_key_featured;
  284.                    
  285.                     if (!empty($pfgetdata['manual_args'])) {
  286.                         $args['meta_key'] = $meta_key_featured;
  287.                         $pfgetdata['manual_args']['orderby'] = array('meta_value_num' => 'DESC' , $pfg_orderby => $pfg_order);
  288.                     }
  289.  
  290.                 }else{
  291.                    
  292.                     $args['meta_key']='webbupointfinder_item_'.$pfg_orderby;
  293.                    
  294.                     if(PFIF_CheckFieldisNumeric_ld($pfg_orderby) == false){
  295.                         $args['orderby']= array('meta_value' => $pfg_order);
  296.                     }else{
  297.                         $args['orderby']= array('meta_value_num' => $pfg_order);
  298.                     }
  299.                    
  300.                     if (!empty($pfgetdata['manual_args'])) {
  301.                         $pfgetdata['manual_args']['meta_key']='webbupointfinder_item_'.$pfg_orderby;
  302.                         if(PFIF_CheckFieldisNumeric_ld($pfg_orderby) == false){
  303.                             $pfgetdata['manual_args']['orderby'] = array('meta_value' => $pfg_order);
  304.                         }else{
  305.                             $pfgetdata['manual_args']['orderby'] = array('meta_value_num' => $pfg_order);
  306.                         }
  307.                     }
  308.                    
  309.                 }
  310.             }else{
  311.                
  312.                 if($pfgetdata['orderby'] != ''){
  313.                     $args['meta_key'] = $meta_key_featured;
  314.                     $args['orderby'] = array('meta_value_num' => 'DESC' , $pfgetdata['orderby'] => $pfgetdata['sortby']);
  315.                 }else{
  316.                     $args['meta_key'] = $meta_key_featured;
  317.                     $args['orderby'] = array('meta_value_num' => 'DESC' , $setup22_searchresults_defaultsortbytype => $setup22_searchresults_defaultsorttype);
  318.                 }
  319.             }
  320.            
  321.            
  322.             if($pfg_number != ''){
  323.                 $args['posts_per_page'] = $pfg_number;
  324.                 if (!empty($pfgetdata['manual_args'])) {
  325.                     $pfgetdata['manual_args']['posts_per_page'] = $pfg_number;
  326.                 }
  327.             }else{
  328.                 if($pfgetdata['items'] != ''){
  329.                     $args['posts_per_page'] = $pfgetdata['items'];
  330.                 }else{
  331.                     $args['posts_per_page'] = $setup22_searchresults_defaultppptype;
  332.                 }
  333.             }
  334.            
  335.             if($pfg_paged != ''){
  336.                 $args['paged'] = $pfg_paged;
  337.                 if (!empty($pfgetdata['manual_args'])) {
  338.                     $pfgetdata['manual_args']['paged'] = $pfg_paged;
  339.                 }
  340.             }  
  341.  
  342.             /*Featured items filter*/
  343.             if($pfgetdata['featureditems'] == 'yes' && $pfgetdata['featureditemshide'] != 'yes'){
  344.                
  345.                 $args['meta_query'][] = array(
  346.                     'key' => 'webbupointfinder_item_featuredmarker',
  347.                     'value' => 1,
  348.                     'compare' => '=',
  349.                     'type' => 'NUMERIC'
  350.                 );
  351.             }
  352.  
  353.             if ($pfgetdata['featureditemshide'] == 'yes') {
  354.                 $args['meta_query'][] = array(
  355.                     'key' => 'webbupointfinder_item_featuredmarker',
  356.                     'value' => 1,
  357.                     'compare' => '!=',
  358.                     'type' => 'NUMERIC'
  359.                 );
  360.             }
  361.  
  362.             if($pfgetdata['agentmode'] != 0){
  363.                 if (!empty($pfgetdata['author'])) {
  364.                     $args['meta_query'][] = array(
  365.                         'key' => 'webbupointfinder_item_agents',
  366.                         'value' => $pfgetdata['author'],
  367.                         'compare' => '=',
  368.                         'type' => 'NUMERIC'
  369.                     );
  370.                 }
  371.             }              
  372.         }
  373.        
  374.  
  375.         if($general_retinasupport == 1){$pf_retnumber = 2;}else{$pf_retnumber = 1;}
  376.            
  377.  
  378.         $featured_image_width = $setupsizelimitconf_general_gridsize1_width*$pf_retnumber;
  379.         $featured_image_height = $setupsizelimitconf_general_gridsize1_height*$pf_retnumber;
  380.  
  381.         switch($pfgrid){
  382.             case 'grid1':
  383.                 $pfgrid_output = 'pf1col';
  384.                 $pfgridcol_output = 'col-lg-12 col-md-12 col-sm-12 col-xs-12';
  385.                 break;
  386.             case 'grid2':
  387.                 $pfgrid_output = 'pf2col';
  388.                 $pfgridcol_output = 'col-lg-6 col-md-6 col-sm-6 col-xs-12';
  389.                 break;
  390.             case 'grid3':
  391.                 $pfgrid_output = 'pf3col';
  392.                 $pfgridcol_output = 'col-lg-4 col-md-6 col-sm-6 col-xs-12';
  393.                 break;
  394.             case 'grid4':
  395.                 $pfgrid_output = 'pf4col';
  396.                 $pfgridcol_output = 'col-lg-3 col-md-4 col-sm-4 col-xs-12';
  397.                 break;
  398.             default:
  399.                 $pfgrid_output = 'pf4col';
  400.                 $pfgridcol_output = 'col-lg-3 col-md-4 col-sm-4 col-xs-12';
  401.                 break;
  402.         }
  403.        
  404.  
  405.         /* On/Off filter for items */
  406.             $args['meta_query'][] = array('relation' => 'OR',
  407.                 array(
  408.                     'key' => 'pointfinder_item_onoffstatus',
  409.                     'compare' => 'NOT EXISTS'
  410.                    
  411.                 ),
  412.                 array(
  413.                         'key'=>'pointfinder_item_onoffstatus',
  414.                         'value'=> 0,
  415.                         'compare'=>'=',
  416.                         'type' => 'NUMERIC'
  417.                 )
  418.                
  419.             );
  420.  
  421.         /* If point is visible */
  422.             $args['meta_query'][] = array(
  423.                 'key' => 'webbupointfinder_item_point_visibility',
  424.                 'compare' => 'NOT EXISTS'
  425.             );
  426.  
  427.  
  428.         /* Start: Coordinate Filter */
  429.             if (empty($pfgetdata['manual_args'])) {
  430.                 $loop = new WP_Query( $args );
  431.             }else{
  432.  
  433.                 /*If coordinatefilter on*/
  434.                 if ((!empty($sw) && !empty($sw2) && !empty($ne) && !empty($ne2))) {
  435.                     $loop_ex_posts = array();
  436.                     $args2 = $pfgetdata['manual_args'];
  437.                     $args2['posts_per_page'] = -1;
  438.                     $loop_ex = new WP_Query( $args2 );
  439.                     if($loop_ex->post_count > 0){
  440.                         while ( $loop_ex->have_posts() ) : $loop_ex->the_post();
  441.                         /*If grid disable coordinate check.*/
  442.                        
  443.                         $coordinates = explode( ',', rwmb_meta('webbupointfinder_items_location'));
  444.                        
  445.                         if($coordinates[0] > $sw && $coordinates[0] < $ne && $coordinates[1] > $sw2 && $coordinates[1] < $ne2 && $coordinates[0] != '' && $coordinates[1] != ''){
  446.                             $loop_ex_posts[] = get_the_id();
  447.                         }
  448.                         endwhile;
  449.                     }
  450.                     if (count($loop_ex_posts) > 0) {
  451.                         $pfgetdata['manual_args']['post__in'] = $loop_ex_posts;
  452.                     }else{
  453.                         $pfgetdata['manual_args']['post__in'] = array(12312312371263751263415234);
  454.                     }
  455.                     wp_reset_postdata();
  456.                 }
  457.  
  458.                 $loop = new WP_Query( $pfgetdata['manual_args'] );
  459.             }
  460.         /* End: Coordinate Filter */
  461.  
  462.        
  463.  
  464.  
  465.         /* Start: Image Settings and hover elements */
  466.             $setup22_searchresults_animation_image  = PFSAIssetControl('setup22_searchresults_animation_image','','WhiteSquare');
  467.             $setup22_searchresults_hover_image  = PFSAIssetControl('setup22_searchresults_hover_image','','0');
  468.             $setup22_searchresults_hover_video  = PFSAIssetControl('setup22_searchresults_hover_video','','0');
  469.             $setup22_searchresults_hide_address  = PFSAIssetControl('setup22_searchresults_hide_address','','0');
  470.            
  471.             $pfbuttonstyletext = 'pfHoverButtonStyle ';
  472.            
  473.             switch($setup22_searchresults_animation_image){
  474.                 case 'WhiteRounded':
  475.                     $pfbuttonstyletext .= 'pfHoverButtonWhite pfHoverButtonRounded';
  476.                     break;
  477.                 case 'BlackRounded':
  478.                     $pfbuttonstyletext .= 'pfHoverButtonBlack pfHoverButtonRounded';
  479.                     break;
  480.                 case 'WhiteSquare':
  481.                     $pfbuttonstyletext .= 'pfHoverButtonWhite pfHoverButtonSquare';
  482.                     break;
  483.                 case 'BlackSquare':
  484.                     $pfbuttonstyletext .= 'pfHoverButtonBlack pfHoverButtonSquare';
  485.                     break;
  486.                
  487.             }
  488.  
  489.            
  490.             $pfboptx1 = PFSAIssetControl('setup22_searchresults_hide_excerpt','1','0');
  491.             $pfboptx2 = PFSAIssetControl('setup22_searchresults_hide_excerpt','2','0');
  492.             $pfboptx3 = PFSAIssetControl('setup22_searchresults_hide_excerpt','3','0');
  493.             $pfboptx4 = PFSAIssetControl('setup22_searchresults_hide_excerpt','4','0');
  494.            
  495.             if($pfboptx1 != 1){$pfboptx1_text = 'style="display:none"';}else{$pfboptx1_text = '';}
  496.             if($pfboptx2 != 1){$pfboptx2_text = 'style="display:none"';}else{$pfboptx2_text = '';}
  497.             if($pfboptx3 != 1){$pfboptx3_text = 'style="display:none"';}else{$pfboptx3_text = '';}
  498.             if($pfboptx4 != 1){$pfboptx4_text = 'style="display:none"';}else{$pfboptx4_text = '';}
  499.            
  500.             switch($pfgrid_output){case 'pf1col':$pfboptx_text = $pfboptx1_text;break;case 'pf2col':$pfboptx_text = $pfboptx2_text;break;case 'pf3col':$pfboptx_text = $pfboptx3_text;break;case 'pf4col':$pfboptx_text = $pfboptx4_text;break;}       
  501.            
  502.             if (is_user_logged_in()) {
  503.                 $user_favorites_arr = get_user_meta( get_current_user_id(), 'user_favorites', true );
  504.                 if (!empty($user_favorites_arr)) {
  505.                     $user_favorites_arr = json_decode($user_favorites_arr,true);
  506.                 }else{
  507.                     $user_favorites_arr = array();
  508.                 }
  509.             }                      
  510.            
  511.             $setup16_featureditemribbon_hide = PFSAIssetControl('setup16_featureditemribbon_hide','','1');
  512.             $setup4_membersettings_favorites = PFSAIssetControl('setup4_membersettings_favorites','','1');
  513.             $setup22_searchresults_hide_re = PFREVSIssetControl('setup22_searchresults_hide_re','','1');
  514.             $setup22_searchresults_hide_excerpt_rl = PFSAIssetControl('setup22_searchresults_hide_excerpt_rl','','2');
  515.             $setup16_reviewstars_nrtext = PFREVSIssetControl('setup16_reviewstars_nrtext','','0');
  516.         /* End: Image Settings and hover elements */
  517.  
  518.  
  519.         /* Start: Favorites check */
  520.             if ($user_loggedin_check) {
  521.                 $user_favorites_arr = get_user_meta( get_current_user_id(), 'user_favorites', true );
  522.                 if (!empty($user_favorites_arr)) {
  523.                     $user_favorites_arr = json_decode($user_favorites_arr,true);
  524.                 }else{
  525.                     $user_favorites_arr = array();
  526.                 }
  527.             }
  528.         /* End: Favorites check */
  529.  
  530.         /* Start: Size Limits */
  531.             switch($pfgrid){
  532.                 case 'grid1':
  533.                     $pf1colfix = ' hidden-lg hidden-md';
  534.                     $limit_chr = PFSizeSIssetControl('setupsizelimitwordconf_general_grid1address','',120);
  535.                     $limit_chr_title = PFSizeSIssetControl('setupsizelimitwordconf_general_grid1title','',120);
  536.                     break;             
  537.                 case 'grid2':
  538.                     $limit_chr = PFSizeSIssetControl('setupsizelimitwordconf_general_grid2address','',96);
  539.                     $limit_chr_title = PFSizeSIssetControl('setupsizelimitwordconf_general_grid2title','',96);
  540.                     break;
  541.                 case 'grid3':
  542.                     $limit_chr = PFSizeSIssetControl('setupsizelimitwordconf_general_grid3address','',32);
  543.                     $limit_chr_title = PFSizeSIssetControl('setupsizelimitwordconf_general_grid3title','',32);
  544.                     break;
  545.                 case 'grid4':
  546.                     $limit_chr = PFSizeSIssetControl('setupsizelimitwordconf_general_grid4address','',32);
  547.                     $limit_chr_title = PFSizeSIssetControl('setupsizelimitwordconf_general_grid4title','',32);
  548.                     break;
  549.                 default:
  550.                     $limit_chr = PFSizeSIssetControl('setupsizelimitwordconf_general_grid4address','',32);
  551.                     $limit_chr_title = PFSizeSIssetControl('setupsizelimitwordconf_general_grid4title','',32);
  552.                     break;
  553.             }
  554.         /* End: Size Limits */
  555.  
  556.        
  557.  
  558.         /*
  559.         print_r($loop->query).PHP_EOL;
  560.         echo $loop->request.PHP_EOL;
  561.         */
  562.  
  563.         if (!empty($pfgetdata['manual_args'])) {
  564.             if($loop->post_count == 1) {
  565.                 $pf_found_text = $loop->found_posts.' '.esc_html__('item found','pointfindert2d');
  566.             }elseif($loop->post_count > 1) {
  567.                 $pf_found_text = $loop->found_posts.' '.esc_html__('items found','pointfindert2d');
  568.             }
  569.  
  570.             if ($loop->post_count == 0) {
  571.                 $wpflistdata .= do_shortcode('[pftext_separator title="'.esc_html__('No matching listings','pointfindert2d').'" title_align="separator_align_left"]');
  572.             } else {
  573.                 $wpflistdata .= do_shortcode('[pftext_separator title="'.esc_html__('Search Results : ','pointfindert2d').' '.$pf_found_text.'" title_align="separator_align_left"]');
  574.             }
  575.            
  576.         }
  577.  
  578.         /* Start: Grid (HTML) */
  579.             $wpflistdata .= '<div class="pfsearchresults '.$pfcontainershow.' pflistgridview pflistgridview-static">
  580.            <form action="" method="GET" name="'.$pfcontainershow.'-form" id="'.$pfcontainershow.'-form">';/*List Data Begin . Form Begi*/
  581.  
  582.            
  583.             /* Start: Header Area for filters (HTML) */    
  584.                 if($pfheaderfilters == ''){
  585.                     $wpflistdata .= '<div class="'.$pfcontainerdiv.'-header pflistcommonview-header">';
  586.  
  587.                         /*
  588.                         * Start: Left Filter Area
  589.                         */
  590.                             $wpflistdata .= '<ul class="'.$pfcontainerdiv.'-filters-left '.$pfcontainerdiv.'-filters searchformcontainer-filters searchformcontainer-filters-left golden-forms clearfix col-lg-9 col-md-9 col-sm-9 col-xs-12">';
  591.  
  592.                                 /*
  593.                                 * Start: SORT BY Section
  594.                                 */ 
  595.                                     $wpflistdata .= '<li>';
  596.                                         $wpflistdata .= '<label for="pfsearch-filter" class="lbl-ui select pfsortby">';
  597.                                             $wpflistdata .= '<select class="pfsearch-filter" name="pfsearch-filter" id="pfsearch-filter">';
  598.                                            
  599.                                                 if($args['orderby'] == 'ID' && $args['orderby'] != 'meta_value_num' && $args['orderby'] != 'meta_value'){
  600.                                                         $wpflistdata .= '<option value="" selected>'.esc_html__('SORT BY','pointfindert2d').'</option>';
  601.                                                 }else{
  602.                                                     $wpflistdata .= '<option value="">'.esc_html__('SORT BY','pointfindert2d').'</option>';
  603.                                                 }
  604.  
  605.                                                 $pfgform_values3 = array('title','date');
  606.                                                 $pfgform_values3_texts = array('title'=>esc_html__('Title','pointfindert2d'),'date'=>esc_html__('Date','pointfindert2d'));
  607.                                            
  608.                                                 if (PFREVSIssetControl('setup11_reviewsystem_check','','0') == 1) {
  609.                                                     array_push($pfgform_values3, 'reviewcount');
  610.                                                     $pfgform_values3_texts['reviewcount'] = esc_html__('Review','pointfindert2d');
  611.                                                 }
  612.                                            
  613.                                            
  614.                                                 foreach($pfgform_values3 as $pfgform_value3){
  615.  
  616.                                                     if(isset($pfg_orderby)){
  617.  
  618.                                                        if(strcmp($pfgform_value3, $pfg_orderby) == 0){
  619.                                                            $wpflistdata .= '<option value="'.$pfgform_value3.'" selected>'.$pfgform_values3_texts[$pfgform_value3].'</option>';
  620.                                                        }else{
  621.                                                            $wpflistdata .= '<option value="'.$pfgform_value3.'">'.$pfgform_values3_texts[$pfgform_value3].'</option>';
  622.                                                        }
  623.  
  624.                                                     }else{
  625.  
  626.                                                        if(strcmp($pfgform_value3, $setup22_searchresults_defaultsortbytype)){
  627.                                                            $wpflistdata .= '<option value="'.$pfgform_value3.'" selected>'.$pfgform_values3_texts[$pfgform_value3].'</option>';
  628.                                                        }else{
  629.                                                            $wpflistdata .= '<option value="'.$pfgform_value3.'">'.$pfgform_values3_texts[$pfgform_value3].'</option>';
  630.                                                        }
  631.  
  632.                                                     }
  633.  
  634.                                                 }
  635.  
  636.                                                 if(!isset($pfg_orderby)){
  637.                                                     $wpflistdata .= PFIF_SortFields_sg($pfgetdata);
  638.                                                 }else{
  639.                                                     $wpflistdata .= PFIF_SortFields_sg($pfgetdata,$pfg_orderby);
  640.                                                 }
  641.  
  642.                                             $wpflistdata .='</select>';
  643.                                         $wpflistdata .= '</label>';
  644.                                     $wpflistdata .= '</li>';
  645.                                 /*
  646.                                 * End: SORT BY Section
  647.                                 */
  648.  
  649.                                 /*
  650.                                 * Start: ASC/DESC Section
  651.                                 */
  652.                                     $wpflistdata .= '
  653.                                     <li>
  654.                                         <label for="pfsearch-filter-order" class="lbl-ui select pforderby">
  655.                                         <select class="pfsearch-filter-order" name="pfsearch-filter-order" id="pfsearch-filter-order" >';
  656.                                         $pfgform_values2 = array('ASC','DESC');
  657.                                         $pfgform_values2_texts = array('ASC'=>esc_html__('ASC','pointfindert2d'),'DESC'=>esc_html__('DESC','pointfindert2d'));
  658.                                         foreach($pfgform_values2 as $pfgform_value2){
  659.                                             if(isset($pfg_order)){
  660.                                                 if(strcmp($pfgform_value2,$pfg_order) == 0){
  661.                                                    $wpflistdata .= '<option value="'.$pfgform_value2.'" selected>'.$pfgform_values2_texts[$pfgform_value2].'</option>';
  662.                                                 }else{
  663.                                                     $wpflistdata .= '<option value="'.$pfgform_value2.'">'.$pfgform_values2_texts[$pfgform_value2].'</option>';
  664.                                                 }
  665.                                             }else{
  666.                                                 if(strcmp($pfgform_value2,$setup22_searchresults_defaultsorttype) == 0){
  667.                                                    $wpflistdata .= '<option value="'.$pfgform_value2.'" selected>'.$pfgform_values2_texts[$pfgform_value2].'</option>';
  668.                                                 }else{
  669.                                                     $wpflistdata .= '<option value="'.$pfgform_value2.'">'.$pfgform_values2_texts[$pfgform_value2].'</option>';
  670.                                                 }
  671.                                             }
  672.                                         }
  673.                                         $wpflistdata .= '</select>
  674.                                         </label>
  675.                                     </li>
  676.                                     ';
  677.                                 /*
  678.                                 * End: ASC/DESC Section
  679.                                 */
  680.  
  681.                                 /*
  682.                                 * Start: Number Section
  683.                                 */
  684.                                     if($pfgetdata['authormode'] == 0 && $pfgetdata['agentmode'] == 0){
  685.                                     $wpflistdata .='
  686.                                     <li>
  687.                                         <label for="pfsearch-filter-number" class="lbl-ui select pfnumberby">
  688.                                         <select class="pfsearch-filter-number" name="pfsearch-filter-number" id="pfsearch-filter-number" >';
  689.                                         $pfgform_values = PFIFPageNumbers();
  690.                                         if($args['posts_per_page'] != ''){
  691.                                             $pagevalforn = $args['posts_per_page'];
  692.                                         }else{
  693.                                             $pagevalforn = $pfgetdata['items'];
  694.                                         }
  695.                                         foreach($pfgform_values as $pfgform_value){
  696.                                            if(strcmp($pfgform_value,$pagevalforn) == 0){
  697.                                                $wpflistdata .= '<option value="'.$pfgform_value.'" selected>'.$pfgform_value.'</option>';
  698.                                            }else{
  699.                                                $wpflistdata .= '<option value="'.$pfgform_value.'">'.$pfgform_value.'</option>';
  700.                                            }
  701.                                         }
  702.                                         $wpflistdata .= '</select>
  703.                                         </label>
  704.                                     </li>';
  705.                                     }
  706.                                 /*
  707.                                 * End: Number Section
  708.                                 */
  709.  
  710.                                 /*
  711.                                 * Start: Category Filters
  712.                                 */
  713.                                     /*
  714.                                     * Start: Listing Type Filter
  715.                                     */  
  716.                                         if (isset($pfgetdata['listingtypefilters'])) {
  717.                                             if($pfgetdata['listingtypefilters'] == 'yes'){
  718.                                                 $wpflistdata .= '
  719.                                                 <li class="pfltypebyli">
  720.                                                     <label for="pfsearch-filter-ltype" class="lbl-ui select pfltypeby">';
  721.                                                     ob_start();
  722.                                                     $pfltypeby_args = array(
  723.                                                         'show_option_all'    => '',
  724.                                                         'show_option_none'   => esc_html__('Listing Types','pointfindert2d'),
  725.                                                         'option_none_value'  => '0',
  726.                                                         'orderby'            => 'ID',
  727.                                                         'order'              => 'ASC',
  728.                                                         'show_count'         => PFASSIssetControl('setup_gridsettings_ltype_filter_c','',0),
  729.                                                         'hide_empty'         => PFASSIssetControl('setup_gridsettings_ltype_filter_h','',0),
  730.                                                         'child_of'           => 0,
  731.                                                         'exclude'            => '',
  732.                                                         'echo'               => 1,
  733.                                                         'selected'           => (!empty($pfg_ltype))?$pfg_ltype:0,
  734.                                                         'hierarchical'       => 1,
  735.                                                         'name'               => 'pfsearch-filter-ltype',
  736.                                                         'id'                 => 'pfsearch-filter-ltype',
  737.                                                         'class'              => 'pfsearch-filter-ltype',
  738.                                                         'depth'              => 0,
  739.                                                         'tab_index'          => 0,
  740.                                                         'taxonomy'           => 'pointfinderltypes',
  741.                                                         'hide_if_empty'      => false,
  742.                                                         'value_field'        => 'term_id',
  743.                                                         'pointfinder'       => 'directorylist'
  744.                                                     );
  745.                                                     wp_dropdown_categories($pfltypeby_args);
  746.                                                     $wpflistdata .= ob_get_contents();
  747.                                                     ob_end_clean();
  748.                                                 $wpflistdata .= '
  749.                                                     </label>
  750.                                                 </li>
  751.                                                 ';
  752.                                             }
  753.                                         }
  754.                                     /*
  755.                                     * End: Listing Type Filter
  756.                                     */
  757.  
  758.  
  759.                                     /*
  760.                                     * Start: Item Type Filter
  761.                                     */
  762.                                         if (isset($pfgetdata['itemtypefilters'])) {
  763.                                             if($pfgetdata['itemtypefilters'] == 'yes' && $setup3_pointposttype_pt4_check == 1){
  764.                                                 $wpflistdata .= '
  765.                                                 <li class="pfitypebyli">
  766.                                                     <label for="pfsearch-filter-itype" class="lbl-ui select pfitypeby">';
  767.                                                 ob_start();
  768.                                                     $pfitypeby_args = array(
  769.                                                         'show_option_all'    => '',
  770.                                                         'show_option_none'   => esc_html__('Item Types','pointfindert2d'),
  771.                                                         'option_none_value'  => '0',
  772.                                                         'orderby'            => 'ID',
  773.                                                         'order'              => 'ASC',
  774.                                                         'show_count'         => PFASSIssetControl('setup_gridsettings_itype_filter_c','',0),
  775.                                                         'hide_empty'         => PFASSIssetControl('setup_gridsettings_itype_filter_h','',0),
  776.                                                         'child_of'           => 0,
  777.                                                         'exclude'            => '',
  778.                                                         'echo'               => 1,
  779.                                                         'selected'           => (!empty($pfg_itype))?$pfg_itype:0,
  780.                                                         'hierarchical'       => 1,
  781.                                                         'name'               => 'pfsearch-filter-itype',
  782.                                                         'id'                 => 'pfsearch-filter-itype',
  783.                                                         'class'              => 'pfsearch-filter-itype',
  784.                                                         'depth'              => 0,
  785.                                                         'tab_index'          => 0,
  786.                                                         'taxonomy'           => 'pointfinderitypes',
  787.                                                         'hide_if_empty'      => false,
  788.                                                         'value_field'        => 'term_id', 
  789.                                                     );
  790.                                                     wp_dropdown_categories($pfitypeby_args);
  791.                                                     $wpflistdata .= ob_get_contents();
  792.                                                     ob_end_clean();
  793.                                                 $wpflistdata .= '
  794.                                                     </label>
  795.                                                 </li>
  796.                                                 ';
  797.                                             }
  798.                                         }
  799.                                     /*
  800.                                     * End: Item Type Filter
  801.                                     */
  802.  
  803.  
  804.                                     /*
  805.                                     * Start: Location Type Filter
  806.                                     */
  807.                                         if (isset($pfgetdata['locationfilters'])) {
  808.                                             if($pfgetdata['locationfilters'] == 'yes' && $setup3_pointposttype_pt5_check == 1){
  809.                                                 $wpflistdata .= '
  810.                                                 <li class="pflocationbyli">
  811.                                                     <label for="pfsearch-filter-location" class="lbl-ui select pflocationby">';
  812.                                                 ob_start();
  813.                                                     $pflocationby_args = array(
  814.                                                         'show_option_all'    => '',
  815.                                                         'show_option_none'   => esc_html__('Locations','pointfindert2d'),
  816.                                                         'option_none_value'  => '0',
  817.                                                         'orderby'            => 'ID',
  818.                                                         'order'              => 'ASC',
  819.                                                         'show_count'         => PFASSIssetControl('setup_gridsettings_location_filter_c','',0),
  820.                                                         'hide_empty'         => PFASSIssetControl('setup_gridsettings_location_filter_h','',0),
  821.                                                         'child_of'           => 0,
  822.                                                         'exclude'            => '',
  823.                                                         'echo'               => 1,
  824.                                                         'selected'           => (!empty($pfg_lotype))?$pfg_lotype:0,
  825.                                                         'hierarchical'       => 1,
  826.                                                         'name'               => 'pfsearch-filter-location',
  827.                                                         'id'                 => 'pfsearch-filter-location',
  828.                                                         'class'              => 'pfsearch-filter-location',
  829.                                                         'depth'              => 0,
  830.                                                         'tab_index'          => 0,
  831.                                                         'taxonomy'           => 'pointfinderlocations',
  832.                                                         'hide_if_empty'      => false,
  833.                                                         'value_field'        => 'term_id', 
  834.                                                     );
  835.                                                     wp_dropdown_categories($pflocationby_args);
  836.                                                     $wpflistdata .= ob_get_contents();
  837.                                                     ob_end_clean();
  838.                                                 $wpflistdata .= '
  839.                                                     </label>
  840.                                                 </li>
  841.                                                 ';
  842.                                             }
  843.                                         }
  844.                                     /*
  845.                                     * End: Location Type Filter
  846.                                     */
  847.                                 /*
  848.                                 * End: Category Filters
  849.                                 */
  850.  
  851.                             $wpflistdata .='</ul>';
  852.                         /*
  853.                         * End: Left Filter Area
  854.                         */
  855.  
  856.                         /*
  857.                         * Start: Right Filter Area
  858.                         */
  859.                             if($pfgetdata['authormode'] == 0 && $pfgetdata['agentmode'] == 0){
  860.                             $wpflistdata .= '
  861.                             <ul class="'.$pfcontainerdiv.'-filters-right '.$pfcontainerdiv.'-filters searchformcontainer-filters searchformcontainer-filters-right clearfix col-lg-3 col-md-3 col-sm-3 col-xs-12">
  862.                                 ';
  863.                                 $setup22_searchresults_status_2col = PFSAIssetControl('setup22_searchresults_status_2col','','0');
  864.                                 $setup22_searchresults_status_3col = PFSAIssetControl('setup22_searchresults_status_3col','','0');
  865.                                 $setup22_searchresults_status_4col = PFSAIssetControl('setup22_searchresults_status_4col','','0');
  866.                                 $setup22_searchresults_status_2colh = PFSAIssetControl('setup22_searchresults_status_2colh','','0');
  867.                                 if($setup22_searchresults_status_2col == 0){$wpflistdata .= '<li class="pfgridlist2 pfgridlistit" data-pf-grid="grid2" ></li>';}
  868.                                 if($setup22_searchresults_status_3col == 0){$wpflistdata .= '<li class="pfgridlist3 pfgridlistit" data-pf-grid="grid3" ></li>';}
  869.                                 if($setup22_searchresults_status_4col == 0){$wpflistdata .= '<li class="pfgridlist4 pfgridlistit" data-pf-grid="grid4" ></li>';}
  870.                                 if($setup22_searchresults_status_2colh == 0){$wpflistdata .= '<li class="pfgridlist5 pfgridlistit" data-pf-grid="grid1" ></li>';}
  871.                                 $wpflistdata .= '
  872.                                 <li class="pfgridlist6"></li>                                
  873.                             </ul>
  874.                             ';
  875.                             }
  876.                         /*
  877.                         * End: Right Filter Area
  878.                         */
  879.  
  880.                     $wpflistdata .= '</div>';
  881.                 }
  882.             /* End: Header Area for filters (HTML) */
  883.                            
  884.            
  885.                 $wpflistdata .=
  886.                 '<div class="'.$pfcontainerdiv.'-content pflistcommonview-content">';/*List Content begin*/
  887.                
  888.                     $wpflistdata .='<ul class="pfitemlists-content-elements '.$pfgrid_output.'" data-layout-mode="'.$grid_layout_mode.'">';
  889.        
  890.                     $wpflistdata_output = '';  
  891.                    
  892.                     if($loop->post_count > 0){
  893.                
  894.                         while ( $loop->have_posts() ) : $loop->the_post();
  895.                        
  896.                         $post_id = get_the_id();
  897.  
  898.                             /* Start: Print out icon visibility
  899.                                 $pfitemvisibilityGet = redux_post_meta("pointfinderthemefmb_options", $post_id, "webbupointfinder_item_point_visibility");
  900.                                 $pfitemvisibilityGet = (empty($pfitemvisibilityGet))? 1: $pfitemvisibilityGet;
  901.                                 if($pfitemvisibilityGet == 0){$pfitemvisibility = 'false';}else{$pfitemvisibility = 'true';}
  902.                             End: Print out icon visibility */
  903.                            
  904.                            
  905.                            
  906.                            
  907.                                 /* Start: Prepare Item Elements */             
  908.                                     $ItemDetailArr = array();
  909.                                    
  910.                                     /* Get Item's WPML ID */
  911.                                     $pflang = PF_current_language();
  912.                                     if (!empty($pflang)) {$pfitemid = PFLangCategoryID_ld($post_id,$pflang);}else{$pfitemid = $post_id;}
  913.  
  914.                                     /* Start: Setup Featured Image */
  915.                                         $featured_image = '';
  916.                                         $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id( $pfitemid ), 'full' );
  917.                                         $ItemDetailArr['featured_image_org'] = $featured_image[0];
  918.                                         if($featured_image[0] != '' && $featured_image[0] != NULL){
  919.                                             $ItemDetailArr['featured_image'] = aq_resize($featured_image[0],$featured_image_width,$featured_image_height,true);
  920.  
  921.                                             if($ItemDetailArr['featured_image'] === false) {
  922.                                                 if($general_retinasupport == 1){
  923.                                                     $ItemDetailArr['featured_image'] = aq_resize($featured_image[0],$featured_image_width/2,$featured_image_height/2,true);
  924.                                                     if($ItemDetailArr['featured_image'] === false) {
  925.                                                         $ItemDetailArr['featured_image'] = $ItemDetailArr['featured_image_org'];
  926.                                                         if($ItemDetailArr['featured_image'] == '') {
  927.                                                             $ItemDetailArr['featured_image'] = get_template_directory_uri().'/images/noimg.png';
  928.                                                         }
  929.                                                     }
  930.                                                 }else{
  931.                                                     $ItemDetailArr['featured_image'] = aq_resize($featured_image[0],$featured_image_width/2,$featured_image_height/2,true);
  932.                                                     if ($ItemDetailArr['featured_image'] === false) {
  933.                                                         $ItemDetailArr['featured_image'] = aq_resize($featured_image[0],$featured_image_width/4,$featured_image_height/4,true);
  934.                                                         if ($ItemDetailArr['featured_image'] === false) {
  935.                                                             $ItemDetailArr['featured_image'] = $ItemDetailArr['featured_image_org'];
  936.                                                             if($ItemDetailArr['featured_image'] == '') {
  937.                                                                 $ItemDetailArr['featured_image'] = get_template_directory_uri().'/images/noimg.png';
  938.                                                             }
  939.                                                         }
  940.                                                     }
  941.                                            
  942.                                                     $ItemDetailArr['featured_image'] = $ItemDetailArr['featured_image_org'];
  943.                                                     if($ItemDetailArr['featured_image'] == '') {
  944.                                                         $ItemDetailArr['featured_image'] = get_template_directory_uri().'/images/noimg.png';
  945.                                                     }
  946.                                                 }
  947.                                                
  948.                                             }
  949.                                
  950.                                         }else{
  951.                                             $ItemDetailArr['featured_image'] = get_template_directory_uri().'/images/noimg.png';
  952.                                         }
  953.                                         $ItemDetailArr['if_title'] = get_the_title($pfitemid);
  954.                                         $ItemDetailArr['if_excerpt'] = get_the_excerpt();
  955.                                         $ItemDetailArr['if_link'] = get_permalink($pfitemid);;
  956.                                         $ItemDetailArr['if_address'] = esc_html(get_post_meta( $pfitemid, 'webbupointfinder_items_address', true ));
  957.                                         $ItemDetailArr['featured_video'] =  get_post_meta( $pfitemid, 'webbupointfinder_item_video', true );
  958.                                     /* End: Setup Featured Image */
  959.  
  960.                                     /* Start: Setup Details */
  961.                                         $output_data = PFIF_DetailText_ld($pfitemid);
  962.                                         if (is_array($output_data)) {
  963.                                             if (!empty($output_data['ltypes'])) {
  964.                                                 $output_data_ltypes = $output_data['ltypes'];
  965.                                             } else {
  966.                                                 $output_data_ltypes = '';
  967.                                             }
  968.                                             if (!empty($output_data['content'])) {
  969.                                                 $output_data_content = $output_data['content'];
  970.                                             } else {
  971.                                                 $output_data_content = '';
  972.                                             }
  973.                                             if (!empty($output_data['priceval'])) {
  974.                                                 $output_data_priceval = $output_data['priceval'];
  975.                                             } else {
  976.                                                 $output_data_priceval = '';
  977.                                             }
  978.                                         } else {
  979.                                             $output_data_priceval = '';
  980.                                             $output_data_content = '';
  981.                                             $output_data_ltypes = '';
  982.                                         }
  983.                                     /* End: Setup Details */
  984.                                 /* End: Prepare Item Elements */
  985.                                
  986.                                 /* Start: Item Box */
  987.                                     $fav_check = 'false';
  988.  
  989.                                     $wpflistdata_output .= '<li class="'.$pfgridcol_output.' wpfitemlistdata isotope-item">';
  990.                                         $wpflistdata_output .= '<div class="pflist-item"'.$pfitemboxbg.'>';
  991.                                             $wpflistdata_output .= '<div class="pflist-item-inner">';
  992.  
  993.                                                 /* Start: Image Container */
  994.                                                     $wpflistdata_output .= '<div class="pflist-imagecontainer pflist-subitem">';
  995.                                                         $wpflistdata_output .= "<a href='".$ItemDetailArr['if_link']."'".$targetforitem."><img src='".$ItemDetailArr['featured_image'] ."' alt='' /></a>";
  996.  
  997.                                                         /* Start: Favorites */
  998.                                                             if($setup4_membersettings_favorites == 1){
  999.                                                                 if ($user_loggedin_check && count($user_favorites_arr)>0) {
  1000.                                                                     if (in_array($pfitemid, $user_favorites_arr)) {
  1001.                                                                         $fav_check = 'true';
  1002.                                                                         $favtitle_text = esc_html__('Remove from Favorites','pointfindert2d');
  1003.                                                                     }
  1004.                                                                 }
  1005.  
  1006.                                                                 $wpflistdata_output .= '
  1007.                                                                 <div class="RibbonCTR">
  1008.                                                                     <span class="Sign">
  1009.                                                                         <a class="pf-favorites-link" data-pf-num="'.$pfitemid.'" data-pf-active="'.$fav_check.'" data-pf-item="false" title="'.$favtitle_text.'">
  1010.                                                                             <i class="pfadmicon-glyph-629"></i>
  1011.                                                                         </a>
  1012.                                                                     </span>
  1013.                                                                     <span class="Triangle"></span>
  1014.                                                                 </div>';
  1015.                                                             }
  1016.                                                         /* End: Favorites */
  1017.  
  1018.  
  1019.                                                         /* Start: Hover mode enabled */
  1020.                                                             if($setup22_searchresults_hover_image == 0){
  1021.                                                                 $wpflistdata_output .= '<div class="pfImageOverlayH hidden-xs"></div>';
  1022.                                                                
  1023.                                                                     if($setup22_searchresults_hover_video == 0 && !empty($ItemDetailArr['featured_video'])){   
  1024.                                                                         $wpflistdata_output .= '<div class="pfButtons pfStyleV pfStyleVAni hidden-xs">';
  1025.                                                                     }else{
  1026.                                                                         $wpflistdata_output .= '<div class="pfButtons pfStyleV2 pfStyleVAni hidden-xs">';
  1027.                                                                     }
  1028.  
  1029.                                                                     $wpflistdata_output .= '
  1030.                                                                     <span class="'.$pfbuttonstyletext.' clearfix">
  1031.                                                                         <a class="pficon-imageclick" data-pf-link="'.$ItemDetailArr['featured_image_org'].'" style="cursor:pointer">
  1032.                                                                             <i class="pfadmicon-glyph-684"></i>
  1033.                                                                         </a>
  1034.                                                                     </span>';
  1035.  
  1036.                                                                     if($setup22_searchresults_hover_video == 0 && !empty($ItemDetailArr['featured_video'])){   
  1037.                                                                         $wpflistdata_output .= '
  1038.                                                                         <span class="'.$pfbuttonstyletext.'">
  1039.                                                                             <a class="pficon-videoclick" data-pf-link="'.$ItemDetailArr['featured_video'].'" style="cursor:pointer">
  1040.                                                                                 <i class="pfadmicon-glyph-573"></i>
  1041.                                                                             </a>
  1042.                                                                         </span>';
  1043.                                                                     }
  1044.                                                                     $wpflistdata_output .= '
  1045.                                                                     <span class="'.$pfbuttonstyletext.'">
  1046.                                                                         <a href="'.$ItemDetailArr['if_link'].'"'.$targetforitem.'>
  1047.                                                                             <i class="pfadmicon-glyph-794"></i>
  1048.                                                                         </a>
  1049.                                                                     </span>';
  1050.  
  1051.                                                                 $wpflistdata_output .= '</div>';
  1052.                                                             }
  1053.                                                         /* End: Hover mode enabled */
  1054.  
  1055.  
  1056.                                                         /* Start: Featured Item Ribbon */
  1057.                                                             if ($setup16_featureditemribbon_hide != 0) {
  1058.                                                                 $featured_check_x = get_post_meta( $pfitemid, 'webbupointfinder_item_featuredmarker', true );
  1059.  
  1060.                                                                 if (!empty($featured_check_x)) {
  1061.                                                                     $wpflistdata_output .= '<div class="pfribbon-wrapper-featured"><div class="pfribbon-featured">'.esc_html__('FEATURED','pointfindert2d').'</div></div>';
  1062.                                                                 }
  1063.                                                             }
  1064.                                                         /* End: Featured Item Ribbon */
  1065.  
  1066.  
  1067.                                                        
  1068.  
  1069.                                                         /* Start: Conditions */
  1070.  
  1071.                                                             if ($setup3_pt14_check == 1) {
  1072.                                                                 $item_defaultvalue = wp_get_post_terms($pfitemid, 'pointfinderconditions', array("fields" => "all"));
  1073.                                                                
  1074.                                                                 if (isset($item_defaultvalue[0]->term_id)) {                                                               
  1075.                                                                     $contidion_colors = pf_get_condition_color($item_defaultvalue[0]->term_id);
  1076.  
  1077.                                                                     $condition_c = (isset($contidion_colors['cl']))? $contidion_colors['cl']:'#494949';
  1078.                                                                     $condition_b = (isset($contidion_colors['bg']))? $contidion_colors['bg']:'#f7f7f7';
  1079.  
  1080.                                                                     $wpflistdata_output .= '<div class="pfconditions-tag" style="color:'.$condition_c.';background-color:'.$condition_b.'">';
  1081.                                                                     $wpflistdata_output .= '<a href="' . esc_url( get_term_link( $item_defaultvalue[0]->term_id, 'pointfinderconditions' ) ) . '" style="color:'.$condition_c.';">'.$item_defaultvalue[0]->name.'</a>';
  1082.                                                                     $wpflistdata_output .= '</div>';
  1083.                                                                 }
  1084.  
  1085.                                                             }
  1086.                                                         /* End: Conditions */
  1087.  
  1088.                                                         /* Start: Price Value Check and Output */
  1089.                                                             if ($output_data_priceval != '' || $output_data_ltypes != '') {
  1090.  
  1091.                                                                 $wpflistdata_output .= '<div class="pflisting-itemband'.$pf1colfix.'">';
  1092.                                                            
  1093.                                                                     $wpflistdata_output .= '<div class="pflist-pricecontainer">';
  1094.                                                                     if ($output_data_ltypes != '') {
  1095.                                                                         $wpflistdata_output .= $output_data_ltypes;
  1096.                                                                     }
  1097.  
  1098.                                                                     if ($output_data_priceval != '') {
  1099.                                                                         $wpflistdata_output .= $output_data_priceval;
  1100.                                                                     }else{
  1101.                                                                         $wpflistdata_output .= '<div class="pflistingitem-subelement pf-price" style="visibility: hidden;"><i class="pfadmicon-glyph-553"></i></div>';
  1102.                                                                     }
  1103.                                                                    
  1104.                                                                     $wpflistdata_output .= '</div>';
  1105.                                                        
  1106.                                                                 $wpflistdata_output .= '</div>';
  1107.                                                             }
  1108.                                                         /* End: Price Value Check and Output */
  1109.  
  1110.                                                     $wpflistdata_output .='</div>';
  1111.  
  1112.                                                 /* End: Image Container */
  1113.                                            
  1114.                                                 /* Start: Detail Texts */
  1115.                                                     $titlecount = strlen($ItemDetailArr['if_title']);
  1116.                                                     $titlecount = (strlen($ItemDetailArr['if_title'])<=$limit_chr_title ) ? '' : '...' ;
  1117.                                                     $title_text = mb_substr($ItemDetailArr['if_title'], 0, $limit_chr_title ,'UTF-8').$titlecount;
  1118.  
  1119.                                                     $addresscount = strlen($ItemDetailArr['if_address']);
  1120.                                                     $addresscount = (strlen($ItemDetailArr['if_address'])<=$limit_chr ) ? '' : '...' ;
  1121.                                                     $address_text = mb_substr($ItemDetailArr['if_address'], 0, $limit_chr ,'UTF-8').$addresscount;
  1122.  
  1123.                                                     $excerpt_text = mb_substr($ItemDetailArr['if_excerpt'], 0, ($limit_chr*$setup22_searchresults_hide_excerpt_rl),'UTF-8').$addresscount;
  1124.                                                     if (strlen($ItemDetailArr['if_excerpt']) > ($limit_chr*$setup22_searchresults_hide_excerpt_rl)) {
  1125.                                                         $excerpt_text .= '...';
  1126.                                                     }
  1127.                                                    
  1128.                                                     /* Title and address area */
  1129.  
  1130.                                                         $wpflistdata_output .= '
  1131.                                                         <div class="pflist-detailcontainer pflist-subitem">
  1132.                                                             <ul class="pflist-itemdetails">
  1133.                                                                 <li class="pflist-itemtitle"><a href="'.$ItemDetailArr['if_link'].'"'.$targetforitem.'>'.$title_text.'</a></li>
  1134.                                                                 ';
  1135.  
  1136.                                                                 /* Start: Review Stars */
  1137.                                                                     if ($review_system_statuscheck == 1) {
  1138.                                                                         if ($setup22_searchresults_hide_re == 0) {
  1139.  
  1140.                                                                             $reviews = pfcalculate_total_review($pfitemid);
  1141.  
  1142.                                                                             if (!empty($reviews['totalresult'])) {
  1143.                                                                                 $wpflistdata_output .= '<li class="pflist-reviewstars">';
  1144.                                                                                 $rev_total_res = round($reviews['totalresult']);
  1145.                                                                                 $wpflistdata_output .= '<div class="pfrevstars-wrapper-review">';
  1146.                                                                                 $wpflistdata_output .= ' <div class="pfrevstars-review">';
  1147.                                                                                     for ($ri=0; $ri < $rev_total_res; $ri++) {
  1148.                                                                                         $wpflistdata_output .= '<i class="pfadmicon-glyph-377"></i>';
  1149.                                                                                     }
  1150.                                                                                     for ($ki=0; $ki < (5-$rev_total_res); $ki++) {
  1151.                                                                                         $wpflistdata_output .= '<i class="pfadmicon-glyph-378"></i>';
  1152.                                                                                     }
  1153.  
  1154.                                                                                 $wpflistdata_output .= '</div></div>';
  1155.                                                                                 $wpflistdata_output .= '</li>';
  1156.                                                                             }else{
  1157.                                                                                 if($setup16_reviewstars_nrtext == 0){
  1158.                                                                                     $wpflistdata_output .= '<li class="pflist-reviewstars">';
  1159.                                                                                     $wpflistdata_output .= '<div class="pfrevstars-wrapper-review">';
  1160.                                                                                     $wpflistdata_output .= '<div class="pfrevstars-review pfrevstars-reviewbl">
  1161.                                                                                     <i class="pfadmicon-glyph-378"></i><i class="pfadmicon-glyph-378"></i><i class="pfadmicon-glyph-378"></i><i class="pfadmicon-glyph-378"></i><i class="pfadmicon-glyph-378"></i></div></div>';
  1162.                                                                                     $wpflistdata_output .= '</li>';
  1163.                                                                                 }
  1164.                                                                             }
  1165.                                                                         }
  1166.                                                                     }
  1167.                                                                 /* End: Review Stars */
  1168.  
  1169.                                                                 if($setup22_searchresults_hide_address == 0){
  1170.                                                                 $wpflistdata_output .= '
  1171.                                                                 <li class="pflist-address"><i class="pfadmicon-glyph-109"></i> '.$address_text.'</li>
  1172.                                                                 ';
  1173.                                                                 }
  1174.                                                                 if (!empty($output_data_ltypes) && $pfgrid == 'grid1') {
  1175.                                                                     $wpflistdata_output .= '<li class="pflist-category visible-lg visible-md"><i class="pfadmicon-glyph-534"></i>';
  1176.  
  1177.                                                                         $output_data_ltypes_f1col = str_replace("<div class=\"pflistingitem-subelement pf-price\">", "", $output_data_ltypes);
  1178.                                                                         $output_data_ltypes_f1col = str_replace("</div>", "", $output_data_ltypes_f1col);
  1179.                                                                         $output_data_ltypes_f1col = str_replace("<ul class=\"pointfinderpflisttermsgr\">", "", $output_data_ltypes_f1col);
  1180.                                                                         $output_data_ltypes_f1col = str_replace("</ul>", "", $output_data_ltypes_f1col);
  1181.                                                                         $output_data_ltypes_f1col = str_replace("<li>", "", $output_data_ltypes_f1col);
  1182.                                                                         $output_data_ltypes_f1col = str_replace("</li>", "", $output_data_ltypes_f1col);
  1183.                                                                         $wpflistdata_output .= $output_data_ltypes_f1col;
  1184.                                                                    
  1185.                                                                     $wpflistdata_output .= '</li>';
  1186.                                                                 }
  1187.                                                                 $wpflistdata_output .= '
  1188.                                                             </ul>
  1189.                                                             ';
  1190.                                                             if($pfboptx_text != 'style="display:none"' && $pfgrid == 'grid1'){
  1191.                                                             $wpflistdata_output .= '
  1192.                                                                 <div class="pflist-excerpt pflist-subitem" '.$pfboptx_text.'>'.$excerpt_text.'</div>
  1193.                                                             ';
  1194.                                                             }
  1195.                                                             $wpflistdata_output .= '
  1196.                                                         </div>
  1197.                                                         ';
  1198.  
  1199.                                                         if($pfboptx_text != 'style="display:none"' && $pfgrid != 'grid1'){
  1200.                                                         $wpflistdata_output .= '
  1201.                                                             <div class="pflist-excerpt pflist-subitem" '.$pfboptx_text.'>'.$excerpt_text.'</div>
  1202.                                                         ';
  1203.                                                         }
  1204.  
  1205.                                                         if (!empty($output_data_content)) {
  1206.                                                             if (!empty($pf1colfix)) {
  1207.                                                                 $pf1colfix2 = '<div class="pflist-customfield-price">'.$output_data_priceval.'</div>';
  1208.                                                             }
  1209.                                                            
  1210.                                                             $wpflistdata_output .= '<div class="pflist-subdetailcontainer pflist-subitem">'.$pf1colfix2.'
  1211.                                                             <div class="pflist-customfields">'.$output_data_content.'</div>
  1212.                                                             </div>';
  1213.                                                         }
  1214.  
  1215.                                                         /* Show on map text for search results and search page */
  1216.                                                         if (!empty($pfgetdata['manual_args'])) {
  1217.                                                             if (PFSAIssetControl('setup22_searchresults_showmapfeature','','1') == 1 && PFSAIssetControl('setup42_searchpagemap_headeritem','','1') == 1) {
  1218.                                                                 $wpflistdata_output .= '<div class="pflist-subdetailcontainer pflist-subitem"><a data-pfitemid="'.$pfitemid.'" class="pfshowmaplink"><i class="pfadmicon-glyph-372"></i> '.esc_html__('SHOW ON MAP','pointfindert2d').'</a></div>';
  1219.                                                             }
  1220.                                                         }
  1221.                                                 /* End: Detail Texts */
  1222.                                                        
  1223.                                             $wpflistdata_output .= '</div>';
  1224.                                         $wpflistdata_output .= '</div>';
  1225.                                     $wpflistdata_output .= '</li>';
  1226.  
  1227.                                 /* End: Item Box */
  1228.                            
  1229.                        
  1230.                            
  1231.                            
  1232.                         endwhile;
  1233.                        
  1234.                         $wpflistdata .= $wpflistdata_output;              
  1235.                         $wpflistdata .= '</ul>';
  1236.                     }else{
  1237.                         $setup3_modulessetup_authornrf = PFSAIssetControl('setup3_modulessetup_authornrf','','0');
  1238.                         $wpflistdata .= $wpflistdata_output;              
  1239.                         $wpflistdata .= '</ul>';
  1240.  
  1241.                         if($setup3_modulessetup_authornrf == 1 && ($pfgetdata['authormode'] == 1 || $pfgetdata['agentmode'] == 1)){
  1242.                             $wpflistdata .= '<div class="golden-forms">';
  1243.                             $wpflistdata .= '<div class="notification warning" id="pfuaprofileform-notify-warning"><p>';
  1244.                             $wpflistdata .= '<strong>'.esc_html__('No record found!','pointfindert2d').'</strong></p>';
  1245.                             $wpflistdata .= '</div>';
  1246.                             $wpflistdata .= '</div>';
  1247.                         }elseif ($pfgetdata['authormode'] == 0 && $pfgetdata['agentmode'] == 0) {
  1248.                             $wpflistdata .= '<div class="golden-forms">';
  1249.                             $wpflistdata .= '<div class="notification warning" id="pfuaprofileform-notify-warning"><p>';
  1250.                             $wpflistdata .= '<strong>'.esc_html__('No record found!','pointfindert2d').'</strong></p>';
  1251.                             $wpflistdata .= '</div>';
  1252.                             $wpflistdata .= '</div>';
  1253.                         }
  1254.                        
  1255.                     }
  1256.                    
  1257.  
  1258.  
  1259.                    
  1260.  
  1261.                     $wpflistdata .= '<div class="pfstatic_paginate" >';
  1262.                    
  1263.                     $big = 999999999;
  1264.                     $wpflistdata .= paginate_links(array(
  1265.                         'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
  1266.                         'format' => '?page=%#%',
  1267.                         'current' => max(1, $pfg_paged),
  1268.                         'total' => $loop->max_num_pages,
  1269.                         'type' => 'list',
  1270.                     ));
  1271.                    
  1272.                     wp_reset_postdata();
  1273.                     $wpflistdata .= '</div></div>';/*List Content End*/
  1274.                     $wpflistdata .= "<input type='hidden' value='".$pfgrid."' name='pfsearch-filter-col'>";
  1275.                     $wpflistdata .= $pfgetdata['hidden_output'];
  1276.                     $wpflistdata .= "</form></div></div> ";/*Form End . List Data End*/
  1277.  
  1278.                     $wpflistdata .= "
  1279.                     <script type='text/javascript'>
  1280.                     (function($) {
  1281.                         'use strict'
  1282.                         $('.pflistgridview{$gridrandno_orj}-filters-right .pfgridlistit').click(function(){
  1283.                             $('input[name=pfsearch-filter-col]').val($(this).attr('data-pf-grid'));
  1284.                             $('#{$pfcontainershow}-form').submit();
  1285.                         });
  1286.                        
  1287.                         $('.pflistgridview{$gridrandno_orj}-filters-left > li > label > select').change(function(){
  1288.                             $('#{$pfcontainershow}-form').submit();
  1289.                         });
  1290.                        
  1291.                         $(function() {
  1292.                             var intervaltime = 0;
  1293.                             var makeitperfextpf = setInterval(function() {
  1294.                                
  1295.                            
  1296.                                
  1297.                                 var layout_modes = {
  1298.                                 fitrows: 'fitRows',
  1299.                                 masonry: 'masonry'
  1300.                                 }
  1301.                                 $('.pflistgridview{$gridrandno_orj}-content').each(function(){
  1302.                                     var \$container = $(this);
  1303.                                     var \$thumbs = \$container.find('.pfitemlists-content-elements');
  1304.                                     var layout_mode = \$thumbs.attr('data-layout-mode');
  1305.                                     \$thumbs.isotope({
  1306.                                         itemSelector : '.isotope-item',
  1307.                                         layoutMode : (layout_modes[layout_mode]==undefined ? 'fitRows' : layout_modes[layout_mode])
  1308.                                     });
  1309.                                    
  1310.                                 });
  1311.                                
  1312.                                
  1313.                                 intervaltime++;
  1314.                                 if (intervaltime == 5) {
  1315.                                     clearInterval(makeitperfextpf);
  1316.                                 }
  1317.                             }, 1000);
  1318.                         });
  1319.  
  1320.                         $('.pfButtons a').click(function() {
  1321.                             if($(this).attr('data-pf-link')){
  1322.                                 $.prettyPhoto.open($(this).attr('data-pf-link'));
  1323.                             }
  1324.                         });
  1325.  
  1326.                     })(jQuery);
  1327.                     </script>
  1328. ";
  1329. return $wpflistdata;
  1330. }
  1331. add_shortcode( 'pf_itemgrid2', 'pf_itemgrid2_func' );
  1332.  
  1333. ?>
Advertisement
Add Comment
Please, Sign In to add comment