|
21 | 21 | node_save($page); |
22 | 22 | } |
23 | 23 |
|
| 24 | + // Checking to see if "Your first post" node still exists |
| 25 | + $query = new EntityFieldQuery(); |
| 26 | + $entities = $query->entityCondition('entity_type', 'node') |
| 27 | + ->propertyCondition('type', 'post') |
| 28 | + ->propertyCondition('title', 'Your first post!') |
| 29 | + ->propertyCondition('status', 1) |
| 30 | + ->range(0,1) |
| 31 | + ->execute(); |
| 32 | + |
| 33 | + if (!empty($entities['node'])) { |
| 34 | + $about = node_load(array_shift(array_keys($entities['node']))); |
| 35 | + } |
| 36 | + // If default post still exists, unpublish it. |
| 37 | + if (!empty($about)) { |
| 38 | + $post = node_load($about->nid); |
| 39 | + $post->status = '0'; |
| 40 | + node_save($post); |
| 41 | + } |
| 42 | + |
24 | 43 | $pages = array( |
| 44 | + '500' => array( |
| 45 | + 'title' => st('What are posts?'), |
| 46 | + 'body' => '500', |
| 47 | + 'type' => 'post', |
| 48 | + 'promote' => '1', |
| 49 | + 'tags' => array('Promoted Content','Posts'), |
| 50 | + ), |
25 | 51 | '501' => array( |
26 | 52 | 'title' => st('Promoted Content'), |
27 | 53 | 'body' => '501', |
|
197 | 223 | config_set('filter.format.filtered_html', 'filters.video_filter.weight', '-2'); |
198 | 224 | config_set('filter.format.filtered_html', 'filters.filter_url.weight', '-1'); |
199 | 225 |
|
200 | | - // Changing the text in the default post provided by standard install profile |
201 | | - $nodes = node_load_multiple(NULL, array("title" => "Your first post!")); |
202 | | - $node = current($nodes); |
203 | | - $content = file_get_contents($module_path . '/content/post.txt'); |
204 | | - $node->body[LANGUAGE_NONE][0]['value'] = $content; |
205 | | - $node->created = time() - '2600000'; |
206 | | - node_save($node); |
207 | | - |
208 | | - |
209 | 226 | // Prepping new image to use in hero block of front page. |
210 | 227 | $field_image_dir = 'public://hero'; |
211 | 228 | file_prepare_directory($field_image_dir, FILE_CREATE_DIRECTORY); |
|
0 commit comments