/** * index 微博首页 * @author:xjw129xjt(肖骏涛) xjt@ourstu.com */ public function index() { $this->assign('tab', 'index'); $tab_config = get_kanban_config('WEIBO_DEFAULT_TAB', 'enable', array('all', 'concerned', 'hot')); if (!is_login()) { $_key = array_search('concerned', $tab_config); unset($tab_config[$_key]); } //获取参数 $aType = I('get.type', reset($tab_config), 'op_t'); $aUid = I('get.uid', 0, 'intval'); $aPage = I('get.page', 1, 'intval'); if (!in_array($aType, $tab_config)) { $this->error(L('_ERROR_PARAM_')); } $param = array(); //查询条件 $weiboModel = D('Weibo'); $param['field'] = 'id'; if ($aPage == 1) { $param['limit'] = 10; } else { $param['page'] = $aPage; $param['count'] = 30; } $param = $this->filterWeibo($aType, $param); $param['where']['status'] = 1; $param['where']['is_top'] = 0; //查询 $list = $weiboModel->getWeiboList($param); $this->assign('list', $list); // 获取置顶微博 $top_list = $weiboModel->getWeiboList(array('where' => array('status' => 1, 'is_top' => 1))); $this->assign('top_list', $top_list); $this->assign('total_count', $weiboModel->getWeiboCount($param['where'])); $this->assign('page', $aPage); $this->assign('loadMoreUrl', U('loadweibo', array('uid' => $aUid))); $this->assign('type', $aType); $this->assign('tab_config', $tab_config); if ($aType == 'concerned') { $this->assign('title', L('_MY_FOLLOW_')); $this->assign('filter_tab', 'concerned'); } else { if ($aType == 'hot') { $this->assign('title', L('_HOT_WEIBO_')); $this->assign('filter_tab', 'hot'); } else { $this->assign('title', L('_ALL_WEBSITE_FOLLOW_')); $this->assign('filter_tab', 'all'); } } $this->setTitle('{$title}' . L('_LINE_LINE_') . L('_MODULE_')); $this->assignSelf(); if (is_login() && check_auth('Weibo/Index/doSend')) { $this->assign('show_post', true); } $this->display(); }
/** * 获取表情列表。 */ public function getSmile() { $aPkg = I('post.pkg', '', 'op_t'); $expressionMode = M('Core/Expression'); $config = get_kanban_config('PKGLIST', 'enable', array('miniblog'), 'EXPRESSION'); $list = array(); foreach ($config as $v) { $list[] = $expressionMode->getPkgInfo($v); } if (empty($aPkg)) { $first = reset($list); $aPkg = $first['name']; } $data['pkg'] = $aPkg; $data['pkgList'] = $list; $data['expression'] = M('Core/Expression')->getExpression($aPkg); //这段代码不是测试代码,请勿删除 exit(json_encode($data)); }
public function index() { if (is_login()) { } hook('homeIndex'); $default_url = C('DEFUALT_HOME_URL'); //获得配置,如果为空则显示聚合,否则跳转 if ($default_url != '' && strtolower($default_url) != 'home/index/index') { redirect(get_nav_url($default_url)); } $show_blocks = get_kanban_config('BLOCK', 'enable', array(), 'Home'); $this->assign('showBlocks', $show_blocks); $enter = modC('ENTER_URL', '', 'Home'); $this->assign('enter', get_nav_url($enter)); $sub_menu['left'] = array(array('tab' => 'home', 'title' => L('_SQUARE_'), 'href' => U('index'))); $this->assign('sub_menu', $sub_menu); $this->assign('current', 'home'); $this->display(); }
public function config() { $builder = new AdminConfigBuilder(); $data = $builder->handleConfig(); $data['OPEN_LOGIN_PANEL'] = $data['OPEN_LOGIN_PANEL'] ? $data['OPEN_LOGIN_PANEL'] : 1; $builder->title('首页设置'); $modules = D('Common/Module')->getAll(); foreach ($modules as $m) { if ($m['is_setup'] == 1 && $m['entry'] != '') { if (file_exists(APP_PATH . $m['name'] . '/Widget/HomeBlockWidget.class.php')) { $module[] = array('data-id' => $m['name'], 'title' => $m['alias']); } } } $module[] = array('data-id' => 'slider', 'title' => '轮播'); $default = array(array('data-id' => 'disable', 'title' => '禁用', 'items' => $module), array('data-id' => 'enable', 'title' => '启用', 'items' => array())); $builder->keyKanban('BLOCK', '展示模块', '拖拽到右侧以展示这些模块,新的模块安装后会多出一些可操作的项目'); $data['BLOCK'] = $builder->parseKanbanArray($data['BLOCK'], $module, $default); $builder->group('展示模块', 'BLOCK'); $builder->keySingleImage('PIC1', '图片'); $builder->keyText('URL1', '链接'); $builder->keyText('TITLE1', '标题'); $builder->keyRadio('TARGET1', '新窗口打开', '', array('_blank' => '新窗口', '_self' => '本窗口')); $builder->group('幻灯片1', 'PIC1,URL1,TITLE1,TARGET1'); $builder->keySingleImage('PIC2', '图片'); $builder->keyText('URL2', '链接'); $builder->keyText('TITLE2', '标题'); $builder->keyRadio('TARGET2', '新窗口打开', '', array('_blank' => '新窗口', '_self' => '本窗口')); $builder->group('幻灯片2', 'PIC2,URL2,TITLE2,TARGET2'); $builder->keySingleImage('PIC3', '图片'); $builder->keyText('URL3', '链接'); $builder->keyText('TITLE3', '标题'); $builder->keyRadio('TARGET3', '新窗口打开', '', array('_blank' => '新窗口', '_self' => '本窗口')); $builder->group('幻灯片3', 'PIC3,URL3,TITLE3,TARGET3'); $show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home'); $builder->buttonSubmit(); $builder->data($data); $builder->display(); }
public function config() { $builder = new AdminConfigBuilder(); $data = $builder->handleConfig(); $data['OPEN_LOGIN_PANEL'] = $data['OPEN_LOGIN_PANEL'] ? $data['OPEN_LOGIN_PANEL'] : 1; $builder->title(L('_HOME_SETTING_')); $modules = D('Common/Module')->getAll(); foreach ($modules as $m) { if ($m['is_setup'] == 1 && $m['entry'] != '') { if (file_exists(APP_PATH . $m['name'] . '/Widget/HomeBlockWidget.class.php')) { $module[] = array('data-id' => $m['name'], 'title' => $m['alias']); } } } $module[] = array('data-id' => 'slider', 'title' => L('_CAROUSEL_')); $default = array(array('data-id' => 'disable', 'title' => L('_DISABLED_'), 'items' => $module), array('data-id' => 'enable', 'title' => L('_ENABLED_'), 'items' => array())); $builder->keyKanban('BLOCK', L('_DISPLAY_BLOCK_'), L('_TIP_DISPLAY_BLOCK_')); $data['BLOCK'] = $builder->parseKanbanArray($data['BLOCK'], $module, $default); $builder->group(L('_DISPLAY_BLOCK_'), 'BLOCK'); $builder->keySingleImage('PIC1', L('_PICTURE_')); $builder->keyText('URL1', L('_LINK_')); $builder->keyText('TITLE1', L('_TITLE_')); $builder->keyRadio('TARGET1', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_'))); $builder->group(L('_SLIDE1_'), 'PIC1,URL1,TITLE1,TARGET1'); $builder->keySingleImage('PIC2', L('_PICTURE_')); $builder->keyText('URL2', L('_LINK_')); $builder->keyText('TITLE2', L('_TITLE_')); $builder->keyRadio('TARGET2', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_'))); $builder->group(L('_SLIDE2_'), 'PIC2,URL2,TITLE2,TARGET2'); $builder->keySingleImage('PIC3', L('_PICTURE_')); $builder->keyText('URL3', L('_LINK_')); $builder->keyText('TITLE3', L('_TITLE_')); $builder->keyRadio('TARGET3', L('_NEW_WINDOW_OPEN_'), '', array('_blank' => L('_NEW_WINDOW_'), '_self' => L('_SELF_WINDOW_'))); $builder->group(L('_SLIDE3_'), 'PIC3,URL3,TITLE3,TARGET3'); $show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home'); $builder->buttonSubmit(); $builder->data($data); $builder->display(); }
public function config() { $builder = new AdminConfigBuilder(); $data = $builder->handleConfig(); $data['OPEN_LOGIN_PANEL'] = $data['OPEN_LOGIN_PANEL'] ? $data['OPEN_LOGIN_PANEL'] : 1; $builder->title(L('_HOME_SETTING_')); $modules = D('Common/Module')->getAll(); foreach ($modules as $m) { if ($m['is_setup'] == 1 && $m['entry'] != '') { if (file_exists(APP_PATH . $m['name'] . '/Widget/HomeBlockWidget.class.php')) { $module[] = array('data-id' => $m['name'], 'title' => $m['alias']); } } } $module[] = array('data-id' => 'slider', 'title' => L('_CAROUSEL_')); $default = array(array('data-id' => 'disable', 'title' => L('_DISABLED_'), 'items' => $module), array('data-id' => 'enable', 'title' => L('_ENABLED_'), 'items' => array())); $builder->keyKanban('BLOCK', L('_DISPLAY_BLOCK_'), L('_TIP_DISPLAY_BLOCK_')); $data['BLOCK'] = $builder->parseKanbanArray($data['BLOCK'], $module, $default); $builder->group(L('_DISPLAY_BLOCK_'), 'BLOCK'); $show_blocks = get_kanban_config('BLOCK_SORT', 'enable', array(), 'Home'); $builder->buttonSubmit(); $builder->data($data); $builder->display(); }
/** * check_step * @param string $now_step * @return string * @author:xjw129xjt(肖骏涛) xjt@ourstu.com */ function check_step($now_step = '') { $step = get_kanban_config('REG_STEP', 'enable', '', 'USERCONFIG'); if (array_search($now_step, $step)) { $return = $now_step; } else { $return = $step[0]; } return $return; }
public function getPkgList($checkStatus = 1) { $ExpressionPkg = $this->ROOT_PATH . "/Uploads/Expression"; $pkgList = $this->myreaddir($ExpressionPkg); $config = get_kanban_config('PKGLIST', 'enable', array('miniblog'), 'EXPRESSION'); if (!$checkStatus || in_array('miniblog', $config)) { $pkg['miniblog']['status'] = in_array('miniblog', $config) ? 1 : 0; $pkg['miniblog']['title'] = L('_DEFAULT_'); $pkg['miniblog']['name'] = 'miniblog'; $pkg['miniblog']['count'] = $this->getCount($this->ROOT_PATH . '/Application/Core/Static/images/Expression/miniblog'); } foreach ($pkgList as $v) { $file = file_get_contents($ExpressionPkg . '/' . $v . '/info.txt'); $file = json_decode($file, true); if (!$checkStatus || in_array($v, $config)) { $pkg[$v]['title'] = $file['title']; $pkg[$v]['name'] = $v; $pkg[$v]['status'] = in_array($v, $config) ? 1 : 0; $pkg[$v]['count'] = $this->getCount($ExpressionPkg . '/' . $v); } } return $pkg; }