public function execute($plugins) { $header = get_page_header(); $this->assign('header', $header); $side_bar_menu = $this->get_side_bar_menu(); $this->assign('side_bar_menu', $side_bar_menu); $this->exchangeModel = $this->loadAppModel('Exchange'); $this->inviteHoldLogModel = $this->loadModel('Invite_hold_log'); $this->inviteHoldExceptionModel = $this->loadModel('Invite_hold_exception'); $this->userModel = $this->loadAppModel('User'); $this->configModel = C('global.php'); $this->operateLogModel = $this->loadModel('Operate_log', array(), 'admin'); $GLOBALS['THRIFT_ROOT'] = '../thriftlib'; require_once $GLOBALS['THRIFT_ROOT'] . '/Thrift.php'; require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php'; require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TBufferedTransport.php'; require_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php'; require_once $GLOBALS['THRIFT_ROOT'] . '/packages/user_service/UserService.php'; //包含thrift客户端库文件 $socket = new TSocket(_PUSH_ANDROID_TSOCKET_USER, 9091); $this->transport = new TBufferedTransport($socket, 1024, 1024); $protocol = new TBinaryProtocol($this->transport); $this->userClient = new UserServiceClient($protocol); }
<?php get_page_header(); if (!wp_is_mobile()) { ?> <div id="myCarousel" class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol class="carousel-indicators"> <?php #get the amount of top stories, then output the correct amount #of indicators for the carousel. $a = query_posts('category_name=Top Stories'); $top_story_count = count($a); for ($x = 0; $x < $top_story_count; $x++) { if ($x == 0) { $class_string = 'class="active"'; } else { $class_string = ''; } $str = "\n<li data-target=\"#myCarousel\" data-slide-to=\"" . $x . "\" " . $class_string . "></li>"; echo $str; } ?> </ol> <div class="carousel-inner" role="listbox"> <?php #this is a counter for the 'active' css to be placed on the first carousel slide object. #there is probably a better way to do this, but this will work. static $x = 0; ?> <?php