本文整理匯總了PHP中IPSText::convertCharsets方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::convertCharsets方法的具體用法?PHP IPSText::convertCharsets怎麽用?PHP IPSText::convertCharsets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSText
的用法示例。
在下文中一共展示了IPSText::convertCharsets方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _getMembers
/**
* Returns possible matches for the string input
*
* @return @e void Outputs to screen
*/
protected function _getMembers()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$name = IPSText::convertUnicode($this->convertAndMakeSafe($this->request['name'], 0), true);
$name = IPSText::convertCharsets($name, 'utf-8', IPS_DOC_CHAR_SET);
//-----------------------------------------
// Check length
//-----------------------------------------
if (IPSText::mbstrlen($name) < 3) {
$this->returnJsonError('requestTooShort');
}
//-----------------------------------------
// Try query...
//-----------------------------------------
$this->DB->build(array('select' => 'm.members_display_name, m.member_id, m.members_seo_name, m.member_group_id', 'from' => array('members' => 'm'), 'where' => "m.members_l_display_name LIKE '" . $this->DB->addSlashes(strtolower($name)) . "%'", 'order' => $this->DB->buildLength('m.members_display_name') . ' ASC', 'limit' => array(0, 15), 'add_join' => array(array('select' => 'p.*', 'from' => array('profile_portal' => 'p'), 'where' => 'p.pp_member_id=m.member_id', 'type' => 'left'))));
$this->DB->execute();
//-----------------------------------------
// Got any results?
//-----------------------------------------
if (!$this->DB->getTotalRows()) {
$this->returnJsonArray(array());
}
$return = array();
while ($r = $this->DB->fetch()) {
$url = $this->registry->output->buildSEOUrl("app=core&module=modcp&do=editmember&mid={$r['member_id']}", 'public');
$photo = IPSMember::buildProfilePhoto($r);
$group = IPSMember::makeNameFormatted('', $r['member_group_id']);
$return[$r['member_id']] = array('name' => $r['members_display_name'], 'showas' => '<strong>' . $r['members_display_name'] . '</strong> (' . $group . ')', 'img' => $photo['pp_thumb_photo'], 'img_w' => $photo['pp_mini_width'], 'img_h' => $photo['pp_mini_height'], 'url' => $url);
}
$this->returnJsonArray($return);
}
示例2: doSearchRequest
/**
* Handles the live search
*
* @return @e void
*/
public function doSearchRequest()
{
//-----------------------------------------
// Init
//-----------------------------------------
$search_term = IPSText::convertCharsets($this->request['search_term'], 'utf-8', IPS_DOC_CHAR_SET);
$results = array();
$results = array('members' => array(), 'groups' => array(), 'groupLangs' => false, 'settings' => array(), 'forums' => array(), 'location' => array());
if (IPSLib::appIsInstalled('nexus')) {
$results['nexus'] = array();
}
//-----------------------------------------
// Search
//-----------------------------------------
$results = $this->_getSettings($search_term, $results);
$results = $this->_getFromXML($search_term, $results);
$results = $this->_getMembers($search_term, $results);
$results = $this->_checkGroups($search_term, $results);
$results = $this->_checkForums($search_term, $results);
if (IPSLib::appIsInstalled('nexus')) {
$results = $this->_checkNexus($search_term, $results);
}
//-----------------------------------------
// Output
//-----------------------------------------
$this->returnJsonArray($results);
}
示例3: share
/**
* Redirect to Twitter
* Exciting, isn't it.
*
* @access private
* @param string Plug in
* @note Removed utf8_encode() call around the title due to the linked bug report
* @link http://community.invisionpower.com/resources/bugs.html/_/ip-board/twitter-share-buttonbox-r41010
*/
public function share($title, $url)
{
$title = IPSText::convertCharsets($title, IPS_DOC_CHAR_SET, 'utf-8');
$hashMan = $this->settings['twitter_hashtag'];
if ($hashMan && substr($hashMan, 0, 1) != '#') {
$hashMan = urlencode('#' . $hashMan);
}
$hashMan = $hashMan ? '%20' . $hashMan : '';
$url = "http://twitter.com/intent/tweet?status=" . urlencode($title) . '%20-%20' . urlencode($url) . $hashMan;
$this->registry->output->silentRedirect($url);
}
示例4: __call
/**
* Send API Call
*
* @param string Method
* @param array Arguments
* @return stdClass Object from returned JSON
*/
public function __call($method, $args)
{
$send = array_merge(array('key' => $this->api_key), (isset($args[0]) and is_array($args[0])) ? $args[0] : array());
if (IPS_DOC_CHAR_SET != 'UTF-8') {
$send['message']['html'] = IPSText::convertCharsets($send['message']['html'], IPS_DOC_CHAR_SET, 'utf-8');
}
$response = $this->cfm->postFileContents(self::URL . str_replace('_', '/', $method) . '.json', json_encode($send));
if ($json = json_decode($response)) {
return $json;
}
return NULL;
}
示例5: share
/**
* Redirect to Print
* Exciting, isn't it.
*
* @access private
* @param string Title
* @param string URL
*/
public function share($title, $url)
{
$title = IPSText::convertCharsets($title, IPS_DOC_CHAR_SET, 'utf-8');
$_qmCount = substr_count($url, '?');
$_count = $this->settings['url_type'] == 'query_string' ? 1 : 0;
if ($_qmCount > $_count) {
#?/furl?s=xxxx
$url .= '&forceDownload=1';
} else {
$url .= '?forceDownload=1';
}
$url .= '&_k=' . $this->member->form_hash;
$this->registry->output->silentRedirect($url);
}
示例6: returnJsonArray
/**
* Return a JSON array
*
* @param array Single dimensional array of key => value fields
* @return void [Outputs JSON string and exits]
*/
public function returnJsonArray($json = array())
{
@header("Content-type: application/json;charset=" . IPS_DOC_CHAR_SET);
$this->printNocacheHeaders();
/* Always return as UTF-8 */
array_walk_recursive($json, create_function('&$value, $key', '$value = IPSText::convertCharsets($value, "' . IPS_DOC_CHAR_SET . '", "UTF-8");'));
$result = json_encode($json);
$result = IPSText::convertCharsets($result, "UTF-8", IPS_DOC_CHAR_SET);
print $result;
exit;
}
示例7: fetchOutput
/**
* Fetches the output
*
* @access public
* @param string Output gathered
* @param string Title of the document
* @param array Navigation gathered
* @param array Array of document head items
* @param array Array of JS loader items
* @param array Array of extra data
* @return string Output to be printed to the client
*/
public function fetchOutput($output, $title, $navigation, $documentHeadItems, $jsLoaderItems, $extraData = array())
{
//-----------------------------------------
// INIT
//-----------------------------------------
$system_vars_cache = $this->caches['systemvars'];
$showPMBox = '';
$currentCharSet = $this->settings['gb_char_set'];
/* Force UTF-8 for the skin */
$this->settings['gb_char_set'] = 'UTF-8';
//-----------------------------------------
// NORMAL
//-----------------------------------------
if ($this->_outputType == 'normal') {
//-----------------------------------------
// Grab output
//-----------------------------------------
$finalOutput = $this->output->getTemplate('global')->globalTemplate($output, $documentHeadItems, $this->_css, $jsLoaderItems, $this->_metaTags, array('title' => $title, 'applications' => $this->core_fetchApplicationData(), 'page' => $this->_current_page_title), array('navigation' => $navigation), array('time' => $this->registry->getClass('class_localization')->getDate(time(), 'SHORT', 1), 'lang_chooser' => $this->html_buildLanguageDropDown(), 'skin_chooser' => $this->html_fetchSetsDropDown(), 'stats' => $this->html_showDebugInfo(), 'copyright' => $this->html_fetchCopyright()), array('ex_time' => sprintf("%.4f", IPSDebug::endTimer()), 'gzip_status' => $this->settings['disable_gzip'] == 1 ? $this->lang->words['gzip_off'] : $this->lang->words['gzip_on'], 'server_load' => ipsRegistry::$server_load, 'queries' => $this->DB->getQueryCount()));
} else {
if ($this->_outputType == 'redirect') {
# SEO?
if ($extraData['seoTitle']) {
$extraData['url'] = $this->output->buildSEOUrl($extraData['url'], 'none', $extraData['seoTitle']);
$extraData['full'] = 1;
}
$finalOutput = $this->output->getTemplate('global')->redirectTemplate($documentHeadItems, $this->_css, $jsLoaderItems, $extraData['text'], $extraData['url'], $extraData['full']);
} else {
if ($this->_outputType == 'popup') {
$finalOutput = $this->output->getTemplate('global')->displayPopUpWindow($documentHeadItems, $this->_css, $jsLoaderItems, $title, $output);
}
}
}
//-----------------------------------------
// Return
//-----------------------------------------
$finalOutput = $this->parseIPSTags($finalOutput);
/* Attempt to clean HTML */
return IPSText::stripNonUtf8(IPSText::convertCharsets($finalOutput, $currentCharSet, 'UTF-8'));
}
示例8: share
/**
* Redirect to Twitter
* Exciting, isn't it.
*
* @access private
* @param string Plug in
*/
public function share($title, $url)
{
$title = IPSText::convertCharsets($title, IPS_DOC_CHAR_SET, 'utf-8');
$url = "http://del.icio.us/post?v=2&url=" . urlencode($url) . "&title=" . urlencode($title);
$this->registry->output->silentRedirect($url);
}
示例9: share
/**
* Redirect to Google
* Exciting, isn't it.
*
* @access private
* @param string Plug in
*/
public function share($title, $url)
{
$title = IPSText::convertCharsets($title, IPS_DOC_CHAR_SET, 'utf-8');
$url = "http://www.google.com/buzz/post?url=" . urlencode($url) . "&title=" . urlencode($title) . "&type=normal-count";
$this->registry->output->silentRedirect($url);
}
示例10: executeFeed
/**
* Execute the feed and return the HTML to show on the page.
* Can be called from ACP or front end, so the plugin needs to setup any appropriate lang files, skin files, etc.
*
* @access public
* @param array Block data
* @return string Block HTML to display or cache
*/
public function executeFeed($block)
{
$this->lang->loadLanguageFile(array('public_ccs'), 'ccs');
$config = unserialize($block['block_config']);
//-----------------------------------------
// Init RSS kernel library
//-----------------------------------------
if (!is_object($this->class_rss)) {
require_once IPS_KERNEL_PATH . 'classRss.php';
$this->class_rss = new classRss();
$this->class_rss->use_sockets = ipsRegistry::$settings['enable_sockets'];
$this->class_rss->doc_type = IPS_DOC_CHAR_SET;
}
$this->class_rss->feed_charset = $config['filters']['rss_charset'];
if (strtolower($config['rss_charset']) != IPS_DOC_CHAR_SET) {
$this->class_rss->convert_charset = 1;
$this->class_rss->destination_charset = $this->class_rss->doc_type;
} else {
$this->class_rss->convert_charset = 0;
}
$this->class_rss->errors = array();
$this->class_rss->rss_items = array();
$this->class_rss->auth_req = '';
$this->class_rss->auth_user = '';
$this->class_rss->auth_pass = '';
$this->class_rss->rss_count = 0;
$this->class_rss->rss_max_show = $config['filters']['rss_limit'];
//-----------------------------------------
// Get feed
//-----------------------------------------
$this->class_rss->parseFeedFromUrl($config['filters']['rss_feed']);
//-----------------------------------------
// Error checking
//-----------------------------------------
if (is_array($this->class_rss->errors) and count($this->class_rss->errors)) {
return '';
}
if (!is_array($this->class_rss->rss_channels) or !count($this->class_rss->rss_channels)) {
return '';
}
if (!is_array($this->class_rss->rss_items) or !count($this->class_rss->rss_items)) {
return '';
}
//-----------------------------------------
// Loop over items and put into array
//-----------------------------------------
$content = array();
foreach ($this->class_rss->rss_channels as $channel_id => $channel_data) {
if (is_array($this->class_rss->rss_items[$channel_id]) and count($this->class_rss->rss_items[$channel_id])) {
foreach ($this->class_rss->rss_items[$channel_id] as $item_data) {
//-----------------------------------------
// Check basic data
//-----------------------------------------
$item_data['content'] = $item_data['content'] ? $item_data['content'] : $item_data['description'];
$item_data['url'] = $item_data['link'];
$item_data['date'] = intval($item_data['unixdate']) ? intval($item_data['unixdate']) : time();
//-----------------------------------------
// Convert charset
//-----------------------------------------
if ($config['rss_charset'] and strtolower(IPS_DOC_CHAR_SET) != strtolower($config['filters']['rss_charset'])) {
$item_data['title'] = IPSText::convertCharsets($item_data['title'], $config['filters']['rss_charset'], IPS_DOC_CHAR_SET);
$item_data['content'] = IPSText::convertCharsets($item_data['content'], $config['filters']['rss_charset'], IPS_DOC_CHAR_SET);
}
//-----------------------------------------
// Dates
//-----------------------------------------
if ($item_data['date'] < 1) {
$item_data['date'] = time();
} else {
if ($item_data['date'] > time()) {
$item_data['date'] = time();
}
}
//-----------------------------------------
// Got stuff?
//-----------------------------------------
if (!$item_data['title'] or !$item_data['content']) {
continue;
}
//-----------------------------------------
// Strip html if needed
//-----------------------------------------
if ($config['filters']['rss_html']) {
$item_data['title'] = strip_tags($item_data['title']);
$item_data['content'] = strip_tags($item_data['content']);
}
$content[] = $item_data;
}
}
}
//-----------------------------------------
// Return formatted content
//.........這裏部分代碼省略.........
示例11: processUpload
//.........這裏部分代碼省略.........
case 2:
// Invalid file ext
$this->error = 'invalid_mime_type';
return $attach_data;
break;
case 3:
// Too big...
$this->error = 'upload_too_big';
return $attach_data;
break;
case 4:
// Cannot move uploaded file
$this->error = 'upload_failed';
return $attach_data;
break;
case 5:
// Possible XSS attack (image isn't an image)
$this->error = 'upload_failed';
return $attach_data;
break;
}
}
//-----------------------------------------
// Still here?
//-----------------------------------------
if ($upload->saved_upload_name and @is_file($upload->saved_upload_name)) {
//-----------------------------------------
// Strip off { } and [ ]
//-----------------------------------------
$upload->original_file_name = str_replace(array('[', ']', '{', '}'), "", $upload->original_file_name);
$attach_data['attach_filesize'] = @filesize($upload->saved_upload_name);
$attach_data['attach_location'] = $this->upload_dir . $upload->parsed_file_name;
if (IPSText::isUTF8($upload->original_file_name)) {
$attach_data['attach_file'] = IPSText::convertCharsets($upload->original_file_name, "UTF-8", IPS_DOC_CHAR_SET);
} else {
$attach_data['attach_file'] = $upload->original_file_name;
}
$attach_data['attach_is_image'] = $upload->is_image;
$attach_data['attach_ext'] = $upload->real_file_extension;
if ($attach_data['attach_is_image'] == 1) {
require_once IPS_KERNEL_PATH . 'classImage.php';
/*noLibHook*/
require_once IPS_KERNEL_PATH . 'classImageGd.php';
/*noLibHook*/
/* Main attachment */
if (!empty($this->settings['attach_img_max_w']) and !empty($this->settings['attach_img_max_h'])) {
$image = new classImageGd();
$image->init(array('image_path' => $this->upload_path, 'image_file' => $upload->parsed_file_name));
$image->force_resize = false;
if ($imgData = $image->resizeImage($this->settings['attach_img_max_w'], $this->settings['attach_img_max_h'], false, true)) {
if (!$imgData['noResize']) {
$image->writeImage($this->upload_path . '/' . $upload->parsed_file_name);
}
if (is_array($imgData)) {
$attach_data['attach_img_width'] = $imgData['newWidth'];
$attach_data['attach_img_height'] = $imgData['newHeight'];
}
$attach_data['attach_filesize'] = @filesize($this->upload_path . '/' . $upload->parsed_file_name);
}
}
/* Thumb nail */
$image = new classImageGd();
$image->force_resize = true;
$image->init(array('image_path' => $this->upload_path, 'image_file' => $upload->parsed_file_name));
if (TRUE) {
if ($this->attach_settings['siu_width'] < $attach_data['attach_img_width'] or $this->attach_settings['siu_height'] < $attach_data['attach_img_height']) {
示例12: finishLogin
/**
* Completes the connection
*
* @access public
* @return redirect
*/
public function finishLogin()
{
/* From reg flag */
if ($_REQUEST['code']) {
/* Load oAuth */
require_once IPS_KERNEL_PATH . 'facebook/facebookoauth.php';
/*noLibHook*/
$this->_oauth = new FacebookOAuth(FACEBOOK_APP_ID, FACEBOOK_APP_SECRET, FACEBOOK_CALLBACK, $this->extendedPerms);
/* Load API */
require_once IPS_KERNEL_PATH . 'facebook/facebook.php';
/*noLibHook*/
$this->_api = new Facebook(array('appId' => FACEBOOK_APP_ID, 'secret' => FACEBOOK_APP_SECRET, 'cookie' => true));
/* Ensure URL is correct */
$_urlExtra = '';
if ($_REQUEST['key']) {
$_urlExtra .= '&key=' . $_REQUEST['key'];
}
if ($_REQUEST['_reg']) {
$_urlExtra .= '&_reg=1';
}
/* Update callback url */
$this->_oauth->setCallBackUrl(FACEBOOK_CALLBACK . $_urlExtra);
/* Generate oAuth token */
$rToken = $this->_oauth->getAccessToken($_REQUEST['code']);
if (is_string($rToken)) {
try {
$_userData = $this->_api->api('me', array('access_token' => $rToken));
} catch (Exception $e) {
/* Try re-authorising */
if (stristr($e->getMessage(), 'invalid')) {
$this->redirectToConnectPage();
}
}
/* A little gymnastics */
$this->_userData = $_userData;
$_userData = $this->fetchUserData($rToken);
/* Got a member linked already? */
$_member = IPSMember::load($_userData['id'], 'all', 'fb_uid');
/* Not connected, check email address */
if (!$_member['member_id'] and $_userData['email']) {
$_member = IPSMember::load($_userData['email'], 'all', 'email');
/* We do have an existing account, so trash email forcing user to sign up with new */
if ($_member['member_id']) {
/* Update row */
IPSMember::save($_member['member_id'], array('core' => array('fb_uid' => $_userData['id'], 'fb_token' => $rToken)));
}
}
if ($_member['member_id']) {
$memberData = $_member;
/* Ensure user's row is up to date */
IPSMember::save($memberData['member_id'], array('core' => array('fb_token' => $rToken)));
/* Here, so log us in!! */
/* changed by denchu 26/12/12 */
$r = $this->_login()->loginWithoutCheckingCredentials($memberData['member_id'], TRUE);
if (is_array($r)) {
if (isset($r[1])) {
$this->registry->getClass('output')->redirectScreen($r[0], $r[1]);
$this->registry->getClass('output')->silentRedirect($r[1]);
} else {
$this->registry->getClass('output')->silentRedirect($r[0]);
}
} elseif (!$r) {
throw new Exception('LINKED_MEMBER_LOGIN_FAIL');
} else {
$this->registry->getClass('output')->silentRedirect($this->settings['base_url']);
}
} else {
/* No? Create a new member */
foreach (array('fbc_s_pic', 'fbc_s_status', 'fbc_s_aboutme') as $field) {
$toSave[$field] = 1;
}
$fb_bwoptions = IPSBWOptions::freeze($toSave, 'facebook');
$safeFBName = IPS_DOC_CHAR_SET != 'UTF-8' ? IPSText::utf8ToEntities($_userData['name']) : $_userData['name'];
/* Make sure usernames are safe */
if ($this->settings['username_characters']) {
$check_against = preg_quote($this->settings['username_characters'], "/");
$check_against = str_replace('\\-', '-', $check_against);
$safeFBName = preg_replace('/[^' . $check_against . ']+/i', '', $safeFBName);
}
/* Check ban filters? */
if (IPSMember::isBanned('email', $_userData['email']) or IPSMember::isBanned('name', $safeFBName)) {
$this->registry->output->showError('you_are_banned', 1090003);
}
$displayName = $this->settings['fb_realname'] == 'enforced' ? $safeFBName : '';
/* From reg, so create new account properly */
$toSave = array('core' => array('name' => IPSText::parseCleanValue($safeFBName), 'members_display_name' => IPSText::parseCleanValue($displayName), 'members_created_remote' => 1, 'member_group_id' => $this->settings['fbc_mgid'] ? $this->settings['fbc_mgid'] : $this->settings['member_group'], 'email' => $_userData['email'], 'fb_uid' => $_userData['id'], 'time_offset' => $_userData['timezone'], 'members_auto_dst' => 1, 'fb_token' => $rToken), 'extendedProfile' => array('pp_about_me' => IPSText::getTextClass('bbcode')->stripBadWords(IPSText::convertCharsets($_userData['about'], 'utf-8', IPS_DOC_CHAR_SET)), 'fb_bwoptions' => $fb_bwoptions));
$memberData = IPSMember::create($toSave, FALSE, FALSE, TRUE);
if (!$memberData['member_id']) {
throw new Exception('CREATION_FAIL');
}
/* Sync up photo */
$this->syncMember($memberData['member_id']);
$pmember = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'members_partial', 'where' => "partial_member_id=" . $memberData['member_id']));
if ($pmember['partial_member_id']) {
//.........這裏部分代碼省略.........
示例13: getWhereClause
/**
* Get the WHERE part of the SQL query
*
* @return string SQL WHERE string
*/
public function getWhereClause()
{
//-----------------------------------------
// Ignore filters?
//-----------------------------------------
if ($this->showAllMembers) {
return '';
}
//-----------------------------------------
// Init
//-----------------------------------------
$data = $this->generateFilterBoxes();
$_sql = array();
//print_r($data);exit;
//-----------------------------------------
// Filters
//-----------------------------------------
if ($data['member_contains_text']) {
$_field = '';
$_text = $this->DB->addSlashes($data['member_contains_text']);
switch ($data['member_contains']) {
default:
case 'member_id':
$_field = 'm.member_id';
break;
case 'name':
$_field = 'm.members_l_username';
$_text = strtolower($_text);
break;
case 'members_display_name':
$_field = 'm.members_l_display_name';
$_text = strtolower($_text);
break;
case 'email':
$_field = 'm.email';
break;
case 'ip_address':
$_field = 'm.ip_address';
break;
case 'signature':
$_field = 'pp.signature';
break;
}
switch ($data['member_contains_type']) {
default:
case 'contains':
$_sql[] = $this->DB->buildCast($_field, 'VARCHAR') . " LIKE '%" . $_text . "%'";
break;
case 'begins':
$_sql[] = $this->DB->buildCast($_field, 'VARCHAR') . " LIKE '" . $_text . "%'";
break;
case 'ends':
$_sql[] = $this->DB->buildCast($_field, 'VARCHAR') . " LIKE '%" . $_text . "'";
break;
case 'equals':
$_sql[] = $this->DB->buildCast($_field, 'VARCHAR') . " = '" . $_text . "'";
break;
}
}
//-----------------------------------------
// "Simple" all-in-one search
//-----------------------------------------
if ($data['member_string'] and strlen($data['member_string']) >= 3) {
/* Fix from ticket 766094 */
$_text = $this->DB->addSlashes(IPSText::convertCharsets($data['member_string'], 'utf-8', IPS_DOC_CHAR_SET));
$_sql[] = '(' . $this->DB->buildCast('m.name', 'VARCHAR') . " LIKE '%" . $_text . "%' OR " . $this->DB->buildCast('m.members_display_name', 'VARCHAR') . " LIKE '%" . $_text . "%' OR " . $this->DB->buildCast('m.email', 'VARCHAR') . " LIKE '%" . $_text . "%' OR " . $this->DB->buildCast('m.ip_address', 'VARCHAR') . " LIKE '%" . $_text . "%')";
}
//-----------------------------------------
// Group limiting
//-----------------------------------------
if ($data['primary_group']) {
if ($data['include_secondary']) {
$_sql[] = "( m.member_group_id=" . intval($data['primary_group']) . " OR " . "m.mgroup_others LIKE '%," . intval($data['primary_group']) . ",%' OR " . "m.mgroup_others LIKE '" . intval($data['primary_group']) . ",%' OR " . "m.mgroup_others LIKE '%," . intval($data['primary_group']) . "' OR " . "m.mgroup_others='" . intval($data['primary_group']) . "' )";
} else {
$_sql[] = "m.member_group_id=" . intval($data['primary_group']);
}
}
if ($data['secondary_group']) {
$_sql[] = "( m.mgroup_others LIKE '%," . $data['secondary_group'] . ",%' OR " . "m.mgroup_others LIKE '" . $data['secondary_group'] . ",%' OR " . "m.mgroup_others LIKE '%," . $data['secondary_group'] . "' OR " . "m.mgroup_others='" . $data['secondary_group'] . "' )";
}
//-----------------------------------------
// Post count
//-----------------------------------------
if (($data['post_count'] or $data['post_count'] == '0') and $data['post_count_type']) {
$_type = '';
if ($data['post_count_type'] == 'gt') {
$_type = '>';
} else {
if ($data['post_count_type'] == 'lt') {
$_type = '<';
} else {
if ($data['post_count_type'] == 'eq') {
$_type = '=';
}
}
//.........這裏部分代碼省略.........
示例14: convert
/**
* Parses the content
*/
public static function convert($k, $v)
{
return is_string($v) && !in_array($k, self::$noConvertFields) ? IPSText::convertCharsets($v, 'UTF-8', IPS_DOC_CHAR_SET) : $v;
}
示例15: prepare_remote_utf8_string
function prepare_remote_utf8_string($str)
{
$charset = get_local_charset();
if (strtolower($charset) == 'utf-8') {
return $str;
}
if (is_ipb()) {
return IPSText::convertCharsets($str, 'utf-8', $charset);
}
$str = html_entity_decode_utf8($str, true);
$converted = false;
if (function_exists('mb_convert_encoding') && !$converted) {
$out = @mb_convert_encoding($str, 'HTML-ENTITIES', 'UTF-8');
$out = @mb_convert_encoding($out, $charset, 'UTF-8');
if (mb_strlen(trim($out)) > 0) {
$converted = true;
}
}
if (function_exists('iconv') && !$converted) {
$out = @iconv('UTF-8', $charset . '//TRANSLIT', $str);
if ($out !== false) {
$converted = true;
}
}
if (!$converted) {
$out = $str;
}
$out = escape_non_numerical_entities($out, $charset);
return $out;
}