{$thisname} should be converted to .
{$thisname}
{thisname} should be converted to
{thisname}
Use a templating system, I suggest using http://phpsavant.com/ although it looks like you're more interested in Smarty or Dwoo
There's no need to re-invent the wheel :)