if (is_email($msn)) { $content .= '<br/>' . $L['content_msn'] . ' ' . im_msn($msn) . ' ' . $msn; } if ($skype) { $content .= '<br/>' . $L['content_skype'] . ' ' . im_skype($skype) . ' ' . $skype; } if (is_date($date)) { $content .= '<hr size="1"/>' . lang($L['content_date'], array($date)); } $message = $L['content_product'] . '<a href="' . $linkurl . '"><strong>' . $item['title'] . '</strong></a><br/>' . $content; //send sms if ($DT['sms'] && $_sms && $item['username'] && isset($sendsms)) { $touser = userinfo($item['username']); if ($touser['mobile']) { $message = lang('sms->sms_price', array($item['tag'], $itemid, $truename, $telephone)); $message = strip_sms($message); $word = word_count($message); $sms_num = ceil($word / $DT['sms_len']); if ($sms_num <= $_sms) { $sms_code = send_sms($touser['mobile'], $message, $word); if (strpos($sms_code, $DT['sms_ok']) !== false) { $tmp = explode('/', $sms_code); if (is_numeric($tmp[1])) { $sms_num = $tmp[1]; } if ($sms_num) { sms_add($_username, -$sms_num); } if ($sms_num) { sms_record($_username, -$sms_num, $_username, $L['sms_price'], 'ID:' . $itemid); }
$DT['sms_sign'] = $sign; $pernum = intval($pernum); if (!$pernum) { $pernum = 10; } $mobiles = file_get(DT_ROOT . '/file/mobile/' . $mobilelist); $mobiles = explode("\n", $mobiles); for ($i = 1; $i <= $pernum; $i++) { $mobile = trim($mobiles[$id++]); if (is_mobile($mobile)) { $user = _userinfo($mobile); $content = $_content; if ($user) { eval("\$content = \"{$content}\";"); } $content = strip_sms($content); $sms_code = send_sms($mobile, $content); if (strpos($sms_code, $DT['sms_ok']) !== false) { $s++; } else { $f++; } } } if ($id < count($mobiles)) { msg('已发送(' . $id . ')条短信,(' . $s . ')成功(' . $f . ')失败,系统将自动继续,请稍候...', '?moduleid=' . $moduleid . '&file=' . $file . '&sendtype=3&id=' . $id . '&s=' . $s . '&f=' . $f . '&pernum=' . $pernum . '&send=1'); } cache_delete($_username . '_sendsms.php'); dmsg('发送成功(' . $s . '),发送失败(' . $f . ')', '?moduleid=' . $moduleid . '&file=' . $file); } }