function setHtmlParam($content, $ParamList) { $splStr = ''; $startStr = ''; $endStr = ''; $c = ''; $paramValue = ''; $ReplaceStartStr = ''; $endStr = '\''; $splStr = aspSplit($ParamList, '|'); foreach ($splStr as $key => $startStr) { $startStr = aspTrim($startStr); if ($startStr != '') { //替换开始字符 因为开始字符类型可变 不同 $ReplaceStartStr = $startStr; if (left($ReplaceStartStr, 3) == 'img') { $ReplaceStartStr = mid($ReplaceStartStr, 4, -1); } else { if (left($ReplaceStartStr, 1) == 'a') { $ReplaceStartStr = mid($ReplaceStartStr, 2, -1); } else { if (inStr('|ul|li|', '|' . left($ReplaceStartStr, 2) . '|') > 0) { $ReplaceStartStr = mid($ReplaceStartStr, 3, -1); } } } $ReplaceStartStr = ' ' . $ReplaceStartStr . '=\''; $startStr = ' ' . $startStr . '=\''; if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0) { $paramValue = StrCut($content, $startStr, $endStr, 2); $paramValue = HandleInModule($paramValue, 'end'); //处理内部模块 $c = $c . $ReplaceStartStr . $paramValue . $endStr; } } } $setHtmlParam = $c; return @$setHtmlParam; }
function XY_ReadColumeSetTitle($action) { $startStr = ''; $endStr = ''; $Style = ''; $title = ''; $valueStr = ''; $MoreClass = ''; $MoreUrl = ''; $MoreStr = ''; $aStr = ''; $c = ''; $action = HandleInModule($action, 'start'); $Style = RParam($action, 'style'); $title = RParam($action, 'Title'); //Call Echo("ContentHeight",ContentHeight) //ValueStr = RParam(Action,"value") //根据模块找内容 $valueStr = moduleFindContent($action, 'value'); //Call Eerr("ValueStr",ValueStr) $valueStr = findModuleStr($GLOBALS['code'], $valueStr); //找模块对应内容 $MoreClass = RParam($action, 'MoreClass'); $MoreUrl = PHPTrim(RParam($action, 'MoreUrl')); $MoreStr = RParam($action, 'MoreStr'); $valueStr = HandleInModule($valueStr, 'end'); $c = readColumeSetTitle($action, $Style, $title, $valueStr); if ($MoreClass == '') { $MoreClass = 'more'; } //More链接为空 则用默认代替 //If MoreUrl="" Then MoreUrl="#" 'More链接网址为空 则用默认#代替 //More链接样式不能为空,因为没有样式它就不能让More在最近边 if ($MoreUrl != '' && $MoreStr != '') { //AStr = "<a href='"& MoreUrl &"' class='"& MoreClass &"'>"& MoreStr &"</a>" $aStr = '<a ' . aHref($MoreUrl, $title, '') . ' class=\'' . $MoreClass . '\'>' . $MoreStr . '</a>'; $c = replace($c, '<!--#AMore#-->', $aStr); } $XY_ReadColumeSetTitle = $c; return @$XY_ReadColumeSetTitle; }
function handleAction($content) { $startStr = ''; $endStr = ''; $ActionList = ''; $splStr = ''; $action = ''; $s = ''; $HandYes = ''; $startStr = '{$'; $endStr = '$}'; $ActionList = GetArray($content, $startStr, $endStr, true, true); //Call echo("ActionList ", ActionList) $splStr = aspSplit($ActionList, '$Array$'); foreach ($splStr as $key => $s) { $action = aspTrim($s); $action = HandleInModule($action, 'start'); //处理\'替换掉 if ($action != '') { $action = aspTrim(mid($action, 3, len($action) - 4)) . ' '; //call echo("s",s) $HandYes = true; //处理为真 //{VB #} 这种是放在图片路径里,目的是为了在VB里不处理这个路径 if (CheckFunValue($action, '# ') == true) { $action = ''; //测试 } else { if (CheckFunValue($action, 'GetLableValue ') == true) { $action = XY_getLableValue($action); //标题在搜索引擎里列表 } else { if (CheckFunValue($action, 'TitleInSearchEngineList ') == true) { $action = XY_TitleInSearchEngineList($action); //加载文件 } else { if (CheckFunValue($action, 'Include ') == true) { $action = XY_Include($action); //栏目列表 } else { if (CheckFunValue($action, 'ColumnList ') == true) { $action = XY_AP_ColumnList($action); //文章列表 } else { if (CheckFunValue($action, 'ArticleList ') == true || CheckFunValue($action, 'CustomInfoList ') == true) { $action = XY_AP_ArticleList($action); //评论列表 } else { if (CheckFunValue($action, 'CommentList ') == true) { $action = XY_AP_CommentList($action); //搜索统计列表 } else { if (CheckFunValue($action, 'SearchStatList ') == true) { $action = XY_AP_SearchStatList($action); //友情链接列表 } else { if (CheckFunValue($action, 'Links ') == true) { $action = XY_AP_Links($action); //显示单页内容 } else { if (CheckFunValue($action, 'GetOnePageBody ') == true || CheckFunValue($action, 'MainInfo ') == true) { $action = XY_AP_GetOnePageBody($action); //显示文章内容 } else { if (CheckFunValue($action, 'GetArticleBody ') == true) { $action = XY_AP_GetArticleBody($action); //显示栏目内容 } else { if (CheckFunValue($action, 'GetColumnBody ') == true) { $action = XY_AP_GetColumnBody($action); //获得栏目URL } else { if (CheckFunValue($action, 'GetColumnUrl ') == true) { $action = XY_GetColumnUrl($action); //获得文章URL } else { if (CheckFunValue($action, 'GetArticleUrl ') == true) { $action = XY_GetArticleUrl($action); //获得单页URL } else { if (CheckFunValue($action, 'GetOnePageUrl ') == true) { $action = XY_GetOnePageUrl($action); //------------------- 模板模块区 ----------------------- //显示包裹块 作用不大 } else { if (CheckFunValue($action, 'DisplayWrap ') == true) { $action = XY_DisplayWrap($action); //显示布局 } else { if (CheckFunValue($action, 'Layout ') == true) { $action = XY_Layout($action); //显示模块 } else { if (CheckFunValue($action, 'Module ') == true) { $action = XY_Module($action); //读模块内容 } else { if (CheckFunValue($action, 'ReadTemplateModule ') == true) { $action = XY_ReadTemplateModule($action); //获得内容模块 20150108 } else { if (CheckFunValue($action, 'GetContentModule ') == true) { $action = XY_ReadTemplateModule($action); //读模板样式并设置标题与内容 软件里有个栏目Style进行设置 } else { if (CheckFunValue($action, 'ReadColumeSetTitle ') == true) { $action = XY_ReadColumeSetTitle($action); //------------------- 其它区 ----------------------- //显示JS渲染ASP/PHP/VB等程序的编辑器 } else { if (CheckFunValue($action, 'displayEditor ') == true) { $action = displayEditor($action); //Js版网站统计 } else { if (CheckFunValue($action, 'JsWebStat ') == true) { $action = XY_JsWebStat($action); //------------------- 链接区 ----------------------- //普通链接A } else { if (CheckFunValue($action, 'HrefA ') == true) { $action = XY_HrefA($action); //栏目菜单(引用后台栏目程序) } else { if (CheckFunValue($action, 'ColumnMenu ') == true) { $action = XY_AP_ColumnMenu($action); //------------------- 循环处理 ----------------------- //For循环处理 } else { if (CheckFunValue($action, 'ForArray ') == true) { $action = XY_ForArray($action); //------------------- 待分区 ----------------------- //网站底部 } else { if (CheckFunValue($action, 'WebSiteBottom ') == true || CheckFunValue($action, 'WebBottom ') == true) { $action = XY_AP_WebSiteBottom($action); //显示网站栏目 20160331 } else { if (CheckFunValue($action, 'DisplayWebColumn ') == true) { $action = XY_DisplayWebColumn($action); //URL加密 } else { if (CheckFunValue($action, 'escape ') == true) { $action = XY_escape($action); //URL解密 } else { if (CheckFunValue($action, 'unescape ') == true) { $action = XY_unescape($action); //asp与php版本 } else { if (CheckFunValue($action, 'EDITORTYPE ') == true) { $action = XY_EDITORTYPE($action); //获得网址 } else { if (CheckFunValue($action, 'getUrl ') == true) { $action = XY_getUrl($action); //暂时不屏蔽 } else { if (CheckFunValue($action, 'copyTemplateMaterial ') == true) { $action = ''; } else { if (CheckFunValue($action, 'clearCache ') == true) { $action = ''; } else { $HandYes = false; //处理为假 } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } //注意这样,有的则不显示 晕 And IsNul(action)=False if (isNul($action) == true) { $action = ''; } if ($HandYes == true) { $content = replace($content, $s, $action); } } } $handleAction = $content; return @$handleAction; }
function XY_HrefA($action) { $content = ''; $Href = ''; $c = ''; $AContent = ''; $AType = ''; $url = ''; $title = ''; $action = HandleInModule($action, 'start'); $content = RParam($action, 'Content'); $AType = RParam($action, 'Type'); if ($AType == '收藏') { //第一种方法 //Url = "window.external.addFavorite('"& WebUrl &"','"& WebTitle &"')" $url = 'shoucang(document.title,window.location)'; $c = '<a href=\'javascript:;\' onClick="' . $url . '" ' . setHtmlParam($action, 'target|title|alt|id|class|style') . '>' . $content . '</a>'; } else { if ($AType == '设为首页') { //第一种方法 //Url = "var strHref=window.location.href;this.style.behavior='url(#default#homepage)';this.setHomePage('"& WebUrl &"');" $url = 'SetHome(this,window.location)'; $c = '<a href=\'javascript:;\' onClick="' . $url . '"' . setHtmlParam($action, 'target|title|alt|id|class|style') . '>' . $content . '</a>'; } else { $content = RParam($action, 'Title'); } } $content = HandleInModule($content, 'end'); if ($c == '') { $c = '<a' . setHtmlParam($action, 'href|target|title|alt|id|class|rel|style') . '>' . $content . '</a>'; } $XY_HrefA = $c; return @$XY_HrefA; }
function replaceValueParam($content, $paramName, $replaceStr) { $startStr = ''; $endStr = ''; $labelStr = ''; $tempLabelStr = ''; $nLen = ''; $nTimeFormat = ''; $delHtmlYes = ''; $funStr = ''; $trimYes = ''; $isEscape = ''; $s = ''; $i = ''; $ifStr = ''; //判断字符 $elseIfStr = ''; //第二判断字符 $valueStr = ''; //显示字符 $elseStr = ''; //否则字符 $elseIfValue = ''; $elseValue = ''; //第二判断值 $instrStr = ''; $instr2Str = ''; //查找字符 $tempReplaceStr = ''; //暂存 //ReplaceStr = ReplaceStr & "这里面放上内容在这时碳呀。" //ReplaceStr = CStr(ReplaceStr) '转成字符类型 if (isNul($replaceStr) == true) { $replaceStr = ''; } $tempReplaceStr = $replaceStr; //最多处理99个 20160225 for ($i = 1; $i <= 999; $i++) { $replaceStr = $tempReplaceStr; //恢复 $startStr = '[$' . $paramName; $endStr = '$]'; //字段名称严格判断 20160226 if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0 && (inStr($content, $startStr . ' ') > 0 || inStr($content, $startStr . $endStr) > 0)) { //获得对应字段加强版20151231 if (inStr($content, $startStr . $endStr) > 0) { $labelStr = $startStr . $endStr; } else { if (inStr($content, $startStr . ' ') > 0) { $labelStr = StrCut($content, $startStr . ' ', $endStr, 1); } else { $labelStr = StrCut($content, $startStr, $endStr, 1); } } $tempLabelStr = $labelStr; $labelStr = HandleInModule($labelStr, 'start'); //删除Html $delHtmlYes = RParam($labelStr, 'delHtml'); //是否删除Html if ($delHtmlYes == 'true') { $replaceStr = replace(delHtml($replaceStr), '<', '<'); } //HTML处理 //删除两边空格 $trimYes = RParam($labelStr, 'trim'); //是否删除两边空格 if ($trimYes == 'true') { $replaceStr = TrimVbCrlf($replaceStr); } //截取字符处理 $nLen = RParam($labelStr, 'len'); //字符长度值 $nLen = handleNumber($nLen); //If nLen<>"" Then ReplaceStr = CutStr(ReplaceStr,nLen,"null")' Left(ReplaceStr,nLen) if ($nLen != '') { $replaceStr = CutStr($replaceStr, $nLen, '...'); } //Left(ReplaceStr,nLen) //时间处理 $nTimeFormat = RParam($labelStr, 'format_time'); //时间处理值 if ($nTimeFormat != '') { $replaceStr = Format_Time($replaceStr, $nTimeFormat); } //获得栏目名称 $s = RParam($labelStr, 'getcolumnname'); if ($s != '') { if ($s == '@ME') { $s = $replaceStr; } $replaceStr = getColumnName($s); } //获得栏目URL $s = RParam($labelStr, 'getcolumnurl'); if ($s != '') { if ($s == '@ME') { $s = $replaceStr; } $replaceStr = getColumnUrl($s, 'id'); } //是否为密码类型 $s = RParam($labelStr, 'password'); if ($s != '') { if ($s != '') { $replaceStr = $s; } } $ifStr = RParam($labelStr, 'if'); $elseIfStr = RParam($labelStr, 'elseif'); $valueStr = RParam($labelStr, 'value'); $elseifValue = RParam($labelStr, 'elseifvalue'); $elseValue = RParam($labelStr, 'elsevalue'); $instrStr = RParam($labelStr, 'instr'); $instr2Str = RParam($labelStr, 'instr2'); //call echo("ifStr",ifStr) //call echo("valueStr",valueStr) //call echo("elseStr",elseStr) //call echo("elseIfStr",elseIfStr) //call echo("replaceStr",replaceStr) if ($ifStr != '' || $instrStr != '') { if ($ifStr == cStr($replaceStr) && $ifStr != '') { $replaceStr = $valueStr; } else { if ($elseIfStr == cStr($replaceStr) && $elseIfStr != '') { $replaceStr = $valueStr; if ($elseifValue != '') { $replaceStr = $elseifValue; } } else { if (inStr(cStr($replaceStr), $instrStr) > 0 && $instrStr != '') { $replaceStr = $valueStr; } else { if (inStr(cStr($replaceStr), $instr2Str) > 0 && $instr2Str != '') { $replaceStr = $valueStr; if ($elseifValue != '') { $replaceStr = $elseifValue; } } else { if ($elseValue != '@ME') { $replaceStr = $elseValue; } } } } } } //函数处理20151231 [$title function='left(@ME,40)'$] $funStr = RParam($labelStr, 'function'); //函数 if ($funStr != '') { $funStr = replace($funStr, '@ME', $replaceStr); $replaceStr = HandleContentCode($funStr, ''); } //默认值 $s = RParam($labelStr, 'default'); if ($s != '' && $s != '@ME') { if ($replaceStr == '') { $replaceStr = $s; } } //escape转码 $isEscape = lCase(RParam($labelStr, 'escape')); if ($isEscape == '1' || $isEscape == 'true') { $replaceStr = escape($replaceStr); } //文本颜色 $s = RParam($labelStr, 'fontcolor'); //函数 if ($s != '') { $replaceStr = '<font color="' . $s . '">' . $replaceStr . '</font>'; } //call echo(tempLabelStr,replaceStr) $content = replace($content, $tempLabelStr, $replaceStr); } else { break; } } $replaceValueParam = $content; return @$replaceValueParam; }