當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Model_Users::getUsername方法代碼示例

本文整理匯總了PHP中Model_Users::getUsername方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model_Users::getUsername方法的具體用法?PHP Model_Users::getUsername怎麽用?PHP Model_Users::getUsername使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Model_Users的用法示例。


在下文中一共展示了Model_Users::getUsername方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getBoardAPP

 public static function getBoardAPP($board_id, $user_id, $username, $url_base, $origen)
 {
     $db = JO_Db::getDefaultAdapter();
     $board = array();
     //carpeta
     if ($origen == "carpeta") {
         //error_log("valor board-". $board_id. "-origen " .$origen,0)  ;
         $query = $db->select()->from('boards')->where('boards.board_id = ?', (int) $board_id);
         $board_id = $db->fetchRow($query);
         if ($board_id) {
             $elemento = $board_id;
             //error_log("valor board ". $board_id,0)  ;
             //foreach($board_id AS $elemento)
             //{
             $username = Model_Users::getUsername($elemento["user_id"]);
             //error_log("valor elemento ". $elemento["title"],0)  ;
             $board['data'][] = array("folderName" => $elemento["title"], "folderUrl" => $url_base . $username . "/" . $elemento['title'], "folderImage" => $elemento["image"]);
             //}
         }
     } elseif ($origen == "pindetail") {
         $query = $db->select()->from('boards')->where('boards.board_id = ?', (int) $board_id)->where('boards.user_id = ?', (int) $user_id);
         $board = $db->fetchRow($query);
         //error_log("valor board-". $board_id['title']. "-origen " .$origen,0)  ;
     } elseif ($origen == "userinfo") {
         $query = $db->select()->from('boards')->where('boards.user_id = ?', (int) $user_id);
         $board_id = $db->fetchAll($query);
         //error_log("valor board ". $board_id,0)  ;
         if ($board_id) {
             //error_log("valor board ". $board_id,0)  ;
             foreach ($board_id as $elemento) {
                 //error_log("valor elemento ". $elemento["title"],0)  ;
                 $board['data'][] = array("folderName" => $elemento["title"], "folderUrl" => $url_base . $username . "/" . $elemento['title'], "folderImage" => $elemento["image"], "folderQty" => $elemento["pins"]);
             }
         }
     } elseif ($origen == "folders") {
         $query = $db->select()->from('boards')->where('boards.user_id = ?', (int) $user_id);
         $board_id = $db->fetchAll($query);
         //error_log("valor board ". $board_id,0)  ;
         if ($board_id) {
             //error_log("valor board ". $board_id,0)  ;
             foreach ($board_id as $elemento) {
                 //error_log("valor elemento ". $elemento["title"],0)  ;
                 $board['data'][] = array("folderid" => $elemento["board_id"], "folderName" => $elemento["title"], "folderUrl" => $url_base . $username . "/" . $elemento['title'], "folderImage" => $elemento["image"]);
             }
         }
     }
     return $board;
 }
開發者ID:noikiy,項目名稱:amatteur,代碼行數:48,代碼來源:Boards.php

