You was not sucessfull adding PHP code into invision powerboard (IPB) template / theme?

Me too, here is how it works:
Login IPB admina area, go to "Look & Feel" > Manage Skin Sets & Templates"
click template name. Then navigate to: "Global Templates" and then click "globalTemplate" or any other tempalte that youw ant to edit.

Paste PHP code like this:

Code:
<php>$variable123 = "Text to show";</php>
{$variable123}
set variable between <php> and </php>and then print variable in template

Another example php code that i pasted into invision powerboard (IPB) template:

Code:
<php>if (strpos($_SERVER['HTTP_USER_AGENT'],'Google') == false) { $outputtt = 'In case you&#x27;re interested in games, try <a href=\"http://www.favoriteminigames.com\">FavoriteminiGames</a>'; }
</php>
{$outputtt}
i used single quotes for variable, so another single quotes within that variable i needed to convert into HMTL entities by HTML entity encoder/decoder . Single quote translates into html entity:
Code:
&#x27;