S
S
Stanislav Morozov2016-12-11 01:50:34
PHP
Stanislav Morozov, 2016-12-11 01:50:34

How to properly filter blog posts?

Here is a part of the code that does not work, I
went through a lot of options, but the filtering still does not work.

if(strpos($pieces[6], "blog"))
  {
      // $pieces[6] - переменная из GET
      preg_match_all("/[^\D+$]{3,16}/",$pieces[6],$out);// ищу цифры в $pieces[6], это и будет id блога
      menu_set($pieces[5],$id_user,$out[0][0]);

      echo "<div class='blog-posts'>";
      echo "<br>";
      //$arrList['PROPERTY_BLOG_ID'] = $out[0][0];--не работает
      $GLOBALS['arrList'] = array("BLOG_ID"=>$out[0][0]);//создаю фильтр, сообщения фильтруются по BLOG_ID
     //print_r($arrList); 
      $APPLICATION->IncludeComponent(
     "demo:blog.blog",
      "",
     Array(
        "SEO_USER" => "Y",
        "MESSAGE_COUNT" => "25",
        "DATE_TIME_FORMAT" => "d.m.Y H:i:s",
        "PATH_TO_BLOG" => "",
        "PATH_TO_BLOG_CATEGORY" => "",
        "PATH_TO_POST" => "",
        "PATH_TO_POST_EDIT" => "",
        "PATH_TO_USER" => "",
        "PATH_TO_SMILE" => "",
        "BLOG_VAR" => "",
        "POST_VAR" => "",
        "USER_VAR" => "",
        "PAGE_VAR" => "",
        "BLOG_URL" => $blog,
        "YEAR" => $year,
        "MONTH" => $month,
        "DAY" => $day,
        "CATEGORY_ID" => $category,
        "CACHE_TYPE" => "A",
        "CACHE_TIME" => "7200",
        "CACHE_TIME_LONG" => "604600",
        "SET_NAV_CHAIN" => "Y",
        "SET_TITLE" => "Y",
        "USE_FILTER" => "Y",
        "SHOW_ALL_WO_SECTION" => "Y", 
        "FILTER_NAME" => "arrList",
        "NAV_TEMPLATE" => "",
        "POST_PROPERTY_LIST" => array("UF_BLOG_POST_DOC"),
        "IMAGE_MAX_WIDTH" => "600",
        "IMAGE_MAX_HEIGHT" => "600"
         )	
         );
      echo "</div>";
    }


}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2016-12-11
@dimonchik2013

https://freelansim.ru/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question