UseBB Community

The official board for UseBB help and discussion

UseBB Community » Help & Support » Undefine Variable: templates

Undefine Variable: templates

Moderators: Gaia.

Page: 1

Author Post
Member
Registered: Oct 2009
Posts: 11
Location: Ontario, Canada
In file sources/template.php on line 120:

E_NOTICE - Undefined variable: templates


How should I go about fixing this? I uploaded a theme, and switched to it and got this error when I tried to re log in.
Developer
Registered: Apr 2004
Posts: 2247
Location: Belgium
Most likely the template has faulty information. To be more specific, it seems global.tpl.php does not contain the $templates variable.

Where did you get the template from?
Member
Registered: Oct 2009
Posts: 11
Location: Ontario, Canada
http://usebbzone.com/file.php?id=29
Developer
Registered: Apr 2004
Posts: 2247
Location: Belgium
It works for me. The template seems fine.

Are you sure all the files have uploaded correctly?
« Last edit by Dietrich on Mon Oct 19, 2009 11:55 am. »
Member
Registered: Oct 2009
Posts: 11
Location: Ontario, Canada
There was no read-me included so I followed how the defualt was uploaded.

So... I installed the root template folder to the templates folder. Did I go about doing it wrong?
Developer
Registered: Apr 2004
Posts: 2247
Location: Belgium
It should work with the template folder in templates/, thus there should be templates/<name>/global.tpl.php and all the other files.

Try altering line 118 in sources/template.php to
include($templates_file);


If this doesn't work I suspect it's either a permission issue that is not detected or actually a bug. Thus make sure all the PHP files for the template are readable (CHMOD in FTP).
Member
Registered: Oct 2009
Posts: 11
Location: Ontario, Canada
I'm not new to forums so I've already gone through the generic issues that I have encountered throughout my time with template errors.

I'm pretty sure I've already checked if it's CHMOD'd correctly. I beleive it's 644.

I will edit the file when I get into my Computer Sciences class, right now I'm finishing up some work.

Dietrich, I appreciate the prompt responses and help.
Member
Registered: Oct 2009
Posts: 11
Location: Ontario, Canada
Didn't work, still has the same outcome.

Line 20 = $this->templates[$section] = $templates;

I commented out but it said my global index was undefined. Hmm.
« Last edit by btraill on Mon Oct 19, 2009 3:23 pm. »
Developer
Registered: Apr 2004
Posts: 2247
Location: Belgium
You can't comment the line out since it puts the contents of the $templates variable in the template object.

I really can't figure out what would be the cause of this. Have you tried any other templates?
Member
Registered: Oct 2009
Posts: 11
Location: Ontario, Canada
Heh, problem is : I can't even access my forum in general, not even the admin.php page. :( Should I re-install?
Developer
Registered: Apr 2004
Posts: 2247
Location: Belgium
Just renaming the template's directory should be enough.
Member
Registered: Oct 2009
Posts: 11
Location: Ontario, Canada
Renamed it, deleted it, restored it, everything...

I get:



In file sources/template.php on line 116:

E_USER_ERROR - Unable to load global templates file for set "CesarDesign01"!


Everytime.
Developer
Registered: Apr 2004
Posts: 2247
Location: Belgium
You have set it as the default template. Set the template config value in config.php to "default".
Member
Registered: Oct 2009
Posts: 11
Location: Ontario, Canada
Thanks :) Dietrich, man, your coding is by far the most efficient and easy to understand out of forum software.
Developer
Registered: Apr 2004
Posts: 2247
Location: Belgium
Don't know if you're being sarcastic :lol:, but UseBB 1's code has become a mess in a quite fast period of time. There are also a number of design flaws (http://sourceforge.net/apps/trac/usebb/wiki/UseBB1DesignFlaws) that I wish to resolve in UseBB 2.

Hope you tried with another template set, there must have been something wrong with the files.

Page: 1

UseBB Community » Help & Support » Undefine Variable: templates

UseBB Community is powered by UseBB 1 Forum Software