個人用ツール

「ver4/関数リファレンス/getBlogs」の版間の差分

提供: baserCMS公式ガイド

移動: 案内, 検索
行33: 行33:
 
全ブログの情報が配列で出力される
 
全ブログの情報が配列で出力される
  
 +
<syntaxhighlight lang="php">
 +
array(3) {
 +
  [0]=>
 +
  array(23) {
 +
    ["id"]=>
 +
    string(1) "1"
 +
    ["name"]=>
 +
    string(4) "news"
 +
    ["title"]=>
 +
    string(12) "新着情報"
 +
    ["description"]=>
 +
    string(65) "baserCMS inc. [デモ] の最新の情報をお届けします。"
 +
    ["layout"]=>
 +
    string(7) "default"
 +
    ["template"]=>
 +
    string(7) "default"
 +
    ["status"]=>
 +
    bool(true)
 +
    ["list_count"]=>
 +
    string(2) "10"
 +
    ["list_direction"]=>
 +
    string(4) "DESC"
 +
    ["feed_count"]=>
 +
    string(2) "10"
 +
    ["tag_use"]=>
 +
    bool(true)
 +
    ["comment_use"]=>
 +
    string(1) "1"
 +
    ["comment_approve"]=>
 +
    string(1) "0"
 +
    ["auth_captcha"]=>
 +
    bool(true)
 +
    ["widget_area"]=>
 +
    string(1) "2"
 +
    ["exclude_search"]=>
 +
    bool(false)
 +
    ["use_content"]=>
 +
    bool(true)
 +
    ["created"]=>
 +
    string(19) "2016-02-02 21:01:37"
 +
    ["modified"]=>
 +
    NULL
 +
    ["eye_catch_size_thumb_width"]=>
 +
    string(3) "300"
 +
    ["eye_catch_size_thumb_height"]=>
 +
    string(3) "300"
 +
    ["eye_catch_size_mobile_thumb_width"]=>
 +
    string(3) "100"
 +
    ["eye_catch_size_mobile_thumb_height"]=>
 +
    string(3) "100"
 +
  }
 +
  [1]=>
 +
  array(23) {
 +
    ["id"]=>
 +
    string(1) "2"
 +
    ["name"]=>
 +
    string(6) "course"
 +
    ["title"]=>
 +
    string(6) "講座"
 +
  //  (省略)
 +
  }
 +
  [2]=>
 +
  array(23) {
 +
    ["id"]=>
 +
    string(1) "3"
 +
    ["name"]=>
 +
    string(10) "staff-blog"
 +
    ["title"]=>
 +
    string(21) "スタッフブログ"
 +
  //  (省略)
 +
  }
 +
}
 +
</syntaxhighlight>
 
### 応用
 
### 応用
 
####コード
 
####コード
行42: 行115:
 
####出力
 
####出力
 
news ブログの情報が配列出力される
 
news ブログの情報が配列出力される
 +
 +
<syntaxhighlight lang="php">
 +
array(3) {
 +
  [0]=>
 +
  array(23) {
 +
    ["id"]=>
 +
    string(1) "1"
 +
    ["name"]=>
 +
    string(4) "news"
 +
    ["title"]=>
 +
    string(12) "新着情報"
 +
    ["description"]=>
 +
    string(65) "baserCMS inc. [デモ] の最新の情報をお届けします。"
 +
    ["layout"]=>
 +
    string(7) "default"
 +
    ["template"]=>
 +
    string(7) "default"
 +
    ["status"]=>
 +
    bool(true)
 +
    ["list_count"]=>
 +
    string(2) "10"
 +
    ["list_direction"]=>
 +
    string(4) "DESC"
 +
    ["feed_count"]=>
 +
    string(2) "10"
 +
    ["tag_use"]=>
 +
    bool(true)
 +
    ["comment_use"]=>
 +
    string(1) "1"
 +
    ["comment_approve"]=>
 +
    string(1) "0"
 +
    ["auth_captcha"]=>
 +
    bool(true)
 +
    ["widget_area"]=>
 +
    string(1) "2"
 +
    ["exclude_search"]=>
 +
    bool(false)
 +
    ["use_content"]=>
 +
    bool(true)
 +
    ["created"]=>
 +
    string(19) "2016-02-02 21:01:37"
 +
    ["modified"]=>
 +
    NULL
 +
    ["eye_catch_size_thumb_width"]=>
 +
    string(3) "300"
 +
    ["eye_catch_size_thumb_height"]=>
 +
    string(3) "300"
 +
    ["eye_catch_size_mobile_thumb_width"]=>
 +
    string(3) "100"
 +
    ["eye_catch_size_mobile_thumb_height"]=>
 +
    string(3) "100"
 +
  }
 +
}
 +
