MyBB Community Forums

Full Version: Cannot change templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(If this is in the wrong place, please move.)

I went to change one of my templates and got this error when I clicked Modify/Delete Templates:

Quote:Warning: reset(): Passed variable is not an array or object in /home/www/videogameempire.net/MessageBoard/admin/templates.php on line 674

Warning: ksort() expects parameter 1 to be array, string given in /home/www/videogameempire.net/MessageBoard/admin/templates.php on line 675

Warning: Invalid argument supplied for foreach() in /home/www/videogameempire.net/MessageBoard/admin/templates.php on line 676

I upgraded to 1.1 earlier today. Could that be the problem? Sad
Have you made any changes to templates.php? Such as adding new template groups to be shown?

If you could take a look on line 68, tell me what you see.

Chris
Nope. I wouldn't know how to do that. I have very little experience with PHP.

Lines 68-94 (in Dreamweaver MX 2004):

$templategroups['calendar'] = $lang->group_calendar;
$templategroups['editpost'] = $lang->group_editpost;
$templategroups['email'] = $lang->group_email;
$templategroups['emailsubject'] = $lang->group_emailsubject;
$templategroups['forumbit'] = $lang->group_forumbit;
$templategroups['forumjump'] = $lang->group_forumjump;
$templategroups['forumdisplay'] = $lang->group_forumdisplay;
$templategroups['index'] = $lang->group_index;
$templategroups['error'] = $lang->group_error;
$templategroups['memberlist'] = $lang->group_memberlist;
$templategroups['multipage'] = $lang->group_multipage;
$templategroups['private'] = $lang->group_private;
$templategroups['portal'] = $lang->group_portal;
$templategroups['postbit'] = $lang->group_postbit;
$templategroups['redirect'] = $lang->group_redirect;
$templategroups['showthread'] = $lang->group_showthread;
$templategroups['usercp'] = $lang->group_usercp;
$templategroups['online'] = $lang->group_online;
$templategroups['moderation'] = $lang->group_moderation;
$templategroups['nav'] = $lang->group_nav;
$templategroups['search'] = $lang->group_search;
$templategroups['showteam'] = $lang->group_showteam;
$templategroups['reputation'] = $lang->group_reputation;
$templategroups['newthread'] = $lang->group_newthread;
$templategroups['newreply'] = $lang->group_newreply;
$templategroups['member'] = $lang->group_member;
$templategroups['cm'] = $lang->cm_template_group;
Heloo there
Chris meant 668

Please find

// Query for custom templates
what's below should look as

$query2 = $db->query("SELECT t1.* FROM ".TABLE_PREFIX."templates t1 LEFT JOIN ".TABLE_PREFIX."templates t2 ON (t1.title=t2.title AND t2.sid='-2') WHERE t1.sid='".$set[sid]."' AND ISNULL(t2.template) ORDER BY t1.title ASC");
			while($template = $db->fetch_array($query2))
			{
				$template['customtemplate'] = 1;
				$templatelist[$template['title']] = $template;
			}

			// Query for original templates
			$query3 = $db->query("SELECT t1.title AS originaltitle, t1.tid AS originaltid, t2.tid FROM ".TABLE_PREFIX."templates t1 LEFT JOIN ".TABLE_PREFIX."templates t2 ON (t2.title=t1.title AND t2.sid='".$set[sid]."') WHERE t1.sid='-2' ORDER BY t1.title ASC");
			while($template = $db->fetch_array($query3)) {
				$templatelist[$template['originaltitle']] = $template;
			}
			reset($templatelist);
			ksort($templatelist);
			foreach($templatelist as $template)

however it would be easier for u , to repload templates.php
regards
All fixed! Smile