本文整理汇总了PHP中addlog函数的典型用法代码示例。如果您正苦于以下问题:PHP addlog函数的具体用法?PHP addlog怎么用?PHP addlog使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addlog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cancel_order
function cancel_order($orderid, $uid)
{
// cancel an order
$query = "\n UPDATE orderbook\n SET status='CANCEL'\n WHERE\n orderid='{$orderid}'\n AND uid='{$uid}'\n AND status='OPEN'\n ";
do_query($query);
if (mysql_affected_rows() != 1) {
if (mysql_affected_rows() > 1) {
throw new Error('Serious...', 'More rows updated than should be. Contact the sysadmin ASAP.');
} else {
if (mysql_affected_rows() == 0) {
throw new Problem(_('Cannot...'), _('Your order got bought up before you were able to cancel.'));
} else {
throw new Error('Serious...', 'Internal error. Contact sysadmin ASAP.');
}
}
}
// Refetch order in case something has happened.
$info = fetch_order_info($orderid);
if ($uid != $info->uid) {
throw new Error('Permission...', '... Denied! Now GTFO.');
}
add_funds($info->uid, $info->amount, $info->type);
// these records indicate returned funds.
create_record($orderid, $info->amount, 0, 0, -1, 0);
addlog(LOG_RESULT, " cancelled order {$orderid}");
}
示例2: x
/**
* Devuelve la traducción de la cadena recibida
* según la lengua en uso; la signature de la
* función es la misma de sprintf
* (http://es.php.net/manual/en/function.sprintf.php)
*
* @return string
*/
function x()
{
global $i18n;
//sólo se carga en el hash $i18n el fichero de la lengua en uso
$args = func_get_args();
$key = array_shift($args);
if (count($args) == 1 && is_array($args[0])) {
$args = $args[0];
}
if (!isset($i18n)) {
$tmp = $key;
} elseif (empty($i18n[$key])) {
$tmp = $key;
addlog(__FILE__, $key);
} else {
$tmp = $i18n[$key];
}
if (!is_array($args)) {
$args = array();
}
array_unshift($args, $tmp);
$tmp = call_user_func_array('sprintf', $args);
return $tmp;
}
示例3: switcher
function switcher($page)
{
global $is_logged_in, $is_admin, $is_verified;
try {
$lock = false;
if (!preg_match("/^[0-9_a-z]*\$/", $page)) {
$page = 'junk';
}
// delay showing the header when logging in until we know whether the login worked or not
if ($page != 'download' && $page != 'login' && $page != 'graph') {
show_header($page, $is_logged_in);
}
if ($is_logged_in) {
get_user_lock($lock = $is_logged_in);
}
addlog(LOG_SWITCHER, sprintf("[%s] visit page '%s'", getenv("REMOTE_ADDR"), $page));
switch ($page) {
////////////////////////////////////////////////////////////////////////
// for general consumption
////////////////////////////////////////////////////////////////////////
case '404':
case 'graph':
case 'help':
case 'news':
case 'orderbook':
case 'test':
case 'trade':
case 'view_trades':
include "{$page}.php";
break;
////////////////////////////////////////////////////////////////////////
// for logged in users only
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// for logged in users only
////////////////////////////////////////////////////////////////////////
case 'api':
case 'deposit':
case 'identity':
case 'place_order':
case 'profile':
case 'statement':
case 'turn_on_duo':
case 'view_order':
case 'view_request':
case 'withdraw':
if ($is_logged_in) {
include "{$page}.php";
} else {
log_badpage($page);
}
break;
////////////////////////////////////////////////////////////////////////
// for admin only
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// for admin only
////////////////////////////////////////////////////////////////////////
case 'add_cash':
case 'bank':
case 'commission':
case 'docs':
case 'download':
case 'freeze':
case 'users':
if ($is_admin) {
include "{$page}.php";
} else {
log_badpage($page);
}
break;
case 'login':
if (!$is_logged_in) {
include "login.php";
// we just tried to log in, so check whether or not it worked before showing the footer
get_login_status();
} else {
addlog(LOG_LOGIN, " already logged in");
log_badpage($page);
}
break;
case 'logout':
setcookie('autologin', FALSE, time() - 60 * 60 * 24 * 365);
logout();
default:
sleep(3);
log_badpage($page);
break;
}
// debugging for session stuff
if (0) {
echo "<div class='content_box'>\n";
echo "<h3>Debug</h3>\n";
echo "<p>\n";
echo "session id: ", session_id(), "<br/>\n";
echo "session age: ", time() - $_SESSION['creation_time'], " seconds<br/>\n";
if (isset($inactivity)) {
echo "you were inactive for {$inactivity} seconds<br/>\n";
}
echo "MAX_IDLE_MINUTES_BEFORE_LOGOUT = ", MAX_IDLE_MINUTES_BEFORE_LOGOUT, " minutes = ", MAX_IDLE_MINUTES_BEFORE_LOGOUT * 60, " seconds<br/>\n";
//.........这里部分代码省略.........
示例4: getPriv
<?php
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING); // [josip] za error reports
header("Content-type: text/html; charset=utf-8");
opendb();
$Allow = getPriv("employees", session("user_id"));
if ($Allow == False) echo header ('Location: ../permission/?l=' . $cLang);
$ua=getBrowser();
$yourbrowser = (bool) strpos($ua['userAgent'], "iPad");
$yourbrowser1 = (bool) strpos($ua['userAgent'], "Macintosh");
addlog(47);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
if($yourbrowser == "1")
{ ?>
<style type="text/css">
html {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
示例5: myadminform
case 'none':
myadminform($naso);
break;
case 'update':
switch ($dconf[maindbtype]) {
case 'mysql':
if ($debug) {
dbg("MY new details", $myadminpost);
}
sql_azurirajAdmin($myc, $myadminpost);
db_writedatachange($myc, 'admins');
break;
}
reloadUrl('Continue', 'myadmin.php');
print "<h1>Updated my admin: " . $myadminpost[username] . "</h1>\n";
addlog(true, "Updated my admin: " . $myadminpost[username]);
break;
}
//
// disconnect from main database
//
switch ($dconf[maindbtype]) {
case 'mysql':
sql_odspojise($myc);
break;
}
?>
</body>
</html>
示例6: foreach
//Nun noch datei abspeichern
foreach ($image2 as $name => $array) {
if ($array["newdesc"]) {
addlog("Speichere neue Bildbeschreibung von {$name}.");
if ($array["number"] == 1) {
$cmtz = "Bot: notice of a derivative work added";
} else {
$cmtz = "Bot: notice of " . $array["number"] . " derivative works added";
}
wikiedit("commons.wikimedia.org", $name, $array["newdesc"], $cmtz, "true", $username, $password);
sleep(15);
}
$image2[$name]["donetime"] = time() - 15;
}
addlog("Update Datenbank");
foreach ($image2 as $name => $array) {
if ($array["derivatives"]) {
foreach ($array["derivatives"] as $derivativfile) {
$resu1 = mysql_query("UPDATE `u_luxo`.`derivativefx` SET `status`='done', `donetime`='" . mysql_real_escape_string($array["donetime"]) . "' WHERE CONVERT(`derivativefx`.`status` USING utf8) = 'open' AND CONVERT(`derivativefx`.`file` USING utf8) ='" . mysql_real_escape_string($name) . "' AND CONVERT(`derivativefx`.`derivative` USING utf8)='" . mysql_real_escape_string($derivativfile) . "'", $dblink) or die(mysql_error());
echo "UPDATE `u_luxo`.`derivativefx` SET `status`='done', `donetime`='" . mysql_real_escape_string($array["donetime"]) . "' WHERE CONVERT(`derivativefx`.`status` USING utf8) = 'open' AND CONVERT(`derivativefx`.`file` USING utf8) ='" . mysql_real_escape_string($name) . "' AND CONVERT(`derivativefx`.`derivative` USING utf8)='" . mysql_real_escape_string($derivativfile) . "'\n";
}
}
if ($array["error"]) {
foreach ($array["error"] as $derivativfile) {
$resu1 = mysql_query("UPDATE `u_luxo`.`derivativefx` SET `status`='noexist', `donetime`='" . mysql_real_escape_string($array["donetime"]) . "' WHERE CONVERT(`derivativefx`.`status` USING utf8) = 'open' AND CONVERT(`derivativefx`.`file` USING utf8) ='" . mysql_real_escape_string($name) . "' AND CONVERT(`derivativefx`.`derivative` USING utf8)='" . mysql_real_escape_string($derivativfile) . "'", $dblink) or die(mysql_error());
echo "UPDATE `u_luxo`.`derivativefx` SET `status`='noexist', `donetime`='" . mysql_real_escape_string($array["donetime"]) . "' WHERE CONVERT(`derivativefx`.`status` USING utf8) = 'open' AND CONVERT(`derivativefx`.`file` USING utf8) ='" . mysql_real_escape_string($name) . "' AND CONVERT(`derivativefx`.`derivative` USING utf8)='" . mysql_real_escape_string($derivativfile) . "'\n";
}
}
}
addlog("Botdurchgang erfolgreich, Ende.");
示例7: foreach
<?php
require_once '../util.php';
$is_logged_in = 'sync_to_bitcoin';
foreach (bitcoin_list_accounts(CONFIRMATIONS_FOR_DEPOSIT) as $account => $balance) {
if ($balance) {
try {
get_openid_for_user($account);
// check they have an account
} catch (Exception $e) {
continue;
}
get_user_lock($account);
addlog(LOG_CRONJOB, sprintf("add %s BTC for user %s", internal_to_numstr($balance), $account));
sync_to_bitcoin((string) $account);
release_lock($account);
}
}
示例8: reloadUrl
print "<h1>Category with ID " . $catpost['id'] . " exists</h1>\n";
reloadUrl('Continue', 'transcat.php');
print "<script language=\"javascript\">\n";
print " url = 'showtranscat.php?name=" . $found[name] . "';\n";
print " openDialog( url , 'showtranscat' , 'width=300,height=300,resizable=yes,scrollbars=yes,status=yes' );\n";
print "</script>\n";
break;
}
switch ($dconf['dbtype']) {
case 'mysql':
sql_addCategory($myc, $catpost);
break;
}
print "<h1>Category " . $catpost['id'] . " added</h1>\n";
reloadUrl('Continue', 'transcat.php');
addlog(true, "Category " . $catpost['id'] . " added");
break;
case 'update':
sql_updateTransCat($myc, $catpost);
print "<h1>Category type " . $catpost['type'] . " and original " . $catpost['original'] . " updated</h1>\n";
reloadUrl('Continue', 'listtranscat.php');
break;
case 'delete':
sql_deleteTransCat($myc, $catpost);
print "<h1>Category type " . $catpost['type'] . " and original " . $catpost['original'] . " deleted</h1>\n";
reloadUrl('Continue', 'listtranscat.php');
break;
}
//
// disconnect from main database
//
示例9: sql_brisiAdmin
case 'mysql':
sql_brisiAdmin($myc, $adminpost);
db_writedatachange($myc, 'admins');
break;
}
// notify deleted admin by email
$adminpost['masteradmin'] = $dadmin['fullname'];
$adminpost['nodename'] = $dconf['nodename'];
$mbody = formattemplate($dconf['nonametvhome'] . "/templates/messages/admin.delete.english.txt", $adminpost);
if ($debug) {
dbg("email body", $mbody);
}
sendemail($adminpost['email'], "Your are no longer an NonameTV admin", $mbody);
reloadUrl('Continue', 'index.php');
print "<h1>Deleted admin: " . $adminpost['username'] . "</h1>\n";
addlog(true, "Deleted admin: " . $adminpost['username']);
break;
}
//
// disconnect from main database
//
switch ($dconf['dbtype']) {
case 'mysql':
sql_dodisconnect($myc);
break;
}
?>
</body>
</html>
示例10: rigorMortis
//.........这里部分代码省略.........
break;
}
}
$rm['bullets'][$int] = array($k[0], $k[1], $k['aim'] / (128 / (M_PI * 2)) - M_PI, $rm['bullets']['pistol']['speed'], $j);
$send .= 'Bf' . pack("n", $j) . pack("N", $rmBuffer[$j][$i][1]);
// Send clientID, delta
//addlog("##ADDED## Fire from client ".$j." @ ".$rmBuffer[$j][$i][1]);
} elseif ($rmBuffer[$j][$i][0] == 'F') {
$k['aim'] = $rmBuffer[$j][$i][2];
// To get dir from this:: players[i]['aim']/(128/(Math.PI*2))-Math.PI = Direction
$send .= 'BF' . pack("n", $j) . pack("N", $rmBuffer[$j][$i][1]) . pack("C", $rmBuffer[$j][$i][2]);
//addlog("#CLIENT".$j." FACES ".$rmBuffer[$j][$i][2]." @ ".$rmBuffer[$j][$i][1]);
}
if (isset($col['collision'])) {
// Position overwrite and movement reset due to previous collision
$send .= 'Bp' . pack('n', $j) . pack('N', $rmtick - $k['lerp']) . pack('N', round($k[0] * 1000)) . pack('N', round($k[1] * 1000)) . pack('N', round(($tmp + M_PI) * 1000)) . pack('n', $k[3]);
}
//$send .= 'Bp'.pack("n",$j).$rmBuffer[$j][0];
}
//addlog("@@@@XPOS:".$k[0].",YPOS:".$k[1]);
//////////// Post position collision checking
/*$tmp = round(atan2($k['keyv'][1],$k['keyv'][0]),3);
$calcArray = array(
$k[0] + round(cos($tmp) * $k[3] * ($rmtick-$rmBuffer[$j][count($rmBuffer[$j])-1][1]-$k['lerp'])*0.001,3),
$k[1] + round(sin($tmp) * $k[3] * ($rmtick-$rmBuffer[$j][count($rmBuffer[$j])-1][1]-$k['lerp'])*0.001,3),
//$k[0] + round(cos($tmp) * $k[3] * ($rmLastPush)*0.001,3),
//$k[1] + round(sin($tmp) * $k[3] * ($rmLastPush)*0.001,3),
'size' => $k['size']
);
//addlog("Using ".$rmLastPush." not ".($rmtick-$rmBuffer[$j][count($rmBuffer[$j])-1][1]));
addlog("Collision checking (".$calcArray[0].",".$calcArray[1].")");
$col = collisionCheck($calcArray); // Check current position of this player and reposition them if necessary
if (isset($col['collision'])) {
$k[0] = $col[0]; $k[1] = $col[1];
//$send = ''; // Cancel out any previous pending movement sends
$send .= 'Bp'.pack('n',$j).pack('N',$rmtick-$k['lerp']).pack('N',round($k[0]*1000)).pack('N',round($k[1]*1000)).pack('N',round(($tmp+M_PI)*1000)).pack('n',$k[3]);
$rmBuffer[$j][count($rmBuffer[$j])-1][1] = $rmtick-$k['lerp'];
} else {
//$k[0] = $col[0]; $k[1] = $col[1];
}*/
// Calc new position
// Will periodically check for collisions and move players even if buffer has not changed
/*$tmp = round(atan2($k['keyv'][1],$k['keyv'][0]),3);
$calcArray = array($k[0],$k[1],$tmp,$k[3]);
$calcArray['size'] = $k['size'];
$tpos = calculateNewPosition($rmtick-$rmBuffer[$j][count($rmBuffer[$j])-1][1], $calcArray);
addlog("Calculated New Pos: (".$tpos[0].",".$tpos[1].")");
$rmBuffer[$j][count($rmBuffer[$j])-1][1] = $rmtick; // Set the last time this buffer was accessed to current time. Makes ready for when a change to buffer comes, or next collision check.
$k[0] = $tpos[0]; $k[1] = $tpos[1]; $k[2] = $tpos[2]; $k[3] = $tpos[3];*/
//$send .= 'Bp'.pack('n',$j).pack('N',$rmBuffer[$j][$i][1]).pack('N',round($k[0]*1000)).pack('N',round($k[1]*1000)).pack('N',round(($k[2]+M_PI)*1000)).pack('n',$k[3]);
$rmBuffer[$j] = array_slice($rmBuffer[$j], count($rmBuffer[$j]) - 1);
// Save the last sent packet to use for the next buffer push
//$rmBuffer[$j][0][1] = $rmtick; // Set the time last accessed of this buffer to current time
} else {
//addlog("Client $j is not a player.");
}
}
// Actions based on time
for ($i = 0; $i < count($rm['emitters']); $i++) {
示例11: addToDateU
$currDateTime2 = $currDateTime0->format($dateformat);
$currDateTime2 = addToDateU($currDateTime, -1, 'days', $dateformat);
//dd-MM-yyyy HH:mm
//now()->format("Y-m-d H:i:s");
$AllowedMaps = "11111";
$cntz = dlookup("select count(*) from pointsofinterest where active='1' and type=2 and clientid=" . Session("client_id"));
//$CurrentTime = DlookUP("select Convert(nvarchar(20), DATEADD(HOUR,(select timeZone from clients where ID=" . Session("client_id") . ") - 1,GETDATE()), 120) DateTime");
$tzone = pg_fetch_result($dsAll, 0, "timezone");
$tzone = $tzone - 1;
//$AllowAddPoi = getPriv("AddPOI", Session("user_id"))
//$AllowViewPoi = getPriv("ViewPOI", Session("user_id"))
//$AllowAddZone = getPriv("AddZones", Session("user_id"))
//$AllowViewZone = getPriv("ViewZones", Session("user_id"))
$ua = getBrowser();
$yourbrowser = (bool) strpos($ua['userAgent'], "iPad");
addlog(37, '');
?>
<style>
.ui-autocomplete {
max-height: 100px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
/* add padding to account for vertical scrollbar */
padding-right: 20px;
z-index: 4000;
}
</style>
<style type="text/css">
.ui-button { margin-left: -1px; }
示例12: header
<?php
include "../include/db.php";
include "../include/functions.php";
include "../include/params.php";
include "../include/dictionary2.php";
?>
<?php
header("Content-type: text/html; charset=utf-8");
$ua = getBrowser();
$yourbrowser = (bool) strpos($ua['userAgent'], "iPad");
$yourbrowser1 = (bool) strpos($ua['userAgent'], "Macintosh");
addlog(46);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<?php
if ($yourbrowser == "1") {
?>
html {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
}
示例13: opendb
<?php
opendb();
?>
<?php
header("Content-type: text/html; charset=utf-8");
opendb();
$Allow = getPriv("employees", session("user_id"));
if ($Allow == False) {
echo header('Location: ../permission/?l=' . $cLang);
}
$ua = getBrowser();
$yourbrowser = (bool) strpos($ua['userAgent'], "iPad");
$yourbrowser1 = (bool) strpos($ua['userAgent'], "Macintosh");
addlog(45);
?>
<html>
<head>
<script type="application/javascript">
lang = '<?php
echo $cLang;
?>
';
</script>
<link rel="stylesheet" type="text/css" href="../style.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
.menuTable { display:none; width:200px; }
</style>
<link rel="stylesheet" type="text/css" href="../style.css">
示例14: getQUERY
<?php
include "../include/functions.php";
include "../include/db.php";
?>
<?php
include "../include/params.php";
include "../include/dictionary2.php";
$id = getQUERY("id");
$descr = getQUERY("desc");
opendb();
$desc = dlookup("select registration || ' (' || code || ')<br>GSM number: ' || gsmnumber from vehicles where gsmnumber='" . $descr . "'");
//echo $desc;
addlog($id, $desc);
closedb();
示例15: pg_fetch_result
//$allPOI = dlookup("select count(*) from pinpoints where clientID=" . session("client_id"));
//$allPOIs As String = "false"
//If allPOI < 1000 Then allPOIs = "true"
$DefMap = pg_fetch_result($dsAll, 0, "defaultmap");
$currDateTime = new Datetime();
$currDateTime = $currDateTime->format("d-m-Y H:i");
$currDateTime1 = new Datetime();
$currDateTime1 = $currDateTime1->format("d-m-Y");
//dd-MM-yyyy HH:mm
//now()->format("Y-m-d H:i:s");
$AllowedMaps = "11111";
addlog(32, '');
$cntz = dlookup("select count(*) from pointsofinterest where type=2 and clientid=" . Session("client_id"));
//$CurrentTime = DlookUP("select Convert(nvarchar(20), DATEADD(HOUR,(select timeZone from clients where ID=" . Session("client_id") . ") - 1,GETDATE()), 120) DateTime");
$tzone = pg_fetch_result($dsAll, 0, "timezone");
$tzone = $tzone - 1;
$AllowAddPoi = getPriv("AddPOI", Session("user_id"));
$AllowViewPoi = getPriv("ViewPOI", Session("user_id"));
$AllowAddZone = getPriv("AddZones", Session("user_id"));
$AllowViewZone = getPriv("ViewZones", Session("user_id"));
$pauseTemp = array(5,10,15,20,25,30,35,40,45,50,55,60);
?>
<script>
AllowAddPoi = '<?php echo $AllowAddPoi?>'