public function search() { BookModule::getList(); }
public function album() { global $_FANWE; $count_result = BookModule::searchInfo(); $count = $count_result['album_count']; $kwy_word = urldecode($_FANWE['request']['kw']); $page_num = intval($_FANWE['setting']['share_search_page']) ? intval($_FANWE['setting']['share_search_page']) : 30; $is_root = false; $img_width = 190; if (!empty($kwy_word)) { $match_key = segmentToUnicode($kwy_word, '+'); $share_condition = " WHERE match(album_title_match) against('" . $match_key . "' IN BOOLEAN MODE) "; } $limit = $page_num; $sql = 'SELECT * FROM ' . FDB::table("album") . $share_condition . "\r\n\t\t\t\tORDER BY id DESC LIMIT " . $limit; $album_list = FDB::fetchAll($sql); if ($album_list) { $list = array(); $current_user = array(); $current_user['u_url'] = FU('u/index', array('uid' => $_FANWE['uid'])); $current_user['avt'] = avatar($_FANWE['uid'], 's', $is_src = 1); foreach ($album_list as $k => $v) { $album_list[$k]['imgs'] = array(); $img_sql = "select sp.img as img from " . FDB::table("share_photo") . " as sp left join " . FDB::table("album_share") . " as als on als.share_id = sp.share_id left join " . FDB::table("album") . " as a on a.id = als.album_id where a.id = " . $v['id']; $res_img = FDB::query($img_sql); $photo_data = array(); while ($img_data = FDB::fetch($res_img)) { $photo_data[] = $img_data['img']; } $album_list[$k]['url'] = FU('album/show', array('id' => $v['id'])); $album_list[$k]['is_follow_album'] = FS('album')->getIsFollow($v['id'], $_FANWE['uid']); $album_list[$k]['is_Me'] = $v['uid'] == $_FANWE['uid'] ? 1 : 0; $album_list[$k]['album_imgs'] = $photo_data; } } $link_url = $_FANWE['site_url'] . "services/service.php?m=search&a=album&width=190&p=2&kwy_word=" . $kwy_word; $json_url = $_FANWE['site_url'] . "services/service.php?m=search&a=album&width=190&kwy_word=" . $kwy_word; include template('page/book/book_index'); display(); }
$actions = array('cate', 'shopping', 'search', 'dapei', 'look'); if (isset($_REQUEST['action'])) { $action = strtolower($_REQUEST['action']); if (!in_array($action, $actions)) { $action = 'shopping'; } } define('ACTION_NAME', $action); require dirname(__FILE__) . '/core/fanwe.php'; $fanwe =& FanweService::instance(); $fanwe->initialize(); require fimport('module/book'); switch (ACTION_NAME) { case 'cate': BookModule::cate(); break; case 'shopping': BookModule::shopping(); break; case 'search': BookModule::search(); break; case 'dapei': define('IS_DAPAI', true); BookModule::dapei(); break; case 'look': define('IS_DAPAI', true); BookModule::look(); break; }
<?php define('MODULE_NAME', 'Book'); $actions = array('share', 'user', 'album'); if (isset($_REQUEST['action'])) { $action = strtolower($_REQUEST['action']); if (!in_array($action, $actions)) { $action = 'share'; } } define('ACTION_NAME', $action); require dirname(__FILE__) . '/core/fanwe.php'; $fanwe =& FanweService::instance(); $fanwe->initialize(); require fimport('module/book'); switch (ACTION_NAME) { case 'share': BookModule::share(); break; case 'user': BookModule::user(); break; case 'album': BookModule::album(); break; }