本文整理匯總了PHP中IPSText::br2nl方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::br2nl方法的具體用法?PHP IPSText::br2nl怎麽用?PHP IPSText::br2nl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSText
的用法示例。
在下文中一共展示了IPSText::br2nl方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: forward_form
function forward_form($title = "", $text = "", $lang = "", $captchaHTML = '', $msg = '')
{
$IPBHTML = "";
if (IPSLib::locationHasHooks('skin_emails', $this->_funcHooks['forward_form'])) {
$count_7c5bc7202e6623ca381ed344e9ec6db0 = is_array($this->functionData['forward_form']) ? count($this->functionData['forward_form']) : 0;
$this->functionData['forward_form'][$count_7c5bc7202e6623ca381ed344e9ec6db0]['title'] = $title;
$this->functionData['forward_form'][$count_7c5bc7202e6623ca381ed344e9ec6db0]['text'] = $text;
$this->functionData['forward_form'][$count_7c5bc7202e6623ca381ed344e9ec6db0]['lang'] = $lang;
$this->functionData['forward_form'][$count_7c5bc7202e6623ca381ed344e9ec6db0]['captchaHTML'] = $captchaHTML;
$this->functionData['forward_form'][$count_7c5bc7202e6623ca381ed344e9ec6db0]['msg'] = $msg;
}
$IPBHTML .= "<form action=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=forums&module=extras&section=forward", "public", ''), "", "") . "\" method=\"post\" name='REPLIER'>\n\t<input type=\"hidden\" name=\"do\" value=\"01\" />\n\t<input type=\"hidden\" name=\"st\" value=\"{$this->request['st']}\" />\n\t<input type=\"hidden\" name=\"f\" value=\"{$this->request['f']}\" />\n\t<input type=\"hidden\" name=\"t\" value=\"{$this->request['t']}\" />\n\t<input type=\"hidden\" name=\"url\" value=\"{$this->request['url']}\" />\n\t<input type=\"hidden\" name=\"title\" value=\"{$this->request['title']}\" />\n\t<input type='hidden' name='k' value='{$this->member->form_hash}' />\n\t" . ($msg ? "\n\t\t<p class='message error'>{$this->lang->words[$msg]}</p><br />\n\t" : "\n\t\t<p class='message'>{$this->lang->words['email_friend']}</p><br />\n\t") . "\n\t\n\t<h2 class='maintitle'>{$this->lang->words['title']}</h2>\n\t<div class='generic_bar'></div>\n\t<div class='ipsForm ipsForm_horizontal'>\n\t\t<fieldset>\n\t\t\t<h3 class='bar'>{$this->lang->words['email_recepient']}</h3>\n\t\t\t<ul class='ipsPad'>\n\t\t\t\t" . (count($this->caches['lang_data']) == 1 ? "\n\t\t\t\t\t<input type='hidden' name='lang' value='{$this->caches['lang_data'][0]['lang_id']}' />\n\t\t\t\t" : "\n\t\t\t\t\t<li class='ipsField clear'>\n\t\t\t\t\t\t<label for='to_lang' class='ipsField_title'>{$this->lang->words['send_lang']}</label>\n\t\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t\t<select name='lang' class='input_select' id='to_lang'>\n\t\t\t\t\t\t\t\t" . $this->__f__51cb3b5822a1e12831217597c9a44779($title, $text, $lang, $captchaHTML, $msg) . "\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</li>\n\t\t\t\t") . "\n\t\t\t\t<li class='ipsField clear'>\n\t\t\t\t\t<label for='to_name' class='ipsField_title'>{$this->lang->words['to_name']}</label>\n\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t<input type=\"text\" id='to_name' class='input_text' name=\"to_name\" value=\"{$this->request['to_name']}\" size=\"30\" maxlength=\"100\" />\n\t\t\t\t\t</p>\n\t\t\t\t</li>\n\t\t\t\t<li class='ipsField clear'>\n\t\t\t\t\t<label for='to_email' class='ipsField_title'>{$this->lang->words['to_email']}</label>\n\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t<input type=\"text\" id='to_email' class='input_text' name=\"to_email\" value=\"{$this->request['to_email']}\" size=\"30\" maxlength=\"100\" />\n\t\t\t\t\t</p>\n\t\t\t\t</li>\n\t\t\t\t<li class='ipsField clear'> \n\t\t\t\t\t<label for='subject' class='ipsField_title'>{$this->lang->words['subject']}</label>\n\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t<input type=\"text\" id=\"subject\" class=\"input_text\" name=\"subject\" value=\"" . ($this->request['subject'] ? "{$this->request['subject']}" : "{$title}") . "\" size=\"30\" maxlength=\"120\" />\n\t\t\t\t\t</p>\n\t\t\t\t</li> \t\t\t\t\n\t\t\t\t<li class='ipsField clear'>\n\t\t\t\t\t<label for='to_message' class='ipsField_title'>{$this->lang->words['message']}</label>\n\t\t\t\t\t<p class='ipsField_content'>\n\t\t\t\t\t\t<textarea id='to_message' cols=\"60\" rows=\"12\" wrap=\"soft\" name=\"message\" class=\"input_text\">" . ($this->request['message'] ? "" . IPSText::br2nl($this->request['message']) . "" : "{$text}") . "</textarea>\n\t\t\t\t\t</p>\n\t\t\t\t</li>\n\t\t\t\t" . ($captchaHTML ? "\n\t\t\t\t\t<li class='ipsField clear'>\n\t\t\t\t\t\t{$captchaHTML}\n\t\t\t\t\t</li>\n\t\t\t\t" : "") . "\n\t\t\t</ul>\n\t\t</fieldset>\n\t\t<fieldset class='submit'>\n\t\t\t<input class='input_submit' type=\"submit\" value=\"{$this->lang->words['submit_send']}\" />\n\t\t</fieldset>\n\t</div>\n</form>";
return $IPBHTML;
}
示例2: banOverview
/**
* Ban filter overview screen
*
* @param array IPs
* @param array Emails
* @param array Usernames
* @return string HTML
*/
public function banOverview($ips, $emails, $names)
{
$IPBHTML = "";
//--starthtml--//
$canRemove = $this->registry->class_permissions->checkPermission('ban_remove');
/* Ban types */
$ban = array();
$ban['bantype'] = $this->registry->output->formDropdown('bantype', array(array('ip', $this->lang->words['ban_ip']), array('email', $this->lang->words['ban_email']), array('name', $this->lang->words['ban_name'])));
$ban['bantext'] = $this->registry->output->formSimpleInput('bantext', '', 50);
$ban['banreason'] = $this->registry->output->formSimpleInput('banreason', '', 50);
/* Remove new lines from the type dropdown or JS won't be happy.. */
$ban['bantype'] = IPSText::br2nl($ban['bantype']);
$IPBHTML .= <<<HTML
<div class='section_title'>
\t<h2>{$this->lang->words['ban_title']}</h2>
\t<div class='ipsActionBar clearfix'>
\t\t<ul>
\t\t\t<li class='ipsActionButton'>
\t\t\t\t<a href='#' id='add_banfilter' title='{$this->lang->words['ban_addnew']}'><img src='{$this->settings['skin_acp_url']}/images/icons/add.png' alt='' /> {$this->lang->words['ban_addnew']}</a>
\t\t\t</li>
\t\t</ul>
\t</div>
</div>
<script tyle='text/javascript' src='{$this->settings['js_app_url']}acp.banfilters.js'></script>
<form method='post' id='ban-delete' action='{$this->settings['base_url']}{$this->form_code}'>
\t<input type='hidden' name='do' value='ban_delete' />
\t<input type='hidden' name='_admin_auth_key' value='{$this->registry->adminFunctions->_admin_auth_key}' />
\t<div class='acp-box'>
\t\t<h3>{$this->lang->words['ban_bancontrol']}</h3>
\t\t
\t\t<div id='tabstrip_banForm' class='ipsTabBar with_left with_right'>
\t\t\t<span class='tab_left'>«</span>
\t\t\t<span class='tab_right'>»</span>
\t\t\t<ul>
\t\t\t\t<li id='tab_BanIps'>{$this->lang->words['ban_ips']}</li>
\t\t\t\t<li id='tab_BanEmails'>{$this->lang->words['ban_emails']}</li>
\t\t\t\t<li id='tab_BanNames'>{$this->lang->words['ban_names']}</li>
\t\t\t</ul>
\t\t</div>
\t\t
\t\t<div id='tabstrip_banForm_content' class='ipsTabBar_content'>
\t\t\t
\t\t\t<!-- IP ADDRESSES -->
\t\t\t<div id='tab_BanIps_content'>
\t\t\t\t<table class='ipsTable double_pad'>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<th width='1%'> </th>
\t\t\t\t\t\t<th width='15%'>{$this->lang->words['ban_ip']}</th>
\t\t\t\t\t\t<th width='60%'>{$this->lang->words['ban_form_reason']}</th>
\t\t\t\t\t\t<th width='24%'>{$this->lang->words['ban_added_on']}</th>
\t\t\t\t\t</tr>
HTML;
if (is_array($ips) && count($ips)) {
foreach ($ips as $r) {
$checkbox = $canRemove ? "<input type='checkbox' name='banid_{$r['ban_id']}' value='1' />" : '';
$IPBHTML .= <<<HTML
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td>{$checkbox}</td>
\t\t\t\t\t\t<td>{$r['ban_content']}</td>
\t\t\t\t\t\t<td>{$r['ban_reason']}</td>
\t\t\t\t\t\t<td>{$r['_date']}</td>
\t\t\t\t\t</tr>
HTML;
}
} else {
$IPBHTML .= <<<HTML
\t\t\t\t\t<tr>
\t\t\t\t\t\t<td colspan='4'>{$this->lang->words['ban_ips_none']}</td>
\t\t\t\t\t</tr>
HTML;
}
$IPBHTML .= <<<HTML
\t\t \t\t</table>
\t\t\t</div>
\t\t\t
\t\t\t<!-- EMAIL ADDRESSES -->
\t\t\t<div id='tab_BanEmails_content'>
\t\t\t\t<table class='ipsTable double_pad'>
\t\t\t\t\t<tr>
\t\t\t\t\t\t<th width='1%'> </th>
\t\t\t\t\t\t<th width='20%'>{$this->lang->words['ban_email']}</th>
\t\t\t\t\t\t<th width='55%'>{$this->lang->words['ban_form_reason']}</th>
\t\t\t\t\t\t<th width='24%'>{$this->lang->words['ban_added_on']}</th>
\t\t\t\t\t</tr>
HTML;
if (is_array($emails) && count($emails)) {
//.........這裏部分代碼省略.........
示例3: databaseAddField
public function databaseAddField($fieldInfo)
{
$_save = array('field_database_id' => $fieldInfo['field_database_id'], 'field_name' => trim($fieldInfo['field_name']), 'field_key' => md5(uniqid(microtime(), true)), 'field_description' => trim($fieldInfo['field_description']), 'field_type' => trim($fieldInfo['field_type']), 'field_required' => intval($fieldInfo['field_required']), 'field_user_editable' => intval($fieldInfo['field_user_editable']), 'field_max_length' => intval($fieldInfo['field_max_length']), 'field_extra' => IPSText::br2nl(trim($fieldInfo['field_extra'])), 'field_html' => intval($fieldInfo['field_html']), 'field_is_numeric' => intval($fieldInfo['field_is_numeric']), 'field_truncate' => intval($fieldInfo['field_truncate']), 'field_default_value' => $fieldInfo['field_default_value'], 'field_display_listing' => intval($fieldInfo['field_display_listing']), 'field_display_display' => intval($fieldInfo['field_display_display']), 'field_format_opts' => is_array($fieldInfo['field_format_opts']) && count($fieldInfo['field_format_opts']) ? implode(',', $fieldInfo['field_format_opts']) : '');
//-----------------------------------------
// Get possible field types
//-----------------------------------------
require_once IPSLib::getAppDir('ccs') . '/sources/databases/fields.php';
$fields = new ccs_database_fields($this->registry);
$types = $fields->getTypes();
//-----------------------------------------
// Validator
//-----------------------------------------
$validators = $fields->getValidators();
if ($fieldInfo['field_validator'] != 'none') {
if (array_key_exists($fieldInfo['field_validator'], $validators)) {
if ($fieldInfo['field_validator'] == 'custom') {
$_save['field_validator'] = $fieldInfo['field_validator'] . ';_;' . str_replace('\', '\\', $fieldInfo['field_validator_custom']) . ';_;' . $fieldInfo['field_validator_error'];
} else {
$_save['field_validator'] = $fieldInfo['field_validator'];
}
}
} else {
$_save['field_validator'] = '';
}
//-----------------------------------------
// Verify field type
//-----------------------------------------
$_isOk = false;
foreach ($types as $_type) {
if ($_type[0] == $_save['field_type']) {
$_isOk = true;
$_save = $fields->preSaveField($_save);
break;
}
}
if (!$_isOk) {
$this->registry->output->showError($this->lang->words['field_type_invalid'], '11CCS52');
}
//-----------------------------------------
// Check key
//-----------------------------------------
$_key = $this->DB->buildAndFetch(array('select' => 'field_id', 'from' => 'ccs_database_fields', 'where' => "field_database_id={$_save['field_database_id']} AND field_key='{$_save['field_key']}'"));
if ($_key['field_id']) {
//$this->registry->output->showError( $this->lang->words['field_key_in_use'] );
$_save['field_key'] = md5(uniqid(microtime(), true));
}
//-----------------------------------------
// Set position
//-----------------------------------------
$max = $this->DB->buildAndFetch(array('select' => 'MAX(field_position) as position', 'from' => 'ccs_database_fields', 'where' => "field_database_id={$_save['field_database_id']}"));
$_save['field_position'] = $max['position'] + 1;
$this->DB->insert('ccs_database_fields', $_save);
$id = $this->DB->getInsertId();
//-----------------------------------------
// Add field to db
//-----------------------------------------
$this->DB->addField('ccs_custom_database_' . $fieldInfo['field_database_id'], 'field_' . $id, 'TEXT');
//-----------------------------------------
// Update database
//-----------------------------------------
$this->DB->update('ccs_databases', array('database_field_count' => 'database_field_count+1'), 'database_id=' . $fieldInfo['field_database_id']);
$this->rebuildFieldCache();
}
示例4: _htmlize
/**
* CKEditor will send posts with HTML entites (<). If we have HTML enabled
* we need to make sure that these HTML entites are converted back into HTML
* and that <br> tags are converted into newlines
* @param string $conten.
*/
protected function _htmlize($content)
{
return $content;
$content = IPSText::br2nl($content);
$content = IPSText::UNhtmlspecialchars($content);
}
示例5: warnForm
function warnForm($member, $errors = '', $modque = false, $postque = false, $ban = false, $editor_html = '')
{
$IPBHTML = "";
if (IPSLib::locationHasHooks('skin_modcp', $this->_funcHooks['warnForm'])) {
$count_571a68c2d8894723c2cc2d545530e8e6 = is_array($this->functionData['warnForm']) ? count($this->functionData['warnForm']) : 0;
$this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['member'] = $member;
$this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['errors'] = $errors;
$this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['modque'] = $modque;
$this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['postque'] = $postque;
$this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['ban'] = $ban;
$this->functionData['warnForm'][$count_571a68c2d8894723c2cc2d545530e8e6]['editor_html'] = $editor_html;
}
$mod_arr = array('timespan' => 0, 'days' => 0, 'hours' => 0);
$mhours = 0;
if ($member['mod_posts'] > 0 and $member['mod_posts'] != 1) {
$mod_arr = IPSMember::processBanEntry($member['mod_posts']);
if ($mod_arr['date_end'] > time()) {
$mhours = ceil(($mod_arr['date_end'] - time()) / 3600);
}
}
$post_arr = array('timespan' => 0, 'hours' => 0, 'days' => 0);
$phours = 0;
if ($member['restrict_post'] > 0 and $member['restrict_post'] != 1) {
$post_arr = IPSMember::processBanEntry($member['restrict_post']);
if ($post_arr['date_end'] > time()) {
$phours = ceil(($post_arr['date_end'] - time()) / 3600);
}
}
$ban_arr = array('timespan' => 0, 'days' => 0, 'hours' => 0);
$hours = 0;
if ($member['temp_ban'] and $member['temp_ban'] != 1) {
$ban_arr = IPSMember::processBanEntry($member['temp_ban']);
if ($ban_arr['date_end'] > time()) {
$hours = ceil(($ban_arr['date_end'] - time()) / 3600);
}
}
$IPBHTML .= "" . $this->registry->getClass('output')->addJSModule("profile", "0") . "\n<script type='text/javascript'>\n\tipb.profile.viewingProfile = {$member['member_id']};\n</script>\n" . ($errors ? "\n\t<h2>{$this->lang->words['errors_found']}</h2>\n\t<p class='message error'>{$errors}</p>\n\t<br />\n" : "") . "\n<form method=\"post\" action='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=modcp&section=editmember&do=dowarn&mid={$member['member_id']}", "public", ''), "", "") . "' id='postingform'>\n<input type=\"hidden\" name=\"key\" value=\"{$this->member->form_hash}\" />\n<input type=\"hidden\" name=\"type\" value=\"{$this->request['type']}\" />\n<input type=\"hidden\" name=\"_st\" value=\"{$this->request['_st']}\" />\n<input type=\"hidden\" name=\"t\" value=\"{$this->request['t']}\" />\n<input type=\"hidden\" name=\"pf\" value=\"{$this->request['pf']}\" />\n<div class='post_form'>\n<h2 class='ipsType_subtitle'>{$this->lang->words['warn_logs_for']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$member['member_id']}", "public", ''), "{$member['members_seo_name']}", "showuser") . "' title='{$this->lang->words['view_profile']}'>{$member['members_display_name']}</a></h2>\n<div class='generic_bar'></div>\n<div class='general_box'>\n<fieldset class='with_subhead'>\n\t<h3 class='bar noTopBorder'>{$this->lang->words['warn_member_details']}</h3>\n\t<h4>\n\t\t<img class=\"ipsUserPhoto ipsUserPhoto_large\" src='{$member['pp_thumb_photo']}' alt=\"" . sprintf($this->lang->words['users_photo'], $member['members_display_name']) . "\" />\n\t</h4>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t" . $this->registry->getClass('output')->getReplacement("find_topics_link") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=user_activity&mid={$member['member_id']}", "public", ''), "", "") . "'>{$this->lang->words['gbl_find_my_content']}</a>\n\t\t</li>\n\t\t" . ($this->memberData['g_mem_info'] && $this->settings['auth_allow_dnames'] ? "\n\t\t\t<li class='field' id='dname_history'>\n\t\t\t\t" . $this->registry->getClass('output')->getReplacement("display_name") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=dname&id={$member['member_id']}", "public", ''), "", "") . "' title='{$this->lang->words['view_dname_history']}'>{$this->lang->words['display_history']}</a>\n\t\t\t</li>\n\t\t" : "") . "\n\t\t" . ($this->settings['reputation_enabled'] ? "<li class='field'>\n\t\t\t\t" . ($member['pp_reputation_points'] > 0 ? "\n\t\t\t\t\t<div class='reputation positive' style='min-width: 150px; text-align: center'>\n\t\t\t\t" : "") . "\n\t\t\t\t" . ($member['pp_reputation_points'] < 0 ? "\n\t\t\t\t\t<div class='reputation negative' style='min-width: 150px; text-align: center'>\n\t\t\t\t" : "") . "\n\t\t\t\t" . ($member['pp_reputation_points'] == 0 ? "\n\t\t\t\t\t<div class='reputation zero' style='min-width: 150px; text-align: center'>\n\t\t\t\t" : "") . "\n\t\t\t\t\t<span class='number'>{$member['pp_reputation_points']}</span>\n\t\t\t\t\t" . ($member['author_reputation'] && $member['author_reputation']['text'] ? "\n\t\t\t\t\t\t<p class='title'>{$member['author_reputation']['text']}</p>\n\t\t\t\t\t" : "") . "\n\t\t\t\t\t" . ($member['author_reputation'] && $member['author_reputation']['image'] ? "\n\t\t\t\t\t\t<p class='image'>{$member['author_reputation']['image']}</p>\n\t\t\t\t\t" : "") . "\n\t\t\t\t</div>\n\t\t\t</li>" : "") . "\n\t</ul>\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_details']}</h3>\n\t<h4>{$this->lang->words['w_adjust_level']}<br /><span class='desc'>{$this->lang->words['warn_current_level']} {$member['warn_level']}/{$this->settings['warn_max']}</span></h4>\n\t<ul>\n <li class='field checkbox'>\n <input type=\"radio\" name=\"level\" id=\"nochange\" class=\"input_radio\" value=\"nochange\" " . (($this->request['type'] == 'nochange' or !$this->request['type']) ? "checked='checked'" : "") . " />\n <label for='nochange'>{$this->lang->words['w_nochange']}</label>\n </li>\n\t\t<li class='field checkbox negative'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"add\" class=\"input_radio\" value=\"add\" " . ($this->request['type'] == 'add' ? "checked='checked'" : "") . " />\n\t\t\t<label for='add'>{$this->lang->words['w_add']}</label>\n\t\t</li>\n\t\t<li class='field checkbox positive'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"minus\" class=\"input_radio\" value=\"remove\" " . ($this->request['type'] == 'minus' ? "checked='checked'" : "") . " />\n\t\t\t<label for='minus'>{$this->lang->words['w_remove']}</label>\n\t\t</li>\t\n\t\t" . ($this->memberData['g_is_supmod'] ? "<li class='field checkbox custom'>\n\t\t\t\t<input type=\"radio\" name=\"level\" id=\"custom\" class=\"input_radio\" value=\"custom\" " . ($this->request['type'] == 'custom' ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='level_custom'>" . sprintf($this->lang->words['w_change_custom'], $this->settings['warn_max']) . "</label>\n\t\t\t\t <input type='text' id='level_custom' name='level_custom' value='" . (isset($this->request['customLevel']) ? "{$this->request['customLevel']}" : "{$member['warn_level']}") . "' size='3' />\n\t\t\t</li>" : "") . "\n\t</ul>\n\t<h4>{$this->lang->words['w_reason']}<br /><span class='desc'>{$this->lang->words['w_reason2']}</span></h4>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t<textarea rows=\"6\" cols=\"50\" class=\"input_text\" name=\"reason\">" . IPSText::br2nl($this->request['reason']) . "</textarea>\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['member_suspension']}</h3>\n\t" . ($modque == true ? "\t\t<h4>{$this->lang->words['w_modq']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='modq' type=\"checkbox\" name=\"mod_indef\" value=\"1\" " . ($member['mod_posts'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='modq'>{$this->lang->words['w_modq_i']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='mod_value'>{$this->lang->words['w_orfor']}</label>\n\t\t\t\t<input class='input_text' type=\"text\" id='mod_value' name=\"mod_value\" value=\"" . (($mhours >= 24 and $mhours / 24 == ceil($mhours / 24) and $timespan = $mhours / 24) ? "{$timespan}" : "{$mhours}") . "\" size=\"5\" /> \n\t\t\t\t<select name=\"mod_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($mhours >= 24 and $mhours / 24 == ceil($mhours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($mhours < 24 or $mhours / 24 != ceil($mhours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($mhours > 0 ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n\t" . ($postque == true ? "\t\t<h4>{$this->lang->words['w_resposts']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='restrict_posts' type=\"checkbox\" name=\"post_indef\" value=\"1\" " . ($member['restrict_post'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='restrict_posts'>{$this->lang->words['w_resposts_i']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='post_value'>{$this->lang->words['w_orfor']}</label>\n\t\t\t\t<input class='input_text' type=\"text\" id='post_value' name=\"post_value\" value=\"" . (($phours >= 24 and $phours / 24 == ceil($phours / 24) and $timespan = $phours / 24) ? "{$timespan}" : "{$phours}") . "\" size=\"5\" /> \n\t\t\t\t<select name=\"post_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($phours >= 24 and $phours / 24 == ceil($phours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($phours < 24 or $phours / 24 != ceil($phours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($phours > 0 ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n\t" . ($ban == true ? "\t\t<h4>{$this->lang->words['w_suspend']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='suspend_member' type=\"checkbox\" name=\"ban_indef\" value=\"1\" " . ($member['member_banned'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='suspend_member'>{$this->lang->words['w_ban_indef']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='susp_value'>{$this->lang->words['w_suspend_or']}</label>\n\t\t\t\t<input type=\"text\" id='susp_value' class='input_text' name=\"susp_value\" value=\"" . (($hours >= 24 and $hours / 24 == ceil($hours / 24) and $timespan = $hours / 24) ? "{$timespan}" : "{$hours}") . "\" size=\"5\" />\n\t\t\t\t<select name=\"susp_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($hours >= 24 and $hours / 24 == ceil($hours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($hours < 24 or $hours / 24 != ceil($hours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($member['temp_ban'] ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_mem_content']}</h3>\n\t<h4>{$this->lang->words['warn_posts_topics']}</h4>\n\t<ul>\n\t\t<li class='field checkbox'>\n\t\t\t<select name=\"topicPosts_type\" class='input_select'>\n\t\t\t\t<option value='unapprove' " . ($this->request['topicPosts_type'] == 'unapprove' ? "selected='selected'" : "") . ">{$this->lang->words['warn_stuff_unapprove']}</option>\n\t\t\t\t<option value='approve' " . ($this->request['topicPosts_type'] == 'approve' ? "selected='selected'" : "") . ">{$this->lang->words['warn_stuff_approve']}</option>\n\t\t\t</select>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"checkbox\" id='topicPosts_topics' class='input_check' name=\"topicPosts_topics\" value=\"1\" />\n\t\t\t<label for='topicPosts_topics'>{$this->lang->words['warn_stuff_alltopics']}</label>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"checkbox\" id='topicPosts_replies' class='input_check' name=\"topicPosts_replies\" value=\"1\" />\n\t\t\t<label for='topicPosts_replies'>{$this->lang->words['warn_stuff_allposts']}</label>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<label for='topicPosts_lastx'>{$this->lang->words['warn_stuff_datecutoff']}</label>\n\t\t\t<input type=\"text\" id='topicPosts_lastx' class='input_text' name=\"topicPosts_lastx\" value=\"\" size=\"5\" />\n\t\t\t<select name=\"topicPosts_lastxunits\" class='input_select'>\n\t\t\t\t<option value=\"d\">{$this->lang->words['w_day']}</option>\n\t\t\t\t<option value=\"h\">{$this->lang->words['w_hour']}</option>\n\t\t\t</select>\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset>\n\t<h3 class='bar'>{$this->lang->words['warn_contact_member']}</h3>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t<label for='subj'>{$this->lang->words['w_c_subj']}</label>\n\t\t\t<input id='subj' class='input_text' type=\"text\" name=\"subject\" value=\"{$this->request['subject']}\" size=\"30\" />\n\t\t</li>\n\t\t<li class='field'>\n\t\t\t<label for='method'>{$this->lang->words['w_c']}</label>\n\t\t\t<select id='method' name=\"contactmethod\" class='input_select'>\n\t\t\t\t" . ($member['members_disable_pm'] != 1 ? "\n\t\t\t\t\t<option value=\"pm\">{$this->lang->words['w_c_p']}</option>\n\t\t\t\t" : "") . "\n\t\t\t\t<option value=\"email\">{$this->lang->words['w_c_e']}</option>\n\t\t\t</select>\n\t\t</li>\n\t\t<li class='ipsPad'>\n\t\t\t{$editor_html}\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset class='submit'>\n\t<input type=\"submit\" class='input_submit' value=\"{$this->lang->words['w_submit']}\" tabindex='0'/>\n</fieldset>\n</div>\n</div>\n</form>";
return $IPBHTML;
}
示例6: _saveComment
/**
* Recieves comment, submits to database, and redirects user
*
* @access private
* @return void
*/
private function _saveComment()
{
//-----------------------------------------
// Make sure we have a report id...
//-----------------------------------------
$rid = intval($this->request['rid']);
if ($rid < 1) {
$this->registry->output->showError('reports_no_comment', 10139);
}
//-----------------------------------------
// Lets make sure we even have this report
//-----------------------------------------
$report = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'rc_reports_index', 'where' => "id=" . $rid));
if ($report['id']) {
$postContent = IPSText::getTextClass('editor')->processRawPost($_POST['comment']);
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_emoticons = 1;
IPSText::getTextClass('bbcode')->parse_nl2br = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'reports';
$postContent = IPSText::getTextClass('bbcode')->preDbParse($postContent);
if (!trim(IPSText::br2nl($postContent))) {
$this->registry->output->showError('reports_no_comment_text', 10188);
}
$build_comment = array('rid' => $rid, 'comment' => $postContent, 'comment_by' => $this->memberData['member_id'], 'comment_date' => time());
$this->DB->insert('rc_comments', $build_comment);
$this->DB->update('rc_reports_index', array('num_comments' => $report['num_comments'] + 1, 'date_updated' => time()), "id=" . $report['id']);
}
$this->registry->output->redirectScreen($this->lang->words['report_comment_saved'], $this->settings['base_url'] . "app=core&module=reports&rid={$report['id']}&do=show_report");
}
示例7: _cleanName
/**
* Clean a username or display name
*
* @access protected
* @param string Name
* @param string Field (name or members_display_name)
* @return array array( 'name' => $cleaned_name, 'errors' => array() )
*/
protected function _cleanName($name, $field = 'members_display_name')
{
$original = $name;
$name = trim($name);
if ($field == 'name') {
// Commented out for bug report #15354
//$name = str_replace( '|', '|' , $name );
/* Remove multiple spaces */
$name = preg_replace("/\\s{2,}/", " ", $name);
}
//-----------------------------------------
// Remove line breaks
//-----------------------------------------
if (ipsRegistry::$settings['usernames_nobr']) {
$name = IPSText::br2nl($name);
$name = str_replace("\n", "", $name);
$name = str_replace("\r", "", $name);
}
//-----------------------------------------
// Remove sneaky spaces
//-----------------------------------------
if (ipsRegistry::$settings['strip_space_chr']) {
/* use hexdec to convert between '0xAD' and chr */
$name = IPSText::removeControlCharacters($name);
}
//-----------------------------------------
// Trim after above ops
//-----------------------------------------
$name = trim($name);
//-----------------------------------------
// Test unicode name
//-----------------------------------------
$unicode_name = $this->_getUnicodeName($name);
//-----------------------------------------
// Do we have a name?
//-----------------------------------------
if ($field == 'name' or $field == 'members_display_name' and ipsRegistry::$settings['auth_allow_dnames']) {
if (!$name or IPSText::mbstrlen($name) < 3 or IPSText::mbstrlen($name) > ipsRegistry::$settings['max_user_name_length']) {
ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_register'), 'core');
$key = $field == 'members_display_name' ? 'reg_error_no_name' : 'reg_error_username_none';
$text = sprintf(ipsRegistry::getClass('class_localization')->words[$key], ipsRegistry::$settings['max_user_name_length']);
//-----------------------------------------
// Only show note about special chars when relevant
//-----------------------------------------
if (strpos($name, '&') !== false) {
$text .= ipsRegistry::getClass('class_localization')->words['reg_error_no_name_spec'];
}
return array('name' => $original, 'errors' => array($text));
}
}
//-----------------------------------------
// Blocking certain chars in username?
//-----------------------------------------
if (ipsRegistry::$settings['username_characters']) {
$check_against = preg_quote(ipsRegistry::$settings['username_characters'], "/");
if (!preg_match("/^[" . $check_against . "]+\$/i", $name)) {
return array('name' => $original, 'errors' => array(str_replace('{chars}', ipsRegistry::$settings['username_characters'], ipsRegistry::$settings['username_errormsg'])));
}
}
//-----------------------------------------
// Manually check against bad chars
//-----------------------------------------
if (strpos($unicode_name, '\') !== false or strpos($unicode_name, '&#quot;') !== false or strpos($unicode_name, '$') !== false or strpos($unicode_name, '&#lt;') !== false or strpos($unicode_name, '$') !== false or strpos($unicode_name, ']') !== false or strpos($unicode_name, '[') !== false or strpos($unicode_name, ',') !== false or strpos($unicode_name, '|') !== false or strpos($unicode_name, '&#gt;') !== false) {
ipsRegistry::getClass('class_localization')->loadLanguageFile(array('public_register'), 'core');
return array('name' => $original, 'errors' => array(ipsRegistry::getClass('class_localization')->words['reg_error_chars']));
}
return array('name' => $name, 'errors' => array());
}
示例8: forumForm
//.........這裏部分代碼省略.........
# Ensure there is an ID
$this->request['f'] = 0;
if ($changetype) {
$addnew_type = $addnew_type == 'category' ? 'forum' : 'category';
}
if ($addnew_type == 'category') {
$forum = array('sub_can_post' => $subcanpost, 'name' => $f_name ? $f_name : $this->lang->words['for_newcat'], 'parent_id' => $parentid, 'use_ibc' => 1, 'allow_poll' => 1, 'prune' => 100, 'topicfilter' => 'all', 'sort_key' => 'last_post', 'sort_order' => 'Z-A', 'inc_postcount' => 1, 'description' => '', 'redirect_url' => '', 'password' => '', 'password_override' => '', 'redirect_on' => 0, 'redirect_hits' => 0, 'permission_showtopic' => '', 'permission_custom_error' => '', 'use_html' => 0, 'allow_pollbump' => 0, 'forum_allow_rating' => 0, 'preview_posts' => 0, 'notify_modq_emails' => 0, 'can_view_others' => 1);
$title = $this->lang->words['for_addcat'];
$button = $this->lang->words['for_addcat'];
$code = "donew";
} else {
$forum = array('sub_can_post' => $subcanpost, 'name' => $f_name ? $f_name : $this->lang->words['for_newfor'], 'parent_id' => $parentid, 'use_ibc' => 1, 'allow_poll' => 1, 'prune' => 100, 'topicfilter' => 'all', 'sort_key' => 'last_post', 'sort_order' => 'Z-A', 'inc_postcount' => 1, 'description' => '', 'redirect_url' => '', 'password' => '', 'password_override' => '', 'redirect_on' => 0, 'redirect_hits' => 0, 'permission_showtopic' => '', 'permission_custom_error' => '', 'use_html' => 0, 'allow_pollbump' => 0, 'forum_allow_rating' => 0, 'preview_posts' => 0, 'notify_modq_emails' => 0, 'min_posts' => 0, 'hide_last_info' => 0, 'can_view_others' => 1);
$title = $this->lang->words['for_addfor'];
$button = $this->lang->words['for_addfor'];
$code = "donew";
}
}
//-----------------------------------------
// Build forumlist
//-----------------------------------------
$forumlist = $this->registry->getClass('class_forums')->adForumsForumList();
//-----------------------------------------
// Build group list
//-----------------------------------------
$mem_group = array();
foreach ($this->caches['group_cache'] as $g_id => $group) {
$mem_group[] = array($g_id, $group['g_title']);
}
//-----------------------------------------
// Generate form items
//-----------------------------------------
# Main settings
$form['name'] = $this->registry->output->formInput('name', IPSText::parseCleanValue(!empty($_POST['name']) ? $_POST['name'] : $forum['name']), null, null, null, "maxlength='128'");
$form['description'] = $this->registry->output->formTextarea("description", IPSText::br2nl(!empty($_POST['description']) ? $_POST['description'] : $forum['description']));
$form['parent_id'] = $this->registry->output->formDropdown("parent_id", $forumlist, !empty($_POST['parent_id']) ? $_POST['parent_id'] : $forum['parent_id']);
$form['sub_can_post'] = $this->registry->output->formYesNo('sub_can_post', !empty($_POST['sub_can_post']) ? $_POST['sub_can_post'] : ($forum['sub_can_post'] == 1 ? 0 : 1));
$form['ipseo_priority'] = $this->registry->getClass('output')->formDropdown('ipseo_priority', array(array('1', '1'), array('0.9', '0.9'), array('0.8', '0.8'), array('0.7', '0.7'), array('0.6', '0.6'), array('0.5', '0.5'), array('0.4', '0.4'), array('0.3', '0.3'), array('0.2', '0.2'), array('0.1', '0.1'), array('0', $this->lang->words['sitemap_priority_ignore']), array('', $this->lang->words['sitemap_priority_inherit'])), $forum['ipseo_priority'] === '' ? 0 : $forum['ipseo_priority']);
$form['viglink'] = $this->registry->output->formYesNo('viglink', !empty($_POST['viglink']) ? $_POST['viglink'] : $forum['viglink']);
# Redirect options
$form['redirect_url'] = $this->registry->output->formInput('redirect_url', !empty($_POST['redirect_url']) ? $_POST['redirect_url'] : $forum['redirect_url']);
$form['redirect_on'] = $this->registry->output->formYesNo('redirect_on', !empty($_POST['redirect_on']) ? $_POST['redirect_on'] : $forum['redirect_on']);
$form['redirect_hits'] = $this->registry->output->formInput('redirect_hits', !empty($_POST['redirect_hits']) ? $_POST['redirect_hits'] : $forum['redirect_hits']);
# Answer system
$form['bw_enable_answers'] = $this->registry->output->formYesNo('bw_enable_answers', !empty($_POST['bw_enable_answers']) ? $_POST['bw_enable_answers'] : $forum['bw_enable_answers']);
# Permission settings
$form['permission_showtopic'] = $this->registry->output->formYesNo('permission_showtopic', !empty($_POST['permission_showtopic']) ? $_POST['permission_showtopic'] : $forum['permission_showtopic']);
$form['permission_custom_error'] = $this->registry->output->formTextarea("permission_custom_error", IPSText::br2nl(!empty($_POST['permission_custom_error']) ? $_POST['permission_custom_error'] : $forum['permission_custom_error']));
# Forum settings
$form['use_html'] = $this->registry->output->formYesNo('use_html', !empty($_POST['use_html']) ? $_POST['use_html'] : $forum['use_html']);
$form['use_ibc'] = $this->registry->output->formYesNo('use_ibc', !empty($_POST['use_ibc']) ? $_POST['use_ibc'] : $forum['use_ibc']);
$form['allow_poll'] = $this->registry->output->formYesNo('allow_poll', !empty($_POST['allow_poll']) ? $_POST['allow_poll'] : $forum['allow_poll']);
$form['allow_pollbump'] = $this->registry->output->formYesNo('allow_pollbump', !empty($_POST['allow_pollbump']) ? $_POST['allow_pollbump'] : $forum['allow_pollbump']);
$form['inc_postcount'] = $this->registry->output->formYesNo('inc_postcount', !empty($_POST['inc_postcount']) ? $_POST['inc_postcount'] : $forum['inc_postcount']);
$form['forum_allow_rating'] = $this->registry->output->formYesNo('forum_allow_rating', !empty($_POST['forum_allow_rating']) ? $_POST['forum_allow_rating'] : $forum['forum_allow_rating']);
$form['min_posts_post'] = $this->registry->output->formInput('min_posts_post', !empty($_POST['min_posts_post']) ? $_POST['min_posts_post'] : $forum['min_posts_post']);
$form['min_posts_view'] = $this->registry->output->formInput('min_posts_view', !empty($_POST['min_posts_view']) ? $_POST['min_posts_view'] : $forum['min_posts_view']);
$form['can_view_others'] = $this->registry->output->formYesNo('can_view_others', !empty($_POST['can_view_others']) ? $_POST['can_view_others'] : $forum['can_view_others']);
$form['hide_last_info'] = $this->registry->output->formYesNo('hide_last_info', !empty($_POST['hide_last_info']) ? $_POST['hide_last_info'] : $forum['hide_last_info']);
$form['disable_sharelinks'] = $this->registry->output->formYesNo('disable_sharelinks', !empty($_POST['disable_sharelinks']) ? $_POST['disable_sharelinks'] : $forum['disable_sharelinks']);
# Mod settings
$form['preview_posts'] = $this->registry->output->formDropdown("preview_posts", $dd_moderate, !empty($_POST['preview_posts']) ? $_POST['preview_posts'] : $forum['preview_posts']);
$form['notify_modq_emails'] = $this->registry->output->formInput('notify_modq_emails', !empty($_POST['notify_modq_emails']) ? $_POST['notify_modq_emails'] : $forum['notify_modq_emails']);
$form['password'] = $this->registry->output->formInput('password', !empty($_POST['password']) ? $_POST['password'] : $forum['password']);
$form['password_override'] = $this->registry->output->formMultiDropdown('password_override[]', $mem_group, !empty($_POST['password_override']) ? $_POST['password_override'] : explode(",", $forum['password_override']));
# Sorting settings
$form['prune'] = $this->registry->output->formDropdown("prune", $dd_prune, !empty($_POST['prune']) ? $_POST['prune'] : $forum['prune']);
示例9: _PMSend
/**
* Sends the PM
*
* @return string HTML to be returned via ajax
* @since IPB 3.0.0.2008-06-25
*/
protected function _PMSend()
{
/* Check permissions */
if (empty($this->memberData['member_id'])) {
$this->returnJsonError('cannotUsePMSystem');
}
if (!$this->memberData['g_use_pm']) {
$this->returnJsonError('cannotUsePMSystem');
}
if ($this->memberData['members_disable_pm']) {
$this->returnJsonError('cannotUsePMSystem');
}
if ($this->messengerFunctions->checkHasHitMax()) {
$this->returnJsonError('cannotUsePMSystem');
}
//-----------------------------------------
// INIT
//-----------------------------------------
$toMemberID = intval($this->request['toMemberID']);
$msgContent = $this->convertHtmlEntities($this->convertUnicode($_POST['Post']));
$msgTitle = IPSText::parseCleanValue($this->convertHtmlEntities($this->convertUnicode($_POST['subject'])));
$this->request['Post'] = IPSText::parseCleanValue($_POST['Post']);
//-----------------------------------------
// Load lang file
//-----------------------------------------
$this->registry->getClass('class_localization')->loadLanguageFile(array("public_error"), 'core');
//-----------------------------------------
// Language
//-----------------------------------------
$this->registry->class_localization->loadLanguageFile(array('public_messaging'), 'members');
if (IPSText::mbstrlen(trim(IPSText::br2nl($msgContent))) < 3) {
$this->returnJsonError($this->lang->words['err_no_msg']);
}
//-----------------------------------------
// Send .. or.. save...
//-----------------------------------------
try {
$this->messengerFunctions->sendNewPersonalTopic($toMemberID, $this->memberData['member_id'], array(), $msgTitle, $msgContent);
return $this->returnJsonArray(array('status' => 'sent'));
} catch (Exception $error) {
$msg = $error->getMessage();
$toMember = IPSMember::load($toMemberID, 'core');
if (strstr($msg, 'BBCODE_')) {
$msg = str_replace('BBCODE_', '', $msg);
return $this->returnJsonArray(array('inlineError' => $this->lang->words[$msg]));
} else {
if (isset($this->lang->words['err_' . $msg])) {
$_msgString = $this->lang->words['err_' . $msg];
$_msgString = str_replace('#NAMES#', implode(",", $this->messengerFunctions->exceptionData), $_msgString);
$_msgString = str_replace('#TONAME#', $toMember['members_display_name'], $_msgString);
$_msgString = str_replace('#FROMNAME#', $this->memberData['members_display_name'], $_msgString);
$_msgString = str_replace('#DATE#', $this->messengerFunctions->exceptionData[0], $_msgString);
} else {
$_msgString = $this->lang->words['err_UNKNOWN'] . ' ' . $msg;
}
}
return $this->returnJsonArray(array('inlineError' => $_msgString));
}
}
示例10: _replaceText
/**
* Do the actual replacement
*
* @access protected
* @param string $txt Parsed text from database to be edited
* @return string BBCode content, ready for editing
*/
protected function _replaceText($txt)
{
$_tags = $this->_retrieveTags();
foreach ($_tags as $_tag) {
//-----------------------------------------
// Determine open and close tags
//-----------------------------------------
$open_tag = '[' . $_tag;
$close_tag = '[/' . $_tag . ']';
//-----------------------------------------
// Ok, quotes suck A LOT
// We have to first match the CLOSE tag, unlike other bbcode
// Then we back-track to find the matching opening tag
// Do the replacement, and repeat....
//-----------------------------------------
while (($this->end_pos = stripos($txt, $close_tag, $this->end_pos)) !== false) {
//-----------------------------------------
// Ok at this point, we have a closing quote tag
// Set start position to end position point
//-----------------------------------------
$this->cur_pos = $this->end_pos;
//-----------------------------------------
// We are at 0 or above still...
//-----------------------------------------
while ($this->cur_pos > 0) {
//-----------------------------------------
// Loop over characters moving backwards 1 by 1
//-----------------------------------------
$this->cur_pos = $this->cur_pos - 1;
//-----------------------------------------
// Shouldn't hit this, but if we do we're done
//-----------------------------------------
if ($this->cur_pos < 0) {
break;
}
//-----------------------------------------
// Have we finally hit the first preceeding open tag?
//-----------------------------------------
if (stripos($txt, $open_tag, $this->cur_pos) === $this->cur_pos) {
//-----------------------------------------
// Start figuring out open tag length
//-----------------------------------------
$open_length = strlen($open_tag);
//-----------------------------------------
// Extract the options (like surgery)
//-----------------------------------------
$_option = '';
$quoteOptions = array();
//-----------------------------------------
// Does we haz it?
//-----------------------------------------
if (substr($txt, $this->cur_pos + strlen($open_tag), 1) == ' ') {
$open_length += 1;
$_option = substr($txt, $this->cur_pos + $open_length, strpos($txt, ']', $this->cur_pos) - ($this->cur_pos + $open_length));
$quoteOptions = $this->_extractSurgicallyTehOptions($_option);
} else {
if (strpos($txt, ']', $this->cur_pos) - ($this->cur_pos + $open_length) !== 0) {
continue;
}
}
//-----------------------------------------
// Otherwise replace out the content too
//-----------------------------------------
$_content = substr($txt, $this->cur_pos + $open_length + strlen($_option) + 1, stripos($txt, $close_tag, $this->cur_pos) - ($this->cur_pos + $open_length + strlen($_option) + 1));
//-----------------------------------------
// Turn attachments into links
// Prevents em from breaking on other pages
//-----------------------------------------
preg_match_all("#\\[attachment=(.+?):(.+?)\\]#", $_content, $matches);
if (is_array($matches[1]) && count($matches[1])) {
foreach ($matches[1] as $idx => $attach_id) {
$_content = str_replace("[attachment={$attach_id}:{$matches[2][$idx]}]", $this->registry->getClass('output')->getReplacement('post_attach_link') . " <a href='{$this->settings['base_url']}app=core&module=attach&section=attach&attach_rel_module=post&attach_id={$attach_id}' target='_blank'>{$matches[2][$idx]}</a>", $_content);
}
}
//-----------------------------------------
// Trim off leading newlines / brs, etc
//-----------------------------------------
$_content = IPSText::br2nl($_content);
$_content = trim($_content);
$_content = nl2br($_content);
//-----------------------------------------
// And replace...
//-----------------------------------------
$txt = substr_replace($txt, $this->_buildOutput($_content, $quoteOptions ? $quoteOptions : ''), $this->cur_pos, stripos($txt, $close_tag, $this->cur_pos) + strlen($close_tag) - $this->cur_pos);
//-----------------------------------------
// Now we break since we've done the inner replacement
//-----------------------------------------
break;
}
}
//-----------------------------------------
// And reset end position to one char further
//-----------------------------------------
//.........這裏部分代碼省略.........
示例11: formProfileInfo
/**
* Show the profile information
*
* @access public
* @author Matt Mecham
* @return string Processed HTML
*/
public function formProfileInfo()
{
/* Load Lang File */
$this->registry->class_localization->loadLanguageFile(array('public_profile'), 'members');
/* INIT */
$required_output = "";
$optional_output = "";
/* Permission Check */
if (!$this->memberData['g_edit_profile']) {
$this->registry->getClass('output')->showError('members_profile_disabled', 1026);
}
/* Format the birthday drop boxes.. */
$date = getdate();
$day = array();
$mon = array();
$year = array();
/* Build the day options */
$day[] = array('0', '--');
for ($i = 1; $i < 32; $i++) {
$day[] = array($i, $i);
}
/* Build the month options */
$mon[] = array('0', '--');
for ($i = 1; $i < 13; $i++) {
$mon[] = array($i, $this->lang->words['M_' . $i]);
}
/* Build the years options */
$i = $date['year'] - 1;
$j = $date['year'] - 100;
$year[] = array('0', '--');
for ($i; $j < $i; $i--) {
$year[] = array($i, $i);
}
/* Custom Fields */
require_once IPS_ROOT_PATH . 'sources/classes/customfields/profileFields.php';
$fields = new customProfileFields();
$fields->member_data = $this->member->fetchMemberData();
$fields->initData('edit');
$fields->parseToEdit();
if (count($fields->out_fields)) {
foreach ($fields->out_fields as $id => $data) {
if ($fields->cache_data[$id]['pf_not_null'] == 1) {
$ftype = 'required_output';
} else {
$ftype = 'optional_output';
}
${$ftype} .= $this->registry->getClass('output')->getTemplate('ucp')->field_entry($fields->field_names[$id], $fields->field_desc[$id], $data, $id);
}
}
/* Personal Statement */
$personal_statement = IPSText::br2nl($this->memberData['pp_bio_content']);
/* Build and return the form */
$template = $this->registry->getClass('output')->getTemplate('ucp')->membersProfileForm($personal_statement, $required_output, $optional_output, $day, $mon, $year);
return $template;
}
示例12: _doWarn
/**
* Add a new arn entry
*
* @access private
* @return void [Outputs to screen/redirects]
*/
private function _doWarn()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$save = array();
$err = 0;
$topicPosts_type = trim($this->request['topicPosts_type']);
$topicPosts_topics = intval($this->request['topicPosts_topics']);
$topicPosts_replies = intval($this->request['topicPosts_replies']);
$topicPosts_lastx = intval($this->request['topicPosts_lastx']);
$topicPosts_lastxunits = trim($this->request['topicPosts_lastxunits']);
$level_custom = intval($this->request['level_custom']);
$ban_indef = intval($this->request['ban_indef']);
$member_banned = intval($this->warn_member['member_banned']);
$warn_level = intval($this->warn_member['warn_level']);
//-----------------------------------------
// Load Mod Squad
//-----------------------------------------
require_once IPSLib::getAppDir('forums') . '/sources/classes/moderate.php';
$moderatorLibrary = new moderatorLibrary($this->registry);
//-----------------------------------------
// Security checks
//-----------------------------------------
if ($this->type == 'member') {
$this->registry->output->showError('warn_member_notes', 2028);
}
//-----------------------------------------
// Check security fang
//-----------------------------------------
if ($this->request['key'] != $this->member->form_hash) {
$this->registry->output->showError('warn_bad_key', 3020);
}
//-----------------------------------------
// As Celine Dion once squawked, "Show me the reason"
//-----------------------------------------
if (trim($this->request['reason']) == "") {
$this->_showForm('we_no_reason');
return;
}
//-----------------------------------------
// Other checks
//-----------------------------------------
if (!$this->settings['warn_past_max'] && $this->request['level'] != 'nochange') {
if ($this->request['level'] == 'custom') {
if ($level_custom > $this->settings['warn_max']) {
$err = 1;
} else {
if ($level_custom < $this->settings['warn_min']) {
$err = 2;
}
}
} else {
if ($this->request['level'] == 'add') {
if ($warn_level >= $this->settings['warn_max']) {
$err = 1;
}
} else {
if ($warn_level <= $this->settings['warn_min']) {
$err = 2;
}
}
}
if ($err) {
$this->registry->output->showError($err == 1 ? 'warn_past_max_high' : 'warn_past_max_low', 10251);
}
}
//-----------------------------------------
// Plussy - minussy?
//-----------------------------------------
if ($this->request['level'] == 'nochange') {
$save['wlog_type'] = 'nochan';
} else {
$save['wlog_type'] = $this->request['level'] == 'custom' ? 'custom' : ($this->request['level'] == 'add' ? 'neg' : 'pos');
}
$save['wlog_date'] = time();
//-----------------------------------------
// Contacting the member?
//-----------------------------------------
$test_content = trim(IPSText::br2nl($_POST['contact']));
if ($test_content != "") {
if (trim($this->request['subject']) == "") {
$this->_showForm('we_no_subject');
return;
}
unset($test_content);
if (IPSText::getTextClass('editor')->method == 'rte') {
$this->request['contact'] = IPSText::getTextClass('editor')->processRawPost('contact');
}
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_html = 0;
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'warn';
$save['wlog_contact'] = $this->request['contactmethod'];
//.........這裏部分代碼省略.........
示例13: buildMessage
/**
* Legacy, generic method: builds an email from a template, replacing variables
*
* @deprecated
* @param array Replacement keys to values
* @param bool Do not "clean"
* @param bool Raw HTML
* @param array Member data - necessary if including unsubscribe link
* @return @e void
*/
public function buildMessage($words, $noClean = false, $rawHtml = FALSE, $memberData = array())
{
/* Init */
$ptWords = array();
$htmlWords = array();
$subjWords = array();
/* Try this first */
if (!$this->plainTextTemplate && !$this->htmlTemplate && $this->message) {
$this->setPlainTextTemplate($this->message, true);
}
/* need to converge some stuff here */
if (!$this->plainTextTemplate && $this->template) {
/* Sniff, sniff */
if (stristr($this->template, '<br')) {
if (!$this->htmlTemplate) {
$this->setHtmlTemplate($this->template);
}
$this->setPlainTextTemplate(IPSText::br2nl($this->template));
} else {
if (!$this->htmlTemplate) {
$this->setHtmlTemplate(nl2br($this->template));
}
$this->setPlainTextTemplate($this->template);
}
}
/* HTML enabled but no specific template: Auto convert */
if ($this->html_email && !$this->htmlTemplate) {
/* It will be dynamically updated at the end */
$this->setHtmlTemplate($this->plainTextTemplate);
}
/* HTML email with HTML template but no plain text version */
if ($this->htmlTemplate && !$this->plainTextTemplate) {
$msg = $this->htmlTemplate;
$msg = preg_replace('/<#(.+?)#>/', '{{{-\\1-}}}', $msg);
$msg = str_replace("<br />", "\n", $msg);
$msg = str_replace("<br>", "\n", $msg);
$msg = IPSText::stripTags($msg);
$msg = html_entity_decode($msg, ENT_QUOTES);
$msg = str_replace('\', '\\', $msg);
$msg = str_replace('$', '$', $msg);
$msg = preg_replace('/\\{\\{\\{(.+?)\\}\\}\\}/', '<#\\1#>', $msg);
$this->setPlainTextTemplate($msg);
}
if ($this->plainTextTemplate && !$this->template && ($this->html_email && !$this->htmlTemplate)) {
$this->error++;
$this->fatalError("Could not build the email message, no template assigned", "Make sure a template is assigned first.");
}
/* Bit more clean up */
$this->plainTextTemplate = str_replace(array("\r\n", "\r", "\n"), "\n", $this->plainTextTemplate);
$this->htmlTemplate = str_replace(array("\r\n", "\r", "\n"), "\n", $this->htmlTemplate);
/* Apply HTML wrapper */
$this->htmlTemplate = $this->applyHtmlWrapper($this->subject, $rawHtml ? $this->htmlTemplate : $this->convertTextEmailToHtmlEmail($this->htmlTemplate, $rawHtml));
/* Add unsubscribe link */
if ($this->unsubscribe and !empty($memberData)) {
$this->registry->class_localization->loadLanguageFile(array('public_global'), 'core', $this->language ? $this->language : IPSLib::getDefaultLanguage(), TRUE);
$key = md5($memberData['email'] . ':' . $memberData['members_pass_hash']);
$link = $this->registry->output->buildUrl("app=core&module=global&section=unsubscribe&member={$memberData['member_id']}&key={$key}", 'publicNoSession');
$this->plainTextTemplate = str_replace("<#UNSUBSCRIBE#>", "{$this->registry->class_localization->words['email_unsubscribe']}: {$link}", $this->plainTextTemplate);
$this->htmlTemplate = str_replace("<#UNSUBSCRIBE#>", "<a href='{$link}'>" . $this->registry->class_localization->words['email_unsubscribe'] . '</a>', $this->htmlTemplate);
}
/* Add some default words */
$words['BOARD_ADDRESS'] = $this->settings['board_url'] . '/index.' . $this->settings['php_ext'];
$words['WEB_ADDRESS'] = $this->settings['home_url'];
$words['BOARD_NAME'] = $this->settings['board_name'];
$words['SIGNATURE'] = $this->settings['signature'] ? $this->settings['signature'] : '';
/* Swap the words: 10.7.08 - Added replacements in subject */
foreach ($words as $k => $v) {
if (!$noClean) {
$ptWords[$k] = $this->cleanMessage($v);
}
$subjWords[$k] = $this->cleanMessage($v, false, false);
/* Convert over words too so links are linkified */
$htmlWords[$k] = $rawHtml ? $v : $this->convertTextEmailToHtmlEmail($v, $rawHtml);
}
$this->_words = $ptWords;
$this->plainTextTemplate = preg_replace_callback("/<#(.+?)#>/", array(&$this, '_swapWords'), $this->plainTextTemplate);
$this->_words = $htmlWords;
$this->htmlTemplate = preg_replace_callback("/<#(.+?)#>/", array(&$this, '_swapWords'), str_replace(array('<#', '#>'), array('<#', '#>'), $this->htmlTemplate));
$this->_words = $subjWords;
$this->subject = preg_replace_callback("/<#(.+?)#>/", array(&$this, '_swapWords'), $this->subject);
$this->_words = array();
/* Final touches */
$this->htmlTemplate = preg_replace('#<!--hook\\.([^\\>]+?)-->#', '', $this->htmlTemplate);
$this->htmlTemplate = $this->registry->getClass('output')->parseIPSTags($this->htmlTemplate);
/* strip all tags if not HTML */
if (!$this->settings['email_use_html']) {
$this->plainTextTemplate = IPSText::stripTags($this->plainTextTemplate);
}
$this->plainTextTemplate = IPSText::stripTags(stripslashes($this->lang->words['email_header'])) . $this->plainTextTemplate . IPSText::stripTags(stripslashes($this->lang->words['email_footer']));
/* Some older apps use $this->message, so give them plaintext */
//.........這裏部分代碼省略.........
示例14: warnForm
function warnForm($member, $tid = 0, $st = 0, $errors = '', $modque = false, $postque = false, $ban = false, $editor_html = '')
{
$IPBHTML = "";
$mod_arr = array('timespan' => 0, 'days' => 0, 'hours' => 0);
$mhours = 0;
if ($member['mod_posts'] > 0 and $member['mod_posts'] != 1) {
$mod_arr = IPSMember::processBanEntry($member['mod_posts']);
$mhours = ceil(($mod_arr['date_end'] - time()) / 3600);
}
$post_arr = array('timespan' => 0, 'hours' => 0, 'days' => 0);
$phours = 0;
if ($member['restrict_post'] > 0 and $member['restrict_post'] != 1) {
$post_arr = IPSMember::processBanEntry($member['restrict_post']);
$phours = ceil(($post_arr['date_end'] - time()) / 3600);
}
$ban_arr = array('timespan' => 0, 'days' => 0, 'hours' => 0);
$hours = 0;
if ($member['temp_ban'] and $member['temp_ban'] != 1) {
$ban_arr = IPSMember::processBanEntry($member['temp_ban']);
$hours = ceil(($ban_arr['date_end'] - time()) / 3600);
}
$IPBHTML .= "" . $this->registry->getClass('output')->addJSModule("profile", "0") . "\n<script type='text/javascript'>\n\tipb.profile.viewingProfile = {$member['member_id']};\n</script>\n" . ($errors ? "\n\t<h2>{$this->lang->words['errors_found']}</h2>\n\t<p class='message error'>{$errors}</p>\n\t<br />\n" : "") . "\n<!-- SKINNOTE: form validation -->\n<form method=\"post\" action='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=warn&section=warn&do=dowarn&mid={$member['member_id']}&t={$tid}&st={$st}&type={$this->request['type']}", 'public', ''), "", "") . "' id='postingform'>\n<input type=\"hidden\" name=\"key\" value=\"{$this->member->form_hash}\" />\n<div class='post_form'>\n<h2 class='maintitle'>{$this->lang->words['warn_logs_for']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showuser={$member['member_id']}", 'public', ''), "{$member['members_display_name']}", "showuser") . "' title='{$this->lang->words['view_profile']}'>{$member['members_display_name']}</a></h2>\n<div class='generic_bar'></div>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_member_details']}</h3>\n\t<h4>\n\t\t<img class=\"photo\" src='{$member['pp_main_photo']}' alt=\"{$member['members_display_name']}{$this->lang->words['users_photo']}\" />\n\t</h4>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t" . $this->registry->getClass('output')->getReplacement("find_posts_link") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=user_posts&mid={$member['member_id']}" . (!in_array($this->settings['search_method'], array('traditional', 'sphinx')) ? "&search_filter_app[forums]=1" : "") . "", 'public', ''), "", "") . "'>{$this->lang->words['find_posts']}</a>\n\t\t</li>\n\t\t<li class='field'>\n\t\t\t" . $this->registry->getClass('output')->getReplacement("find_topics_link") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=user_posts&mid={$member['member_id']}&search_filter_app[forums]=1&view_by_title=1", 'public', ''), "", "") . "'>{$this->lang->words['find_topics']}</a>\n\t\t</li>\n\t\t" . ($this->memberData['g_mem_info'] && $this->settings['auth_allow_dnames'] ? "\n\t\t\t<li class='field' id='dname_history'>\n\t\t\t\t" . $this->registry->getClass('output')->getReplacement("display_name") . " <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=members&module=profile&section=dname&id={$member['member_id']}", 'public', ''), "", "") . "' title='{$this->lang->words['view_dname_history']}'>{$this->lang->words['display_history']}</a>\n\t\t\t</li>\n\t\t" : "") . "\n\t\t" . ($this->settings['reputation_enabled'] ? "<li class='field'>\n\t\t\t\t{$this->lang->words['warn_rep']} {$member['pp_reputation_points']}\n\t\t\t\t" . ($member['author_reputation'] && $member['author_reputation']['text'] ? "\n\t\t\t\t\t<p class='title'>{$member['author_reputation']['text']}</p>\n\t\t\t\t" : "") . "\n\t\t\t\t" . ($member['author_reputation'] && $member['author_reputation']['image'] ? "\n\t\t\t\t\t<p class='image'>{$member['author_reputation']['image']}</p>\n\t\t\t\t" : "") . "\n\t\t\t</li>" : "") . "\n\t</ul>\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_details']}</h3>\n\t<h4>{$this->lang->words['w_adjust_level']}<br /><span class='desc'>{$this->lang->words['warn_current_level']} {$member['warn_level']}/{$this->settings['warn_max']}</span></h4>\n\t<ul>\n\t\t<li class='field checkbox negative'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"add\" class=\"input_radio\" value=\"add\" " . ($this->request['type'] == 'add' ? "checked='checked'" : "") . " />\n\t\t\t<label for='add'>{$this->lang->words['w_add']}</label>\n\t\t</li>\n\t\t<li class='field checkbox positive'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"minus\" class=\"input_radio\" value=\"remove\" " . ($this->request['type'] == 'minus' ? "checked='checked'" : "") . " />\n\t\t\t<label for='minus'>{$this->lang->words['w_remove']}</label>\n\t\t</li>\t\n\t\t" . ($this->memberData['g_is_supmod'] ? "<li class='field checkbox custom'>\n\t\t\t\t<input type=\"radio\" name=\"level\" id=\"custom\" class=\"input_radio\" value=\"custom\" " . ($this->request['type'] == 'custom' ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='level_custom'>" . sprintf($this->lang->words['w_change_custom'], $this->settings['warn_max']) . "</label>\n\t\t\t\t <input type='text' id='level_custom' name='level_custom' value='" . (isset($this->request['customLevel']) ? "{$this->request['customLevel']}" : "{$member['warn_level']}") . "' size='3' />\n\t\t\t</li>" : "") . "\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"radio\" name=\"level\" id=\"nochange\" class=\"input_radio\" value=\"nochange\" " . ($this->request['type'] == 'nochange' ? "checked='checked'" : "") . " />\n\t\t\t<label for='nochange'>{$this->lang->words['w_nochange']}</label>\n\t\t</li>\t\t\n\t</ul>\n\t<h4>{$this->lang->words['w_reason']}<br /><span class='desc'>{$this->lang->words['w_reason2']}</span></h4>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t<textarea rows=\"6\" cols=\"70\" class=\"input_text\" name=\"reason\">" . IPSText::br2nl($this->request['reason']) . "</textarea>\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['member_suspension']}</h3>\n\t" . ($modque == true ? "\t\t<h4>{$this->lang->words['w_modq']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='modq' type=\"checkbox\" name=\"mod_indef\" value=\"1\" " . ($member['mod_posts'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='modq'>{$this->lang->words['w_modq_i']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='mod_value'>{$this->lang->words['w_orfor']}</label>\n\t\t\t\t<input class='input_text' type=\"text\" id='mod_value' name=\"mod_value\" value=\"" . (($mhours > 24 and $mhours / 24 == ceil($mhours / 24) and $timespan = $mhours / 24) ? "{$timespan}" : "{$mhours}") . "\" size=\"5\" /> \n\t\t\t\t<select name=\"mod_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($mhours > 24 and $mhours / 24 == ceil($mhours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($mhours < 24 or $mhours / 24 != ceil($mhours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($mhours > 0 ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n\t" . ($postque == true ? "\t\t<h4>{$this->lang->words['w_resposts']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='restrict_posts' type=\"checkbox\" name=\"post_indef\" value=\"1\" " . ($member['restrict_post'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='restrict_posts'>{$this->lang->words['w_resposts_i']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='post_value'>{$this->lang->words['w_orfor']}</label>\n\t\t\t\t<input class='input_text' type=\"text\" id='post_value' name=\"post_value\" value=\"" . (($phours > 24 and $phours / 24 == ceil($phours / 24) and $timespan = $phours / 24) ? "{$timespan}" : "{$phours}") . "\" size=\"5\" /> \n\t\t\t\t<select name=\"post_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($phours > 24 and $phours / 24 == ceil($phours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($phours < 24 or $phours / 24 != ceil($phours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($phours > 0 ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n\t" . ($ban == true ? "\t\t<h4>{$this->lang->words['w_suspend']}</h4>\n\t\t<ul>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<input class='input_check' id='suspend_member' type=\"checkbox\" name=\"ban_indef\" value=\"1\" " . ($member['member_banned'] == 1 ? "checked='checked'" : "") . " />\n\t\t\t\t<label for='suspend_member'>{$this->lang->words['w_ban_indef']}</label>\n\t\t\t</li>\n\t\t\t<li class='field checkbox'>\n\t\t\t\t<label for='susp_value'>{$this->lang->words['w_suspend_or']}</label>\n\t\t\t\t<input type=\"text\" id='susp_value' class='input_text' name=\"susp_value\" value=\"" . (($hours > 24 and $hours / 24 == ceil($hours / 24) and $timespan = $hours / 24) ? "{$timespan}" : "{$hours}") . "\" size=\"5\" />\n\t\t\t\t<select name=\"susp_unit\" class='input_select'>\n\t\t\t\t\t<option value=\"d\" " . (($hours > 24 and $hours / 24 == ceil($hours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_day']}</option>\n\t\t\t\t\t<option value=\"h\" " . (($hours < 24 or $hours / 24 != ceil($hours / 24)) ? "selected='selected'" : "") . ">{$this->lang->words['w_hour']}</option>\n\t\t\t\t</select>\n\t\t\t\t" . ($member['temp_ban'] ? "\n\t\t\t\t\t<span class='desc'>{$this->lang->words['w_restricted']}</span>\n\t\t\t\t" : "") . "\n\t\t\t</li>\n\t\t</ul>" : "") . "\n</fieldset>\n<fieldset class='with_subhead'>\n\t<h3 class='bar'>{$this->lang->words['warn_mem_content']}</h3>\n\t<h4>{$this->lang->words['warn_posts_topics']}</h4>\n\t<ul>\n\t\t<li class='field checkbox'>\n\t\t\t<select name=\"topicPosts_type\" class='input_select'>\n\t\t\t\t<option value='unapprove' " . ($this->request['topicPosts_type'] == 'unapprove' ? "selected='selected'" : "") . ">{$this->lang->words['warn_stuff_unapprove']}</option>\n\t\t\t\t<option value='approve' " . ($this->request['topicPosts_type'] == 'approve' ? "selected='selected'" : "") . ">{$this->lang->words['warn_stuff_approve']}</option>\n\t\t\t</select>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"checkbox\" id='topicPosts_topics' class='input_check' name=\"topicPosts_topics\" value=\"1\" />\n\t\t\t<label for='topicPosts_topics'>{$this->lang->words['warn_stuff_alltopics']}</label>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<input type=\"checkbox\" id='topicPosts_replies' class='input_check' name=\"topicPosts_replies\" value=\"1\" />\n\t\t\t<label for='topicPosts_replies'>{$this->lang->words['warn_stuff_allposts']}</label>\n\t\t</li>\n\t\t<li class='field checkbox'>\n\t\t\t<label for='topicPosts_lastx'>{$this->lang->words['warn_stuff_datecutoff']}</label>\n\t\t\t<input type=\"text\" id='topicPosts_lastx' class='input_text' name=\"topicPosts_lastx\" value=\"\" size=\"5\" />\n\t\t\t<select name=\"topicPosts_lastxunits\" class='input_select'>\n\t\t\t\t<option value=\"d\">{$this->lang->words['w_day']}</option>\n\t\t\t\t<option value=\"h\">{$this->lang->words['w_hour']}</option>\n\t\t\t</select>\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset>\n\t<h3 class='bar'>{$this->lang->words['warn_contact_member']}</h3>\n\t<ul>\n\t\t<li class='field'>\n\t\t\t<label for='subj'>{$this->lang->words['w_c_subj']}</label>\n\t\t\t<input id='subj' class='input_text' type=\"text\" name=\"subject\" value=\"{$this->request['subject']}\" size=\"30\" />\n\t\t</li>\n\t\t<li class='field'>\n\t\t\t<label for='method'>{$this->lang->words['w_c']}</label>\n\t\t\t<select id='method' name=\"contactmethod\" class='input_select'>\n\t\t\t\t" . ($member['members_disable_pm'] != 1 ? "\n\t\t\t\t\t<option value=\"pm\">{$this->lang->words['w_c_p']}</option>\n\t\t\t\t" : "") . "\n\t\t\t\t<option value=\"email\">{$this->lang->words['w_c_e']}</option>\n\t\t\t</select>\n\t\t</li>\n\t\t<li>\n\t\t\t{$editor_html}\n\t\t</li>\n\t</ul>\n</fieldset>\n<fieldset class='submit'>\n\t<input type=\"submit\" class='input_submit' value=\"{$this->lang->words['w_submit']}\" tabindex='0'/> {$this->lang->words['or']} <a href='" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("showtopic={$tid}&st={$st}", 'public', ''), "", "") . "' title='{$this->lang->words['cancel']}' class='cancel' tabindex='0'>{$this->lang->words['cancel']}</a>\n</fieldset>\n\t\n</div>\n</form>";
return $IPBHTML;
}
示例15: rssImportRebuildCache
//.........這裏部分代碼省略.........
$final_items[$data['unixdate'] . $item_count] = $data;
}
}
/* Sort Array */
krsort($final_items);
/* Pick off last X */
$count = 1;
$tmp_final_items = $final_items;
$final_items = array();
foreach ($tmp_final_items as $date => $data) {
$final_items[$date] = $data;
if ($count >= $row['rss_import_pergo']) {
break;
}
$count++;
}
/* Anything left? */
if (!count($final_items)) {
continue;
}
/* Figure out MID */
$member = $this->DB->buildAndFetch(array('select' => 'member_id, name, members_display_name, ip_address', 'from' => 'members', 'where' => "member_id={$row['rss_import_mid']}"));
if (!$member['member_id']) {
continue;
}
/* Set member in post class */
$this->post->setAuthor($member['member_id']);
$this->post->setForumData($this->registry->getClass('class_forums')->forum_by_id[$row['rss_import_forum_id']]);
/* Make 'dem posts */
$affected_forum_ids[] = $row['rss_import_forum_id'];
foreach ($final_items as $topic_item) {
/* Fix & */
$topic_item['title'] = str_replace('&', '&', $topic_item['title']);
$topic_item['title'] = trim(IPSText::br2nl($topic_item['title']));
$topic_item['title'] = strip_tags($topic_item['title']);
$topic_item['title'] = IPSText::parseCleanValue($topic_item['title']);
/* Fix up &reg; */
$topic_item['title'] = str_replace('&reg;', '®', $topic_item['title']);
if ($row['rss_import_topic_pre']) {
$topic_item['title'] = str_replace(' ', ' ', str_replace('&nbsp;', ' ', $row['rss_import_topic_pre'])) . ' ' . $topic_item['title'];
}
/* Build topic insert array */
$topic = array('title' => IPSText::mbsubstr($topic_item['title'], 0, 250), 'title_seo' => IPSText::makeSeoTitle(IPSText::mbsubstr($topic_item['title'], 0, 250)), 'description' => '', 'state' => $row['rss_import_topic_open'] ? 'open' : 'closed', 'posts' => 0, 'starter_id' => $member['member_id'], 'starter_name' => $member['members_display_name'], 'start_date' => $topic_item['unixdate'], 'last_poster_id' => $member['member_id'], 'last_poster_name' => $member['members_display_name'], 'last_post' => $topic_item['unixdate'], 'icon_id' => 0, 'author_mode' => 1, 'poll_state' => 0, 'last_vote' => 0, 'views' => 0, 'forum_id' => $row['rss_import_forum_id'], 'approved' => $row['rss_import_topic_hide'] ? 0 : 1, 'pinned' => 0);
/* More post class stuff */
$this->post->setPublished($row['rss_import_topic_hide'] ? FALSE : TRUE);
/* Sort post content: Convert HTML to BBCode */
IPSText::getTextClass('bbcode')->parse_smilies = 1;
IPSText::getTextClass('bbcode')->parse_html = intval($row['rss_import_allow_html']);
IPSText::getTextClass('bbcode')->parse_bbcode = 1;
IPSText::getTextClass('bbcode')->parsing_section = 'topics';
$this->memberData['_canUseRTE'] = true;
$_POST['ed-0_wysiwyg_used'] = 1;
IPSText::getTextClass('editor')->method = 'rte';
/* Clean up.. */
$topic_item['content'] = preg_replace("#<br />(\r)?\n#is", "<br />", $topic_item['content']);
/* Add in Show link... */
if ($row['rss_import_showlink'] and $topic_item['link']) {
$the_link = str_replace('{url}', trim($topic_item['link']), $row['rss_import_showlink']);
if ($row['rss_import_allow_html']) {
$_POST['_tmpPostField'] = IPSText::getTextClass('bbcode')->preEditParse(stripslashes($the_link));
$the_link = "<br /><br />" . IPSText::getTextClass('bbcode')->preDbParse(IPSText::getTextClass('editor')->processRawPost('_tmpPostField'));
} else {
$the_link = "<br /><br />" . $the_link;
}
$topic_item['content'] .= $the_link;
}