/[drupal]/contributions/modules/sitenotes/sitenotes.install
ViewVC logotype

Contents of /contributions/modules/sitenotes/sitenotes.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (show annotations) (download) (as text)
Thu Feb 14 17:05:08 2008 UTC (21 months, 1 week ago) by nancyw
Branch: MAIN
CVS Tags: DRUPAL-5--1-4, DRUPAL-5--1-3, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
Changes since 1.9: +11 -12 lines
File MIME type: text/x-php
#177436 by nancyw for mel55113 - honor weight, sticky in "recent" block.
#160574 by nancyw for tamoraj - searching allowed as an option.
#158318 by nancyw for nancyw - fixed "Edit" tab.
Added min-word count of 5.
Corrected Coder finds.
Removed "LIMIT" from queries - added db_query_range.
1 <?php
2 // $Id: sitenotes.install,v 1.9 2007/08/04 15:03:31 nancyw Exp $
3
4 /**
5 * Implementation of hook_install().
6 */
7 function sitenotes_install() {
8 watchdog('SiteNotes', 'sitenotes module installed');
9 // drupal_set_message(t('The Site Notes module was installed. You may want to go to the <a href="!settings">settings page now</a>.', array('!settings' => url('admin/build/sitenotes'))));
10
11 }
12
13 /**
14 * Implementation of hook_update().
15 * This is update is needed to add weight to existing sitenotes nodes.
16 */
17 function sitenotes_update_1() {
18 return array(update_sql("UPDATE {node} SET sticky=-100 WHERE type='sitenotes'"));
19 }
20
21 /**
22 * Implementation of hook_uninstall().
23 */
24 function sitenotes_uninstall() {
25
26 // Remove all Site Note nodes.
27 $result = db_query('SELECT nid FROM {node} WHERE type = "sitenotes"');
28 while ($obj = db_fetch_object($result)) {
29 node_delete($obj->nid);
30 }
31
32 // Remove the node type.
33 node_type_delete('sitenotes');
34
35 // Remove all Site Note blocks.
36 db_query("DELETE FROM {blocks} WHERE module='sitenotes'");
37
38 // Remove variables.
39 variable_del('sitenotes_block_0');
40 variable_del('sitenotes_search');
41
42 // clear the cache tables (see http://drupal.org/node/64279#comment-211282)
43 cache_clear_all('*', 'cache', TRUE);
44 cache_clear_all('*', 'cache_filter', TRUE);
45 cache_clear_all('*', 'cache_page', TRUE);
46
47 watchdog('SiteNotes', 'sitenotes module removed');
48 }

  ViewVC Help
Powered by ViewVC 1.1.2