echo ""; } else { foreach ($__LIST__ as $key => $vo) { $mod = $i % 2; ++$i; ?> <li> <p><?php echo $vo["title"]; ?> :(<?php echo intval($vo["num"]); ?> 名)</p> <?php echo get_img_html($vo["img"]); ?> <span><?php echo $vo["name"]; ?> </span> </li><?php } } } else { echo ""; } ?> </ul><?php } ?>
function cdbr_get_activity_content_body_callback($content, $activity) { if ($activity->type == 'new_blog_post') { $imgs = get_img_html($content); if (isset($imgs[0])) { $new_content = '<span class="thumbnail">' . $imgs[0] . '</span>'; $new_content .= '<p>' . strip_tags($content, '<a><br>') . '</p>'; $content = $new_content; } } return $content; }
$i = 0; $__LIST__ = $list["list_data"]; if (count($__LIST__) == 0) { echo ""; } else { foreach ($__LIST__ as $key => $product) { $mod = $i % 2; ++$i; ?> <li> <a href="<?php echo addons_url('Shop://Shop/detail', array('id' => $product[id])); ?> "> <div class="img_wrap"><?php echo get_img_html($product["cover"]); ?> <p class="price">¥<?php echo $product["discount_price"]; ?> <del>¥<?php echo $product["market_price"]; ?> </del></p> </div> </a> </li><?php } } } else { echo "";
public function lists() { $this->assign('add_button', false); $this->assign('search_button', false); // 解析列表规则 $fields[] = 'openid'; $fields[] = 'cTime'; $fields[] = 'forms_id'; $girds['field'] = 'uid'; $girds['title'] = '用户'; $list_data['list_grids'][] = $girds; $girds['field'] = 'cTime|time_format'; $girds['title'] = '增加时间'; $list_data['list_grids'][] = $girds; $map['forms_id'] = $this->forms_id; $attribute = M('forms_attribute')->where($map)->order('sort asc, id asc')->select(); foreach ($attribute as &$fd) { $fd['name'] = 'attr_' . $fd['forms_id'] . '_' . $fd['sort']; } foreach ($attribute as $vo) { $girds['field'] = $fields[] = $vo['name']; $girds['title'] = $vo['title']; $list_data['list_grids'][] = $girds; $attr[$vo['name']]['type'] = $vo['type']; if ($vo['type'] == 'radio' || $vo['type'] == 'checkbox' || $vo['type'] == 'select') { $extra = parse_config_attr($vo['extra']); if (is_array($extra) && !empty($extra)) { $attr[$vo['name']]['extra'] = $extra; } } elseif ($vo['type'] == 'cascade' || $vo['type'] == 'dynamic_select') { $attr[$vo['name']]['extra'] = $vo['extra']; } } $fields[] = 'id'; $girds['field'][0] = 'id'; $girds['title'] = '操作'; $girds['href'] = '[DELETE]&forms_id=[forms_id]&id=[id]|删除'; $list_data['list_grids'][] = $girds; $list_data['fields'] = $fields; $param['forms_id'] = $this->forms_id; $param['model'] = $this->model['id']; $add_url = U('add', $param); $this->assign('add_url', $add_url); // 搜索条件 $map = $this->_search_map($this->model, $fields); $page = I('p', 1, 'intval'); $row = 20; $name = parse_name(get_table_name($this->model['id']), true); $list = M($name)->where($map)->order('id DESC')->selectPage(); $list_data = array_merge($list_data, $list); foreach ($list_data['list_data'] as &$vo) { $value = unserialize($vo['value']); foreach ($value as $n => &$d) { $type = $attr[$n]['type']; $extra = $attr[$n]['extra']; if ($type == 'radio' || $type == 'select') { if ($extra) { // $extArr = explode ( ' ', $extra [0] ); $d = $extra[$d]; } } elseif ($type == 'checkbox') { // $extArr = explode ( ' ', $extra); //var_dump($extra[1]); foreach ($d as &$v) { //var_dump($d); if (isset($extra[$v])) { $v = $extra[$v]; } } $d = implode(', ', $d); } elseif ($type == 'datetime') { $d = time_format($d); } elseif ($type == 'picture') { $imgstr = ''; foreach ($d as $p) { $imgstr .= get_img_html($p) . ' '; } $d = $imgstr; // dump($d); // $d = get_cover_url ( $d ); } elseif ($type == 'cascade') { $d = getCascadeTitle($d, $extra); } } unset($vo['value']); $vo = array_merge($vo, $value); $vo['uid'] = get_nickname($vo['uid']); } $this->assign($list_data); //dump ( $list_data ); $this->display(); }
} ?> <?php if (!empty($product["img_4"])) { ?> <li><?php echo get_img_html($product["img_4"]); ?> </li><?php } ?> <?php if (!empty($product["img_5"])) { ?> <li><?php echo get_img_html($product["img_5"]); ?> </li><?php } ?> <!--<li><a href="#"><img src="http://gd4.alicdn.com/bao/uploaded/i4/T1CYpUFcpbXXXXXXXX_!!0-item_pic.jpg_460x460.jpg_.webp"/></a><span class="title">2014春装新款韩版女装宽松休闲打底显瘦长袖雪纺衬衫上衣衬衣</span></li>--> </ul> <span class="identify"> <?php if (!empty($product["img_1"])) { ?> <em></em><?php } ?> <?php