N
N
NeveR3d2017-09-27 14:57:33
PHP
NeveR3d, 2017-09-27 14:57:33

Display the last viewed news?

There is a module that displays news in the block that have been viewed, but they are displayed as added to the site. Is it possible to make them appear the way a person looked at them, i.e. fresh on the left.

if( ! defined( 'DATALIFEENGINE' ) ) return;
$limit = is_numeric($limit) ? intval($limit) : 5;
$newsid = is_numeric($newsid) ? intval($newsid) : false;
if(!$newsid) return;
if($dle_module == "showfull")
{
  if(isset($_COOKIE['senpainoticeme']))
  {
    $array_senpainoticeme = explode(",",$_COOKIE['senpainoticeme']);
    array_unshift($array_senpainoticeme, $newsid);
    $array_senpainoticeme = array_unique($array_senpainoticeme);
    if(count($array_senpainoticeme) > $limit)
      $array_senpainoticeme = array_slice($array_senpainoticeme, 0, $limit, true);
    $array_senpainoticeme = implode(",", $array_senpainoticeme);
    set_cookie("senpainoticeme", $array_senpainoticeme, 7);
  }
  else
    set_cookie("senpainoticeme", $newsid, 7);
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question