过期域名预定抢注

 找回密碼
 免费注册

Simple tags重複自動連接問題

[複製鏈接]
發表於 2013-12-6 13:21:01 | 顯示全部樓層 |閱讀模式
請教下高手們,
5 x1 t4 A5 R& ?: r3 {5 A我用Simple tags在後台已經設置了Maximum number of links for the same tag為1,但是文章中照樣會出現同一個標籤被鏈接多次的現象。刷新緩存什麼的都試過多次。
2 g$ I) h! I" P7 z2 p# g% p我用的是wordpress3.7.1版本,直接在後台查找從官網下載的simple tags。這個要怎麼解決啊
; P4 l3 Q3 P' t

6 W1 t* P' c( d3 L( C
7 L: Q* \2 l8 T% ~/ H! o3 i' P0 H  A; q
 樓主| 發表於 2013-12-6 19:28:44 | 顯示全部樓層
本帖最後由 jeffseo 於 2013-12-6 19:33 編輯 . y/ {5 x& r0 S* y7 L# ~
! D$ P2 W, R4 f7 R. P9 I
換其它WP的版本也還是這樣,9 K% Y+ |  D' p/ a- m
另外Maximum number of links per article:這個值也沒讀成功,設置10個TAG,文章中仍然會把所有TAG都鏈接上。

$ @. z9 y/ Q( _9 R, L% V3 @* G. H' t看代碼似乎都沒什麼問題,
% E" d% v* N# Z其它用simple tags的哥們也是這樣的嗎
  1.   // there should always be at least one token, but check just in case
    4 s' ?. W/ P' N: `$ `7 G7 m
  2.                 $anchor_level = 0;
    8 ?& W1 {% e' T7 G( @- G
  3.                 if (isset($tokens) && is_array($tokens) && count($tokens) > 0) {* U: K2 `: }" q( s1 A! s: `
  4.                         $i = 0;
    & {& ^) ~3 h5 d, h1 m$ I5 D) g/ n) b
  5.                         foreach ($tokens as $token) {3 u7 w, W" G+ c/ D$ ?
  6.                                 if (++$i % 2 && $token != '') { // this token is (non-markup) text
    6 S7 t% @6 M) k" ]# l: L( n$ W
  7.                                         if ($anchor_level == 0) { // linkify if not inside anchor tags
    ; U( t9 \6 D7 `) h0 T4 N, G/ S. n
  8.                                                 if (preg_match($match, $token)) { // use preg_match for compatibility with PHP 4
    ( x  r1 \" {% u* z5 b
  9.                                                         $j++;( w# j5 M) G, A5 w8 o
  10.                                                         if ($j <= SimpleTags_Plugin::get_option_value('auto_link_max_by_tag') || SimpleTags_Plugin::get_option_value('auto_link_max_by_tag') == 0) {// Limit replacement at 1 by default, or options value !
    ( k" E$ T- L: ]) n( L
  11.                                                                 $token = preg_replace($match, $substitute, $token); // only PHP 5 supports calling preg_replace with 5 arguments7 Q9 L( o; H: b  {/ Z+ e2 K
  12.                                                         }' B, N: S. ], R) `! i" @9 e
  13.                                                         $must_tokenize = true; // re-tokenize next time around
    1 i, I" c6 D- J  v# W, l
  14.                                                 }
    4 c( B' j: j% S/ p
  15.                                         }
    1 q: z) T% G$ ]) S
  16.                                 } else { // this token is markup
    ' A& z& ^" C- g2 W# ?* r8 @2 s
  17.                                         if (preg_match("#<\s*a\s+[^>]*>#i", $token)) { // found <a ...>9 n* \) [! k9 h7 i
  18.                                                 $anchor_level++;" r$ @: x9 l: ]
  19.                                         } elseif (preg_match("#<\s*/\s*a\s*>#i", $token)) { // found </a>
    & ?% D6 y: Q, ]
  20.                                                 $anchor_level--;0 q7 N5 M2 \& a8 R( F1 k9 ^
  21.                                         }9 k. ~  v: K; f' ~3 \/ i
  22.                                 }
    ; {$ D$ t* m% J, J) R0 t
  23.                                 $filtered .= $token; // this token has now been filtered- _5 D# L# \) t* {4 J1 d" P
  24.                         }. ~: ?4 u9 }) o; H6 B
  25.                         $content = $filtered; // filtering completed for this link
    - n  i% O' |: i" k0 h, I
  26.                 }
複製代碼
QQ截图20131206192511.jpg ; ]0 _7 A9 x1 ?8 c& M" T% _4 H$ X

; A8 w  n. Q* n4 V
. `5 V( ~- D" |3 b9 ^  X# @2 x
回復 给力 爆菊

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 免费注册

本版積分規則

點基跨境 數位編輯創業論壇

GMT+8, 2025-7-15 03:37

By DZ X3.5

小黑屋

快速回復 返回頂部 返回列表