本文整理汇总了PHP中iaUtil::getIp方法的典型用法代码示例。如果您正苦于以下问题:PHP iaUtil::getIp方法的具体用法?PHP iaUtil::getIp怎么用?PHP iaUtil::getIp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iaUtil
的用法示例。
在下文中一共展示了iaUtil::getIp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerVisitor
public function registerVisitor()
{
$entryData = array('status' => iaCore::STATUS_ACTIVE, 'page' => IA_SELF, 'date' => date(iaDb::DATETIME_FORMAT));
if (self::hasIdentity()) {
$entryData['username'] = self::getIdentity()->username;
$entryData['fullname'] = self::getIdentity()->fullname;
} else {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$signatures = array('bot', 'spider', 'crawler', 'wget', 'curl', 'validator');
foreach ($signatures as $signature) {
if (stripos($_SERVER['HTTP_USER_AGENT'], $signature) !== false) {
$entryData['is_bot'] = 1;
$entryData['fullname'] = $_SERVER['HTTP_USER_AGENT'];
break;
}
}
}
}
$sessionId = session_id();
$iaDb =& $this->iaCore->iaDb;
$iaDb->setTable('online');
if ((int) $iaDb->one(iaDb::STMT_COUNT_ROWS, iaDb::convertIds($sessionId, 'session_id'))) {
$iaDb->update($entryData, "`session_id` = '{$sessionId}'");
} else {
$entryData['session_id'] = $sessionId;
$entryData['ip'] = iaUtil::getIp();
$iaDb->insert($entryData);
}
$iaDb->resetTable();
}
示例2: registerVisitor
public function registerVisitor()
{
$entryData = array('status' => iaCore::STATUS_ACTIVE, 'page' => IA_SELF);
if (self::hasIdentity()) {
$entryData['username'] = self::getIdentity()->username;
$entryData['fullname'] = self::getIdentity()->fullname;
} else {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$signatures = array('bot', 'spider', 'crawler', 'wget', 'curl', 'validator');
foreach ($signatures as $signature) {
if (stripos($_SERVER['HTTP_USER_AGENT'], $signature) !== false) {
$entryData['is_bot'] = 1;
$entryData['fullname'] = $_SERVER['HTTP_USER_AGENT'];
break;
}
}
}
}
$sessionId = session_id();
$iaDb =& $this->iaCore->iaDb;
$iaDb->setTable('online');
$count = (int) $iaDb->one(iaDb::STMT_COUNT_ROWS, iaDb::convertIds($sessionId, 'session_id'));
$rawValues = array('date' => iaDb::FUNCTION_NOW);
if ($count > 0) {
$iaDb->update($entryData, "`session_id` = '{$sessionId}'", $rawValues);
} else {
$entryData['session_id'] = $sessionId;
$entryData['ip'] = iaUtil::getIp();
$iaDb->insert($entryData, $rawValues);
}
$iaDb->update(array('status' => 'expired'), '`date` < NOW() - INTERVAL 20 MINUTE');
$iaDb->delete('`date` < NOW() - INTERVAL 2 DAY');
}
示例3: array
return;
}
$output = array('result' => false, 'message' => iaLanguage::get('unable_to_approve_listing'));
if (!iaUsers::hasIdentity()) {
$iaView->assign($output);
return;
}
$iaItem = $iaCore->factory('item');
$iaCore->factory('util');
$itemName = $_POST['item'];
$itemId = $_POST['id'];
if ($packageName = $iaItem->getPackageByItem($itemName)) {
$packageInstance = $iaCore->factoryPackage('item', $packageName, iaCore::FRONT, $itemName);
$itemData = $packageInstance->getById($itemId);
$itemUrl = $packageInstance->url('view', $itemData);
$entry = array('date' => date(iaDb::DATETIME_FORMAT), 'ip' => iaUtil::getIp(), 'member_id' => iaUsers::getIdentity()->id, 'item' => $itemName, 'item_id' => $itemId, 'item_title' => $itemData['title'] ? $itemData['title'] : $itemData['venue_title'], 'item_url' => $itemUrl, 'type' => $_POST['type'], 'status' => 'pending', 'notes' => null);
$message = null;
switch ($_POST['type']) {
case 'manual':
$entry['name'] = empty($_POST['name']) ? null : $_POST['name'];
$entry['email'] = empty($_POST['email']) ? null : $_POST['email'];
$entry['phone'] = empty($_POST['phone']) ? null : $_POST['phone'];
$entry['job_title'] = empty($_POST['job_title']) ? null : $_POST['job_title'];
$message = iaLanguage::get('your_request_saved');
break;
case 'email':
if (!$iaCore->get('cl_enable_email_approval')) {
return;
}
if (!empty($itemData['email'])) {
$key = iaUtil::generateToken();