本文整理匯總了PHP中IPSText::removeMacrosFromInput方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::removeMacrosFromInput方法的具體用法?PHP IPSText::removeMacrosFromInput怎麽用?PHP IPSText::removeMacrosFromInput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSText
的用法示例。
在下文中一共展示了IPSText::removeMacrosFromInput方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _showNewTopicForm
/**
* Show PM form
*
* @access private
* @param array Array of errors
* @return string returns HTML
*/
private function _showNewTopicForm($errors = '')
{
//-----------------------------------------
// INIT
//-----------------------------------------
/* Check max per day */
if ($this->messengerFunctions->checkHasHitMax()) {
$this->registry->getClass('output')->showError('maxperday_hit', 10271);
}
/* Check PM flood */
if ($this->messengerFunctions->floodControlCheck() !== TRUE) {
$this->registry->getClass('output')->showError(sprintf($this->lang->words['pm_flood_stop'], $this->messengerFunctions->exceptionData[0]), 010271);
}
$_msg_id = 0;
$formMemberID = intval($this->request['fromMemberID']);
# WAS MID
$topicID = intval($this->request['topicID']);
$preview = $this->request['preview'];
$inviteUsers = array();
$displayData = array('errors' => $errors, 'topicID' => $topicID, 'preview' => '', 'name' => '', 'title' => '', 'message' => '');
$_POST['Post-NS'] = isset($_POST['Post']) ? $_POST['Post'] : '';
$_POST['Post'] = IPSText::removeMacrosFromInput(IPSText::raw2form(isset($_POST['Post']) ? $_POST['Post'] : ''));
//-----------------------------------------
// Preview post?
//-----------------------------------------
if ($preview) {
/* Grab language for attachment previews */
$this->registry->getClass('class_localization')->loadLanguageFile(array("public_topic"), 'forums');
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->settings['msg_allow_code'];
IPSText::getTextClass('bbcode')->parsing_section = 'pms';
IPSText::getTextClass('bbcode')->parsing_mgroup = $this->memberData['member_group_id'];
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->memberData['mgroup_others'];
$this->settings['max_emos'] = 0;
$old_msg = IPSText::getTextClass('editor')->processRawPost('Post-NS');
$old_msg = IPSText::getTextClass('bbcode')->preDisplayParse(IPSText::getTextClass('bbcode')->preDbParse($old_msg));
if (!is_object($this->class_attach)) {
//-----------------------------------------
// Grab render attach class
//-----------------------------------------
require_once IPSLib::getAppDir('core') . '/sources/classes/attach/class_attach.php';
$this->class_attach = new class_attach($this->registry);
}
//-----------------------------------------
// Continue...
//-----------------------------------------
$this->class_attach->type = 'msg';
$this->class_attach->attach_post_key = $this->_postKey;
$this->class_attach->init();
$attachData = $this->class_attach->renderAttachments(array(0 => $old_msg));
$displayData['preview'] = $attachData[0]['html'] . $attachData[0]['attachmentHtml'];
}
//-----------------------------------------
// Errors
//-----------------------------------------
if ($errors or IPSText::getTextClass('bbcode')->error != "") {
if (IPSText::getTextClass('bbcode')->error) {
$displayData['errors'][] = $this->lang->words[IPSText::getTextClass('bbcode')->error];
}
$preview = 1;
}
//-----------------------------------------
// Did we come from a button with a user ID?
//-----------------------------------------
if ($formMemberID) {
$name = IPSMember::load($formMemberID, 'core');
if ($name['member_id']) {
$displayData['name'] = $name['members_display_name'];
}
} else {
$displayData['name'] = $this->request['entered_name'] ? $this->request['entered_name'] : '';
}
//-----------------------------------------
// Are we quoting an old message?
//-----------------------------------------
if ($preview) {
$displayData['message'] = $_POST['Post-NS'];
$displayData['title'] = str_replace("'", "'", str_replace('"', '"', IPSText::stripslashes($_POST['msg_title'])));
} else {
if ($topicID) {
$draftTopic = $this->messengerFunctions->fetchTopicDataWithMessage($topicID, TRUE);
if ($draftTopic['mt_to_member_id']) {
$displayData['name'] = $draftTopic['from_name'];
}
if ($draftTopic['mt_title']) {
$_member = IPSMember::load($draftTopic['mt_to_member_id'], 'core');
$displayData['name'] = $_member['members_display_name'];
$displayData['title'] = $draftTopic['mt_title'];
$_msg_id = $draftTopic['msg_id'];
$this->_postKey = $draftTopic['msg_post_key'];
IPSText::getTextClass('bbcode')->parse_html = $this->settings['msg_allow_html'];
//.........這裏部分代碼省略.........
示例2: sendNewPersonalTopic
//.........這裏部分代碼省略.........
throw new Exception('FROM_USER_BLOCKED');
}
}
//-----------------------------------------
// Is this simply a copy-to?
//-----------------------------------------
if ($isCopyTo === TRUE) {
/* Send out the main one */
$this->sendNewPersonalTopic($toMemberID, $fromMemberID, array(), $msgTitle, $_originalMessageContent, array());
/* Send out copy-tos */
foreach ($inviteUsersData as $id => $toMember) {
$this->sendNewPersonalTopic($toMember['member_id'], $fromMemberID, array(), $msgTitle, $_originalMessageContent, array());
}
/* Done */
return TRUE;
}
//-----------------------------------------
// Insert the user data
//-----------------------------------------
$_count = count($inviteUsersData);
//-----------------------------------------
// Got a topic ID?
//-----------------------------------------
if ($options['topicID']) {
/* Fetch topic data */
$_topicData = $this->fetchTopicData($options['topicID']);
if (!$_topicData['mt_id'] and $this->forceMessageToSend !== TRUE) {
throw new Exception('TOPIC_ID_NOT_EXISTS');
}
$this->DB->force_data_type = array('mt_title' => 'string');
/* First off, update message_topics and message_posts... */
$this->DB->update('message_topics', array('mt_date' => time(), 'mt_title' => $msgTitle, 'mt_starter_id' => $fromMemberData['member_id'], 'mt_start_time' => time(), 'mt_last_post_time' => time(), 'mt_invited_members' => serialize(array_keys($inviteUsersData)), 'mt_to_count' => count(array_keys($inviteUsersData)) + 1, 'mt_to_member_id' => $toMemberData['member_id'], 'mt_is_draft' => $isDraft), 'mt_id=' . $_topicData['mt_id']);
/* Now the posts ... */
$this->DB->update('message_posts', array('msg_date' => time(), 'msg_topic_id' => $_topicData['mt_id'], 'msg_post' => IPSText::removeMacrosFromInput($msgContent), 'msg_author_id' => $fromMemberData['member_id'], 'msg_is_first_post' => 1, 'msg_ip_address' => $this->member->ip_address), 'msg_id=' . $_topicData['mt_first_msg_id']);
/* Delete any current user mapping as this will be sorted out below */
$this->DB->delete('message_topic_user_map', 'map_topic_id=' . $_topicData['mt_id']);
/* Reset variable IDs */
$msg_topic_id = $_topicData['mt_id'];
$msg_id = $_topicData['mt_first_msg_id'];
IPSMember::save($toMemberData['member_id'], array('core' => array('msg_count_new' => 'plus:1')));
} else {
/* Create topic entry */
$this->DB->force_data_type = array('mt_title' => 'string');
$this->DB->insert('message_topics', array('mt_date' => time(), 'mt_title' => $msgTitle, 'mt_starter_id' => $fromMemberData['member_id'], 'mt_start_time' => time(), 'mt_last_post_time' => time(), 'mt_invited_members' => serialize(array_keys($inviteUsersData)), 'mt_to_count' => count(array_keys($inviteUsersData)) + 1, 'mt_to_member_id' => $toMemberData['member_id'], 'mt_is_draft' => $isDraft ? 1 : 0, 'mt_is_system' => $isSystem, 'mt_replies' => 0));
$msg_topic_id = $this->DB->getInsertId();
$this->DB->insert('message_posts', array('msg_date' => time(), 'msg_topic_id' => $msg_topic_id, 'msg_post' => IPSText::removeMacrosFromInput($msgContent), 'msg_post_key' => $options['postKey'], 'msg_author_id' => $fromMemberData['member_id'], 'msg_is_first_post' => 1, 'msg_ip_address' => $this->member->ip_address));
$msg_id = $this->DB->getInsertId();
IPSMember::save($toMemberData['member_id'], array('core' => array('msg_count_new' => 'plus:1')));
}
//-----------------------------------------
// Update with last / first msg ID
//-----------------------------------------
$this->DB->update('message_topics', array('mt_last_msg_id' => $msg_id, 'mt_first_msg_id' => $msg_id, 'mt_hasattach' => intval($this->_makeAttachmentsPermanent($options['postKey'], $msg_id, $msg_topic_id))), 'mt_id=' . $msg_topic_id);
//-----------------------------------------
// Not a draft?
//-----------------------------------------
if ($isDraft !== TRUE) {
//-----------------------------------------
// Add in 'to user' and 'from user' to the cc array
//-----------------------------------------
$inviteUsersData[$toMemberData['member_id']] = $toMemberData;
$inviteUsersData[$fromMemberData['member_id']] = $fromMemberData;
//-----------------------------------------
// Loop....
//-----------------------------------------
foreach ($inviteUsersData as $id => $toMember) {
示例3: saveAboutMe
/**
* UserCP Save Form: About me page
*
* @access public
* @return array Errors
*/
public function saveAboutMe()
{
//-----------------------------------------
// Check to make sure that we can edit profiles..
//-----------------------------------------
if (!$this->memberData['g_edit_profile']) {
$this->registry->getClass('output')->showError('members_profile_disabled', 10212);
}
$aboutme = $this->DB->buildAndFetch(array('select' => 'pp_member_id, pp_about_me', 'from' => 'profile_portal', 'where' => 'pp_member_id=' . $this->memberData['member_id']));
//-----------------------------------------
// Remove board tags
//-----------------------------------------
$this->request['Post'] = IPSText::removeMacrosFromInput($this->request['Post']);
//-----------------------------------------
// Post process the editor
// Now we have safe HTML and bbcode
//-----------------------------------------
$post = IPSText::getTextClass('editor')->processRawPost('Post');
//-----------------------------------------
// Parse post
//-----------------------------------------
IPSText::getTextClass('bbcode')->parse_smilies = intval($this->settings['aboutme_emoticons']);
IPSText::getTextClass('bbcode')->parse_html = intval($this->settings['aboutme_html']);
IPSText::getTextClass('bbcode')->parse_bbcode = intval($this->settings['aboutme_bbcode']);
IPSText::getTextClass('bbcode')->parsing_section = 'aboutme';
$post = IPSText::getTextClass('bbcode')->preDbParse($post);
$text = IPSText::getTextClass('bbcode')->preDisplayParse($post);
if (IPSText::getTextClass('bbcode')->error != "") {
$this->lang->loadLanguageFile(array('public_post'), 'forums');
$this->registry->getClass('output')->showError(IPSText::getTextClass('bbcode')->error, 10213);
}
//-----------------------------------------
// Write it to the DB.
//-----------------------------------------
IPSMember::save($this->memberData['member_id'], array('extendedProfile' => array('pp_about_me' => $post)));
return TRUE;
}
示例4: compilePostData
/**
* Compiles all the incoming information into an array which is returned to hte accessor
*
* @access protected
* @return array
**/
protected function compilePostData()
{
//-----------------------------------------
// Sort out post content
//-----------------------------------------
if ($this->getPostContentPreFormatted()) {
$postContent = $this->getPostContentPreFormatted();
} else {
$postContent = $this->formatPost($this->getPostContent());
}
//-----------------------------------------
// Remove board tags
//-----------------------------------------
$postContent = IPSText::removeMacrosFromInput($postContent);
//-----------------------------------------
// Need to format the post?
//-----------------------------------------
$post = array('author_id' => $this->getAuthor('member_id') ? $this->getAuthor('member_id') : 0, 'use_sig' => $this->getSettings('enableSignature'), 'use_emo' => $this->getSettings('enableEmoticons'), 'ip_address' => $this->member->ip_address, 'post_date' => time(), 'icon_id' => $this->request['iconid'] ? $this->request['iconid'] : 0, 'post' => $postContent, 'author_name' => $this->getAuthor('member_id') ? $this->getAuthor('members_display_name') : $this->request['UserName'], 'topic_id' => "", 'queued' => $this->getPublished() ? 0 : 1, 'post_htmlstate' => $this->getSettings('post_htmlstatus'));
//-----------------------------------------
// If we had any errors, parse them back to this class
// so we can track them later.
//-----------------------------------------
IPSText::getTextClass('bbcode')->parse_smilies = $post['use_emo'];
IPSText::getTextClass('bbcode')->parse_html = ($this->getForumData('use_html') and $this->getAuthor('g_dohtml') and $post['post_htmlstate']) ? 1 : 0;
IPSText::getTextClass('bbcode')->parse_nl2br = $post['post_htmlstate'] == 2 ? 1 : 0;
IPSText::getTextClass('bbcode')->parse_bbcode = $this->getForumData('use_ibc') ? 1 : 0;
IPSText::getTextClass('bbcode')->parsing_section = 'topics';
IPSText::getTextClass('bbcode')->parsing_mgroup = $this->getAuthor('member_group_id');
IPSText::getTextClass('bbcode')->parsing_mgroup_others = $this->getAuthor('mgroup_others');
$testParse = IPSText::getTextClass('bbcode')->preDisplayParse($postContent);
if (IPSText::getTextClass('bbcode')->error) {
$this->_postErrors = IPSText::getTextClass('bbcode')->error;
}
return $post;
}
示例5: saveFormNotes
/**
* UserCP Save Form: Notes
*
* @access public
* @return boolean Successful
*/
public function saveFormNotes()
{
//-----------------------------------------
// Remove board tags
//-----------------------------------------
$_POST['Post'] = IPSText::removeMacrosFromInput($_POST['Post']);
//-----------------------------------------
// Write it to the DB.
//-----------------------------------------
IPSMember::save($this->memberData['member_id'], array('extendedProfile' => array('notes' => htmlspecialchars($_POST['Post']))));
$this->ok_message = $this->lang->words['notes_saved_msg'];
return TRUE;
}