root/ip/tags/release_1_3_0_53/mail_digests.php

111163
92
$digest_log_entry = '';
92
$digest_log_entry = '';
93
93
94
// Is today the day to run the weekly digest?
94
// Is today the day to run the weekly digest?
95
$today = getdate();
95
$today = @getdate();
96
$wday = $today['wday'];
96
$wday = $today['wday'];
97
$current_hour = $today['hours'];
97
$current_hour = $today['hours'];
98
$weekly_digest_text = ($wday == DIGEST_WEEKLY_DIGEST_DAY) ? " or (digest_type = 'WEEK' and send_hour = " . $current_hour . ")" :
"";
98
$weekly_digest_text = ($wday == DIGEST_WEEKLY_DIGEST_DAY) ? " or (digest_type = 'WEEK' and send_hour = " . $current_hour . ")" :
"";
...
...
247
247
248
	// Create a list of forums to be queried from the database. This is a comma delimited list of all forums
248
	// Create a list of forums to be queried from the database. This is a comma delimited list of all forums
249
	// the user is allowed to read that can be used with the SQL IN operation.
249
	// the user is allowed to read that can be used with the SQL IN operation.
250
	$forum_list = implode(',',$queried_forums);
250
	$forums_list = implode(',', $queried_forums);
251
	if (empty($forums_list))
252
	{
253
		continue;
254
	}
251
255
252
	// Format sender's email address (SMTP seems to have a problem with adding username)
256
	// Format sender's email address (SMTP seems to have a problem with adding username)
253
	$to = ($board_config['smtp_delivery']) ? $row['user_email'] : $row['username'] . ' <' . $row['user_email'] . '>';
257
	$to = ($board_config['smtp_delivery']) ? $row['user_email'] : $row['username'] . ' <' . $row['user_email'] . '>';
...
...
313
			AND p.poster_id = u.user_id
317
			AND p.poster_id = u.user_id
314
			AND f.cat_id = c.cat_id
318
			AND f.cat_id = c.cat_id
315
			AND p.post_time > " . $code . "
319
			AND p.post_time > " . $code . "
316
			AND f.forum_id IN (" . $forum_list . ")
320
			AND f.forum_id IN (" . $forums_list . ")
317
		ORDER BY c.cat_order, f.forum_order, t.topic_title, p.post_time";
321
		ORDER BY c.cat_order, f.forum_order, t.topic_title, p.post_time";
318
322
319
	// Uncomment next line to see SQL used
323
	// Uncomment next line to see SQL used
...
...
552
		$digest_emailer->assign_vars(array(
556
		$digest_emailer->assign_vars(array(
553
			'BOARD_URL' => DIGEST_SITE_URL,
557
			'BOARD_URL' => DIGEST_SITE_URL,
554
			'LINK' => $link_tag,
558
			'LINK' => $link_tag,
555
			'L_SITENAME' => $board_config['sitename'],
559
			'L_SITENAME' => ip_stripslashes($board_config['sitename']),
556
			'L_SALUTATION' => $lang['digest_salutation'],
560
			'L_SALUTATION' => $lang['digest_salutation'],
557
			'SALUTATION' => $row['username'],
561
			'SALUTATION' => $row['username'],
558
			'L_DIGEST_OPTIONS' => $lang['digest_your_digest_options'],
562
			'L_DIGEST_OPTIONS' => $lang['digest_your_digest_options'],