过期域名预定抢注

 找回密碼
 免费注册

Simple tags重複自動連接問題

[複製鏈接]
發表於 2013-12-6 13:21:01 | 顯示全部樓層 |閱讀模式
請教下高手們," x' t5 f5 u& j- F
我用Simple tags在後台已經設置了Maximum number of links for the same tag為1,但是文章中照樣會出現同一個標籤被鏈接多次的現象。刷新緩存什麼的都試過多次。5 C' c8 G3 D# k" d8 T" d
我用的是wordpress3.7.1版本,直接在後台查找從官網下載的simple tags。這個要怎麼解決啊

0 R. `7 z$ @1 Z3 s/ e, j. l0 N6 C. ^
4 X4 O! e/ v% e0 l/ B% x0 ^* \& r# I1 e$ Q( M) c% A3 H
$ ~* l4 L# e1 n8 W
 樓主| 發表於 2013-12-6 19:28:44 | 顯示全部樓層
本帖最後由 jeffseo 於 2013-12-6 19:33 編輯
4 h) U/ s. ?# N) o! \! p6 O0 @; H: N3 e
換其它WP的版本也還是這樣,3 C3 a3 O7 J  s# y
另外Maximum number of links per article:這個值也沒讀成功,設置10個TAG,文章中仍然會把所有TAG都鏈接上。
! l$ g- z$ _) V- h
看代碼似乎都沒什麼問題,  K% _4 `5 Z" J5 W
其它用simple tags的哥們也是這樣的嗎
  1.   // there should always be at least one token, but check just in case1 @5 M4 R# t# }, Z
  2.                 $anchor_level = 0;( A% b5 b6 @/ \$ l( b
  3.                 if (isset($tokens) && is_array($tokens) && count($tokens) > 0) {7 }0 v6 @4 S. ^. \1 Q
  4.                         $i = 0;
    5 F: K; Y3 O# R! L9 {8 b. p
  5.                         foreach ($tokens as $token) {
    # o9 y$ [- d! F# E* z% |, L  _4 n
  6.                                 if (++$i % 2 && $token != '') { // this token is (non-markup) text
    ; i; D5 ]' ]0 P& V" v% \: s
  7.                                         if ($anchor_level == 0) { // linkify if not inside anchor tags5 x* o' H5 m& I. Y
  8.                                                 if (preg_match($match, $token)) { // use preg_match for compatibility with PHP 4# Z% M4 O. h) R) X3 z. W
  9.                                                         $j++;7 U% N/ @! e# Q" Y: V& n; s
  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 !+ R. `" P( p5 L
  11.                                                                 $token = preg_replace($match, $substitute, $token); // only PHP 5 supports calling preg_replace with 5 arguments
    5 N- E; [+ H8 z0 ~9 X" |2 E! j/ k1 l
  12.                                                         }
    " Z, f( X0 i8 `9 B( t1 W2 A* }2 S
  13.                                                         $must_tokenize = true; // re-tokenize next time around1 O3 T1 z& j5 s- Q1 U* n# k1 D
  14.                                                 }( V. h! I/ j6 c0 l$ v1 I
  15.                                         }
    " A( ?, W5 ?( Q2 d* N$ n; M/ J4 Y
  16.                                 } else { // this token is markup% Q/ n  M. u- m" W$ Z5 S
  17.                                         if (preg_match("#<\s*a\s+[^>]*>#i", $token)) { // found <a ...>$ y5 N& m3 r  W# m7 J( p
  18.                                                 $anchor_level++;+ U1 L7 B% [8 I( l8 q7 I
  19.                                         } elseif (preg_match("#<\s*/\s*a\s*>#i", $token)) { // found </a>
    4 h0 w/ u% C/ ]8 v- i, i
  20.                                                 $anchor_level--;4 ^  t' K8 s1 L
  21.                                         }8 [, B8 m' Y0 u& Z& `/ \
  22.                                 }* j! \% t  p3 h
  23.                                 $filtered .= $token; // this token has now been filtered9 v5 B" L3 U/ L/ R" w
  24.                         }5 n; C4 P3 w3 @% L5 M5 x
  25.                         $content = $filtered; // filtering completed for this link" J, c2 _. ~! @1 n4 {$ n
  26.                 }
複製代碼
QQ截图20131206192511.jpg
$ k; d- }' f& B! Y9 |/ d. h

& B8 W  r1 U* I) T) @8 _1 _4 S# ]$ o. H
回復 给力 爆菊

使用道具 舉報

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

本版積分規則

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

GMT+8, 2025-9-19 01:39

By DZ X3.5

小黑屋

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