Dynamic Publishing         ...
Block   ...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
$repeat true2    $repeat false      Block      MTIf     smarty_block_TAGNAMEstash Stash 2          Stash Stash          St...
Function     ...
smarty_function_TAGNAMEStash
smarty_function_TAGNAMEStash
smarty_function_TAGNAMEStash
Modifier  ...
smarty_modifier_MODIFIERNAME $text   Modifier
smarty_modifier_MODIFIERNAME $text   Modifier
smarty_modifier_MODIFIERNAME $text   Modifier
$mt = MT::get_instance();$db = $mt->db();$args[‘limit’] = 10;$args[‘offset’] = 10;$entries = $db->fetch_entries( $args );i...
$mt = MT::get_instance();$db = $mt->db();$where = “entry_id = 1 and placement_blog_id = 1”;$extra[‘join’] = array( ‘mt_pla...
$mt = MT::get_instance();$db = $mt->db();$sql = “delete from mt_session”;$db->Execute( $sql );
$mt = MT::get_instance();$db = $mt->db();require_once(‘class.mt_entry.php’);$entry = New Entry;$entry->title = ‘Hello, wor...
$mt = MT::get_instance();$db = $mt->db();require_once(‘class.mt_blog.php’);$blog = New Blog;$blog->Load( ‘blog_id = 1’ );e...
require_once(‘class.baseobject.php’);class NewObject extends BaseObject{   public $_table = ‘mt_newobject’;   protected $_...
•                           BaseObject•• Meta• blog / author / entry                  BaseObject    • entry_id / author_id...
mtdb.base.php     // Construction     public function __construct($user,                       $password = ’,             ...
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
Upcoming SlideShare
Loading in …5
×

Phpで作るmovable typeプラグイン

3,139 views
3,083 views

Published on

PHP

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,139
On SlideShare
0
From Embeds
0
Number of Embeds
630
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Phpで作るmovable typeプラグイン

    1. 1. Dynamic Publishing ...
    2. 2. Block ...
    3. 3. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    4. 4. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    5. 5. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    6. 6. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    7. 7. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    8. 8. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    9. 9. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    10. 10. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    11. 11. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    12. 12. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    13. 13. $repeat true2 $repeat false Block MTIf smarty_block_TAGNAMEstash Stash 2 Stash Stash Stash
    14. 14. Function ...
    15. 15. smarty_function_TAGNAMEStash
    16. 16. smarty_function_TAGNAMEStash
    17. 17. smarty_function_TAGNAMEStash
    18. 18. Modifier ...
    19. 19. smarty_modifier_MODIFIERNAME $text Modifier
    20. 20. smarty_modifier_MODIFIERNAME $text Modifier
    21. 21. smarty_modifier_MODIFIERNAME $text Modifier
    22. 22. $mt = MT::get_instance();$db = $mt->db();$args[‘limit’] = 10;$args[‘offset’] = 10;$entries = $db->fetch_entries( $args );if ( !empty( $entries ) ) { foreach ( $entries as $e ) { // do something... }}
    23. 23. $mt = MT::get_instance();$db = $mt->db();$where = “entry_id = 1 and placement_blog_id = 1”;$extra[‘join’] = array( ‘mt_placement’ => array( ‘condition’ => ‘placement_entry_id = entry_id’ ),);$extra[‘distinct’] = ‘distinct’;$extra[‘limit’] = 1;require_once( ‘class_mt_entry.php’ );$class = New Entry;$entries = $class->Find( $where, false, false, $extra );if ( empty( $entries ) ) return null;$entry = $entries[0];
    24. 24. $mt = MT::get_instance();$db = $mt->db();$sql = “delete from mt_session”;$db->Execute( $sql );
    25. 25. $mt = MT::get_instance();$db = $mt->db();require_once(‘class.mt_entry.php’);$entry = New Entry;$entry->title = ‘Hello, world.”;$entry->blog_id = 1;$entry->author_id = 1;$entry->save();
    26. 26. $mt = MT::get_instance();$db = $mt->db();require_once(‘class.mt_blog.php’);$blog = New Blog;$blog->Load( ‘blog_id = 1’ );echo $blog->id;echo $blog->blog_page_layout;
    27. 27. require_once(‘class.baseobject.php’);class NewObject extends BaseObject{ public $_table = ‘mt_newobject’; protected $_prefix = ‘newobject_’; protected $_has_meta = true;}ADODB_Active_Record::ClassHasMany( NewObject, mt_newobject_meta, newobject_meta_newobject_id);BaseObject::install_meta( ‘newobject’, new_meta_column’, ‘vchar’);
    28. 28. • BaseObject•• Meta• blog / author / entry BaseObject • entry_id / author_id / blog_id
    29. 29. mtdb.base.php // Construction public function __construct($user, $password = ’, $dbname = , $host = , $port = , $sock = ) { $this->id = md5(uniqid(MTDatabase,true)); $this->connect($user, $password, $dbname, $host, $port, $sock); ADOdb_Active_Record::SetDatabaseAdapter( $this->conn); # $this->conn->debug = true; }

    ×