Ejemplo n.º 1
0
function buklsms_multiple_sms($sms_to, $sms_class, $sms_msg, $sms_dca, $set_sms_from, $unicode)
{
    // Bulksms provider does not support sms with a length > 160 (7bit) or > 70 (16bit)
    // we need to split sms according to sms length and send each one of then. 0
    // Based on http://stackoverflow.com/questions/6700556/how-to-split-up-a-message-longer-than-160-chars-into-multiple-messages-for-sendi
    global $plugin_config;
    $divider = $unicode == 1 ? 70 : 160;
    $page_idicator_length = 8;
    if (strlen($sms_msg) > $divider) {
        $messages = str_split($sms_msg, $divider - $page_idicator_length);
        $how_many = count($messages);
        foreach ($messages as $index => $message) {
            $msg_number = $index + 1;
            $sms = convert_to_unicode($unicode, "(" . $msg_number . "/" . $how_many . ") " . $message);
            $url = bulksms_sms_url($sms_to, $sms_class, $sms, $sms_dca, $set_sms_from);
            $fd = @implode('', file($url));
            if ($msg_number == $how_many) {
                // let's track the last part of our long sms
                return $fd;
            }
        }
    }
    $sms_msg = convert_to_unicode($unicode, $sms_msg);
    $url = bulksms_sms_url($sms_to, $sms_class, $sms_msg, $sms_dca, $set_sms_from);
    logger_print("url:" . $url, 3, "bulksms outgoing");
    $fd = @implode('', file($url));
    return $fd;
}
function bk_email_spam_protector_shortcode($atts, $content = null)
{
    $a = shortcode_atts(array('email' => '*****@*****.**', 'param' => '0'), $atts);
    $email_converted = '';
    if ($a['param'] == 1) {
        $email_converted = '<span style = "unicode-bidi: bidi-override; direction: rtl;">' . strrev($a['email']) . '</span>';
    } else {
        $email_converted = convert_to_unicode($a['email']);
    }
    return "{$email_converted}";
}