@@ 38-46 (lines=9) @@ | ||
35 | if ( is_bool($argumentLink) && $argumentLink ) { |
|
36 | $argumentLink = '<a href="http://twitter.com/search?q=%23{argument}" target="_blank">#{argument}</a>'; |
|
37 | } |
|
38 | if ($userLink) { |
|
39 | //link twitter users |
|
40 | $text = preg_replace_callback( '/([\b ])@([a-z0-9_]*)\b/i', |
|
41 | function ( $matches ) use ( $userLink ) { |
|
42 | return $matches[1].str_replace( "{user}", $matches[2], $userLink ); |
|
43 | }, |
|
44 | $text |
|
45 | ); |
|
46 | } |
|
47 | if ($argumentLink) { |
|
48 | //link twitter arguments |
|
49 | $text = preg_replace_callback( '/([\b ])#([a-z0-9_]*)\b/i', |
|
@@ 47-55 (lines=9) @@ | ||
44 | $text |
|
45 | ); |
|
46 | } |
|
47 | if ($argumentLink) { |
|
48 | //link twitter arguments |
|
49 | $text = preg_replace_callback( '/([\b ])#([a-z0-9_]*)\b/i', |
|
50 | function ( $matches ) use ( $argumentLink ) { |
|
51 | return $matches[1].str_replace( "{argument}", $matches[2], $argumentLink ); |
|
52 | }, |
|
53 | $text |
|
54 | ); |
|
55 | } |
|
56 | } |
|
57 | ||
58 | return trim($text); |