当前位置: 首页>>代码示例>>PHP>>正文


PHP EventLog::add方法代码示例

本文整理汇总了PHP中EventLog::add方法的典型用法代码示例。如果您正苦于以下问题:PHP EventLog::add方法的具体用法?PHP EventLog::add怎么用?PHP EventLog::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EventLog的用法示例。


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

示例1: save

 function save()
 {
     $rValue = false;
     if ($this->name != "" && $this->project_id != "" && $this->version != "") {
         global $dbh;
         if ($this->file_id == 0) {
             $this->file_id = $this->getFileID($this->name, $this->project_id, $this->version);
         }
         $sql = "INSERT INTO";
         $where = "";
         if ($this->file_id > 0) {
             $sql = "UPDATE";
             $where = " WHERE file_id = " . sqlSanitize($this->file_id, $dbh);
         }
         $Event = new EventLog("files", "file_id", $this->file_id, $sql);
         $sql .= " files \n\t\t\t\t\t\tSET file_id \t= " . sqlSanitize($this->file_id, $dbh) . ",\n\t\t\t\t\t\t\tproject_id\t= " . returnQuotedString(sqlSanitize($this->project_id, $dbh)) . ", \n\t\t\t\t\t\t\tversion\t\t= " . returnQuotedString(sqlSanitize($this->version, $dbh)) . ", \n\t\t\t\t\t\t\tname\t\t= " . returnQuotedString(sqlSanitize($this->name, $dbh)) . ",\n\t\t\t\t\t\t\tplugin_id\t= " . returnQuotedString(sqlSanitize($this->plugin_id, $dbh)) . ",\n\t\t\t\t\t\t\tis_active\t= " . $this->is_active . $where;
         if (mysql_query($sql, $dbh)) {
             if ($this->file_id == 0) {
                 $this->file_id = mysql_insert_id($dbh);
                 $Event->key_value = $this->file_id;
             }
             $rValue = true;
             $Event->add();
         } else {
             echo $sql . "\n";
             $GLOBALS['g_ERRSTRS'][1] = mysql_error();
         }
     } else {
         echo "ERROR: One missing:Name: " . $this->name . "Project: " . $this->project_id . "Version: " . $this->version;
     }
     return $rValue;
 }
开发者ID:Tiger66639,项目名称:server-1,代码行数:32,代码来源:file.class.php

示例2: load

 function load($email, $password)
 {
     if ($email != "" && $password != "") {
         if (eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z.]{2,5}$', $email)) {
             global $addon;
             $addon->callHook('user_authentication', array(&$this, $email, $password));
         }
     }
     if ($this->userid > 0) {
         $Event = new EventLog("users", "userid", $this->userid, "__auth_success");
         $Event->add();
     } else {
         $Event = new EventLog("users", "userid", $_SERVER['REMOTE_ADDR'] . ":" . $email, "__auth_failure");
         $Event->add();
     }
     return $this->userid;
 }
开发者ID:joklaps,项目名称:mytourbook,代码行数:17,代码来源:user.class.php

示例3: deactivate

 /**
  * Sets a string as inactive
  * @author droy
  * @param Integer string_id
  * @return bool success status
  */
 function deactivate($_string_id)
 {
     $rValue = 0;
     if ($_string_id > 0) {
         global $dbh;
         $sql = "UPDATE strings \n\t\t\t\t\tSET is_active = 0 WHERE string_id = " . sqlSanitize($_string_id, $dbh);
         $rValue = mysql_query($sql, $dbh);
         $Event = new EventLog("strings", "string_id", $_string_id, "DEACTIVATE");
         $Event->add();
     }
     return $rValue;
 }
开发者ID:Tiger66639,项目名称:server-1,代码行数:18,代码来源:string.class.php


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