/*
Plugin Name: Tagalize It
Plugin URI: http://tagalizeit.com/
Description: Create taged text by enclosing the text to be tagged in one of the following. [TAG-Tec] [Tag-Ice] and [Tag-self] also alternate tags can be inserted into the [Tag-tec "new tag"]
Version: 0.10 rc2
Author: Todd Sieland-Peterson
Author URI: http://tagalizeit.com/
Update: http://tagalizeit.com/download
*/
#/
/*
* Available tags are [tag-tec] [tag-ice] [tag-self] [tag-cat] [tag-dir] [tag-dtec]
*
* If you have put your blog in a subdirectory or changed the
* /search/ or /category/ locations then you must change the variables
* inside the function below $self_loc, $dir_loc and $cat_loc.
* this will change later to an edit page in the server.
*/
function tagazlie_it_tagger($tag, $swaptext, $intext) {
$self_loc = '/index.php?tag=';
$dir_loc = '/search/';
$cat_loc = '/category/';
// be ready to add the '+'s
$sep = '+';
$tags = explode(' ', trim($swaptext));
if (strlen($swaptext) == 1 ) { // if there is only 1 character then assume it is a format char
switch ($swaptext) {
case '-':
$sep = '-';
$tags = explode(' ', trim($intext)); //sub out the text
break;
case '+':
$sep = '+';
$tags = explode(' ', trim($intext));
break;
default:
break;
}
}
if ($tags != null && sizeof($tags) > 1)
$tagMerge = join($sep, $tags);
else
$tagMerge = $swaptext;
$tagtype='tag';
//$newwin=' target=new';
// figure out which tag to translate to
switch(strtolower($tag)) {
case 'self' : // Self
$site = "{$_SERVER['HTTP_HOST']}{$self_loc}{$tagMerge}";
break;
case 'dir' : // search
$tagMerge = join('+', $tags);
$site = "{$_SERVER['HTTP_HOST']}{$dir_loc}{$tagMerge}";
$tagtype='tag directory';
break;
case 'cat' : // category
$tagMerge = join('-', $tags);
$site = "{$_SERVER['HTTP_HOST']}{$cat_loc}{$tagMerge}/";
$tagtype='tag directory';
break;
case 'tec' : // technorati
$site = "www.technorati.com/tag/{$tagMerge}";
break;
case 'dtec' : // Directory Technorati
$site = "www.technorati.com/search/{$tagMerge}";
$tagtype='tag directory';
break;
case 'ice' : // ice
$site = "blogs.icerocket.com/tag/{$tagMerge}";
break;
default:
break;
}
return "{$intext}";
}
function tagalize_it($text) {
//echo $text;
# Parse text looking for ACT tags.
$actedtext='';
// foreach (preg_split('|(\[TAG-.+?\].+?\[/TEC-.+?\])|i', $text, -1, PREG_SPLIT_DELIM_CAPTURE) as $token) {
// $token = preg_split('|(\[TAG-.+?\].+?\[/TEC-.+?\])|i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
if (preg_split('|\[TAG-|i', $text, -1, PREG_SPLIT_DELIM_CAPTURE)) {
// ? dont be greedy
// pull out the tag only
while (preg_match('|\[TAG-([a-zA-Z]+)\](.+?)\[/TAG-[a-zA-Z]+\](.*)|i', $text, $resultsall , PREG_OFFSET_CAPTURE)) {
// make sure that there are at least 5 array elements
// rework the array
$actedtext .= substr($text, 0, $resultsall[0][1]);
$tagNameStart = @$resultsall[1][0];
$intext = @$resultsall[2][0];
$text = substr($text, $resultsall[3][1]);
$actedtext .= tagazlie_it_tagger($tagNameStart, $intext, $intext);
} // while
$actedtext .= $text;
$text = $actedtext; // reset the string
$actedtext = '';
//echo "Working with Text : " . $text;
// plull out the tag + sub values
while (preg_match('|\[TAG-([a-zA-Z]+) (.+?)\](.+?)\[/TAG-[a-zA-Z]+\](.*)|i', $text, $resultsall , PREG_OFFSET_CAPTURE)) {
// make sure that there are at least 5 array elements
// rework the array
$actedtext .= substr($text, 0, $resultsall[0][1]);
$tagNameStart = @$resultsall[1][0];
$subtext = @$resultsall[2][0];
$intext = @$resultsall[3][0];
$text = substr($text, $resultsall[4][1]);
$actedtext .= tagazlie_it_tagger($tagNameStart, $subtext, $intext);
} // while
$actedtext .= $text;
} else {
$actedtext = $text;
}
return $actedtext;
}
# Turn on the tagalizer process.
// tagalize_it
add_filter('the_content', 'tagalize_it');
/*
$_SERVER['HTTP_HOST'] = 'www.test.com';
$text = "this is [TAG-TEC]one[/TAG-TEC] tesing
";
$textout = tagalize_it($text);
echo $textout;
$text = "[TAG-TEC]two[/TAG-TEC]";
$textout = tagalize_it($text);
echo $textout . '
';
$text = '[TAG-TEC snowboard]Board[/TAG-TEC] override with snowboard
';
$textout = tagalize_it($text);
echo $textout;
$text = '[TAG-TEC -]snow Board[/TAG-TEC] - insert
';
$textout = tagalize_it($text);
echo $textout;
$text = '[TAG-cat]snow Board[/TAG-TEC] as category with +
';
$textout = tagalize_it($text);
echo $textout;
$text = '[TAG-dir -]snow Board[/TAG-TEC] as directory with -
';
$textout = tagalize_it($text);
echo $textout;
$text = '[TAG-cat]snow Board[/TAG-TEC] as category with +
';
$textout = tagalize_it($text);
echo $textout;
$text = '[TAG-dir]snowBoard[/TAG-TEC] as directory with -
';
$textout = tagalize_it($text);
echo $textout;
$text = '[TAG-TEC]snowBoard[/TAG-TEC] + insert
';
$textout = tagalize_it($text);
echo $textout;
$text = '[TAG-dTEC +]snow Board[/TAG-dTEC] + insert for Directory
';
$textout = tagalize_it($text);
echo $textout;
$text = "this is [TAG-TEC]text[/TAG-TEC] basic tec tag";
$textout = tagalize_it($text);
echo $textout . '
';
$text = "this is [TAG-TEC]text[/TAG-TEC] [TAG-SELF]that[/TAG-SELF]tesing
";
$textout = tagalize_it($text);
echo $textout;
$text = "this is [TAG-TEC]text[/TAG-TEC] or [TAG-ICE]text[/TAG-ICE] tesing
";
$textout = tagalize_it($text);
echo $textout;
$text = 'this is [TAG-TEC try]text[/TAG-TEC] or [TAG-ICE good]text[/TAG-ICE] tesing
';
$textout = tagalize_it($text);
echo $textout;
$text = "this is text tesing
";
$textout = tagalize_it($text);
echo $textout;
*/
?>
Parse error: syntax error, unexpected '}' in /home/monica/public_html/autismchoices/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php on line 1401