Esempio n. 1
0
 /**
  * 智能跳转
  * 用于热门关键词的智能检索,优先搜团购->商品->优惠券->活动->商家->分享,如都没有提示没有相关数据
  */
 public function jump()
 {
     $kw = strim($_REQUEST['kw']);
     if ($kw) {
         $param['kw'] = $kw;
         $condition_param['city_id'] = $GLOBALS['city']['id'];
         global_run();
         //先验证团购
         require_once APP_ROOT_PATH . "system/model/deal.php";
         $ext_condition = "  d.buy_type <> 1 and d.is_shop = 0 ";
         $ext_condition .= " and d.name like '%" . $kw . "%' ";
         if (get_deal_count(array(DEAL_ONLINE, DEAL_NOTICE), $condition_param, "", $ext_condition)) {
             app_redirect(url("index", "tuan", $param));
         } else {
             //商品
             $ext_condition = "  d.buy_type <> 1 and d.is_shop = 1 ";
             $ext_condition .= " and d.name like '%" . $kw . "%' ";
             if (get_goods_count(array(DEAL_ONLINE, DEAL_NOTICE), $condition_param, "", $ext_condition)) {
                 app_redirect(url("index", "cate", $param));
             } else {
                 //优惠券
                 require_once APP_ROOT_PATH . "system/model/youhui.php";
                 $ext_condition = " y.name like '%" . $kw . "%' ";
                 if (get_youhui_count(array(YOUHUI_NOTICE, YOUHUI_ONLINE), $condition_param, "", $ext_condition)) {
                     app_redirect(url("index", "youhuis", $param));
                 } else {
                     //活动
                     require_once APP_ROOT_PATH . "system/model/event.php";
                     $ext_condition = " e.name like '%" . $kw . "%' ";
                     if (get_event_count(array(EVENT_NOTICE, EVENT_ONLINE), $condition_param, "", $ext_condition)) {
                         app_redirect(url("index", "events", $param));
                     } else {
                         //商家
                         require_once APP_ROOT_PATH . "system/model/supplier.php";
                         $ext_condition = " sl.name like '%" . $kw . "%' ";
                         $rs = get_location_list(1, $condition_param, "", $ext_condition);
                         if ($rs['list']) {
                             app_redirect(url("index", "stores", $param));
                         } else {
                             app_redirect(url("index", "discover", $param));
                         }
                     }
                 }
             }
         }
     } else {
         app_redirect(url("index"));
     }
 }
Esempio n. 2
0
echo get_news_count('pending');
?>
 Pending
          </td>
        </tr>
        <tr>
          <td valign="top"><strong><?php 
echo get_event_count();
?>
 Event(s)</strong></td>
          <td valign="top">
          		<?php 
echo get_event_count('active');
?>
 Published<br />
             	<?php 
echo get_event_count('pending');
?>
 Pending
          </td>
        </tr>
      </table>
      </div>
    </div>
    </div>
</div>
-->
</div>
</body>
</html>
Esempio n. 3
0
?>
	</div>
</div>

<div class="filter-list sub year <?php 
echo $slug;
?>
" data-filter="year">
	<div class="options">
		<?php 
$start_date = 2010;
$end_date = date('Y');
$years = array_reverse(range($start_date, $end_date));
foreach ($years as $year) {
    $filter_url = query_url('date', $year, $page_url);
    $year_count = get_event_count('year', $year);
    if ($year_count != 0) {
        $classes = 'year';
        if ($year == $year_param) {
            $classes .= ' selected';
        }
        echo '<div class="option ' . $classes . '">';
        echo '<a href="' . $filter_url . '" data-value="' . $year . '">';
        echo $year;
        echo '<div class="swap">';
        echo '<div class="icon default"></div>';
        echo '<div class="icon hover"></div>';
        echo '</div>';
        echo '</a>';
        echo '</div>';
    }