The method of getting browsing History by Imperial CMS
This article is about how Imperial CMS obtains browsing history. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.
How does Imperial CMS get browsing history?
The method steps are as follows:
First, add the following code to e/class/userfun.php:
The code is as follows:
Function user_SetCook ($name,$id,$time=0,$num=10) {/ / cookie name ID timestamp quantity if (! $id) {printerror2 ('nonexistent product record', $_ SERVER ['HTTP_REFERER']);} $prodq=$id.' |'; $projilu=getcvar ($name); if ($projilu) {$prozuhe=$prodq.$projilu;// put newly browsed on the first $pro_arr=explode ('|', $prozuhe); $new_arr=array_merge (array_unique ($pro_arr)) / / remove duplicates and re-index subscript foreach ($new_arr as $key= > $val) {if (($keyquery ("select id,title,titlepic,titleurl from {$dbtbpre} ecms_ {$tbname} where idin ({$jilu_idin}) order by find_in_set (id,' {$jilu_idin}') limit {$num}"); / / sort while ($jilu_r=$empire- > fetch ($sql)) {$titleurl=sys_ReturnBqTitleLink ($jilu_r) in idin; echo'. $jilu_ r [title]. / / here, to modify the style, you need to add your own picture}}
Second, add the following code to the top of the content template:
The code is as follows:
Three: add the following code where it needs to be displayed:
The code is as follows:
Where:
Cookiepro is the name
Shop is the name of the data table
10 is the number of calls
Thank you for reading! This is the end of the way for Imperial CMS to obtain browsing records. I hope the above content can be of some help to you so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.