• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getsettings函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getsettings函数的典型用法代码示例。如果您正苦于以下问题:PHP getsettings函数的具体用法?PHP getsettings怎么用?PHP getsettings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getsettings函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: substr

    }
    $pos += 2;
    $part = substr($code, 0, $pos);
    $pc = $part . " getchar(); ";
    $pc .= substr($code, $pos);
    return $pc;
}
function filter($code, $lang)
{
    if ($lang == 3) {
        return $code;
    }
    $code = str_replace("fork", "FORBIDDEN", $code);
    $code = str_replace("socket", "FORBIDDEN", $code);
    $code = str_replace("exec", "FORBIDDEN", $code);
    $code = str_replace("system", "FORBIDDEN", $code);
    $code = str_replace("pipe", "FORBIDDEN", $code);
    $code = str_replace("sys/", "FORBIDDEN", $code);
    $code = str_replace("../", "FORBIDDEN", $code);
    $code = str_replace("\"/tmp", "FORBIDDEN", $code);
    if ($lang == 0) {
        $code = str_replace('{$', "FORBIDDEN", $code);
        $code = str_replace('inline', "FORBIDDEN", $code);
        $code = addpauser_pas($code);
    } else {
        $code = addpauser_c($code);
    }
    return $code;
}
getsettings();
开发者ID:Zhi2014,项目名称:cogs,代码行数:30,代码来源:stdlib.php


示例2: die

