正式更新右侧列表推荐分类

hotfix/paypal-note
Jimmy Liow 2 years ago
parent a5f85155c1
commit 1c8fcdb727

@ -987,7 +987,7 @@ class Information extends CI_Controller
{ {
$information = $this->Information_model->Detail($this->input->get('is_id')); $information = $this->Information_model->Detail($this->input->get('is_id'));
$recommand_information = $this->recommand_information($information); $recommand_information = $this->recommand_information($information);
var_dump($recommand_information); // var_dump($recommand_information);
$tips_right_a = []; $tips_right_a = [];
$tips_right_b = []; $tips_right_b = [];
$tips_right_c = []; $tips_right_c = [];
@ -1521,26 +1521,38 @@ class Information extends CI_Controller
$template = str_replace('<!--@TIPS-RIGHT@-->', "<div class='right_tour'><div class='ah_inforight'>" . $template_recommand['Tips Right']->it_content . "</div></div>", $template); $template = str_replace('<!--@TIPS-RIGHT@-->', "<div class='right_tour'><div class='ah_inforight'>" . $template_recommand['Tips Right']->it_content . "</div></div>", $template);
} }
// 右侧列表广告 // 右侧列表广告
$tipsRightList = []; $tips_right_a = [];
for ($i=1; $i <= 36; $i++) { $tips_right_b = [];
$key = 'List Tips Right '.$i; $tips_right_c = [];
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right A_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) { if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tipsRightList[] = $recommand_information[$key]; $tips_right_a[] = $recommand_information[$key];
}
}
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right B_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_b[] = $recommand_information[$key];
}
}
for ($i=1; $i <= 12; $i++) {
$key = 'List Tips Right C_'.$i;
if (array_key_exists($key, $recommand_information) && $recommand_information[$key]) {
$tips_right_c[] = $recommand_information[$key];
} }
} }
if (!empty($tipsRightList)) { $tips_right_list_content = $this->load->view(
$tips_right_list_content = $this->load->view( 'mobile_first/ah-tips-right-list',
'mobile_first/ah-tips-right-list', array(
array( 'tips_right_a' => $tips_right_a,
'tips_right_first' => array_slice($tipsRightList, 0, 12), 'tips_right_b' => $tips_right_b,
'tips_right_second' => array_slice($tipsRightList, 12, 12), 'tips_right_c' => $tips_right_c),
'tips_right_third' => array_slice($tipsRightList, 24, 12)), true
true );
);
$template = str_replace('<!--@TIPS-RIGHT-LIST@-->', $tips_right_list_content, $template); $template = str_replace('<!--@TIPS-RIGHT-LIST@-->', $tips_right_list_content, $template);
}
//文中的信息推荐 //文中的信息推荐
if (strpos($information->ic_content, '<!--@Content-Recommends-Article@-->') !== false) { if (strpos($information->ic_content, '<!--@Content-Recommends-Article@-->') !== false) {

Loading…
Cancel
Save