示例2: searchAction

 public function searchAction()
 {
     $this->noViewRenderer(true);
     $request = $this->getRequest();
     $response = $this->getResponse();
     $page = (int) $request->getRequest('page');
     if ($page < 1) {
         $page = 1;
     }
     $callback = $request->getRequest('callback');
     if (!preg_match('/^([a-z0-9_.]{1,})$/', $callback)) {
         $callback = false;
     }
     $data = array();
     $url = "";
     $return = array();
     $kind = $request->getRequest('kind');
     $query = $request->getRequest('query');
     $userId = $request->getRequest('userId');
     if ($kind == 0) {
         // pins
         $data = array('start' => JO_Registry::get('config_front_limit') * $page - JO_Registry::get('config_front_limit'), 'limit' => JO_Registry::get('config_front_limit'), 'filter_description' => $query, 'filter_marker' => $request->getRequest('marker'));
         $this->view->pins = '';
         $pins = Model_Pins::getPinsAPP($data);
         if ($pins) {
             $model_images = new Helper_Images();
             foreach ($pins as $pin) {
                 $images = array();
                 $image = call_user_func(array(Helper_Pin::formatUploadModule($pin['store']), 'getPinImage'), $pin, '_B');
                 if ($image) {
                     $images['thumb']['src'] = $image['image'];
                     $images['thumb']['width'] = $image['width'];
                     $images['thumb']['height'] = $image['height'];
                     $images['original'] = $image['original'];
                 }
                 $categorias = array();
                 $categories = Model_Categories::getCategory($pin['category_id']);
                 if ($categories['parent_id'] != 0) {
                     $categorias['category_id'] = $categories['parent_id'];
                     $categorias['subcategory_id'] = $categories['category_id'];
                 } else {
                     $categorias['category_id'] = $categories['category_id'];
                     $categorias['subcategory_id'] = $categories['parent_id'];
                 }
                 $pos = strripos($pin['image'], '.');
                 $return['data'][] = array('pin_id' => $pin['pin_id'], 'pinFooter' => $pin['description'], 'category_id' => $categorias['category_id'], 'subcategory_id' => $categorias['subcategory_id'], 'pinImage' => substr_replace($pin['image'], '_B.', $pos, 1), 'pinWidth' => $pin['width'], 'pinHeight' => $pin['height'], 'pinUrl' => WM_Router::create($request->getBaseUrl() . '?controller=pin&pin_id=' . $pin['pin_id']), 'userId' => $pin['user_id'], 'username' => $pin['username'], 'avatar' => $pin['avatar'], 'userLike' => $pin['liked'], 'pinVideo' => $pin['from']);
             }
             $return['next_page'] = WM_Router::create($request->getBaseUrl() . '?controller=apiv1&action=timeline' . $url);
         }
     } else {
         if ($kind == 1) {
             //boards
             $data = array('start' => JO_Registry::get('config_front_limit') * $page - JO_Registry::get('config_front_limit'), 'limit' => JO_Registry::get('config_front_limit'), 'filter_title' => $query);
             $this->view->pins = '';
             $boards = Model_Boards::getBoards($data);
             if ($boards) {
                 $view = JO_View::getInstance();
                 $view->loged = JO_Session::get('user[user_id]');
                 $view->enable_sort = false;
                 $model_images = new Helper_Images();
                 foreach ($boards as $board) {
                     $board['href'] = WM_Router::create($request->getBaseUrl() . '?controller=boards&action=view&user_id=' . $board['user_id'] . '&board_id=' . $board['board_id']);
                     $board['thumbs'] = array();
                     $get_big = false;
                     for ($i = 0; $i < 5; $i++) {
                         $image = isset($board['pins_array'][$i]) ? $board['pins_array'][$i]['image'] : false;
                         if ($image) {
                             if ($get_big) {
                                 $size = '_A';
                             } else {
                                 $size = '_C';
                                 $get_big = true;
                             }
                             $data_img = Helper_Uploadimages::pin($board['pins_array'][$i], $size);
                             if ($data_img) {
                                 $board['thumbs'][] = $data_img['image'];
                             } else {
                                 $board['thumbs'][] = false;
                             }
                         } else {
                             $board['thumbs'][] = false;
                         }
                     }
                     $board['boardIsFollow'] = Model_Users::isFollow(array('board_id' => $board['board_id']));
                     $board['userFollowIgnore'] = $board['user_id'] != JO_Session::get('user[user_id]');
                     $board['follow'] = WM_Router::create($request->getBaseUrl() . '?controller=boards&action=follow&user_id=' . $board['user_id'] . '&board_id=' . $board['board_id']);
                     $board['edit'] = false;
                     if ($board['user_id'] == JO_Session::get('user[user_id]') || Model_Boards::allowEdit($board['board_id'])) {
                         $board['userFollowIgnore'] = false;
                         $board['edit'] = WM_Router::create($request->getBaseUrl() . '?controller=boards&action=edit&user_id=' . $board['user_id'] . '&board_id=' . $board['board_id']);
                     }
                     $username = Model_Users::getUsername($board["user_id"]);
                     $url_base = WM_Router::create($request->getBaseUrl());
                     $return['data'][] = array('folderId' => $board['board_id'], 'folderName' => $board['title'], 'folderUrl' => $url_base . $username . "/" . $board['title'], 'folderImage' => $board['image'], 'folderQty' => $board['pins']);
                     //$return[] = $board;
                 }
             }
         } else {
             if ($kind == 2) {
                 //people
//.........這裏部分代碼省略.........
開發者ID:noikiy,項目名稱:amatteur,代碼行數:101,代碼來源:Apiv1Controller.php


注:本文中的Model_Users::getUsername方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。