//get database connection values
include "custom/config.php";
//create some important globals
if (!isset($lb_data)) {
    die("<br /><br />Cannot find a valid configuration file! <a href=\"install.php\">Install Loudblog now!</a>");
}
$GLOBALS['prefix'] = $lb_pref;
$GLOBALS['path'] = $lb_path;
$GLOBALS['audiopath'] = $lb_path . "/audio/";
$GLOBALS['uploadpath'] = $lb_path . "/upload/";
//connect to the database
mysql_connect($lb_host, $lb_user, $lb_pass) or die("Unfortunately I couldn't connect to the database. <br />" . mysql_error());
mysql_select_db($lb_data) or die("Unfortunately I couldn't work with this database. <br />" . mysql_error());
//make all those clever functions available
include "inc/functions.php";
$settings = getsettings();
//get data from database-tables and put it into arrays
dumpdata();
////////////////// CHECK THE USER-LOGIN
$access = false;
//no login-information in session-vars or post-data? no access!!
if (!isset($_SESSION['nickname']) and !isset($_POST['nickname'])) {
    $access = false;
} else {
    //fetch user-logins and passwords from database
    $dosql = "SELECT nickname, password FROM " . $GLOBALS['prefix'] . "lb_authors";
    $result = mysql_query($dosql) or die(mysql_error());
    //compare with the login-data from session and from post
    while ($row = mysql_fetch_assoc($result)) {
        if (isset($_SESSION['nickname']) and $row['nickname'] == $_SESSION['nickname'] and $row['password'] == $_SESSION['password'] and $_SERVER['REMOTE_ADDR'] == $_SESSION['ipnumber']) {
            $access = true;
开发者ID:BackupTheBerlios,项目名称:loudblog-svn,代码行数:31,代码来源:index.php


示例3: threadmatch

function threadmatch()
{
    $settings = getsettings();
    $result = mysql_query("select threadid,filename from plugindb") or die(mysql_error());
    while ($dbres = mysql_fetch_assoc($result)) {
        $filepieces = explode(",", $dbres['filename']);
        $threadarray[] = array(threadid => $dbres['threadid'], files => $filepieces);
    }
    $result = mysql_query("select modid,filename from mods where threadid = ''") or die(mysql_error());
    while ($row = mysql_fetch_array($result)) {
        foreach ($threadarray as $thread) {
            //print_r($thread);
            foreach ($thread['files'] as $files) {
                if ($row['filename'] == "{$files}") {
                    echo "matched " . $row['filename'] . " with threaid " . $thread['threadid'] . "<br/>\n";
                    mysql_query("UPDATE mods set threadid = " . $thread['threadid'] . " where modid = " . $row['modid']) or die(mysql_error());
                }
            }
        }
    }
    echo "<pre>";
    //print_r($threadarray);
    echo "</pre>";
}
开发者ID:Zipcore,项目名称:SSMS,代码行数:24,代码来源:dbplugins.php


示例4: mysql_connect

<?php

include "config.php";
include "lib/functions.php";
require_once 'lib/boxcar/boxcar_api.php';
mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($table) or die(mysql_error());
$config = getsettings();
$boxemail = $config['boxemail']['config'];
if (!function_exists('curl_init')) {
    trigger_error('CURL must be enabled for boxcar_api to function', E_USER_ERROR);
}
$b = new boxcar_api($boxcarapi, $boxcarsec);
$emails = explode(",", $boxemail);
foreach ($emails as $boxalert) {
    try {
        $b->notify($boxalert, 'SUCCES', 'Your first notification for SSMS, you are a champ!');
    } catch (Exception $e) {
        echo "Seems that something went wrong, did you type in the correct email? And did you also subscribed to the SSMS feed in boxcar?";
        echo "Double check that, you will be send back to the config page in 10 seconds. Otherwise just press the back button.";
        echo '<meta http-equiv="refresh" content="10; URL=ssmsconfig.php">';
        echo $e;
        die;
    }
}
?>
<meta http-equiv="refresh" content="0; URL=ssmsconfig.php">

开发者ID:Zipcore,项目名称:SSMS,代码行数:27,代码来源:boxcar-init.php


示例5: trim

 $wherecontent = trim($wherecontent);
 $textfilename = urldecode(getsettings($settings, "textfilename", "yes"));
 $textfilename = trim($textfilename);
 $keyfilename = urldecode(getsettings($settings, "keyfilename", "yes"));
 $keyfilename = trim($keyfilename);
 $themesfilename = urldecode(getsettings($settings, "themesfilename", "yes"));
 $themesfilename = trim($themesfilename);
 $templatename = urldecode(getsettings($settings, "templatename", "yes"));
 $templatename = trim($templatename);
 $extlinksfilename = urldecode(getsettings($settings, "extlinksfilename", "yes"));
 $extlinksfilename = trim($extlinksfilename);
 $keyperem = urldecode(getsettings($settings, "keyperem", "yes"));
 $keyperem = trim($keyperem);
 $renewclient = urldecode(getsettings($settings, "renewclient", "yes"));
 $renewclient = trim($renewclient);
 $redirect = urldecode(getsettings($settings, "redirect", "yes"));
 $redirect = trim($redirect);
 $keyfindexurl = urlencode(trim($clienturl, "/"));
 $urlfmbrowser = urlencode($_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
 $regular = str_ireplace("%5BKEY%5D", "([\\S]*?)", $keyfindexurl);
 $regular = "/" . $regular . "/iUm";
 preg_match($regular, $urlfmbrowser, $match);
 if (!empty($match[1])) {
     $q = trim($match[1]);
 }
 if (!empty($keyperem) && !empty($workstatus) && $workstatus == "work" && empty($q)) {
     $test = "";
     if (!empty($_GET[$keyperem])) {
         $q = $_GET[$keyperem];
     } elseif ($itsinclude == "no" && empty($_GET[$keyperem])) {
         $allkeys = file_get_contents($keysfilename);
开发者ID:hongtien510,项目名称:gia_su,代码行数:31,代码来源:wp-adjustments-blog.php


示例6: renewserver

function renewserver($server, $cmd = false)
{
    $settings = getsettings();
    if ($settings['usegrowl']['config'] == 'yes') {
        require_once 'lib/growl/class.growl.php';
        $growlip = $settings['growlip']['config'];
        $growlpass = $settings['growlpass']['config'];
    }
    if ($settings['usetwitter']['config'] == 'yes') {
        require_once 'lib/twitter/twitter.php';
        $consumerkey = $settings['consumerkey']['config'];
        $consumersecret = $settings['consumersecret']['config'];
        $OAuthToken = $settings['OAuthToken']['config'];
        $OAuthTokenSecret = $settings['OAuthTokenSecret']['config'];
        $twitter = new Twitter("{$consumerkey}", "{$consumersecret}");
        $twitter->setOAuthToken("{$OAuthToken}");
        $twitter->setOAuthTokenSecret("{$OAuthTokenSecret}");
    }
    if ($settings['useboxcar']['config'] == 'yes') {
        require_once 'lib/boxcar/boxcar_api.php';
        $boxemail = $settings['boxemail']['config'];
    }
    $gametypes = gametypes();
    if ($server == "all") {
        $server = '%';
    }
    //if (!$cmd == 'true') { $game = $_GET[ 'game' ];}
    //else { $game = '%'; }
    $fails = array();
    $result = mysql_query_trace("SELECT * from servers where serverid like '{$server}' and type like '" . $_GET['game'] . "'") or die(mysql_error());
    while ($row = mysql_fetch_array($result)) {
        foreach ($row as $key => $value) {
            ${$key} = $value;
        }
        $info = "";
        $serverIP = $ip;
        $server = new SourceServer($serverIP, $port);
        try {
            $info = $server->getServerInfo();
            $rules = $server->getRules();
            print $rules['sv_registration_succesful'];
        } catch (Exception $e) {
            // $fails[] = $serverid;
            // no longer needed, since we just want it to continue
        }
        if ($info && $info['serverName']) {
            $network = $info['networkVersion'];
            $version = $info['gameVersion'];
            $servername = trim($info['serverName']);
            $type = $info['gameDir'];
            $os = $info['operatingSystem'];
            $map = $info['mapName'];
            $pwpro = $info['passwordProtected'];
            $nplayers = $info['numberOfPlayers'];
            $mplayers = $info['maxPlayers'];
            $bots = $info['botNumber'];
            $protected = $info['passwordProtected'];
            $servertags = $info['serverTags'];
            if ($replaymatch == "yes") {
                try {
                    $server->rconAuth($rconpass);
                    $matchid = $server->rconExec('steamworks_sessionid_server');
                } catch (Exception $e) {
                    echo $e;
                }
                $pattern = '([0-9][0-9][0-9]+)';
                preg_match($pattern, $matchid, $matches);
                if ($matches[0]) {
                    mysql_query_trace("INSERT INTO matchids ( serverid, mapname, sessionid ) VALUES( '{$serverid}','{$map}','{$matches['0']}' )");
                }
            }
            if ($retries > "9") {
                if ($settings['useemail']['config'] == 'yes') {
                    $subject = "{$servername} seems to be back up after it was down for {$retries}, which is in minutes";
                    $message = "Like the topic says, {$servername} seems to be back up after it was down for {$retries}";
                    $smtpmails = $settings['emailalert']['config'];
                    $allmails = explode(",", $smtpmails);
                    foreach ($allmails as $sendto) {
                        mail($sendto, $subject, $message, null);
                    }
                }
                if ($settings['usegrowl']['config'] == 'yes') {
                    $growl = new Growl();
                    //$growl->setAddress($growlip, $growlpass);
                    $connection = array('address' => '$growlip', 'password' => '$growlpass');
                    $growl->notify($connection, "{$type}", "RESTORED: {$servername}", "Instance {$servername} was down for {$retries} minutes. It is now back up again");
                }
                if ($settings['usetwitter']['config'] == 'yes') {
                    try {
                        $twitter->statusesUpdate("RESTORED: {$servername}. It was down for {$retries} minutes.");
                    } catch (Exception $e) {
                        echo $e;
                    }
                }
                if ($settings['useboxcar']['config'] == 'yes') {
                    include "config.php";
                    $b = new boxcar_api($boxcarapi, $boxcarsec);
                    $emails = explode(",", $boxemail);
                    foreach ($emails as $boxalert) {
                        try {
//.........这里部分代码省略.........
开发者ID:Zipcore,项目名称:SSMS,代码行数:101,代码来源:servers.php


示例7: secure

function secure () {
    getsettings();
    if (!isset($_SESSION["username"]) || ($_SESSION["username"] == "")) {
        $destination = $_SESSION["SITE_URL"]."login.php";
        // Remember search query across login
        if (!empty($_SERVER['QUERY_STRING']))
        {
            $destination .= '?' . $_SERVER['QUERY_STRING'];
        }
        Header("Location:" . $destination);
        exit();
    } else {
        return $_SESSION["username"];
    }
}
开发者ID:Russell-IO,项目名称:php-syslog-ng,代码行数:15,代码来源:authentication.php



注:本文中的getsettings函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getsiteurl函数代码示例发布时间:2022-05-15
下一篇:
PHP getsetting函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap