@@ -1,162 +1,21 @@ | |||
div.flash | |||
{ | |||
width:375px; | |||
-moz-border-radius-topleft:5px; | |||
-webkit-border-top-left-radius:5px; | |||
-moz-border-radius-topright:5px; | |||
-webkit-border-top-right-radius:5px; | |||
-moz-border-radius-bottomleft:5px; | |||
-webkit-border-bottom-left-radius:5px; | |||
-moz-border-radius-bottomright:5px; | |||
-webkit-border-bottom-right-radius:5px; | |||
border-color:#D9E4FF; | |||
margin:10px 5px; | |||
} | |||
#btnSubmit | |||
{ | |||
margin:0 0 0 155px; | |||
} | |||
.progressWrapper | |||
{ | |||
width:357px; | |||
overflow:hidden; | |||
} | |||
.progressContainer | |||
{ | |||
border:solid 1px #E8E8E8; | |||
background-color:#F7F7F7; | |||
overflow:hidden; | |||
margin:5px; | |||
padding:4px; | |||
} | |||
.message | |||
{ | |||
border:solid 1px #FD9; | |||
background-color:#FFC; | |||
overflow:hidden; | |||
margin:1em 0; | |||
padding:10px 20px; | |||
} | |||
.red | |||
{ | |||
border:solid 1px #B50000; | |||
background-color:#FFEBEB; | |||
} | |||
.green | |||
{ | |||
border:solid 1px #DDF0DD; | |||
background-color:#EBFFEB; | |||
} | |||
.blue | |||
{ | |||
border:solid 1px #CEE2F2; | |||
background-color:#F0F5FF; | |||
} | |||
.progressName | |||
{ | |||
font-size:8pt; | |||
font-weight:700; | |||
color:#555; | |||
width:323px; | |||
height:14px; | |||
text-align:left; | |||
white-space:nowrap; | |||
overflow:hidden; | |||
} | |||
.progressBarInProgress,.progressBarComplete,.progressBarError | |||
{ | |||
font-size:0; | |||
width:0; | |||
height:2px; | |||
background-color:blue; | |||
margin-top:2px; | |||
} | |||
.progressBarComplete | |||
{ | |||
width:100%; | |||
background-color:green; | |||
visibility:hidden; | |||
} | |||
.progressBarError | |||
{ | |||
width:100%; | |||
background-color:red; | |||
visibility:hidden; | |||
} | |||
.progressBarStatus | |||
{ | |||
margin-top:2px; | |||
width:337px; | |||
font-size:7pt; | |||
font-family:Arial; | |||
text-align:left; | |||
white-space:nowrap; | |||
} | |||
a.progressCancel | |||
{ | |||
font-size:0; | |||
display:block; | |||
height:14px; | |||
width:14px; | |||
background-image:url(../images/cancelbutton.gif); | |||
background-repeat:no-repeat; | |||
background-position:-14px 0; | |||
float:right; | |||
} | |||
a.progressCancel:hover | |||
{ | |||
background-position:0 0; | |||
} | |||
.swfupload | |||
{ | |||
vertical-align:top; | |||
} | |||
.albCt | |||
{ | |||
float:left; | |||
width:244px; | |||
height:150px; | |||
margin-right:10px; | |||
margin-bottom:10px; | |||
border:1px dashed #AAD381; | |||
background:#FAFFEE; | |||
text-align:center; | |||
padding:3px; | |||
} | |||
.albEdit | |||
{ | |||
height:180px; | |||
} | |||
.picinfo | |||
{ | |||
height:30px; | |||
line-height:30px; | |||
margin:10px 0; | |||
} | |||
.thumbnails img,.thumbnailsEdit img | |||
{ | |||
margin:5px; | |||
} | |||
.albCt img { | |||
height: 100px!important; | |||
} | |||
div.flash{margin:10px 5px;width:375px;border-color:#D9E4FF;border-radius:.2rem} | |||
#btnSubmit{margin:0 0 0 155px} | |||
.progressWrapper{width:357px;overflow:hidden} | |||
.progressContainer{padding:4px;margin:5px;background-color:#f8f8f8;border:solid 1px #E8E8E8;overflow:hidden} | |||
.message{margin:10px 0;padding:10px 20px;background-color:#FFC;border:solid 1px #FD9;overflow:hidden} | |||
.red{background-color:#FFEBEB;border:solid 1px #B50000} | |||
.green{background-color:#EBFFEB;border:solid 1px #DDF0DD} | |||
.blue{background-color:#F0F5FF;border:solid 1px #CEE2F2} | |||
.progressName{width:320px;height:14px;text-align:left;white-space:nowrap;overflow:hidden} | |||
.progressBarInProgress,.progressBarComplete,.progressBarError{margin-top:2px;width:0;height:2px;font-size:0;background-color:blue} | |||
.progressBarComplete{width:100%;background-color:green;visibility:hidden} | |||
.progressBarError{width:100%;background-color:red;visibility:hidden} | |||
.progressBarStatus{margin-top:2px;width:340px;text-align:left;white-space:nowrap} | |||
a.progressCancel{font-size:0;display:block;height:14px;width:14px;background-image:url(../images/cancelbutton.gif);background-repeat:no-repeat;background-position:-14px 0;float:right} | |||
a.progressCancel:hover{background-position:0 0} | |||
.swfupload{vertical-align:top} | |||
.albCt{float:left;width:240px;height:180px;margin-right:10px;margin-bottom:10px;border:1px dashed #eee;background:#f8f8f8;text-align:center;padding:10px} | |||
.albEdit{height:180px} | |||
.picinfo{height:30px;line-height:30px;margin:10px 0} | |||
.thumbnails img,.thumbnailsEdit img{margin:5px} | |||
.albCt img{height:100px!important} |
@@ -624,7 +624,7 @@ class Archives | |||
if($row[$get]['id']) $this->dtp->Assign($i,$revalue); | |||
} | |||
} | |||
else if ($ctag->GetName() == 'fieldlist') { | |||
else if ($ctag->GetName() == 'fieldlist') { | |||
$innertext = trim($ctag->GetInnerText()); | |||
if ($innertext == '') $innertext = GetSysTemplets('tag_fieldlist.htm'); | |||
$dtp2 = new DedeTagParse(); | |||
@@ -659,7 +659,6 @@ class Archives | |||
$this->dtp->Assign($i, $res); | |||
} //end case | |||
} //结束模板循环 | |||
} | |||
} | |||
/** | |||
@@ -1004,51 +1003,29 @@ class Archives | |||
* @param string $body | |||
* @return string | |||
*/ | |||
function ReplaceKeyword($kw, &$body) | |||
function ReplaceKeyword($kw,&$body) | |||
{ | |||
global $cfg_cmspath; | |||
$maxkey = 5; | |||
$kws = explode(",", trim($kw)); //以分好为间隔符 | |||
$i = 0; | |||
$kws = explode(",",trim($kw));//以分好为间隔符 | |||
$i=0; | |||
$karr = $kaarr = $GLOBALS['replaced'] = array(); | |||
//暂时屏蔽超链接 | |||
$body = preg_replace("#(<a(.*))(>)(.*)(<)(\/a>)#isU", '\\1-]-\\4-[-\\6', $body); | |||
/* | |||
foreach($kws as $k) | |||
{ | |||
$k = trim($k); | |||
if($k!="") | |||
{ | |||
if($i > $maxkey) | |||
{ | |||
break; | |||
} | |||
$myrow = $this->dsql->GetOne("SELECT * FROM #@__keywords WHERE keyword='$k' AND rpurl<>'' "); | |||
if(is_array($myrow)) | |||
{ | |||
$karr[] = $k; | |||
$GLOBALS['replaced'][$k] = 0; | |||
$kaarr[] = "<a href='{$myrow['rpurl']}'><u>$k</u></a>"; | |||
} | |||
$i++; | |||
} | |||
} | |||
*/ | |||
$query = "SELECT * FROM #@__keywords WHERE rpurl<>'' ORDER BY rank DESC"; | |||
$this->dsql->SetQuery($query); | |||
$this->dsql->Execute(); | |||
while ($row = $this->dsql->GetArray()) { | |||
while($row = $this->dsql->GetArray()) | |||
{ | |||
global $cfg_replace_num; | |||
$key = trim($row['keyword']); | |||
$key_url = trim($row['rpurl']); | |||
$key_url=trim($row['rpurl']); | |||
$karr[] = $key; | |||
$kaarr[] = "<a href='$key_url' target='_blank'><u>$key</u></a>"; | |||
$kaarr[] = "<a href='$key_url' target='_blank'>$key</a>"; | |||
} | |||
$GLOBALS['_dd_karr'] = $karr; | |||
$GLOBALS['_dd_kaarr'] = $kaarr; | |||
// 这里可能会有错误 | |||
//这里可能会有错误 | |||
if (version_compare(PHP_VERSION, '5.5.0', '>=')) | |||
{ | |||
//$body = @preg_replace_callback("#(^|>)([^<]+)(?=<|$)#sU", "_highlight('\\2', \$karr, \$kaarr, '\\1')", $body); | |||
if($cfg_replace_num > 0) | |||
{ | |||
$query = "SELECT * FROM #@__keywords WHERE rpurl<>'' ORDER BY rank DESC"; | |||
@@ -1058,7 +1035,7 @@ class Archives | |||
{ | |||
$key = trim($row['keyword']); | |||
$key_url=trim($row['rpurl']); | |||
$body = str_replace_limit($key, "<a href='$key_url' target='_blank'><u>$key</u></a>", $body, $cfg_replace_num); | |||
$body = str_replace_limit($key, "<a href='$key_url' target='_blank'>$key</a>", $body, $cfg_replace_num); | |||
} | |||
} else { | |||
$query = "SELECT * FROM #@__keywords WHERE rpurl<>'' ORDER BY rank DESC"; | |||
@@ -1079,25 +1056,38 @@ class Archives | |||
return $body; | |||
} | |||
}//End Archives | |||
function _highlight8($matches){ | |||
return _highlight($matches[2], $GLOBALS['_dd_karr'], $GLOBALS['_dd_kaarr'], $matches[1]); | |||
//指定替换次数功能 | |||
function str_replace_limit($search, $replace, $subject, $limit){ | |||
if(is_array($search)){ | |||
foreach($search as $k=>$v){ | |||
$search[$k] = '`'. preg_quote($search[$k], '`'). '`'; | |||
} | |||
} else { | |||
$search = '`'. preg_quote($search, '`'). '`'; | |||
} | |||
return preg_replace($search, $replace, $subject, $limit); | |||
} | |||
//高亮专用, 替换多次是可能不能达到最多次 | |||
//高亮专用, 替换多次时可能不能达到最多次 | |||
function _highlight($string, $words, $result, $pre) | |||
{ | |||
global $cfg_replace_num; | |||
if (version_compare(PHP_VERSION, '5.5.0', '>=') && version_compare(PHP_VERSION, '8.0.0', '<')) { | |||
if (version_compare(PHP_VERSION, '5.5.0', '>=')) | |||
{ | |||
$string = $string[0]; | |||
$pre = $pre[0]; | |||
} | |||
$string = str_replace('\"', '"', $string); | |||
if ($cfg_replace_num > 0) { | |||
foreach ($words as $key => $word) { | |||
if ($GLOBALS['replaced'][$word] == 1) { | |||
if($cfg_replace_num > 0) | |||
{ | |||
foreach ($words as $key => $word) | |||
{ | |||
if($GLOBALS['replaced'][$word] == 1) | |||
{ | |||
continue; | |||
} | |||
$string = preg_replace("#".preg_quote($word)."#", $result[$key], $string, $cfg_replace_num); | |||
if (strpos($string, $word) !== FALSE) { | |||
if(strpos($string, $word) !== FALSE) | |||
{ | |||
$GLOBALS['replaced'][$word] = 1; | |||
} | |||
} | |||