过期域名预定抢注

 找回密碼
 免费注册

Simple tags重複自動連接問題

[複製鏈接]
發表於 2013-12-6 13:21:01 | 顯示全部樓層 |閱讀模式
請教下高手們,
8 X# r0 Q1 E  A4 O( C我用Simple tags在後台已經設置了Maximum number of links for the same tag為1,但是文章中照樣會出現同一個標籤被鏈接多次的現象。刷新緩存什麼的都試過多次。
8 S: q: q' j( n* i/ V我用的是wordpress3.7.1版本,直接在後台查找從官網下載的simple tags。這個要怎麼解決啊

' C, M9 Q& s  l/ a5 j7 p( j/ u5 Y. F2 K2 `  S

2 A0 C5 N. [. t+ c5 b
7 F3 f' _+ r" d4 Z) b
 樓主| 發表於 2013-12-6 19:28:44 | 顯示全部樓層
本帖最後由 jeffseo 於 2013-12-6 19:33 編輯 $ y3 p5 w5 j! s# X; H- Z
# q( W. g4 {6 d# w# S+ @; O
換其它WP的版本也還是這樣,
( r3 m( Z1 ^9 G( }+ K另外Maximum number of links per article:這個值也沒讀成功,設置10個TAG,文章中仍然會把所有TAG都鏈接上。
3 B* s9 N9 l, D; X! K3 q
看代碼似乎都沒什麼問題,# E) N( o& e- j9 J- Q/ `  X2 c
其它用simple tags的哥們也是這樣的嗎
  1.   // there should always be at least one token, but check just in case* r) U+ j) s* n% u; N: g  t6 M
  2.                 $anchor_level = 0;2 Q$ K: o- B2 g3 x( e; M
  3.                 if (isset($tokens) && is_array($tokens) && count($tokens) > 0) {& M' z% q9 b* I' z# i* ?
  4.                         $i = 0;
    - l: w' l2 B1 S' ~0 z0 k' n
  5.                         foreach ($tokens as $token) {
    ! O; Z& E- e! ^8 s0 l4 F" I
  6.                                 if (++$i % 2 && $token != '') { // this token is (non-markup) text' ?$ g9 A5 r! f) n9 o% B1 U& E2 q
  7.                                         if ($anchor_level == 0) { // linkify if not inside anchor tags" G1 l1 i2 y6 s, D  k2 F$ v8 x
  8.                                                 if (preg_match($match, $token)) { // use preg_match for compatibility with PHP 4
    5 P# P: p  p5 f  n+ p% b
  9.                                                         $j++;3 @! {9 E( W* V) g% Z* w
  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 !
    4 o; |6 c6 s, V9 w# e# d0 }$ G
  11.                                                                 $token = preg_replace($match, $substitute, $token); // only PHP 5 supports calling preg_replace with 5 arguments
    ! i. I. ?% g9 ~  B; q
  12.                                                         }
    * O0 I% u# X# j8 u9 J
  13.                                                         $must_tokenize = true; // re-tokenize next time around
    ' }/ x0 R- {# N! {" {$ O
  14.                                                 }5 e" T2 U: j9 y, i2 F' \
  15.                                         }, _: P+ E0 @9 Y& X
  16.                                 } else { // this token is markup
    4 \7 \+ q) ?. s' `4 ~
  17.                                         if (preg_match("#<\s*a\s+[^>]*>#i", $token)) { // found <a ...>
    7 q; J/ j  t+ @
  18.                                                 $anchor_level++;
    * B! C1 Y3 G" H
  19.                                         } elseif (preg_match("#<\s*/\s*a\s*>#i", $token)) { // found </a>
    ' ^* ~" f0 }" x, m- @5 `6 t
  20.                                                 $anchor_level--;
    & T* H+ Y" A6 ~9 Z, D' [7 ~
  21.                                         }
    " A3 g) K8 A% s
  22.                                 }
    ! K, F# c" E5 a8 C$ X
  23.                                 $filtered .= $token; // this token has now been filtered
    / c2 l2 S; k  [5 y
  24.                         }
    ! n5 E. ], g4 C: J" g) f7 [9 ~
  25.                         $content = $filtered; // filtering completed for this link
    8 c' [' n) T: o; D/ O( ~2 w% X2 @7 F
  26.                 }
複製代碼
QQ截图20131206192511.jpg
: m- q0 R+ [4 M

/ `5 u/ H: Q3 p5 G% q1 S
1 T! |& O, x8 d
回復 给力 爆菊

使用道具 舉報

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

本版積分規則

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

GMT+8, 2025-7-2 07:48

By DZ X3.5

小黑屋

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