| 04.04.2011, 12:34 | iloveadult | - , ?
. .. , |
| 04.04.2011, 15:55 | Bara | Terms Descriptions
|
| 04.04.2011, 16:31 | chesser | wp-content/plugins/:
<?php
/*
Plugin Name: Chesser Relpace
Description: Find and replace substrings
Author: Chesser
Version: 1.0
Author URI: http://chesser.ru/blog/
*/
function func_replace($content) {
return str_replace(
array(
'vasya',
'masha',
),
array(
'petya',
'dasha',
),
$content
);
}
add_filter('the_content', 'func_replace');
?>
,
"vasya petya" , :)
str_replace str_ireplace - .
, - mb_string |
| 04.04.2011, 16:37 | majordon | .. ,
Terms Descriptions , |
| 04.04.2011, 17:02 | iloveadult | wp-content/plugins/:
<?php
/*
Plugin Name: Chesser Relpace
Description: Find and replace substrings
Author: Chesser
Version: 1.0
Author URI: http://chesser.ru/blog/
*/
function func_replace($content) {
return str_replace(
array(
'vasya',
'masha',
),
array(
'petya',
'dasha',
),
$content
);
}
add_filter('the_content', 'func_replace');
?>
,
"vasya petya" , :)
str_replace str_ireplace - .
, - mb_string
, ! |
| 04.04.2011, 17:27 | iloveadult | :
:
g.com
y.com
:
y.com |
| 04.04.2011, 17:35 | Sezeo8 | :
:
g.com
y.com
:
y.com
" " "" |
| 04.04.2011, 17:43 | iloveadult | , , 2. 10 , . |
| 04.04.2011, 17:56 | Sezeo8 | , , |
| 04.04.2011, 17:58 | iloveadult | , :
URL="http://gofuckbiz.info/"] forum[/URL]
:
URL="http://gofuckbiz.info/"]URL="http://gofuckbiz.info/"] forum[/URL] forum[/URL]
, html
upd ))
, , , |
| 04.04.2011, 20:30 | incognito | .:
<?php
function func_replace($content) {
$search_replace = "THANKS{-}thanks{;}BIG THANKS{-}big thanks{;}VERY BIG THANKS{-}very big thanks";
# :
//$search_replace = file_get_contents('searchreplace.txt');
$content = strip_tags($content); //
$sr_arr_tmp = explode('{;}',$search_replace);
foreach ($sr_arr_tmp as $value_sr){
$sr_para_tmp = explode('{-}',$value_sr);
$sr_para[$sr_para_tmp[0]] = $sr_para_tmp[1];
$search_long[$sr_para_tmp[0]] = strlen($sr_para_tmp[0]);
}
arsort($search_long,SORT_NUMERIC);
foreach ($search_long as $key_sl=>$value_sl){
$search_arr[] = $key_sl;
$replace_arr[] = $sr_para[$key_sl];
}
return str_replace($search_arr,$replace_arr,$content);
}
add_filter('the_content', 'func_replace');
?>
:
- ("img" ).
- " " - .
- .
. :pardon: |
| 04.04.2011, 20:52 | href | search-regex - , |
| 04.04.2011, 20:59 | sspy | - , ?
. .. ,
Internal Link Building |
| 05.04.2011, 15:28 | iloveadult | .:
<?php
function func_replace($content) {
$search_replace = "THANKS{-}thanks{;}BIG THANKS{-}big thanks{;}VERY BIG THANKS{-}very big thanks";
# :
//$search_replace = file_get_contents('searchreplace.txt');
$content = strip_tags($content); //
$sr_arr_tmp = explode('{;}',$search_replace);
foreach ($sr_arr_tmp as $value_sr){
$sr_para_tmp = explode('{-}',$value_sr);
$sr_para[$sr_para_tmp[0]] = $sr_para_tmp[1];
$search_long[$sr_para_tmp[0]] = strlen($sr_para_tmp[0]);
}
arsort($search_long,SORT_NUMERIC);
foreach ($search_long as $key_sl=>$value_sl){
$search_arr[] = $key_sl;
$replace_arr[] = $sr_para[$key_sl];
}
return str_replace($search_arr,$replace_arr,$content);
}
add_filter('the_content', 'func_replace');
?>
:
- ("img" ).
- " " - .
- .
. :pardon:
, , (
Internal Link Building
, ���������� ))) |
| 05.04.2011, 15:30 | oso | , , (
, .
/*
Plugin Name:
Description:
Author:
Version:
Author URI:
*/ |
| 05.04.2011, 15:36 | iloveadult | , .
/*
Plugin Name:
Description:
Author:
Version:
Author URI:
*/
, :
Parse error: syntax error, unexpected T_STRING in ..../wp-content/plugins/auto-auto.php on line 11 |
| 05.04.2011, 15:46 | oso | <?php
/*
Plugin Name: replace plugin
Description: This is replace text plugin
Version: 1.0
*/
function func_replace($content) {
$search_replace = "THANKS{-}thanks{;}BIG THANKS{-}big thanks{;}VERY BIG THANKS{-}very big thanks";
# :
//$search_replace = file_get_contents('searchreplace.txt');
$content = strip_tags($content); //
$sr_arr_tmp = explode('{;}',$search_replace);
foreach ($sr_arr_tmp as $value_sr){
$sr_para_tmp = explode('{-}',$value_sr);
$sr_para[$sr_para_tmp[0]] = $sr_para_tmp[1];
$search_long[$sr_para_tmp[0]] = strlen($sr_para_tmp[0]);
}
arsort($search_long,SORT_NUMERIC);
foreach ($search_long as $key_sl=>$value_sl){
$search_arr[] = $key_sl;
$replace_arr[] = $sr_para[$key_sl];
}
return str_replace($search_arr,$replace_arr,$content);
}
add_filter('the_content', 'func_replace');
?> |
| 05.04.2011, 15:52 | iloveadult | ...
, , , ..:
THANKS{-}<a href="http://xyipizda.com/">cheap xyipizda</a>{;}
, , , |
| 05.04.2011, 16:56 | iloveadult | search-regex - :(
+ . |
| 05.04.2011, 16:56 | chesser | ?
:
function func_replace($content) {
return str_replace(
array(
'buy cheap',
'Cialis online',
),
array(
'<a href="http://chesser.ru/buy-cheap">buy cheap</a>',
'<a href="http://chesser.ru/Cialis online">Cialis online</a>',
),
$content
);
}
: http://chesser.ru/blog/services/copywriting/
" "
ps: search- -
,
- - , .. , . |
| 05.04.2011, 16:58 | iloveadult | )
, (http://gofuckbiz.info/showpost.php?p=464223&postcount=10), |
| 05.04.2011, 18:03 | chesser | iloveadult, / , . , ,
function func_replace($content) {
return str_replace(
array(
'gofuck forum',
'forum',
),
array(
'<a href="http://gofuckbiz.info">gofuck forum</a>',
'<a href="http://gofuckbiz.com">forum</a>',
),
$content
);
}
, , forum - , :
function func_replace($content) {
return str_replace(
array(
'gofuck forum',
'forum',
'jdhgfuiredguidnfuig',
),
array(
'<a href="http://gofuckbiz.info">gofuck jdhgfuiredguidnfuig</a>',
'<a href="http://gofuckbiz.com">forum</a>',
'forum'
),
$content
);
}
jdhgfuiredguidnfuig - ,
|
| 05.04.2011, 18:26 | iloveadult | , ) |
| 05.04.2011, 18:28 | chesser | , , :
function func_replace($content) {
$replace = array(
'gofuck forum' => '<a href="http://gofuckbiz.info">gofuck forum</a>',
'forum' => '<a href="http://gofuckbiz.com">forum</a>',
'gofuck forum link' => '<a href="http://gofuckbiz.info">gofuck forum link</a>',
);
function cmp($a, $b) {
$a = strlen($a);
$b = strlen($b);
if ($a == $b) return 0;
return ($a < $b) ? 1 : -1;
}
uksort($replace, 'cmp');
$replace_after = array();
$tmp = $replace;
array_shift($tmp);
foreach($replace as $k=>$v) {
foreach($tmp as $kk=>$vv)
if(strpos($v, $kk) !== false) {
$md5_kk = md5($kk) . 'gofuck';
$replace[$k] = str_replace($kk, $md5_kk, $v);
$replace_after[$md5_kk] = $kk;
}
array_shift($tmp);
}
$content = str_replace(array_keys($replace), array_values($replace), $content);
$content = str_replace(array_keys($replace_after), array_values($replace_after), $content);
return $content;
}
ps - |
| 05.04.2011, 19:03 | iloveadult | , |
| 05.04.2011, 20:24 | balamutik | , , <noindex> ? <noindex> ?) |
| 05.04.2011, 22:03 | chesser | ,
:
$replace[$k] = str_replace($kk, $md5_kk, $v);
:
$replace[$k] = str_replace($kk, $md5_kk, $replace[$k]);
:
<?php
/*
Plugin Name: Chesser Relpace
Description: Find and replace substrings
Author: Chesser
Version: 1.0
Author URI: http://chesser.ru/blog/
*/
function func_replace($content) {
$replace = array(
'gofuck forum' => '<a href="http://gofuckbiz.info">gofuck forum</a>',
'forum' => '<a href="http://gofuckbiz.com">forum</a>',
'gofuck forum link' => '<a href="http://gofuckbiz.info">gofuck forum link</a>',
);
function cmp($a, $b) {
$a = strlen($a);
$b = strlen($b);
if ($a == $b) return 0;
return ($a < $b) ? 1 : -1;
}
uksort($replace, 'cmp');
$replace_after = array();
$tmp = $replace;
array_shift($tmp);
foreach($replace as $k=>$v) {
foreach($tmp as $kk=>$vv)
if(strpos($v, $kk) !== false) {
$md5_kk = md5($kk) . 'gofuck';
$replace[$k] = str_replace($kk, $md5_kk, $replace[$k]);
$replace_after[$md5_kk] = $kk;
}
array_shift($tmp);
}
$content = str_replace(array_keys($replace), array_values($replace), $content);
$content = str_replace(array_keys($replace_after), array_values($replace_after), $content);
return $content;
}
add_filter('the_content', 'func_replace');
?>
, |
| 05.04.2011, 22:18 | iloveadult | , , |
| 06.04.2011, 00:02 | sergeospb | , add_filter('the_content', 'xxx), :
add_filter('the_content', 'func_replace', 100); |
| 06.04.2011, 09:49 | chesser | wordpress- (http://chesser.ru/blog/wordpress-plugin-chesser-autoreplace-text/). - .
wordpress svn, - . ? :eek: |
| 13.04.2011, 03:07 | chesser | , Wordpress
wp, chesser
, : " " " ".
, - .
- , |
vBulletin® 3.8.6. Copyright ©2000-2011, Jelsoft Enterprises Ltd. : zCarot
|