Index: trunk/extensions/CentralNotice/CentralNotice.db.php |
— | — | @@ -132,40 +132,39 @@ |
133 | 133 | $templates = array(); |
134 | 134 | |
135 | 135 | if ( $campaigns ) { |
136 | | - foreach ( $campaigns as $campaignId ) { |
137 | | - $res = $dbr->select( |
138 | | - array( |
139 | | - 'cn_notices', |
140 | | - 'cn_assignments', |
141 | | - 'cn_templates' |
142 | | - ), |
143 | | - array( |
144 | | - 'tmp_name', |
145 | | - 'tmp_weight', |
146 | | - 'tmp_display_anon', |
147 | | - 'tmp_display_account', |
148 | | - 'tmp_fundraising', |
149 | | - 'tmp_landing_pages' |
150 | | - ), |
151 | | - array( |
152 | | - 'cn_notices.not_id' => $campaignId, |
153 | | - 'cn_notices.not_id = cn_assignments.not_id', |
154 | | - 'cn_assignments.tmp_id = cn_templates.tmp_id' |
155 | | - ), |
156 | | - __METHOD__ |
| 136 | + $res = $dbr->select( |
| 137 | + array( |
| 138 | + 'cn_notices', |
| 139 | + 'cn_assignments', |
| 140 | + 'cn_templates' |
| 141 | + ), |
| 142 | + array( |
| 143 | + 'tmp_name', |
| 144 | + 'tmp_weight', |
| 145 | + 'tmp_display_anon', |
| 146 | + 'tmp_display_account', |
| 147 | + 'tmp_fundraising', |
| 148 | + 'tmp_landing_pages', |
| 149 | + 'not_name' |
| 150 | + ), |
| 151 | + array( |
| 152 | + 'cn_notices.not_id' => $campaigns, |
| 153 | + 'cn_notices.not_id = cn_assignments.not_id', |
| 154 | + 'cn_assignments.tmp_id = cn_templates.tmp_id' |
| 155 | + ), |
| 156 | + __METHOD__ |
| 157 | + ); |
| 158 | + |
| 159 | + foreach ( $res as $row ) { |
| 160 | + $templates[] = array( |
| 161 | + 'name' => $row->tmp_name, |
| 162 | + 'weight' => intval( $row->tmp_weight ), |
| 163 | + 'display_anon' => intval( $row->tmp_display_anon ), |
| 164 | + 'display_account' => intval( $row->tmp_display_account ), |
| 165 | + 'fundraising' => intval( $row->tmp_fundraising ), |
| 166 | + 'landing_pages' => $row->tmp_landing_pages, |
| 167 | + 'campaign' => $row->not_name |
157 | 168 | ); |
158 | | - |
159 | | - foreach ( $res as $row ) { |
160 | | - $templates[] = array( |
161 | | - 'name' => $row->tmp_name, |
162 | | - 'weight' => intval( $row->tmp_weight ), |
163 | | - 'display_anon' => intval( $row->tmp_display_anon ), |
164 | | - 'display_account' => intval( $row->tmp_display_account ), |
165 | | - 'fundraising' => intval( $row->tmp_fundraising ), |
166 | | - 'landing_pages' => $row->tmp_landing_pages, |
167 | | - 'campaign' => CentralNotice::getNoticeName( $campaignId ) |
168 | | - ); |
169 | | - } |
170 | 169 | } |
171 | 170 | } |
172 | 171 | return $templates; |