3
I fixed it.
The problem turned out to be me not knowing enough about XOOPS (surprise).
So I restored the database and files to a fairly early date (just before I started messing with it). I lost a few days work but otherwise it was fine.
The only thing I could advise others who are modifying themes , templates, modules, and stuff (hopefully before they have this problem), is to:
1. Back up the database regularly (daily if possible)
2. Use a duplicate of the template
it was the only thing that allowed me to see anything after this problem started. If I couldn't switch to the original template i would never have been able to fix it.
3. Make small changes.
I know it seems like a huge inconvienience to make one tiny change, then delete cache (templates_c) and then view changes again, but a minor change is easy to reverse.
4. Find out everything about it
I have found since that the problem I was having was a mix of changes to data and files that I had no idea were being affected by my changes.
So if you are going to do something that involves editing bits of code or anything other than what the module developers have provided, DON'T, hehe, or if you have to, do it very carefully and do a lot of research.
Thanks for the advice jensclas