过期域名预定抢注

 找回密碼
 免费注册

Simple tags重複自動連接問題

[複製鏈接]
發表於 2013-12-6 13:21:01 | 顯示全部樓層 |閱讀模式
請教下高手們,3 U9 B+ V' h" w0 x) W0 R9 |
我用Simple tags在後台已經設置了Maximum number of links for the same tag為1,但是文章中照樣會出現同一個標籤被鏈接多次的現象。刷新緩存什麼的都試過多次。4 T/ q# j. R5 c" S9 t3 |1 e
我用的是wordpress3.7.1版本,直接在後台查找從官網下載的simple tags。這個要怎麼解決啊

$ r3 `0 @) b' y8 o3 B
9 f1 [' Y" H: f( [2 i( T' ~, @' R
; e; L  ~# e8 }; {: M' u& U
8 J; I. g+ F& }7 r4 ]) O$ ?# W
 樓主| 發表於 2013-12-6 19:28:44 | 顯示全部樓層
本帖最後由 jeffseo 於 2013-12-6 19:33 編輯 4 R1 r8 Q+ C% V6 H
0 G; d9 }0 x2 w/ |
換其它WP的版本也還是這樣,
5 I. T" y7 r" J3 k) _) Z( ^8 [另外Maximum number of links per article:這個值也沒讀成功,設置10個TAG,文章中仍然會把所有TAG都鏈接上。
4 E6 p3 F$ V% Y" Z: \. G" H
看代碼似乎都沒什麼問題,; D; N! W( I4 b' D
其它用simple tags的哥們也是這樣的嗎
  1.   // there should always be at least one token, but check just in case
    + b0 ^! z8 y1 p( U
  2.                 $anchor_level = 0;; l; e8 Y, V; w. e! P0 B
  3.                 if (isset($tokens) && is_array($tokens) && count($tokens) > 0) {
    4 S4 B- I2 j. W( s# H; J5 I5 K
  4.                         $i = 0;' `+ T; f% D( [" N# ?
  5.                         foreach ($tokens as $token) {
    + ?% e; S% ^) D9 m# D
  6.                                 if (++$i % 2 && $token != '') { // this token is (non-markup) text
    + m9 Q* H$ z& n  t6 Y
  7.                                         if ($anchor_level == 0) { // linkify if not inside anchor tags" [, o, E: T/ ~2 y4 ^
  8.                                                 if (preg_match($match, $token)) { // use preg_match for compatibility with PHP 4
    6 I$ s* |: c+ K1 D8 X
  9.                                                         $j++;/ `9 d* N# R3 M0 ]. v
  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 !
    5 Q4 \( W, E8 f+ b5 Z( p9 l. E
  11.                                                                 $token = preg_replace($match, $substitute, $token); // only PHP 5 supports calling preg_replace with 5 arguments
    0 [4 }  v( n6 b; k9 r
  12.                                                         }8 U4 n! a0 e( q5 T- O5 |# _
  13.                                                         $must_tokenize = true; // re-tokenize next time around
    / m) K& v$ {" y% M
  14.                                                 }
    + Z9 ^" s4 c( ]) h
  15.                                         }/ ~% Y/ [1 N% f/ A
  16.                                 } else { // this token is markup! _, @+ d& @. @6 o8 Y. V* g
  17.                                         if (preg_match("#<\s*a\s+[^>]*>#i", $token)) { // found <a ...># S' y8 w- d7 a! s
  18.                                                 $anchor_level++;
    : Z2 k" n6 Y5 t; e2 O4 G: W
  19.                                         } elseif (preg_match("#<\s*/\s*a\s*>#i", $token)) { // found </a>
    3 z9 O4 g/ b* L3 ]7 }6 }
  20.                                                 $anchor_level--;
    # J8 e; z+ t; H9 O' H" k. x* ^
  21.                                         }! _/ y; B' R- E) P5 R! S
  22.                                 }
    " K: M0 t6 @( N" ?8 W  s
  23.                                 $filtered .= $token; // this token has now been filtered
    , s( {+ l0 h9 g9 t( Q3 |
  24.                         }
    / A( b/ d) v2 R) p
  25.                         $content = $filtered; // filtering completed for this link
    : E" o0 j  N3 G8 F) T4 N' v
  26.                 }
複製代碼
QQ截图20131206192511.jpg # f- l3 t% O7 d% I9 {: W
9 h  A% ]9 k: T

' ?( b: o. z$ m$ n
回復 给力 爆菊

使用道具 舉報

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

本版積分規則

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

GMT+8, 2025-2-17 17:28

By DZ X3.5

小黑屋

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