本文整理汇总了PHP中_pcpin_loadClass函数的典型用法代码示例。如果您正苦于以下问题:PHP _pcpin_loadClass函数的具体用法?PHP _pcpin_loadClass怎么用?PHP _pcpin_loadClass使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_pcpin_loadClass函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: increaseCounter
/**
* Increase failed logins counter for specified IP address and ban it if maximum allowed login attempt limit exceeds.
* This method must be called on every failed login attempt.
* @param string $ip IP address
* @param string $ban_reason Reason for ban, if issued
*/
function increaseCounter($ip, $ban_reason = '')
{
$ip = trim($ip);
if (!empty($ip)) {
if ($this->_db_query($this->_db_makeQuery(2090, $ip))) {
if (!empty($this->_conf_all['ip_failed_login_limit']) && $this->_db_getList('count', 'ip =# ' . $ip, 1)) {
if ($this->_db_list[0]['count'] > $this->_conf_all['ip_failed_login_limit']) {
_pcpin_loadClass('ipfilter');
$ban = new PCPIN_IPFilter($this);
$ban->addAddress($ip, date('Y-m-d H:i:s', time() + 3600 * $this->_conf_all['ip_failed_login_ban']), $ban_reason, 'd');
$this->clearCounter($ip);
}
}
}
}
}
示例2: deleteAttachment
/**
* Delete attachment
* @param int $id Optional. Attachment ID
* @param int $message_id Optional. Message ID
* @return boolean TRUE on success or FALSE on error
*/
function deleteAttachment($id = 0, $message_id = 0)
{
$result = false;
_pcpin_loadClass('binaryfile');
$binaryfile = new PCPIN_BinaryFile($this);
if (!empty($id) && $this->_db_getList('binaryfile_id', 'id = ' . $id, 1)) {
$result = true;
$binaryfile->deleteBinaryFile($this->_db_list[0]['binaryfile_id']);
$this->_db_deleteRow($id);
} elseif (!empty($message_id) && $this->_db_getList('id,binaryfile_id', 'message_id = ' . $message_id)) {
$result = true;
$ids = $this->_db_list;
foreach ($ids as $data) {
$binaryfile->deleteBinaryFile($data['binaryfile_id']);
$this->_db_deleteRow($data['id']);
}
}
$this->_db_freeList();
return $result;
}
示例3: addNewUserData
/**
* Add new userdata record
* @param int $user_id User ID
* @param array $fields Associative array with field ID as KEY and field value as VAL
*/
function addNewUserData($user_id, $fields = array())
{
// Get available userdata fields
_pcpin_loadClass('userdata_field');
$userdata_field = new PCPIN_UserData_Field($this);
$userdata_field->_db_getList('id,default_value');
$list = $userdata_field->_db_list;
$userdata_field->_db_freeList();
$fields_new = array();
foreach ($list as $data) {
if (isset($fields[$data['id']])) {
$fields_new[$data['id']] = $fields[$data['id']];
} else {
$fields_new[$data['id']] = $data['default_value'];
}
}
// Insert data rows
$this->user_id = $user_id;
foreach ($fields_new as $key => $val) {
$this->field_id = $key;
$this->field_value = $val;
$this->_db_insertObj();
}
}
示例4: _pcpin_loadClass
* This file is part of "PCPIN Chat 6".
*
* "PCPIN Chat 6" is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* "PCPIN Chat 6" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
_pcpin_loadClass('badword');
$badword = new PCPIN_Badword($session);
$errortext = array();
if (!isset($word)) {
$word = '';
}
if (!isset($replacement)) {
$replacement = '';
}
if (!empty($current_user->id) && $current_user->is_admin === 'y') {
if ($word == '') {
$errortext[] = $l->g('word_empty_error');
}
if ($badword->_db_getList('word = ' . $word, 1)) {
$errortext[] = str_replace('[WORD]', $word, $l->g('word_already_exists_error'));
$badword->_db_freeList();
示例5: _pcpin_loadClass
* This file is part of "PCPIN Chat 6".
*
* "PCPIN Chat 6" is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* "PCPIN Chat 6" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
_pcpin_loadClass('nickname');
$nickname = new PCPIN_Nickname($session);
if (empty($profile_user_id) || $profile_user_id != $current_user->id && $current_user->is_admin !== 'y') {
$profile_user_id = $current_user->id;
}
if (empty($nickname_id) || !is_scalar($nickname_id)) {
$nickname_id = 0;
}
if (!empty($nickname_id) && $nickname->_db_getList('id,default', 'id = ' . $nickname_id, 'user_id = ' . $profile_user_id, 1)) {
// Nickname exists
$xmlwriter->setHeaderMessage('OK');
$xmlwriter->setHeaderStatus(0);
if ($nickname->_db_list[0]['default'] != 'y') {
$nickname->setDefault($nickname_id, $profile_user_id);
}
$nickname->_db_freeList();
示例6: _pcpin_loadClass
/**
* This file is part of "PCPIN Chat 6".
*
* "PCPIN Chat 6" is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* "PCPIN Chat 6" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
_pcpin_loadClass('invitation');
$invitation = new PCPIN_Invitation($session);
$invitations_xml = array();
if (!empty($current_user->id)) {
$xmlwriter->setHeaderMessage('OK');
$xmlwriter->setHeaderStatus(0);
$invitations = $invitation->getNewInvitations($current_user->id, false);
foreach ($invitations as $invitation_data) {
if (false === strpos(',' . $current_user->muted_users . ',', ',' . $invitation_data['author_id'] . ',')) {
$invitations_xml[] = array('id' => $invitation_data['id'], 'author_id' => $invitation_data['author_id'], 'author_nickname' => $invitation_data['author_nickname'], 'room_id' => $invitation_data['room_id'], 'room_name' => $invitation_data['room_name']);
}
}
}
$xmlwriter->setData(array('invitation' => $invitations_xml));
示例7: _pcpin_loadClass
* @param int $sort_by Sort by... Values: see $user->getMemberlist()
* @param int $sort_dir Sort direction. Values: see $user->getMemberlist()
* @param int $page_nr Page number.
* @param boolean $banned_only Optional. If TRUE, then only banned users will be listed
* @param boolean $muted_only Optional. If TRUE, then only muted users will be listed
* @param boolean $moderators_only Optional. If TRUE, then only moderators will be listed
* @param boolean $admins_only Optional. If TRUE, then only admins will be listed
* @param boolean $not_activated_only Optional. If TRUE, then only not activated user accounts will be listed
* @param string $user_ids Optional. User IDs separated by comma
* @param int $load_custom_fields Optional. If not empty, custom profile fields will be loaded
*/
_pcpin_loadClass('room');
$room = new PCPIN_Room($session);
_pcpin_loadClass('category');
$category = new PCPIN_Category($session);
_pcpin_loadClass('userdata');
$userdata = new PCPIN_UserData($session);
if (!isset($nickname) || !is_scalar($nickname)) {
$nickname = '';
}
if (!isset($sort_by) || !pcpin_ctype_digit($sort_by)) {
$sort_by = 0;
}
if (!isset($sort_dir) || !pcpin_ctype_digit($sort_dir)) {
$sort_dir = 0;
}
if (!isset($page) || !pcpin_ctype_digit($page)) {
$page = 0;
}
if (!isset($banned_only) || $current_user->is_admin !== 'y') {
$banned_only = false;
示例8: _pcpin_loadClass
* This file is part of "PCPIN Chat 6".
*
* "PCPIN Chat 6" is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* "PCPIN Chat 6" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
_pcpin_loadClass('disallowed_name');
$disallowed_name = new PCPIN_Disallowed_Name($session);
$errortext = array();
if (!isset($name)) {
$name = '';
}
if (!empty($current_user->id) && $current_user->is_admin === 'y') {
if ($name == '') {
$errortext[] = $l->g('name_empty_error');
}
if ($disallowed_name->_db_getList('name = ' . $name, 1)) {
$errortext[] = str_replace('[NAME]', $name, $l->g('name_already_exists_error'));
$disallowed_name->_db_freeList();
}
if (empty($errortext)) {
// Save word
示例9: date
$current_user->globalMuteUnmute($current_user->id, 1, $session->_conf_all['flood_protection_mute_time'] / 60, $l->g('flooding'));
$msg->addMessage(10110, 'n', 0, $l->g('server'), $session->_s_room_id, 0, $current_user->id . '/0/' . $session->_conf_all['flood_protection_mute_time'] / 60 . '/' . $l->g('flooding'), date('Y-m-d H:i:s'), 0, '');
$last_sent_message_repeats_count = 0;
$last_sent_message_hash = '';
break;
// Ignore further messages
} else {
// Add message to database
$last_sent_message_time = time();
$msg->addMessage($type, $offline, $current_user->id, $current_nickname, $target_room_id, $target_user_id, $body, date('Y-m-d H:i:s'), $privacy, $css_properties);
// Attachments?
_pcpin_loadClass('attachment');
$attachment = new PCPIN_Attachment($session);
_pcpin_loadClass('message_log_attachment');
$message_log_attachment = new PCPIN_Message_Log_Attachment($session);
_pcpin_loadClass('binaryfile');
$binaryfile = new PCPIN_BinaryFile($session);
if (!empty($tmpdata_list)) {
foreach ($tmpdata_list as $tmpdata_data) {
$attachment->addAttachment($msg->id, $tmpdata_data['binaryfile_id'], $tmpdata_data['filename']);
if (!empty($session->_conf_all['logging_period']) && $binaryfile->_db_getList('body,size,mime_type', 'id = ' . $tmpdata_data['binaryfile_id'], 1)) {
$message_log_attachment->addLogRecord($msg->id, $tmpdata_data['filename'], $binaryfile->_db_list[0]['body'], $binaryfile->_db_list[0]['size'], $binaryfile->_db_list[0]['mime_type']);
$binaryfile->_db_freeList();
}
}
}
}
}
}
}
}
示例10: _pcpin_loadClass
* (at your option) any later version.
*
* "PCPIN Chat 6" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Update moderator data
*/
_pcpin_loadClass('room');
$room = new PCPIN_Room($session);
_pcpin_loadClass('category');
$category = new PCPIN_Category($session);
if (!isset($moderator_user_id) || !pcpin_ctype_digit($moderator_user_id)) {
$moderator_user_id = 0;
}
if (!isset($categories) || !is_scalar($categories)) {
$categories = '';
}
if (!isset($rooms) || !is_scalar($rooms)) {
$rooms = '';
}
// Get client session
if (is_object($session) && !empty($moderator_user_id) && !empty($current_user->id) && $current_user->is_admin === 'y') {
if ($current_user->_db_getList('id = ' . $moderator_user_id, 1)) {
$xmlwriter->setHeaderMessage('OK');
$xmlwriter->setHeaderStatus(0);
示例11: _pcpin_loadClass
// Get software version
if (!defined('PCPIN_NO_SESSION') && empty($_GET['external_url'])) {
_pcpin_loadClass('version');
$_pcpin_version = new PCPIN_Version($_pcpin_init_session);
if ($_pcpin_version->_db_getList('version', 1)) {
define('PCPIN_VERSION', number_format($_pcpin_version->_db_list[0]['version'], 2, '.', ''));
$_pcpin_version->_db_freeList();
unset($_pcpin_version);
} else {
define('PCPIN_VERSION', '0.00');
}
}
// Load language
if (!defined('PCPIN_NO_SESSION')) {
if (empty($_GET['b_id']) && empty($_GET['external_url'])) {
_pcpin_loadClass('language');
$l = new PCPIN_Language($_pcpin_init_session);
$_pcpin_set_language = $_pcpin_init_session->_s_language_id;
if (!empty($_pcpin_init_session->_conf_all['allow_language_selection']) && !empty($_POST['language_id'])) {
$_pcpin_set_language = $_POST['language_id'];
}
if (true !== $l->setLanguage($_pcpin_set_language)) {
PCPIN_Common::dieWithError(-1, '<b>Fatal error</b>: Failed to load language');
}
if (!empty($_pcpin_init_session->_s_id) && $l->id != $_pcpin_init_session->_s_language_id) {
$_pcpin_init_session->_s_updateSession($_pcpin_init_session->_s_id, true, true, $l->id);
}
unset($_pcpin_set_language);
}
}
/**
示例12: _pcpin_loadClass
*
* "PCPIN Chat 6" is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* "PCPIN Chat 6" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Initiate XML writer object
_pcpin_loadClass('xmlwrite');
$xmlwriter = new PCPIN_XMLWrite($ajax);
// Defaults
$xmlwriter->setHeaderMessage('ACCESS_DENIED');
$xmlwriter->setHeaderStatus(-1);
if (!empty($ajax) && is_scalar($ajax)) {
// AJAX request
switch ($ajax) {
case 'add_avatar_gallery':
// Add new avatar into Avatar gallery
require_once './inc/ajax/add_avatar_gallery.inc.php';
break;
case 'add_banner':
// Add new banner
require_once './inc/ajax/add_banner.inc.php';
break;
示例13: deleteField
/**
* Delete existing field
* @param int $field_id Field ID
*/
function deleteField($field_id)
{
if (!empty($field_id) && $this->_db_getList('id', 'id =# ' . $field_id, 'custom = y', 1)) {
$this->_db_freeList();
if ($this->_db_deleteRow($field_id)) {
// Delete field from all userdata records
_pcpin_loadClass('userdata');
$userdata = new PCPIN_UserData($this);
$userdata->_db_deleteRow($field_id, 'field_id', true);
}
}
}
示例14: _pcpin_loadClass
* (at your option) any later version.
*
* "PCPIN Chat 6" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Get addresses listed in IP filter table
* @param int $sort_by Sort by (0: Address, 1: Action type, 2: Expiration date, 3: Description, 4: "Added on" date)
* @param int $sort_dir Sort direction (0: Ascending, 1: Descending)
*/
_pcpin_loadClass('ipfilter');
$ipfilter = new PCPIN_IPFilter($session);
$ip_addresses = array();
if (!isset($sort_by)) {
$sort_by = 0;
}
if (!isset($sort_dir)) {
$sort_dir = 0;
}
// Get client session
if (is_object($session) && !empty($current_user->id) && $current_user->is_admin === 'y') {
$xmlwriter->setHeaderMessage('OK');
$xmlwriter->setHeaderStatus(0);
$addresses = $ipfilter->readAddresses($sort_by, $sort_dir);
foreach ($addresses as $address_data) {
$ip_addresses[] = array('id' => $address_data['id'], 'type' => $address_data['type'], 'mask' => $address_data['address'], 'added_on' => $current_user->makeDate(PCPIN_Common::datetimeToTimestamp($address_data['added_on'])), 'expires' => $address_data['expires'] > '0000-00-00 00:00:00' ? $current_user->makeDate(PCPIN_Common::datetimeToTimestamp($address_data['expires'])) : $l->g('never'), 'action' => $address_data['action'], 'description' => $address_data['description']);
示例15: _pcpin_loadClass
*
* "PCPIN Chat 6" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Update smilie
* @param int $smilie_id Smilie ID
* @param string $code New smilie code
* @param string $description New smilie description
*/
_pcpin_loadClass('smilie');
$smilie = new PCPIN_Smilie($session);
if (!isset($smilie_id) || !pcpin_ctype_digit($smilie_id)) {
$smilie_id = 0;
}
if (!isset($code) || !is_scalar($code)) {
$code = '';
}
if (!isset($description) || !is_scalar($description)) {
$description = '';
}
// Get client session
if (is_object($session) && !empty($current_user->id) && $session->_s_user_id == $current_user->id && $current_user->is_admin === 'y') {
$xmlwriter->setHeaderMessage($l->g('changes_saved'));
$xmlwriter->setHeaderStatus(0);
if (!empty($smilie_id)) {