Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -529,6 +529,7 @@ |
530 | 530 | $wgExtNewTables[] = array( 'flaggedrevs_tracking', "$base/archives/patch-flaggedrevs_tracking.sql" ); |
531 | 531 | $wgExtNewFields[] = array( 'flaggedpages', 'fp_pending_since', "$base/archives/patch-fp_pending_since.sql" ); |
532 | 532 | $wgExtNewFields[] = array( 'reader_feedback', 'rfb_timestamp', "$base/archives/patch-rfb_timestamp.sql" ); |
| 533 | + $wgExtNewFields[] = array( 'reader_feedback', 'rfb_ratings', "$base/archives/patch-rfb_ratings.sql" ); |
533 | 534 | } else if( $wgDBtype == 'postgres' ) { |
534 | 535 | $wgExtNewTables[] = array( 'flaggedrevs', "$base/FlaggedRevs.pg.sql" ); // Inital install tables |
535 | 536 | $wgExtPGNewFields[] = array('flaggedpage_config', 'fpc_expiry', "TIMESTAMPTZ NULL" ); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.sql |
— | — | @@ -126,6 +126,8 @@ |
127 | 127 | rfb_user integer NOT NULL, |
128 | 128 | rfb_ip varchar(255) NOT NULL default '', |
129 | 129 | rfb_timestamp char(14) NOT NULL default '', |
| 130 | + --Vote info |
| 131 | + rfb_ratings mediumblob NOT NULL, |
130 | 132 | -- No double voting! |
131 | 133 | PRIMARY KEY (rfb_rev_id,rfb_user,rfb_ip) |
132 | 134 | ) /*$wgDBTableOptions*/; |
Index: trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php |
— | — | @@ -226,12 +226,21 @@ |
227 | 227 | } |
228 | 228 | return false; |
229 | 229 | } |
| 230 | + |
| 231 | + protected function flattenRatings( $dims ) { |
| 232 | + $s = array(); |
| 233 | + foreach( $dims as $tag => $value ) { |
| 234 | + $s[] = "{$tag}={$value}"; |
| 235 | + } |
| 236 | + return implode("\n",$s); |
| 237 | + } |
230 | 238 | |
231 | 239 | private function submit() { |
232 | 240 | global $wgUser; |
233 | 241 | $dbw = wfGetDB( DB_MASTER ); |
234 | 242 | # Get date timestamp... |
235 | 243 | $date = str_pad( substr( wfTimestampNow(), 0, 8 ), 14, '0' ); |
| 244 | + $ratings = $this->flattenRatings( $this->dims ); |
236 | 245 | # Make sure revision is valid! |
237 | 246 | $rev = Revision::newFromId( $this->oldid ); |
238 | 247 | if( !$rev || !$rev->getTitle()->equals( $this->page ) ) { |
— | — | @@ -247,7 +256,8 @@ |
248 | 257 | 'rfb_rev_id' => $this->oldid, |
249 | 258 | 'rfb_user' => $wgUser->getId(), |
250 | 259 | 'rfb_ip' => wfGetIP(), |
251 | | - 'rfb_timestamp' => $dbw->timestamp() |
| 260 | + 'rfb_timestamp' => $dbw->timestamp(), |
| 261 | + 'rfb_ratings' => $ratings |
252 | 262 | ); |
253 | 263 | $dbw->insert( 'reader_feedback', $insertRow, __METHOD__, 'IGNORE' ); |
254 | 264 | # Make sure initial page data is there to begin with... |
Index: trunk/extensions/FlaggedRevs/archives/patch-rfb_ratings.sql |
— | — | @@ -0,0 +1,2 @@ |
| 2 | +ALTER TABLE /*$wgDBprefix*/reader_feedback |
| 3 | + ADD rfb_ratings mediumblob NOT NULL; |
Property changes on: trunk/extensions/FlaggedRevs/archives/patch-rfb_ratings.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 4 | + native |