Binary files premium-HEAD/.premium.info.swp and premium-5.x/.premium.info.swp differ
diff -urNp premium-HEAD/premium.css premium-5.x/premium.css
--- premium-HEAD/premium.css 1969-12-31 18:00:00.000000000 -0600
+++ premium-5.x/premium.css 2007-05-01 15:47:13.000000000 -0500
@@ -0,0 +1,5 @@
+.premium-message
+ {
+ background-color: #ccffcc;
+ }
+
diff -urNp premium-HEAD/premium.info premium-5.x/premium.info
--- premium-HEAD/premium.info 1969-12-31 18:00:00.000000000 -0600
+++ premium-5.x/premium.info 2007-05-01 15:31:36.000000000 -0500
@@ -0,0 +1,3 @@
+name = Premium
+description = Restrict access to premium content.
+version = 5.x-1.x-dev
diff -urNp premium-HEAD/premium.install premium-5.x/premium.install
--- premium-HEAD/premium.install 2006-03-10 20:43:26.000000000 -0600
+++ premium-5.x/premium.install 2007-05-01 15:46:27.000000000 -0500
@@ -5,7 +5,7 @@ function premium_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
- db_query("CREATE TABLE premium (
+ db_query("CREATE TABLE {premium} (
nid INT NOT NULL,
start_ts INT,
end_ts INT,
@@ -15,4 +15,15 @@ function premium_install() {
case 'pgsql':
break;
}
-}
\ No newline at end of file
+}
+
+function premium_uninstall() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query('drop table {premium}');
+ break;
+ case 'pgsql':
+ break;
+ }
+}
diff -urNp premium-HEAD/premium.module premium-5.x/premium.module
--- premium-HEAD/premium.module 2006-07-19 11:39:33.000000000 -0500
+++ premium-5.x/premium.module 2007-05-01 15:48:18.000000000 -0500
@@ -1,25 +1,27 @@
- 'admin/settings/premium',
+ 'title' => t('Premium'),
+ 'description' => t('Set the Premium mode, time count, time unit and message.'),
+ 'callback' => 'drupal_get_form',
+ 'callback arguments' => 'premium_settings',
+ 'access' => user_access('administer site configuration'));
+ }
+ return $items;
+}
/**
* Implementation of hook_settings()
@@ -65,7 +67,7 @@ function premium_settings() {
'#rows' => 30,
'#description' => t('When a visitor doesn\'t have access to a premium item they will see this message instead of its full text')
);
- return $form;
+ return system_settings_form($form);
}
/**
@@ -118,7 +120,11 @@ function premium_nodeapi(&$node, $op, $t
}
$node->premium_access = false;
- $node->body = theme('premium_body', $node);
+ // You do not change body in 5.0.
+ //$node->body = theme('premium_body', $node);
+ // The following is one replacement. The other is to use nodeapi alter.
+ $node->content['body']['#value'] = theme('premium_body', $node);
+
}
return;
}
@@ -183,5 +189,5 @@ function _premium_offset($node, &$start_
* Reformat the message body with a premium content message
*/
function theme_premium_body($node) {
- return $node->teaser . '
'.variable_get('premium_message','');
+ return $node->teaser . '
'.variable_get('premium_message','') . '';
}