</syntaxhighlight>
  
 
## 注
 
## 注

2017年5月23日 (火) 18:14時点における版

[このコンテンツは内容調整中です]

説明

ブログの基本情報(説明、設定、表示件数、コメント許可など)を全て取得する。

使い方

$this->BcBaser->getBlogs( $name , [$options] );

パラメータ

(string) $name
ブログアカウント名を指定するとそのブログのみの基本情報を返す。空指定(default)で、全てのブログの基本情報。
ex) 'news' (初期値 :’ ’ )
(array) $options オプション(初期値 :array())
sort : データのソート順 取得出来るフィールドのどれかでソートができる ex) 'created DESC'(初期値 : 'id')
siteId : サブサイトIDで絞り込む場合に指定する(初期値:0

戻り値

(array)
サイト基本設定配列

用例

基本

コード

<?php var_dump($this->BcBaser->getBlogs()); ?>

出力

全ブログの情報が配列で出力される

array(3) {
  [0]=>
  array(23) {
    ["id"]=>
    string(1) "1"
    ["name"]=>
    string(4) "news"
    ["title"]=>
    string(12) "新着情報"
    ["description"]=>
    string(65) "baserCMS inc. [デモ] の最新の情報をお届けします。"
    ["layout"]=>
    string(7) "default"
    ["template"]=>
    string(7) "default"
    ["status"]=>
    bool(true)
    ["list_count"]=>
    string(2) "10"
    ["list_direction"]=>
    string(4) "DESC"
    ["feed_count"]=>
    string(2) "10"
    ["tag_use"]=>
    bool(true)
    ["comment_use"]=>
    string(1) "1"
    ["comment_approve"]=>
    string(1) "0"
    ["auth_captcha"]=>
    bool(true)
    ["widget_area"]=>
    string(1) "2"
    ["exclude_search"]=>
    bool(false)
    ["use_content"]=>
    bool(true)
    ["created"]=>
    string(19) "2016-02-02 21:01:37"
    ["modified"]=>
    NULL
    ["eye_catch_size_thumb_width"]=>
    string(3) "300"
    ["eye_catch_size_thumb_height"]=>
    string(3) "300"
    ["eye_catch_size_mobile_thumb_width"]=>
    string(3) "100"
    ["eye_catch_size_mobile_thumb_height"]=>
    string(3) "100"
  }
  [1]=>
  array(23) {
    ["id"]=>
    string(1) "2"
    ["name"]=>
    string(6) "course"
    ["title"]=>
    string(6) "講座"
  //  (省略)
  }
  [2]=>
  array(23) {
    ["id"]=>
    string(1) "3"
    ["name"]=>
    string(10) "staff-blog"
    ["title"]=>
    string(21) "スタッフブログ"
  //  (省略)
  }
}

応用

コード

(例)news ブログの場合

<?php var_dump($this->BcBaser->getBlogs('news')); ?>

出力

news ブログの情報が配列出力される

array(3) {
  [0]=>
  array(23) {
    ["id"]=>
    string(1) "1"
    ["name"]=>
    string(4) "news"
    ["title"]=>
    string(12) "新着情報"
    ["description"]=>
    string(65) "baserCMS inc. [デモ] の最新の情報をお届けします。"
    ["layout"]=>
    string(7) "default"
    ["template"]=>
    string(7) "default"
    ["status"]=>
    bool(true)
    ["list_count"]=>
    string(2) "10"
    ["list_direction"]=>
    string(4) "DESC"
    ["feed_count"]=>
    string(2) "10"
    ["tag_use"]=>
    bool(true)
    ["comment_use"]=>
    string(1) "1"
    ["comment_approve"]=>
    string(1) "0"
    ["auth_captcha"]=>
    bool(true)
    ["widget_area"]=>
    string(1) "2"
    ["exclude_search"]=>
    bool(false)
    ["use_content"]=>
    bool(true)
    ["created"]=>
    string(19) "2016-02-02 21:01:37"
    ["modified"]=>
    NULL
    ["eye_catch_size_thumb_width"]=>
    string(3) "300"
    ["eye_catch_size_thumb_height"]=>
    string(3) "300"
    ["eye_catch_size_mobile_thumb_width"]=>
    string(3) "100"
    ["eye_catch_size_mobile_thumb_height"]=>
    string(3) "100"
  }
}

変更履歴

ソースファイル

関連資料

類似の関数