| 1 |
<?php /* $Id: premium.module,v 1.14 2008/08/03 04:28:04 vauxia Exp $ */ |
<?php /* $Id: premium.module,v 1.16 2008/08/03 06:17:46 jerdavis Exp $ */ |
| 2 |
/** |
/** |
| 3 |
* @file Restrict access to the full body of premium content |
* @file Restrict access to the full body of premium content |
| 4 |
*/ |
*/ |
| 202 |
*/ |
*/ |
| 203 |
function premium_settings_save($form_id, $form_values) { |
function premium_settings_save($form_id, $form_values) { |
| 204 |
$count = $form_values['premium_time_count']; |
$count = $form_values['premium_time_count']; |
| 205 |
$unit = $form_values['premium_unit_count']; |
$unit = $form_values['premium_time_unit']; |
| 206 |
$mode = $form_values['premium_mode']; |
$mode = $form_values['premium_mode']; |
| 207 |
$types = $form_values['premium_node_types']; |
$types = $form_values['premium_node_types']; |
| 208 |
|
|
| 273 |
if ($node->nid) { |
if ($node->nid) { |
| 274 |
// Attempt to find the value from the premium table. |
// Attempt to find the value from the premium table. |
| 275 |
return (int) db_result(db_query("SELECT 1 FROM {premium} WHERE nid = %d |
return (int) db_result(db_query("SELECT 1 FROM {premium} WHERE nid = %d |
| 276 |
AND ( start_ts = 0 and end_ts > %d) |
AND (( start_ts = 0 and end_ts > %d) |
| 277 |
OR ( start_ts < %d AND end_ts = 0) |
OR ( start_ts < %d AND end_ts = 0) |
| 278 |
OR ( start_ts = 0 AND end_ts = 0)", $node->nid, time(), time())); |
OR ( start_ts = 0 AND end_ts = 0))", $node->nid, time(), time())); |
| 279 |
} |
} |
| 280 |
|
|
| 281 |
// Use default settings for this node type. |
// Use default settings for this node type. |