announcements.install

Functions & methods

NameDescription
announcements_installHook install. Called when the module is installed on the admin modules page.

File

modules/announcements/announcements.install
View source
  1. <?php
  2. /**
  3. * This file should contain only hooks relating to installing, enabling, disabling, and uninstalling this module.
  4. *
  5. */
  6. /**
  7. * Hook install. Called when the module is installed on the admin modules page.
  8. */
  9. function announcements_install() {
  10. // Install a default announcement when first run.
  11. $body = '<p>This is a sample announcement! You may add new announcements (or delete this one) from the Admin Console, then Content.</p>';
  12. db_query("INSERT INTO content (user_id, type, title, body, settings, posted, updated)
  13. VALUES ('1', 'announcement', 'Sample Announcement', '?', '?', '?', '?')
  14. ", $body, 'a:1:{s:10:"visibility";s:6:"public";}', time(), time());
  15. }