The way things are written, all three variables could be non-zero (I would guess) and so you end up going through each if statement and they write over each other (in each you set $ain_id to something).
If all you are doing is placing something at the beginning or end of the navbar, why don't you just append it instead of using str_replace? (something like $navbar = $navbar . $ain_tableh . $ain_tablef)
|