示例#1
0
    $tempEfftect = "";
    foreach ($effect as $e) {
        if (!in_array($e, $allowedEffects)) {
            exit("Not allowed effect" . $e);
        }
        $tempEfftect .= $e . ',';
    }
    $effect = $tempEfftect;
}
switch ($type) {
    case "image":
        $content = IMAGES . Image();
        break;
    case "youtube":
        $content = filter_input(INPUT_POST, "youtubeUrl", FILTER_SANITIZE_URL);
        $duration = Youtube($content);
        break;
    case "website":
        $content = filter_input(INPUT_POST, "websiteUrl", FILTER_SANITIZE_URL);
        break;
    default:
        die("No.");
}
try {
    $pdo = DataBase::GetPDO();
} catch (Exception $error) {
    echo $error;
}
if ($startTime != NULL) {
    $sql = "INSERT INTfO `mkSlide`\n                            (`priority`, `type`, `data`, `duration`, `effect`, `startTime`, `stopTime`)\n                            VALUES\n                            ({$priority},'{$type}','{$content}',{$duration},'{$effect}',{$startTime},{$endTime})";
} else {
示例#2
0
function license()
{
    $users = new usersMenus();
    $tpl = new templates();
    $sock = new sockets();
    $CPU_NUMBER = $sock->getFrameWork("services.php?CPU-NUMBER=yes");
    if (is_numeric($CPU_NUMBER)) {
        if ($CPU_NUMBER < 2) {
            $html = "<div style='margin-top:15px'>" . Paragraphe("warning-panneau-64.png", "{performance_issue}", "{performance_issue_cpu_number_text}", "javascript:Loadjs('artica.license.php')", "go_to_section", 665, 132, 1);
            echo $tpl->_ENGINE_parse_body($html) . "</div>";
        }
    }
    if ($users->CORP_LICENSE) {
        Youtube();
        return;
    }
    $ASWEB = false;
    if ($users->SQUID_INSTALLED) {
        $ASWEB = true;
    }
    if ($users->WEBSTATS_APPLIANCE) {
        $ASWEB = true;
    }
    $sock = new sockets();
    $EnableKerbAuth = $sock->GET_INFO("EnableKerbAuth");
    if (!is_numeric($EnableKerbAuth)) {
        $EnableKerbAuth = 0;
    }
    if ($EnableKerbAuth == 1) {
        $Days = 86400 * 30;
        $DayToLeft = 30;
        if (is_file("/usr/share/artica-postfix/ressources/class.pinglic.inc")) {
            include_once "/usr/share/artica-postfix/ressources/class.pinglic.inc";
            $EndTime = $GLOBALS['ADLINK_TIME'] + $Days;
            $seconds_diff = $EndTime - time();
            $DayToLeft = floor($seconds_diff / 3600 / 24);
        }
        $html = "<div style='margin-top:15px'>" . Paragraphe("warning-panneau-64.png", "Active Directory", "{warn_no_license_activedirectory_30days}", "javascript:Loadjs('artica.license.php')", "go_to_section", 665, 132, 1);
        $html = str_replace("%s", $DayToLeft, $html);
        echo $tpl->_ENGINE_parse_body($html) . "</div>";
    }
    $LicenseInfos = unserialize(base64_decode($sock->GET_INFO("LicenseInfos")));
    if ($LicenseInfos["license_status"] == null) {
        $text = "{explain_license_free}";
    } else {
        $text = "{explain_license_order}";
    }
    $html = "<div style='margin-top:15px'>" . Paragraphe("license-error-64.png", "{artica_license}", $text, "javascript:Loadjs('artica.license.php')", "go_to_section", 665, 132, 1);
    echo $tpl->_ENGINE_parse_body($html) . "</div>" . Youtube();
}
示例#3
0
文件: bot.php 项目: hrs113355/OfSmall
function getReply($origin, $count, $user_id)
{
    global $all_origins;
    global $default_origins;
    $reply_queue = array();
    if (($pos = mb_strpos($origin, '小的回噗率', 0, 'UTF-8')) !== false) {
        return responseRate(mb_substr($origin, $pos + 5, 200, 'UTF-8'), $user_id, 1);
    }
    if (($pos = mb_strpos($origin, '世界線變動率', 0, 'UTF-8')) !== false) {
        return responseRate(mb_substr($origin, $pos + 6, 200, 'UTF-8'), $user_id, 2);
    }
    if (($pos = mb_strpos($origin, '幫我查', 0, 'UTF-8')) !== false || ($pos = mb_strpos($origin, '幫我找', 0, 'UTF-8')) !== false) {
        return googleForYou(mb_substr($origin, $pos + 3, 200, 'UTF-8'));
    }
    if (mb_strpos($origin, '想聽', 0, 'UTF-8') !== false) {
        $parseY = preg_split('/想聽/', $origin);
        print $parseY[count($parseY) - 1];
        $reply_queue = Youtube($parseY[count($parseY) - 1]);
        $random = rand(0, count($reply_queue) - 1);
        if ($random >= 0) {
            return $reply_queue[$random]->reply;
        }
    } else {
        if ($pos = mb_strpos($origin, '點播', 0, 'UTF-8') !== false) {
            $parseY = preg_split('/點播/', $origin);
            print $parseY[count($parseY) - 1];
            $reply_queue = Youtube($parseY[count($parseY) - 1]);
            $random = rand(0, count($reply_queue) - 1);
            if ($random >= 0) {
                return $reply_queue[$random]->reply;
            }
        }
    }
    if (rand(0, 99) >= getResponseRate($user_id)) {
        return false;
    }
    if ($count == 2) {
        return '小的來搶三樓了(worship)';
    }
    if ($count == 4) {
        return '小的誠惶誠恐地來搶大大的五樓了(worship)';
    }
    foreach ($all_origins as $o) {
        if (strpos($origin, $o->origin) !== false) {
            array_push($reply_queue, $o);
        }
    }
    if (count($reply_queue) == 0) {
        $reply_queue = $default_origins;
    }
    $random = rand(0, count($reply_queue) - 1);
    if ($random >= 0) {
        return $reply_queue[$random]->reply;
    }
    return false;
}