function newReplaceValueParam($content, $paramName, $replaceStr) { $startStr = ''; $endStr = ''; $labelStr = ''; $nLen = ''; $nTimeFormat = ''; $delHtmlYes = ''; $trimYes = ''; //ReplaceStr = ReplaceStr & "这里面放上内容在这时碳呀。" //ReplaceStr = CStr(ReplaceStr) '转成字符类型 if (isNul($replaceStr) == true) { $replaceStr = ''; } $startStr = '[$' . $paramName; $endStr = '$]'; if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0) { $labelStr = StrCut($content, $startStr, $endStr, 1); //删除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); } $content = replace($content, $labelStr, $replaceStr); } $newReplaceValueParam = $content; return @$newReplaceValueParam; }
function XY_handleGetTableBody($action, $tableName, $fieldParamName, $defaultFileName, $adminUrl) { $url = ''; $content = ''; $id = ''; $sql = ''; $addSql = ''; $fieldName = ''; $fieldParamValue = ''; $fieldNameList = ''; $nLen = ''; $delHtmlYes = ''; $trimYes = ''; $defaultStr = ''; $noisonhtml = ''; $intoFieldStr = ''; $valuesStr = ''; $nonull = ''; $fieldName = RParam($action, 'fieldname'); //字段名称 $noisonhtml = RParam($action, 'noisonhtml'); //不生成html $nonull = RParam($action, 'noisonhtml'); //内容不能为空20160716 home if ($noisonhtml == 'true') { $intoFieldStr = ',isonhtml'; $valuesStr = ',0'; } $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表'); //字段名称不为空,并且要在表字段里 if ($fieldName == '' || inStr($fieldNameList, ',' . $fieldName . ',') == false) { $fieldName = $defaultFileName; } $fieldName = lCase($fieldName); //转为小写,因为在PHP里是全小写的 $fieldParamValue = RParam($action, $fieldParamName); //截取字段内容 $id = handleNumber(RParam($action, 'id')); //获得ID $addSql = ' where ' . $fieldParamName . '=\'' . $fieldParamValue . '\''; if ($id != '') { $addSql = ' where id=' . $id; } $content = getDefaultValue($action); $defaultStr = $content; //获得默认内容 $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . $tableName . $addSql; $rsObj = $GLOBALS['conn']->query($sql); if (@mysql_num_rows($rsObj) == 0) { $rs = mysql_fetch_array($rsObj); //自动添加 20160113 if (RParam($action, 'autoadd') == 'true') { connexecute('insert into ' . $GLOBALS['db_PREFIX'] . $tableName . ' (' . $fieldParamName . ',' . $fieldName . $intoFieldStr . ') values(\'' . $fieldParamValue . '\',\'' . ADSql($content) . '\'' . $valuesStr . ')'); } } else { $id = $rs['id']; $content = $rs[$fieldName]; if (len($content) <= 0) { $content = $defaultStr; connexecute('update ' . $GLOBALS['db_PREFIX'] . $tableName . ' set ' . $fieldName . '=\'' . $content . '\' where id=' . $rs['id']); } } //删除Html $delHtmlYes = RParam($action, 'delHtml'); //是否删除Html if ($delHtmlYes == 'true') { $content = replace(delHtml($content), '<', '<'); } //HTML处理 //删除两边空格 $trimYes = RParam($action, 'trim'); //是否删除两边空格 if ($trimYes == 'true') { $content = TrimVbCrlf($content); } //截取字符处理 $nLen = RParam($action, 'len'); //字符长度值 $nLen = handleNumber($nLen); //If nLen<>"" Then ReplaceStr = CutStr(ReplaceStr,nLen,"null")' Left(ReplaceStr,nLen) if ($nLen != '') { $content = CutStr($content, $nLen, '...'); } //Left(ReplaceStr,nLen) if ($id == '') { $id = XY_AP_GetFieldValue('', $sql, 'id'); } $url = $adminUrl . '&id=' . $id . '&n=' . getRnd(11); if (@$_REQUEST['gl'] == 'edit') { $content = '<span>' . $content . '</span>'; } //call echo(sql,url) $content = handleDisplayOnlineEditDialog($url, $content, '', 'span'); $XY_handleGetTableBody = $content; return @$XY_handleGetTableBody; }
$kind5_id = $DB_Record[13]; $kind6_id = $DB_Record[16]; //初始化各个变量 $count = 0; $cateid = '0'; $txt = 0; $textalign = ''; $width = 0; $height = 0; //循环 $str_loop_begin = '{module' . $i . '_loop_begin}'; $str_loop_end = '{module' . $i . '_loop_end}'; $str_module_pic = '{module' . $i . '_pic}'; $str_module_title = '{module' . $i . '_title}'; $str_module_url = '{module' . $i . '_url}'; $LoopString = CutStr($contents, $str_loop_begin, $str_loop_end); $LoopContent = ''; /*/ $refresh_time = 300; if($refresh_time==300){ echo "<hr>i=".$i; echo "<hr>"; echo $LoopString; echo "<hr>"; } //*/ //静态处理 switch ($kind) { case 'kind1': $count = $kind1_count; $cateid = $kind1_cateid;
$search_SQL = "SELECT * FROM tbl_web_sub_content_item WHERE web_sub_content_id=" . $sub_content_ID . " ORDER BY web_sub_content_item_order ASC, web_sub_content_item_id ASC "; $search_Result = mysql_query($search_SQL, $link_id); while ($search_Result_Obj = mysql_fetch_object($search_Result)) { ?> <tr align="left" valign="top" > <td bgcolor="#FFFFFF"><font class="style8"><?php echo $search_Result_Obj->web_sub_content_item_title; ?> </font></td> <td bgcolor="#FFFFFF"><?php echo CutStr(strip_tags($search_Result_Obj->web_sub_content_item_html), 60); ?> </td> <!-- <td align="center" bgcolor="#FFFFFF" ></td> <?php echo $search_Result_Obj->date; ?> --> <td align="center" bgcolor="#FFFFFF" ><font class="style8" color="#0000FF"><a href="w_gallery.php?id=<?php echo $search_Result_Obj->web_sub_content_item_id; ?> "><img src="../icons/bmp.gif" width="16" height="16" border=0 alt=圖片管理></a></font></td> <td align="center" bgcolor="#FFFFFF" ><font class="style8" color="#0000FF"><a href="w_sub_content_item_update.php?id=<?php echo $search_Result_Obj->web_sub_content_item_id;
$query = "SELECT * FROM `tbl_calendar` WHERE `date` = '{$year}-{$month}-{$i}' and type ='{$type}'"; $result = mysql_query($query, $link_id); $isToday = date("Y") == $_GET["year"] && date("m") == $_GET["month"] && date("d") == $i ? true : false; $tdcolor = $isToday ? "#ECECEC" : "#FFFFFF"; if (mysql_num_rows($result) != 0) { $show = 1; echo "<td bgcolor={$tdcolor}>"; if ($isToday) { echo "<b>"; } echo $i; if ($isToday) { echo "</b>"; } while ($object = mysql_fetch_object($result)) { echo "<br><a href=calendarview.php?id={$object->calendarid}&year={$_GET['year']}&month={$_GET['month']}>" . CutStr($object->title, 10) . "</a>"; } } else { $show = 0; echo "<td bgcolor={$tdcolor}>"; if ($isToday) { echo "<b>"; } echo $i; if ($isToday) { echo "</b>"; } } echo "</td>"; $i++; if ($i > $mdays && $y != 6) {
/** * 得到一个字符串中的某一部分 * @param $Url 需要抓取的地址 * @param $ArticleId 入库文章编号 * @param $ContentStartFlag 文章内容开始、结束 * @param $ContentEndFlag * @param $FlagAdStart 过滤广告开始、结束标志 * @param $FlagAdEnd * @param $FlagSingle 单项过滤 * @param $ImagePath 图片保存地址 * @param $ImageUrl 图片显示地址 */ function getContent($Url, $id, $ContentStartFlag, $ContentEndFlag, $FlagAdStart, $FlagAdEnd, $FlagSingle, $ImagePath, $ImageUrl, $utf8) { //获取源数据 $Content = file_get_contents($Url); //echo $Content; $Content = EnCodeStr($Content); //echo $Content; /* Zerolone Add 07-04-28 如果是UTF-8编码的则 //*/ if ($utf8) { $Content = mb_convert_encoding($Content, "GB2312", "UTF-8"); } //切割数据 $Content = CutStr($Content, $ContentStartFlag, $ContentEndFlag); //echo $Content; //切割广告 //*// $FlagAdStartArray = explode(",", $FlagAdStart); $FlagAdEndArray = explode(",", $FlagAdEnd); for ($i = 0; $i < count($FlagAdStartArray); $i++) { $Content = CutStr($Content, $FlagAdStartArray[$i], $FlagAdEndArray[$i], 1); } //*/ //echo $Content; //单项替换 $FlagSingleArray = explode(",", $FlagSingle); for ($i = 0; $i < count($FlagSingleArray); $i++) { $Content = str_replace($FlagSingleArray[$i], '', $Content); } echo $Content; //获取图片路径 preg_match_all("/src=(\"|')(.*?)(\"|')/i", DeCodeStr($Content), $temp); $imageList = $temp[2]; //echo $imageList; //建立文件夹 if (!is_dir($ImagePath)) { mkdir($ImagePath); } $ImagePath .= '/' . date("m", time()); if (!is_dir($ImagePath)) { mkdir($ImagePath); } $ImagePath .= '/' . date("d", time()) . '/'; if (!is_dir($ImagePath)) { mkdir($ImagePath); } //网页上面的路径 $ImageUrl .= date("m", time()) . '/' . date("d", time()) . '/'; for ($i = 0; $i < count($imageList); $i++) { $fName = saveFile($imageList[$i], $ImagePath, $ImageUrl); if (!empty($fName)) { $filename[$i] = $fName; } } for ($i = 0; $i < count($imageList); $i++) { $Content = str_replace($imageList[$i], $ImageUrl . $filename[$i], $Content); } /* echo '<hr>'; echo decode($TheContent); echo '<hr>'; exit(); //*/ /* //去掉无用的页面脚本 //去掉js $cp = preg_replace( "@\<script(.*?)\</script\>@is", "", $cp ); //去掉HTML //去Table $cp = preg_replace( "@\<table(.*?)\</table\>@is", "", $cp ); //去Tr $cp = preg_replace( "@\<tr(.*?)\</tr\>@is", "", $cp ); //去Td $cp = preg_replace( "@\<td(.*?)\</td\>@is", "", $cp ); //去div $cp = preg_replace( "@\<div(.*?)\</div\>@is", "", $cp ); //去iframe $cp = preg_replace( "@\<iframe(.*?)\</iframe\>@is", "", $cp ); //去掉css //$cp = preg_replace( "@\<style(.*?)\</style\>@is", "", $cp ); */ //去掉超连接 $Content = preg_replace(EnCodeStr("@\\<a(.*?)\\>@is"), "", $Content); //去<!-- --> $Content = preg_replace(EnCodeStr("@\\<!--(.*?)\\--\\>@is"), "", $Content); //页面内容入库 $SqlStr = 'UPDATE `' . table_pre . 'article` SET '; //文章内容 $SqlStr .= '`flag`=1,'; //文章内容 $SqlStr .= '`content`='; $SqlStr .= '\'' . $Content . '\''; $SqlStr .= ' WHERE `id`=' . $id; // echo $SqlStr; query($SqlStr); return true; }
<tr align="left" valign="middle" > <td bgcolor="#FFFFFF" ><font class="style8"><?php if ($SplitPage_Record_Obj->web_sub_content_inner != 0) { $inner_sql = " SELECT * FROM tbl_web_sub_content WHERE web_sub_content_id=" . $SplitPage_Record_Obj->web_sub_content_inner; $inner_result = mysql_query($inner_sql, $link_id); if ($inner_obj = mysql_fetch_object($inner_result)) { echo $inner_obj->web_sub_content_title . " > "; } } echo CutStr($SplitPage_Record_Obj->web_sub_content_title, 25); ?> </font></td> <td bgcolor="#FFFFFF" ><font class="style8"><?php echo CutStr($SplitPage_Record_Obj->web_sub_content_description, 50); ?> </font></td> <td align="center" bgcolor="#FFFFFF" ><font class="style8"><?php echo $SplitPage_Record_Obj->web_sub_content_inner == 0 ? "否" : "是"; ?> </font></td> <td align="center" valign="middle" nowrap bgcolor="#FFFFFF" ><font class="style8" color="#0000FF"><a href="w_sub_content_update.php?id=<?php echo $SplitPage_Record_Obj->web_sub_content_id; ?> "><img src="../icons/xie.gif" width="16" height="16" border=0 alt="更改"></a></font></td> <td align="center" valign="middle" nowrap bgcolor="#FFFFFF" ><font class="style8" color="#0000FF"><a href="w_sub_content.php?id=<?php echo $SplitPage_Record_Obj->web_sub_content_id;
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; }
function OutItem($oRs, $p, $key, $TdColor) { $str = '<td style="background-color:#' . $TdColor . ';height:51px;text-align:center">' . CutStr($oRs['username'], 12) . '(' . $oRs["userid"] . ')['; if ($oRs['usergender'] == 1) { $str .= 'Male'; } else { $str .= 'Female'; } $str .= ']<br /><a href="mailto:' . $oRs["useremail"] . '">' . CutStr($oRs['useremail'], 22) . '</a></td>'; $str .= '<td style="background-color:#' . $TdColor . ';text-align:center"><a target="_blank" href="../userface/' . $oRs["userface"] . '"><img title="' . $oRs["username"] . '" src="../userface/' . $oRs["userface"] . '" style="width:50px;height:50px;border:0"/></a></td>'; $str .= '<td style="background-color:#' . $TdColor . ';text-align:center"><a onclick="if(!confirm(\'Are You Sure To Remove “' . $oRs["username"] . '” Permanently?\'))return false;else showLoading();" href="?p=' . $p . '&op=del&id=' . $oRs["id"] . '&k=' . $key . '">Remove</a><br />'; if (0 == $_SESSION['userpower']) { if ($oRs['userpower'] == 1) { $str .= '<a onclick="shoLoading();" href="?p=' . $p . '>&op=chgpower&pw=2&id=' . $oRs["id"] . '&k=' . $key . '">Relegate To Normal User</a>'; } elseif ($oRs['userpower'] == 2) { $str .= '<a onclick="showLoading();" href="?p=' . $p . '&op=chgpower&pw=1&id=' . $oRs["id"] . '&k=' . $key . '">Promote To Administrator</a>'; } else { $str .= 'Supper Administrator'; } } $str .= '</td>'; return $str; }