本文整理汇总了PHP中get_encoding函数的典型用法代码示例。如果您正苦于以下问题:PHP get_encoding函数的具体用法?PHP get_encoding怎么用?PHP get_encoding使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_encoding函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: WYSIWYGTextarea
/**
* Module API wrapper function
*
* @since 1.0
* @return string
*/
public static function WYSIWYGTextarea($name = 'textarea', $columns = '80', $rows = '15', $encoding = '', $content = '', $stylesheet = '', $addtext = '')
{
$mod = cms_utils::get_module('MicroTiny');
// Check if we are in object instance
if (!is_object($mod)) {
return false;
}
// TODO: some error message?
// Force WYSIWYG on
$mod->wysiwygactive = true;
// Stikki: calling this before TODO cause whole thing failing, check this Silmarillion.
if ($stylesheet != '') {
$_SESSION["microtiny_live_templateid"] = substr($stylesheet, strpos($stylesheet, "=") + 1);
} else {
$tplops = cmsms()->GetTemplateOperations();
$templateid = $tplops->LoadDefaultTemplate();
$mod->templateid = $templateid->id;
}
self::add_textarea($name);
$output = '<textarea id="' . $name . '" name="' . $name . '" cols="' . $columns . '" rows="' . ($rows + 5) . '" ' . $addtext . '>' . cms_htmlentities($content, ENT_NOQUOTES, get_encoding($encoding)) . '</textarea>';
global $CMS_ADMIN_PAGE;
if ($CMS_ADMIN_PAGE && $mod->CheckPermission('MicroTiny View HTML Source')) {
$output .= '<span style="display:block; margin-top:10px;"><input type="checkbox" id="toggle_' . $name . '" onclick="toggleMicroTiny(\'' . $name . '\');"/><label for="toggle_' . $name . '">' . $mod->Lang('view_html') . '</label></span>';
}
return $output;
}
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:32,代码来源:class.microtiny_utils.php
示例2: cms_admin_sendheaders
function cms_admin_sendheaders($content_type = 'text/html', $charset = '')
{
if (!$charset) {
$charset = get_encoding();
}
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// Language shizzle
header("Content-Type: {$content_type}; charset={$charset}");
}
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:17,代码来源:include.php
示例3: intval
<?php
require "../global.php";
require "../cache/s_cate_array.php";
require_once "global.func.php";
require_once "search.class.php";
$s = intval($_GET["s"]);
$wd = $_GET["wd"];
$from_host = str_replace("http://", "", GetSiteUrl($_SERVER['HTTP_REFERER']));
if ($from_host != $_SERVER['HTTP_HOST']) {
$wd = get_encoding($wd, "GB2312");
}
$old_wd = $wd;
$wd = FilterSearch($wd);
if (strlen($wd) <= 0) {
header("location:" . $config["url"]);
}
$wd_en = urlencode($wd);
$is_site = false;
//////////////////////
class runtime
{
var $StartTime = 0;
var $StopTime = 0;
function get_microtime()
{
list($usec, $sec) = explode(' ', microtime());
return (double) $usec + (double) $sec;
}
function start()
{
开发者ID:tanny2015,项目名称:DataStructure,代码行数:31,代码来源:index.php
示例4: get_preference
$themeName = get_preference(get_userid(), 'admintheme', 'default');
$themeObjectName = $themeName . "Theme";
$userid = get_userid();
debug_buffer('before theme load');
if (file_exists(dirname(__FILE__) . "/themes/{$themeName}/{$themeObjectName}.php")) {
include dirname(__FILE__) . "/themes/{$themeName}/{$themeObjectName}.php";
$themeObject = new $themeObjectName($gCms, $userid, $themeName);
} else {
$themeObject = new AdminTheme($gCms, $userid, $themeName);
}
debug_buffer('after theme load');
$gCms->variables['admintheme'] =& $themeObject;
if (isset($gCms->config['admin_encoding']) && $gCms->config['admin_encoding'] != '') {
$themeObject->SendHeaders(isset($charsetsent), $gCms->config['admin_encoding']);
} else {
$themeObject->SendHeaders(isset($charsetsent), get_encoding('', false));
}
debug_buffer('before populate admin navigation');
$themeObject->PopulateAdminNavigation(isset($CMS_ADMIN_SUBTITLE) ? $CMS_ADMIN_SUBTITLE : '');
debug_buffer('after populate admin navigation');
debug_buffer('before theme-y stuff');
$themeObject->DisplayDocType();
$themeObject->DisplayHTMLStartTag();
$themeObject->DisplayHTMLHeader(false, isset($headtext) ? $headtext : '');
$themeObject->DisplayBodyTag();
$themeObject->DoTopMenu();
$themeObject->DisplayMainDivStart();
debug_buffer('after theme-y stuff');
// Display notification stuff from modules
// should be controlled by preferences or something
$ignoredmodules = explode(',', get_preference($userid, 'ignoredmodules'));
开发者ID:rasomu,项目名称:chuza,代码行数:31,代码来源:header.php
示例5: createtmpfname
function createtmpfname(&$contentobj)
{
$gCms = cmsms();
$config = $gCms->GetConfig();
$templateops = $gCms->GetTemplateOperations();
$data["content_id"] = $contentobj->Id();
$data['content_type'] = $contentobj->Type();
$data["title"] = $contentobj->Name();
$data["menutext"] = $contentobj->MenuText();
$data["content"] = $contentobj->Show();
$data["template_id"] = $contentobj->TemplateId();
$data["hierarchy"] = $contentobj->Hierarchy();
$templateobj = $templateops->LoadTemplateById($contentobj->TemplateId());
$data['template'] = $templateobj->content;
$data['encoding'] = get_encoding();
$data['serialized_content'] = serialize($contentobj);
$tmpfname = '';
if (is_writable($config["previews_path"])) {
$tmpfname = tempnam($config["previews_path"], "cmspreview");
} else {
$tmpfname = tempnam(TMP_CACHE_LOCATION, "cmspreview");
}
$handle = fopen($tmpfname, "w");
fwrite($handle, serialize($data));
fclose($handle);
return $tmpfname;
}
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:27,代码来源:editcontent_extra.php
示例6: lang_by_realm_en
/**
* A method to return a translation for a specific string in a specific realm.
* called with the realm first, followed by the key, this method will attempt
* to load the specific realm data if necessary before doing translation.
*
* This method accepts a variable number of arguments. Any arguments after
* the realm and the key are passed to the key via vsprintf
*
* i.e: lang_by_realm('tasks','my_string');
*
* @since 1.8
* @param string The realm
* @param string The lang key
* @return string
*/
function lang_by_realm_en()
{
$gCms = cmsms();
global $lang;
$name = '';
$realm = 'admin';
$params = array();
$result = '';
$num = func_num_args();
if ($num == 0) {
return '';
}
$name = func_get_arg(0);
if ($num > 1) {
$realm = func_get_arg(1);
if ($num > 2 && is_array(func_get_arg(2))) {
$params = func_get_arg(2);
} else {
if ($num > 2) {
$params = array_slice(func_get_args(), 2);
}
}
}
// we now have a name, a realm, and possible additonal arguments.
if (!isset($lang[$realm])) {
$saved_lang = $lang;
$lang = array();
cms_load_lang_realm($realm, NULL, NULL, NULL, NULL, NULL, 'en_US');
}
// do processing.
if (isset($lang[$realm][$name])) {
if (count($params)) {
$result = vsprintf($lang[$realm][$name], $params);
} else {
$result = $lang[$realm][$name];
}
} else {
$result = "--Add Me - {$name} --";
}
// conversion.
if (isset($gCms->config['admin_encoding']) && isset($gCms->variables['convertclass'])) {
if (strcasecmp(get_encoding('', false), $gCms->config['admin_encoding'])) {
$class =& $gCms->variables['convertclass'];
$result = $class->Convert($result, get_encoding('', false), $gCms->config['admin_encoding']);
}
}
$lang = $saved_lang;
return $result;
}
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:64,代码来源:translation.functions.php
示例7: db_store_html
function db_store_html($seed, $strHTML, $strURL)
{
/*!! TODO: Encoding Issues, pull date from header*/
#store strHTML and current datetime
#echo "start db_store_html(....)\n";
#echo "$strHTML";
//ENCODING!!!!!!!!!!
try {
$enc = get_encoding($strHTML, true);
if (strlen($enc) > 0) {
$enc = $enc . ",";
}
$enc = $enc . "x-euc-jp,EUC-JP,JIS,SJIS,iso-8859-1,ASCII";
#mb_detect_encoding($strHTML,$enc)
$strHTML = mb_convert_encoding($strHTML, "UTF-8", $enc);
//$strHTML = html_entity_decode( $strHTML, ENT_QUOTES, "UTF-8" );
//$strHTML = remove($strHTML,"<script","</script>");//strip JavaScript
//$strHTML=strip_tags($strHTML);//Remove html tags
$strHTML = strtolower_utf8($strHTML);
$return = $strHTML;
try {
$strHTML = $strHTML;
if ($strURL && clean_url($strURL) != clean_url($seed["strURL"])) {
$domain = get_domain($strURL);
$cleanURL = clean_url($strURL);
$url = $strURL;
$strSQL = "UPDATE tblPages SET strURL=?, strCleanURL=?, strHTML=? WHERE iPageID=?";
$params = array($url, $cleanURL, $strHTML, $seed["iPageID"]);
} else {
$strSQL = "UPDATE tblPages SET strHTML=? WHERE iPageID=?";
$params = array($strHTML, $seed["iPageID"]);
}
db_run_query($strSQL, $params);
#echo "end db_store_html(...)\n";
#'" . date("YmdHi___NEED SECONDS__") . "'"
#e.g. '20100131000000' 2010-01-31 00:00:00
#CurDate(), CurTime, Now()
} catch (Exception $e) {
//ignore
}
return $return;
} catch (Exception $e) {
print "Exeception {$e}\n";
return null;
}
}
开发者ID:kuko-mainroot,项目名称:phpWebCralwer,代码行数:46,代码来源:LIB_db_functions.php
示例8: header
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
} else {
// no 404 error page.
ErrorHandler404();
return;
}
}
}
// while trycount
Events::SendEvent('Core', 'ContentPostRender', array('content' => &$html));
$ct = cmsms()->get_variable('content-type');
if (!$ct) {
$ct = 'text/html';
}
header("Content-Type: {$ct}; charset=" . get_encoding());
echo $html;
@ob_flush();
$endtime = microtime();
$db =& cmsms()->GetDb();
if ($config['debug'] == TRUE || isset($config['show_performance_info']) && $showtemplate == true) {
$memory = function_exists('memory_get_usage') ? memory_get_usage() : 0;
$memory = $memory - $orig_memory;
$memory_peak = function_exists('memory_get_peak_usage') ? memory_get_peak_usage() : 0;
if (!is_sitedown() && $config["debug"] == true) {
echo "<p>Generated in " . microtime_diff($starttime, $endtime) . " seconds by CMS Made Simple using " . (isset($db->query_count) ? $db->query_count : '') . " SQL queries and {$memory} bytes of memory (peak memory usage was {$memory_peak})</p>";
} else {
if (isset($config['show_performance_info']) && $showtemplate == true) {
$txt = microtime_diff($starttime, $endtime) . " / " . (isset($db->query_count) ? $db->query_count : '') . " / {$memory} / {$memory_peak}";
debug_display($txt);
echo '<!-- ' . $txt . " -->\n";
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:31,代码来源:index.php
示例9: ob_list_handlers
$content =& $contentops->LoadContentFromId($pageid);
$title = $content->Name();
$templateid = $content->TemplateId();
$menutext = $content->MenuText();
$this->smarty->assign("title", $title);
$this->smarty->assign("content", $showcontent);
$this->smarty->assign("url", $url);
$encoding = $config['default_encoding'];
// kill any output that may have happened already.
$handlers = ob_list_handlers();
for ($cnt = 0; $cnt < sizeof($handlers); $cnt++) {
ob_end_clean();
}
//Printing-specific assignments
$smarty->assign("templateid", $templateid);
$smarty->assign("overridestylesheet", $this->GetPreference("overridestyle"));
$smarty->assign("encoding", $encoding);
$smarty->assign("rooturl", $config["root_url"] . "/");
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Date in the past
header("Content-Type: " . cmsms()->get_variable('content-type') . "; charset=" . get_encoding());
if ($script) {
$smarty->assign("printscript", '<script type="text/javascript">window.print();</script>');
} else {
$smarty->assign("printscript", '');
}
$str = $this->ProcessTemplateFromDatabase("printtemplate");
echo $str;
exit;
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:31,代码来源:action.output.php
示例10: create_textarea
/**
* A method to create a text area control
*
* @internal
* @access private
* @param boolean Wether the currently selected wysiwyg area should be enabled (depends on user, and site preferences
* @param string The contents of the text area
* @param string The name of the text area
* @param string An optional class name
* @param string An optional ID (HTML ID) value
* @param string The optional encoding
* @param string Optional style information
* @param integer Width (the number of columns) (CSS can and will override this)
* @param integer Hieght (the number of rows) (CSS can and will override this)
* @param string A flag to indicate that the wysiwyg should be forced to a different type independant of user settings
* @param string The name of the syntax hilighter to use (if empty it is assumed that a wysiwyg text area is requested instead of a syntax hiliter)
* @param string Optional additional text to include in the textarea tag
* @return string
*/
function create_textarea($enablewysiwyg, $text, $name, $classname = '', $id = '', $encoding = '', $stylesheet = '', $width = '80', $height = '15', $forcewysiwyg = '', $wantedsyntax = '', $addtext = '')
{
$gCms = cmsms();
$result = '';
$uid = get_userid(false);
if ($enablewysiwyg == true) {
$module = cms_utils::get_wysiwyg_module($forcewysiwyg);
if ($module) {
$result = $module->WYSIWYGTextArea($name, $width, $height, $encoding, $text, $stylesheet, $addtext);
}
}
if (!$result && $wantedsyntax) {
$module = cms_utils::get_syntax_highlighter_module();
if ($module) {
$result = $module->SyntaxTextArea($name, $wantedsyntax, $width, $height, $encoding, $text, $addtext);
}
}
if ($result == '') {
$result = '<textarea name="' . $name . '" cols="' . $width . '" rows="' . $height . '"';
if ($classname != '') {
$result .= ' class="' . $classname . '"';
} else {
$result .= ' class="cms_textarea"';
}
if ($id != '') {
$result .= ' id="' . $id . '"';
}
if (!empty($addtext)) {
$result .= ' ' . $addtext;
}
$result .= '>' . cms_htmlentities($text, ENT_NOQUOTES, get_encoding($encoding)) . '</textarea>';
}
return $result;
}
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:53,代码来源:page.functions.php
示例11: each
//Events::SendEvent('Core', 'ContentPostRenderNonCached', array(&$html));
#}
#Perform the content postrender callback
#reset($gCms->modules);
#while (list($key) = each($gCms->modules))
#{
# $value =& $gCms->modules[$key];
# if ( isset($gCms->modules[$key]['installed']) &&
# $gCms->modules[$key]['installed'] == true &&
# $gCms->modules[$key]['active'] == true)
# {
# $gCms->modules[$key]['object']->ContentPostRender($html);
# }
#}
Events::SendEvent('Core', 'ContentPostRender', array('content' => &$html));
header("Content-Type: " . $gCms->variables['content-type'] . "; charset=" . (isset($pageinfo->template_encoding) && $pageinfo->template_encoding != '' ? $pageinfo->template_encoding : get_encoding()));
echo $html;
@ob_flush();
$endtime = microtime();
$db =& $gCms->GetDb();
$memory = function_exists('memory_get_usage') ? memory_get_usage() : 0;
$memory = $memory - $orig_memory;
$memory_peak = function_exists('memory_get_peak_usage') ? memory_get_peak_usage() : 0;
if (!is_sitedown() && $config["debug"] == true) {
echo "<p>Generated in " . microtime_diff($starttime, $endtime) . " seconds by CMS Made Simple using " . (isset($db->query_count) ? $db->query_count : '') . " SQL queries and {$memory} bytes of memory (peak memory usage was {$memory_peak})</p>";
} else {
if (isset($config['show_performance_info']) && $showtemplate == true) {
echo "<!-- " . microtime_diff($starttime, $endtime) . " / " . (isset($db->query_count) ? $db->query_count : '') . " / {$memory} / {$memory_peak} -->\n";
}
}
if (is_sitedown() || $config['debug'] == true) {
开发者ID:rasomu,项目名称:chuza,代码行数:31,代码来源:index.php
示例12: module_get_template
/**
* Retrieve output from a module.
* This method grabs parameters from the request, and given the module name
* will call the module with the specified parameters to retrieve the module output.
* This is used to replace the contents of the {content} tag when a module action is
* called in a non inline manner.
*
* @access private
* @param string The module name.
* @param string (returned) The moduleoutput.
* @param object The smarty object.
* @return boolean
*/
function module_get_template($tpl_name, &$tpl_source, &$smarty_obj)
{
$gCms = cmsms();
$contentobj = $gCms->variables['content_obj'];
$config = $gCms->config;
#Run the execute_user function and replace {content} with it's output
$obj = cms_utils::get_module($tpl_name);
if (is_object($obj)) {
@ob_start();
$id = $smarty_obj->id;
$returnid = is_object($contentobj) ? $contentobj->Id() : '';
$params = GetModuleParameters($id);
$action = 'default';
if (isset($params['action'])) {
$action = $params['action'];
}
echo $obj->DoActionBase($action, $id, $params, is_object($contentobj) ? $contentobj->Id() : '');
$modoutput = @ob_get_contents();
@ob_end_clean();
$tpl_source = $modoutput;
}
header("Content-Type: " . $gCms->variables['content-type'] . "; charset=" . get_encoding());
if (isset($gCms->variables['content-filename']) && $gCms->variables['content-filename'] != '') {
header('Content-Disposition: attachment; filename="' . $gCms->variables['content-filename'] . '"');
header("Pragma: public");
}
#So no one can do anything nasty, take out the php smarty tags. Use a user
#defined plugin instead.
if (!(isset($config["use_smarty_php_tags"]) && $config["use_smarty_php_tags"] == true)) {
$tpl_source = preg_replace("/\\{\\/?php\\}/", "", $tpl_source);
}
return true;
}
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:46,代码来源:class.Smarty_CMS.php
示例13: cms_html_entity_decode
$params['errors'] = $this->Lang('error_insufficientparams');
$this->Redirect($id, $the_action, $returnid, $params);
return;
}
if (isset($params['cancel'])) {
$module->_current_tab = $this->_current_tab;
$module->RedirectToTab($id, $this->_current_tab, '', $the_action);
}
if (!isset($params['templatecontent'])) {
$params['errors'] = $this->Lang('error_insufficientparams');
$module->Redirect($id, $params['origaction'], '', $params);
return;
}
if (!isset($params['template'])) {
$params['errors'] = $this->Lang('error_insufficientparams');
$module->Redirect($id, $params['origaction'], '', $params);
return;
}
$module->SetTemplate($params['prefix'] . $params['template'], cms_html_entity_decode($params['templatecontent'], ENT_QUOTES, get_encoding()));
audit('', $module->GetName(), 'Edited Tempalte ' . $params['prefix'] . $params['template']);
if (isset($params['applybutton'])) {
unset($params['applybutton']);
$_SESSION['cge_edittemplate'] = $params;
$this->Redirect($id, 'edittemplate', $returnid);
}
if ($this->_current_tab != '') {
$module->_current_tab = $this->_current_tab;
$module->RedirectToTab($id, '', '', $the_action);
return;
}
$module->Redirect($id, $the_action);
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:31,代码来源:action.do_edittemplate.php
示例14: create_textarea
/**
* A method to create a text area control
*
* @internal
* @access private
* @param boolean Wether the currently selected wysiwyg area should be enabled (depends on user, and site preferences
* @param string The contents of the text area
* @param string The name of the text area
* @param string An optional class name
* @param string An optional ID (HTML ID) value
* @param string The optional encoding
* @param string Optional style information
* @param integer Width (the number of columns) (CSS can and will override this)
* @param integer Hieght (the number of rows) (CSS can and will override this)
* @param string A flag to indicate that the wysiwyg should be forced to a different type independant of user settings
* @param string The name of the syntax hilighter to use (if empty it is assumed that a wysiwyg text area is requested instead of a syntax hiliter)
* @param string Optional additional text to include in the textarea tag
* @return string
*/
function create_textarea($enablewysiwyg, $text, $name, $classname = '', $id = '', $encoding = '', $stylesheet = '', $width = '80', $height = '15', $forcewysiwyg = '', $wantedsyntax = '', $addtext = '')
{
global $gCms;
$result = '';
if ($enablewysiwyg == true) {
reset($gCms->modules);
while (list($key) = each($gCms->modules)) {
$value =& $gCms->modules[$key];
if ($gCms->modules[$key]['installed'] == true && $gCms->modules[$key]['active'] == true && $gCms->modules[$key]['object']->IsWYSIWYG()) {
if ($forcewysiwyg == '') {
if (get_userid(false) == false) {
//echo "admin";
//get_preference(get_userid(), 'wysiwyg')!="" && //not needed as it won't match the wisiwyg anyway
if ($gCms->modules[$key]['object']->GetName() == get_site_preference('frontendwysiwyg')) {
$result = $gCms->modules[$key]['object']->WYSIWYGTextarea($name, $width, $height, $encoding, $text, $stylesheet, $addtext);
}
} else {
if ($gCms->modules[$key]['object']->GetName() == get_preference(get_userid(false), 'wysiwyg')) {
$result = $gCms->modules[$key]['object']->WYSIWYGTextarea($name, $width, $height, $encoding, $text, $stylesheet, $addtext);
}
}
} else {
if ($gCms->modules[$key]['object']->GetName() == $forcewysiwyg) {
$result = $gCms->modules[$key]['object']->WYSIWYGTextarea($name, $width, $height, $encoding, $text, $stylesheet, $addtext);
}
}
}
}
}
if ($result == "" && $wantedsyntax != '') {
reset($gCms->modules);
while (list($key) = each($gCms->modules)) {
$value =& $gCms->modules[$key];
if ($gCms->modules[$key]['installed'] == true && $gCms->modules[$key]['active'] == true && $gCms->modules[$key]['object']->IsSyntaxHighlighter()) {
if ($forcewysiwyg == '') {
//get_preference(get_userid(), 'wysiwyg')!="" && //not needed as it won't match the wisiwyg anyway
if ($gCms->modules[$key]['object']->GetName() == get_preference(get_userid(false), 'syntaxhighlighter')) {
$result = $gCms->modules[$key]['object']->SyntaxTextarea($name, $wantedsyntax, $width, $height, $encoding, $text, $addtext);
}
} else {
if ($gCms->modules[$key]['object']->GetName() == $forcewysiwyg) {
$result = $gCms->modules[$key]['object']->SyntaxTextarea($name, $wantedsyntax, $width, $height, $encoding, $text, $addtext);
}
}
}
}
}
if ($result == '') {
$result = '<textarea name="' . $name . '" cols="' . $width . '" rows="' . $height . '"';
if ($classname != '') {
$result .= ' class="' . $classname . '"';
} else {
$result .= ' class="cms_textarea"';
}
if ($id != '') {
$result .= ' id="' . $id . '"';
}
if (!empty($addtext)) {
$result .= ' ' . $addtext;
}
$result .= '>' . cms_htmlentities($text, ENT_NOQUOTES, get_encoding($encoding)) . '</textarea>';
}
return $result;
}
开发者ID:rasomu,项目名称:chuza,代码行数:83,代码来源:page.functions.php
示例15: create_textarea
/**
* A method to create a text area control
*
* @internal
* @access private
* @param boolean Wether or not we are enabling a wysiwyg. If false, and forcewysiwyg is not empty then a syntax area is used.
* @param string The contents of the text area
* @param string The name of the text area
* @param string An optional class name
* @param string An optional ID (HTML ID) value
* @param string The optional encoding
* @param string Optional style information
* @param integer Width (the number of columns) (CSS can and will override this)
* @param integer Hieght (the number of rows) (CSS can and will override this)
* @param string Optional name of the syntax hilighter or wysiwyg to use. If empty, preferences indicate which a syntax editor or wysiwyg should be used.
* @param string Optional name of the language used. If non empty it indicates that a syntax highlihter will be used.
* @param string Optional additional text to include in the textarea tag
* @return string
*/
function create_textarea($enablewysiwyg, $text, $name, $classname = '', $id = '', $encoding = '', $stylesheet = '', $width = '80', $height = '15', $forcewysiwyg = '', $wantedsyntax = '', $addtext = '')
{
// todo: rewrite me with var args... to accept a numeric array of arguments, or a hash.
$gCms = cmsms();
$result = '';
$uid = get_userid(false);
if ($enablewysiwyg == true || $forcewysiwyg) {
$module = cms_utils::get_wysiwyg_module($forcewysiwyg);
if ($module) {
$result = $module->WYSIWYGTextArea($name, $width, $height, $encoding, $text, $stylesheet, $addtext);
}
}
if (!$result && $wantedsyntax) {
// here we should get a list of installed/available modules.
$module = cmsms()->GetModuleOperations()->GetSyntaxHighlighter($forcewysiwyg);
if ($module) {
$result = $module->SyntaxTextArea($name, $wantedsyntax, $width, $height, $encoding, $text, $addtext);
}
}
if ($result == '') {
$result = '<textarea name="' . $name . '" cols="' . $width . '" rows="' . $height . '"';
if ($classname != '') {
$result .= ' class="' . $classname . '"';
} else {
$result .= ' class="cms_textarea"';
}
if ($id != '') {
$result .= ' id="' . $id . '"';
}
if (!empty($addtext)) {
$result .= ' ' . $addtext;
}
$result .= '>' . cms_htmlentities($text, ENT_NOQUOTES, get_encoding($encoding)) . '</textarea>';
}
return $result;
}
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:55,代码来源:page.functions.php
示例16: insert_url_temp
function insert_url_temp($site_id, $url, $level)
{
global $db;
$url_htmlcode = get_url_content($url);
$url_htmlcode = get_encoding($url_htmlcode, "GB2312");
$links = get_links($url_htmlcode, $url, 1, $url);
//echo $url;
// print_r ($links);
foreach ($links as $key => $value) {
$array = array('no_id' => $key, 'site_id' => $site_id, 'updatetime' => $level, 'url' => $value);
$query = $db->query("select * from ve123_links_temp where url='" . $value . "'");
$num = $db->num_rows($query);
if ($num == 0) {
$db->insert("ve123_links_temp", $array);
} else {
$db->update("ve123_links_temp", $array, "url='" . $value . "'");
}
}
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:19,代码来源:start.php
示例17: lang
if (isset($_POST['loginsubmit'])) {
//No error if changing languages
$error .= lang('usernameincorrect');
debug_buffer("Login failed. Error is: " . $error);
audit($username, $username, 'User Login Failed');
#Now call the event
Events::SendEvent('Core', 'LoginPost', $username);
} else {
debug_buffer($_POST["loginsubmit"]);
}
}
}
// Language shizzle
//header("Content-Encoding: " . get_encoding());
header("Content-Language: " . $current_language);
header("Content-Type: text/html; charset=" . get_encoding());
//CHANGED
$theme = get_site_preference('logintheme', 'default');
//echo "theme:$theme";
debug_buffer('debug is:' . $error);
if (file_exists(dirname(__FILE__) . "/themes/{$theme}/login.php")) {
include dirname(__FILE__) . "/themes/{$theme}/login.php";
} else {
include dirname(__FILE__) . "/themes/default/login.php";
}
//STOP
?>
<?php
if (isset($gCms->config) and $gCms->config['debug'] == true) {
foreach ($gCms->errors as $globalerror) {
开发者ID:rasomu,项目名称:chuza,代码行数:31,代码来源:login.php
示例18: convert_string
function convert_string($string, $source_encoding = null, $target_encoding = null)
{
if ($source_encoding == null or strtolower($source_encoding) == "auto") {
$source_encoding = get_encoding($string);
}
if ($target_encoding == null or strtolower($target_encoding) == "auto") {
$target_encoding = iconv_get_encoding("internal_encoding");
}
//echo "$source_encoding - $target_encoding - ". iconv($source_encoding, $target_encoding , $string)."<br>\n";
if ($source_encoding != $target_encoding) {
return iconv($source_encoding, $target_encoding, $string);
} else {
//Keine Änderung des Zeichensatz
return $string;
}
}
开发者ID:reimht,项目名称:lisa,代码行数:16,代码来源:functions.php
示例19: _display_text_block
private function _display_text_block($blockInfo, $value, $adding)
{
$ret = '';
$oneline = isset($blockInfo['oneline']) && cms_to_bool($blockInfo['oneline']);
if ($oneline) {
$size = isset($blockInfo['size']) ? $blockInfo['size'] : 50;
$maxlength = isset($blockInfo['maxlength']) ? $blockInfo['maxlength'] : 255;
$ret = '<input type="text" size="' . $size . '" maxlength="' . $maxlength . '" name="' . $blockInfo['id'] . '" value="' . cms_htmlentities($value, ENT_NOQUOTES, get_encoding('')) . '" />';
} else {
$block_wysiwyg = true;
$hide_wysiwyg = $this->GetPropertyValue('disable_wysiwyg');
if ($hide_wysiwyg) {
$block_wysiwyg = false;
} else {
$block_wysiwyg = $blockInfo['usewysiwyg'] == 'false' ? false : true;
}
$ret = create_textarea($block_wysiwyg, $value, $blockInfo['id'], '', $blockInfo['id'], '', $this->stylesheet);
}
return $ret;
}
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:20,代码来源:Content.inc.php
示例20: add_links
function add_links($url, $is_index_page = true, $num = '')
{
global $db;
$new_links = array();
$j = 1;
$url_htmlcode = get_url_content($url);
$url_htmlcode = get_encoding($url_htmlcode, "GB2312");
$links = get_links($url_htmlcode, $url, 1, $url);
echo "<br><b>url=";
print_r($url);
echo "<br></b>";
if ($is_index_page) {
foreach ($links as $value) {
$new_links[] = GetSiteUrl($value);
}
} else {
$new_links = $links;
}
$new_links = distinct_array($new_links);
foreach ($new_links as $value) {
//echo $value."<br>";
//ob_flush();
//flush();
$query = $db->query("select * from ve123_links where url='{$value}'");
$num = $db->num_rows($query);
if ($num == 0) {
echo "<font color=#C60A00><b>抓取到:</b></font>" . $value . "<br>";
if (!add_update_link($value, "", "", "add")) {
continue;
}
$j++;
if (!empty($num)) {
if ($j >= $num) {
exit;
}
}
} else {
echo "<b>已存在了:</b>";
echo "<a href=" . $value . " target=_blank>" . $value . "</a>";
echo "<br>";
}
ob_flush();
flush();
}
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:45,代码来源:links.php
注:本文中的get_encoding函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论