本文整理汇总了PHP中logger::getip方法的典型用法代码示例。如果您正苦于以下问题:PHP logger::getip方法的具体用法?PHP logger::getip怎么用?PHP logger::getip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logger
的用法示例。
在下文中一共展示了logger::getip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logKill
/**
* Log a new kill.
*
* @param integer $killid
* @param string $note
*/
public static function logKill($killid, $note = null)
{
if (is_null($note)) {
$note = "IP:" . logger::getip();
}
$qry = DBFactory::getDBQuery(true);
$qry->execute("INSERT INTO kb3_log (log_kll_id, log_site," . " log_ip_address, log_timestamp) values(" . $killid . ",'" . KB_SITE . "','" . $qry->escape($note) . "', UTC_TIMESTAMP())");
}
示例2: addComment
/**
* Add a comment to a kill.
*
* The kill id is set when the Comments object is constructed.
* @param string $name The name of the comment poster.
* @param string $text The text of the comment to post.
*/
function addComment($name, $text)
{
$comment = $this->bbencode(trim($text));
$name = trim($name);
$qryP = new DBPreparedQuery();
$sql = "INSERT INTO kb3_comments (`kll_id`,`site`, `comment`,`name`,`posttime`, `ip`)\n VALUES (?, ?, ?, ?, ?, ?)";
$qryP->prepare($sql);
$site = KB_SITE;
$date = kbdate('Y-m-d H:i:s');
$ip = logger::getip();
$params = array('isssss', &$this->id_, &$site, &$comment, &$name, &$date, &$ip);
$qryP->bind_params($params);
$qryP->execute();
$id = $qryP->getInsertID();
$this->comments_[] = array('time' => kbdate('Y-m-d H:i:s'), 'name' => $name, 'comment' => $comment, 'id' => $id);
// create comment_added event
event::call('comment_added', $this);
}