Looking at these functions one at a time...
function nicetrim ($s) {
$str_to_count = html_entity_decode($s);
if (strlen($str_to_count) <= $block_textcount) {
return $s;
}
$s2 = substr($str_to_count, 0, $block_textcount);
$s2 = substr($str_to_count, 0, $block_textcount - 3);
$s2 .= "... [More]";
return htmlentities($s2);
}
1. Where is $block_textcount ever defined? (It's not.)
function nicetrim2 ($t) {
$str_to_count = html_entity_decode($t);
if (strlen($str_to_count2) <= $block_titlecount) {
return $t;
}
$t2 = substr($str_to_count2, 0, $block_titlecount);
$t2 = substr($str_to_count2, 0, $block_titlecount - 3);
$t2 .= "... [More]";
return htmlentities($t2);
}
1. Where is $block_titlecount ever defined? (It's not.)
- You never define $str_to_count2, though I believe this is a typo and that the $str_to_count variable declaration should actually have a 2 on the end of it.
Also, you should note that the following two functions:
function foo($foobar) {
$barbar = 'Hi ' . $foobar;
}
function bar($foobar) {
$barbar = 'Hi ' . $foobar;
}
have 0 variables being "redeclared" (which wouldn't cause any error or notice anyway). Why? Because of the scope of the variables - i.e. they're not in the global scope.