MyBB Central

Full Version: cannot edit templates in blue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi, when I save a template that is in blue the changes do not show up, but all the other templates work, so it must be something to do with it being blue.

i am trying to change a forumbit_forum template

thanks
Blue links are just templates that have not yet been edited. They should edit just fine.
Ahh crap, if it isn't the normal link colour, a blue template name means it's a non-default template, and if a template that is actually default is in blue, it's bad news, because, as you've seen, changes won't be saved. This is usually caused by a plugin deleting the master copy of the template, and need an SQL query to add the master copy back... I'll edit it in in a bit.

Edit: Which forumbit template is it?? Can't give you the query without that.
Thanks.
forumbit_depth2_cat
Ok, give this a go, make sure you have the entire query...

PHP Code:
INSERT INTO mybb_templates (title,template,sid,versionVALUES('forumbit_depth2_cat''<tr>
<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['
imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" /></td>
<td class="{$bgcolor}" valign="top">
<strong><a href="{$forum_url}">{$forum['
name']}</a></strong>{$forum_viewers_text}<div class="smalltext">{$forum['description']}{$subforums}</div>
</td>
<td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$threads}{$unapproved['
unapproved_threads']}</td>
<td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$posts}{$unapproved['
unapproved_posts']}</td>
<td class="{$bgcolor}" valign="top" align="right" style="white-space: nowrap">{$lastpost}</td>
</tr>'
'-2''1400'); 
Hi,

I'm in php_myadmin and opened "Run SQL query/queries on database".

which table to I run the sql query?
Once you click the database name, you can click the SQL tab along the top and paste the code in there.
Sad

Error

SQL query:

INSERT INTO mybb_templates( title, template, sid, version )
VALUES (
'forumbit_depth2_cat', '<tr> <td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme['imgdir ']}/{$lightbulb['folder ']}.gif" alt="{$lightbulb['altonoff ']}" title="{$lightbulb['altonoff ']}" class="ajax_mark_read" id="mark_read_{$forum['fid ']}" /></td> <td class="{$bgcolor}" valign="top"> <strong><a href="{$forum_url}">{$forum['name ']}</a></strong>{$forum_viewers_text}<div class="smalltext">{$forum['description ']}{$subforums}</div> </td> <td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$threads}{$unapproved['unapproved_threads ']}</td> <td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$posts}{$unapproved['unapproved_posts ']}</td> <td class="{$bgcolor}" valign="top" align="right" style="white-space: nowrap">{$lastpost}</td> </tr>', '-2', '1400'
)

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$li' at line 1
Dammit, always forget to escape things... try this.

INSERT INTO mybb_templates (title,template,sid,version) VALUES('forumbit_depth2_cat', '<tr>
<td class="{$bgcolor}" align="center" valign="top" width="1"><img src="{$theme[\'imgdir\']}/{$lightbulb[\'folder\']}.gif" alt="{$lightbulb[\'altonoff\']}" title="{$lightbulb[\'altonoff\']}" class="ajax_mark_read" id="mark_read_{$forum[\'fid\']}" /></td>
<td class="{$bgcolor}" valign="top">
<strong><a href="{$forum_url}">{$forum[\'name\']}</a></strong>{$forum_viewers_text}<div class="smalltext">{$forum[\'description\']}{$subforums}</div>
</td>
<td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$threads}{$unapproved[\'unapproved_threads\']}</td>
<td class="{$bgcolor}" valign="top" align="center" style="white-space: nowrap">{$posts}{$unapproved[\'unapproved_posts\']}</td>
<td class="{$bgcolor}" valign="top" align="right" style="white-space: nowrap">{$lastpost}</td>
</tr>', '-2', '1400');
That worked but now for some reason the template still won't edit and it is not in blue.