I'm looking for a spinning php script

tata668

Newbie
Joined
Jul 13, 2008
Messages
40
Reaction score
0
Anyone has a good spinning php script? A script for content using the {aaa|bbb|ccc} syntax?

I could code it myself but I'm pretty sure there already are some good ones available!

Thanks
 
PHP:
<?
$body = stripslashes($_POST['body']);

for ($j=0; $j< 10; $j++) {
$pattern = '/\{([^{}]*)\}/si';
preg_match_all($pattern,$body,$matches);
for ($i=0; $i< count($matches[0]); $i++) {
$search = explode("|",$matches[1][$i]);
srand((float)microtime() * 1000000);
shuffle($search);
$body = str_replace($matches[0][$i],$search[0],$body);
}
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

$titles = stripslashes($titles);

for ($j=0; $j< 10; $j++) {
$pattern = '/\{([^{}]*)\}/si';
preg_match_all($pattern,$titles,$matchtitles);
for ($i=0; $i< count($matchtitles[0]); $i++) {
$search3 = explode("|",$matchtitles[1][$i]);
srand((float)microtime() * 1000000);
shuffle($search3);
$titles = str_replace($matchtitles[0][$i],$search3[0],$titles);
}
}

$title = explode("|",$titles);
shuffle($title);

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

$summary = stripslashes($_POST['summary']);
for ($j=0; $j< 10; $j++) {
$pattern = '/\{([^{}]*)\}/si';
preg_match_all($pattern,$summary,$matches);
for ($i=0; $i< count($matches[0]); $i++) {
$search = explode("|",$matches[1][$i]);
srand((float)microtime() * 1000000);
shuffle($search);
$summary = str_replace($matches[0][$i],$search[0],$summary);
}
}


//#################################################################
#################Originally made by itrevor
$resourcebox = stripslashes($_POST['resourcebox']);

for ($j=0; $j< 10; $j++) {
$pattern = '/\{([^{}]*)\}/si';
preg_match_all($pattern,$resourcebox,$matchresource);
for ($i=0; $i< count($matchresource[0]); $i++) {
$search2 = explode("|",$matchresource[1][$i]);
srand((float)microtime() * 1000000);
shuffle($search2);
$resourcebox = str_replace($matchresource[0][$i],$search2[0],$resourcebox);
}
}

$article_title = trim($title[0]);
$article_summary=stripslashes($summary);
$article_body = stripslashes(trim($body));
$resource_box = $resourcebox;
?>
 
Thanks SharePro! I'll check that code!
 
Back
Top