Your SlideShare is downloading. ×
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Ruby on discuz
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ruby on discuz

4,311

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,311
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
38
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • 積分制度 ..etc
  • 積分制度 ..etc
  • 積分制度 ..etc
  • 積分制度 ..etc
  • 積分制度 ..etc
  • 積分制度 ..etc
  • Transcript

    • 1.
        Ruby on Discuz!
        Ryudo in Ruby Tuesday 2010.05.18
      用 Ruby 擴充論壇的社群功能
    • 2.
        自我 介紹
    • 3.
        鄧慕凡
        Mu-Fan Teng
    • 4.
        我的 工作
    • 5.
        遊戲 開發
        Ex-Game Developer
    • 6.  
    • 7.  
    • 8.
        網站 開發
        WEB Developer
    • 9.
        網站 維運
        WEB Operation
    • 10.
        FREEBBS.TW
    • 11.
        GAMECLUB.TW
    • 12.
        網路社群型態
    • 13.
        論壇
        Forum
    • 14.
        部落格
        Blog
    • 15.
        Google Trends(TW)
    • 16.
        最強的論壇系統
    • 17.
        DISCUZ!
    • 18.
        唯一 華人製作
        180 多人的大公司
    • 19.
        華人地區市場獨佔
    • 20.
        還是 Google Trends
    • 21.
        哪些網站使用 DZ?
    • 22.
        YAHOO 網站排行榜前 10 名
    • 23.
        YAHOO 網站排行榜 11~20 名
    • 24.
        Rails 界也有
    • 25. RailsFUN.TW
    • 26.
        受歡迎的原因
    • 27.
        符合華人使用習慣
    • 28.
         
         
        用戶組制度 + 積分制度
    • 29.
        論壇行為和積分掛勾
    • 30.
        積分可以讓 USER 升級
    • 31.
        會員間可以交易積分
    • 32.
        滿足資源論壇需求
    • 33.
        滿足 USER 升級的虛榮心
    • 34.
        插件 / 主題資源眾多
    • 35.
        效能 強大
    • 36.
        在 DZ 上開發功能
    • 37.  
    • 38.
        省事 !
    • 39.
      • LAYOUT 元件
        • 數千種佈景主題可供選用
    • 43.
        跨語言的 DRY 實現
    • 44.
        開始進入 技術層面
    • 45.
        呈現的方式
    • 46.
        INSIDE of DISCUZ!(AJAX)
    • 47.
      • 不用自行處理登入登出
      • 48. 不用 render 整頁
      • 49. 容易一體化
      • 50. 和頁面元素可互動
        優點
    • 51.
      • REQUEST 次數多
      • 52. 須修改 DZ 的樣板來達到 AJAX
      • 53. 切頁問題
      • 54. LAYOUT 會被污染
        缺點
    • 55.
        INSIDE of DISCUZ!(Iframe)
    • 56.
      • 不用自行處理登入登出
      • 57. LAYOUT 不會被污染
        優點
    • 58.
        • 回應慢 (2 個完整頁 )
        • 59. 一樣得修改樣板
        • 60. 無法和頁面互動
        • 61. 自己處理認證
        缺點
    • 62.
        OUTSIDE of DISCUZ!
    • 63.
        • 完全掌控頁面
        • 64. 回應快
        • 65. 不用更改 DZ 樣板
        優點
    • 66.
        • 得自己處理認證
        • 67. 花時間模仿 DZ 的 HTML
        缺點
    • 68.
        從共用 Host 開始
    • 69.
        WEB 伺服器的選擇
    • 70.
    • 71.
        Rails APP as Sub-URI
    • 72.
        Mixed together
    • 73.
        PHP deploy on SUB-URI
    • 74.
        Config file of Discuz!
    • 75.
        Map DB to ARecord
      • Set Primary Key and Table Name
      • 76. Set emulate_booleans to false
      • 77. Set inheritance_column to nil.
        class Forum < ActiveRecord :: Base
        set_table_name 'cdb_forums' set_inheritance_column nil set_primary_key 'fid' connection.emulate_booleans = false default_scope :conditions => [ &quot;type = ? &quot; , 'forum' ] belongs_to :group , :class_name => 'ForumGroup' , :foreign_key => :fup has_many :children , :class_name => 'SubForum' , :foreign_key => :fup
        end
    • 78.
        Session
    • 79.
        Session Table
        • Caches username
        • 80. Update lastactivity to avoid session lost.
    • 81.
        Session Key(1)
        cookies[:#{cookie_pre}_sid]
        • Primary Key of session table
        • 82. Auto generated when you enter any page of DZ!
        • 83. Not persistent.
    • 84.
        Session key(2)
        cookies[:#{cookie_pre}_auth]
        • Include login information
        • 85. Could recover login session by decoding it.
        • 86. Persistent.
    • 87.
        Session of Admin
        table: #{table_prefix}_adminsessions
        • Primary Key is also foreign key
        • 88. Have 1 to 1 relation with session table
        • 89. Available only if administrator logged in backend.
    • 90.
        Log in/out Process
      • URI:/logging.php?action=(login/logout)
      • 91. Log out request(get) must with the formhash param.
    • 92.
        Auth. Flow of logon
    • 93.
        Member(1)
        table: #{table_prefix}_members
    • 94.
        Member(2)
        • MD5.hexdigest(username) = Password
        • 95. Field 「 credits 」 means 積分
        • 96. Field extcredits1..8
    • 97.
        MemberField
      • Additional fields for member
      • 98. Column can be added automatically in DISCUZ!.
      • 99. Manually added field names are fields1..2~
      • 100. Able to find column metadata from profilefields table.
        table: #{table_prefix}_memberfields
    • 101.
        Forum Models(1)
      • table: #{table_prefix}_forums
      • 102. 3 models share one table.
    • 103.
        Forum Models(2)
    • 104.
        Forum Table
      • Fid: Primary Key
      • 105. Fup: foreign_key for Forum and SubForum
      • 106. Type:
          • group => 論壇分類
          • 107. forum => 論壇
          • 108. sub => 子論壇
    • 109.
        ForumGroup( 論壇分類 )
        class ForumGroup < ActiveRecord :: Base
        set_table_name 'cdb_forums' set_inheritance_column nil set_primary_key 'fid' connection.emulate_booleans = false default_scope :conditions => [ &quot;type = ? &quot; , 'group' ] has_many :forums , :class_name => 'Forum' , :foreign_key => 'fup'
        end
    • 110.
        ForumGroup( 論壇 )
        class Forum < ActiveRecord :: Base
        set_table_name 'cdb_forums' set_inheritance_column nil set_primary_key 'fid' connection.emulate_booleans = false default_scope :conditions => [ &quot;type = ? &quot; , 'forum' ] belongs_to :group , :class_name => 'ForumGroup' , :foreign_key => :fup has_many :children , :class_name => 'SubForum' , :foreign_key => :fup
        end
    • 111.
        SubForum ( 子論壇 )
        class SubForum < ActiveRecord :: Base
        set_table_name 'cdb_forums' set_inheritance_column nil set_primary_key 'fid' connection.emulate_booleans = false default_scope :conditions => [ &quot;type = ? &quot; , 'sub' ] belongs_to :forum , :class_name => 'Forum' , :foreign_key => :fup
        end
    • 112.
        Topic Models
    • 113.
        Topic( 主題 ) Table(1)
      • Table Name : #{prefix}_threads
      • 114. Primary Key : tid
      • 115. Class Name can’t be 「 Thread 」
      • 116. Belongs to Forum and SubForum
    • 117.
        Topic Table(2)
        class Topic < ActiveRecord :: Base
        set_table_name 'cdb_threads' set_primary_key 'tid' connection.emulate_booleans = false belongs_to :forum , :foreign_key => :fid belongs_to :sub_forum , :foreign_key => :fid has_many :posts , :foreign_key => :tid
        end
    • 118.
        Post( 帖 ) Table
      • Table Name : #{prefix}_posts
      • 119. Primary Key : pid
      • 120. Caches fid value from Topic.
      • 121. Field 「 first 」 means first post(1) or not(0)
      • 122. Each post can have its own subject
      • 123. Field 「 htmlon 」 means escape HTML or not.
    • 124.
        Topic Table(2)
        class Post < ActiveRecord :: Base
        set_table_name 'cdb_posts' set_primary_key 'pid' connection.emulate_booleans = false belongs_to :forum , :foreign_key => :fid belongs_to :sub_forum , :foreign_key => :fid belongs_to :topic , :foreign_key => :tid named_scope :html_escaped , :conditions => 'htmlon = 0' named_scope :html_not_escaped , :conditions => 'htmlon = 1' named_scope :first , :conditions => 'first = 1' named_scope :not_first , :conditions => 'first <> 1'
        end
    • 125.
        Build Layout by DZ styles
      • Get Session data row and styleid
      • 126. Link 「 /forumdata/cache/style_#{styleid}.css 」
      • 127. Customize Paginate Renderer for WillPaginate to make DZ-Style Paginate DIV.
        class DiscuzLinkRenderer < WillPaginate :: LinkRenderer
        ...
        end
    • 128.
        END

    ×