- 1.
- Ryudo in Ruby Tuesday 2010.05.18
Ruby
2.
3.
4.
5.
6. 7. 8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25. RailsFUN.TW 26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37. 38.
39.
40. 41. / 42. 43.
44.
45.
46.
47.
48. render 49. 50.
51.
52. DZ AJAX 53. 54. LAYOUT
55.
- INSIDE of DISCUZ!(Iframe)
56.
57. LAYOUT
58.
60. 61.
62.
63.
65. DZ
66.
68.
69.
70.
71.
72.
73.
74.
75.
- Set Primary Key and Table Name
76. Set emulate_booleans to false 77. Set inheritance_column to
nil.
- set_table_name'cdb_forums' set_inheritance_columnnil
set_primary_key'fid' connection.emulate_booleans =false
default_scope:conditions=> [ "type = ? " ,'forum' ]
belongs_to:group ,:class_name=>'ForumGroup'
,:foreign_key=>:fup has_many:children
,:class_name=>'SubForum' ,:foreign_key=>:fup
78.
79.
-
- 80. Update lastactivity to avoid session lost.
81.
- cookies[:#{cookie_pre}_sid]
-
- Primary Key of session table
- 82. Auto generated when you enter any page of DZ!
83. Notpersistent. 84.
- cookies[:#{cookie_pre}_auth]
-
- Include login information
- 85. Could recover login session by decoding it.
86. Persistent. 87.
- 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.
- URI:/logging.php?action=(login/logout)
91. Log out request(get) must with the formhash param. 92.
93.
- table: #{table_prefix}_members
94.
-
- MD5.hexdigest(username) = Password
- 95. Field creditsmeans
96. Field extcredits1..8 97.
- 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.
- table: #{table_prefix}_forums
102. 3 models share one table. 103.
104.
105. Fup: foreign_key for Forum and SubForum 106. Type:
109.
- set_table_name'cdb_forums' set_inheritance_columnnil
set_primary_key'fid' connection.emulate_booleans =false
default_scope:conditions=> [ "type = ? " ,'group' ]
has_many:forums ,:class_name=>'Forum'
,:foreign_key=>'fup'
110.
- set_table_name'cdb_forums' set_inheritance_columnnil
set_primary_key'fid' connection.emulate_booleans =false
default_scope:conditions=> [ "type = ? " ,'forum' ]
belongs_to:group ,:class_name=>'ForumGroup'
,:foreign_key=>:fup has_many:children
,:class_name=>'SubForum' ,:foreign_key=>:fup
111.
- set_table_name'cdb_forums' set_inheritance_columnnil
set_primary_key'fid' connection.emulate_booleans =false
default_scope:conditions=> [ "type = ? " ,'sub' ]
belongs_to:forum ,:class_name=>'Forum'
,:foreign_key=>:fup
112.
113.
- Table Name : #{prefix}_threads
114. Primary Key : tid 115. Class Name cant be Thread 116.
Belongs to Forum and SubForum 117.
- 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
118.
- 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.
- 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'
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.
128.