| 1 |
<?php |
<?php |
| 2 |
// $Id: ezmlm.module,v 1.18.4.1.2.3 2008/07/01 15:14:55 hutch Exp $ |
// $Id: ezmlm.module,v 1.18.4.1.2.4 2008/12/16 22:10:26 hutch Exp $ |
| 3 |
// $Name: $ |
// $Name: DRUPAL-6--1 $ |
| 4 |
// for drupal 6.x |
// for drupal 6.x |
| 5 |
|
|
| 6 |
/** |
/** |
| 141 |
case 0: |
case 0: |
| 142 |
$block = ""; |
$block = ""; |
| 143 |
if (drupal_strlen(trim(variable_get('ezmlmmailinglists', '')))) { |
if (drupal_strlen(trim(variable_get('ezmlmmailinglists', '')))) { |
| 144 |
|
$display = variable_get('ezmlm_block_display', 'email'); |
| 145 |
|
$form = drupal_get_form('ezmlm_subscribe_form', 'DEFAULT', $display); |
| 146 |
$block['subject'] = variable_get('ezmlm_block_title', t('Subscriptions')); |
$block['subject'] = variable_get('ezmlm_block_title', t('Subscriptions')); |
| 147 |
$block['content'] .= ezmlm_page(variable_get('ezmlm_block_display', 'email')); |
$block['content'] .= theme('ezmlm_subscribe_page', $form, 'block'); |
| 148 |
} |
} |
| 149 |
return $block; |
return $block; |
| 150 |
} |
} |
| 258 |
if (! $display) { |
if (! $display) { |
| 259 |
$display = variable_get('ezmlm_display', 'email'); |
$display = variable_get('ezmlm_display', 'email'); |
| 260 |
} |
} |
| 261 |
$output = drupal_get_form('ezmlm_subscribe_form', 'DEFAULT', $display); |
$form = drupal_get_form('ezmlm_subscribe_form', 'DEFAULT', $display); |
| 262 |
return $output; |
return theme('ezmlm_subscribe_page', $form, 'page'); |
| 263 |
} |
} |
| 264 |
|
|
| 265 |
/** |
/** |
| 279 |
list($list_name, $list_domain) = split('@', $list_email); |
list($list_name, $list_domain) = split('@', $list_email); |
| 280 |
// subscribe address for list formatted below |
// subscribe address for list formatted below |
| 281 |
$to = trim($list_name) .'-subscribe-'. trim($user_name) .'='. trim($user_domain) .'@'. trim($list_domain); |
$to = trim($list_name) .'-subscribe-'. trim($user_name) .'='. trim($user_domain) .'@'. trim($list_domain); |
| 282 |
mail($to, '', ''); |
$lang = language_default(); |
| 283 |
|
drupal_mail('ezmlm', 'subscribe', $to, $lang); |
| 284 |
|
// mail($to, '', ''); |
| 285 |
$mylists[] = trim($list_email); |
$mylists[] = trim($list_email); |
| 286 |
} |
} |
| 287 |
} |
} |
| 290 |
} |
} |
| 291 |
|
|
| 292 |
/** |
/** |
| 293 |
|
* Implementation of hook_mail(). |
| 294 |
|
*/ |
| 295 |
|
function ezmlm_mail($key, &$message, $params) { |
| 296 |
|
switch($key) { |
| 297 |
|
case 'subscribe': |
| 298 |
|
$message['subject'] = ''; |
| 299 |
|
$message['body'] = ''; |
| 300 |
|
break; |
| 301 |
|
} |
| 302 |
|
} |
| 303 |
|
|
| 304 |
|
/** |
| 305 |
* Return current number of lists. |
* Return current number of lists. |
| 306 |
* Use this instead of count(_ezmlm_get_lists()) because non-array counts as 1. |
* Use this instead of count(_ezmlm_get_lists()) because non-array counts as 1. |
| 307 |
*/ |
*/ |
| 330 |
} |
} |
| 331 |
} |
} |
| 332 |
|
|
| 333 |
|
/** |
| 334 |
|
* Implementation of hook_theme(). |
| 335 |
|
*/ |
| 336 |
|
function ezmlm_theme() { |
| 337 |
|
return array( |
| 338 |
|
'ezmlm_subscribe_page' => array( |
| 339 |
|
'arguments' => array( |
| 340 |
|
$form = "", |
| 341 |
|
$type = "", |
| 342 |
|
), |
| 343 |
|
), |
| 344 |
|
); |
| 345 |
|
} |
| 346 |
|
|
| 347 |
|
function theme_ezmlm_subscribe_page($form, $type = 'page') { |
| 348 |
|
switch ($type) { |
| 349 |
|
case 'block': |
| 350 |
|
$output = $form; |
| 351 |
|
break; |
| 352 |
|
case 'page': |
| 353 |
|
$output = $form; |
| 354 |
|
break; |
| 355 |
|
} |
| 356 |
|
return $output; |
| 357 |
|
} |