MyBB Community Forums

Full Version: Where can I edit templates? (rather than ACP)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

Hmm, due to current frustrating problems with my host, I need a work around to edit templates without the need to do that through the ACP. Can I do that through the database directly? Or...are there any 'physical' files for the templates like the language files?

Thanks a lot!
why wouldn't you be able to edit it in in the acp? if you have access to the db and language files as you stated why would you not be able to edit via acp..., is it a chmod perms issue? and just curious..., also on some hosts disabling codepress solves editing issues. also you could just export the default theme and edit the templates sections needed via the the themes .xml file and re-upp when you are finished all the edits you need.
Na, it's probably a mod_security problem as Dennis suggested in this thread:

http://community.mybboard.net/thread-42788.html

Anyway, is there any solution?
(2009-01-01, 05:07 PM)youssef93 Wrote: [ -> ]Na, it's probably a mod_security problem as Dennis suggested in this thread:

http://community.mybboard.net/thread-42788.html

Anyway, is there any solution?



Try this first i had that prob once and this worked:

The htaccess.txt that comes with the MyBB package disables mod_security by default. If you haven't already, rename the htaccess.txt file to ".htaccess" (without the quotation marks, note the leading dot in the filename).

If nothing else helps then:

If confirmed that mod_security is enabled on your server, you can try to ask your webhost to "whitelist" your domain to bypass mod_security.
Yeah, already contacted them...But it'll take them a while..But what I mean is, I want to add the newsbar code in the headerinclude template, isn't there any alternative mean?

What if I imported a theme which has the edited headerinclude template that I want included in it so that it is imported when I import the theme?

What should I edit in the themes xml file if that's possible?

I know that this might not be a definite solution but if it works, it'll get things going until the host resolves the issue.

Any input will be highly appreciated...Thanks!
(2009-01-01, 05:14 PM)youssef93 Wrote: [ -> ]Yeah, already contacted them...But it'll take them a while..But what I mean is, I want to add the newsbar code in the headerinclude template, isn't there any alternative mean?

What if I imported a theme which has the edited headerinclude template that I want included in it so that it is imported when I import the theme?

What should I edit in the themes xml file if that's possible?

I know that this might not be a definite solution but if it works, it'll get things going until the host resolves the issue.

Any input will be highly appreciated...Thanks!

first i would try renaming your htacess file seriously.


but to answer your question...., if you have the theme you want open the themes .xml file in your favorite text editor or xml editor scroll through the code until you find the header include section and add the necessary code you want added and save the file..., then install said theme..., you can do total theme and template edits via your xml file if you know what you are doing..., i suggest exporting the theme and selecting the option to include all template and theme files for that particular theme as it will include all the necessary sections for said theme.


for example on the default theme this is the section you are looking for in the .xml file:

<template name="headerinclude" version="1400"><![CDATA[<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1400"></script>
{$stylesheets}
<script type="text/javascript">
<!--
	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var imagepath = "{$theme['imgdir']}";
// -->
</script>
{$newpmmsg}]]></template>
		<template name="showthread_similarthreads" version="120"><![CDATA[<br />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" align="center" colspan="6"><strong>{$lang->similar_threads}</strong></td>
</tr>
<tr>
<td class="tcat" align="center" colspan="2"><span class="smalltext"><strong>{$lang->thread}</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>{$lang->author}</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>{$lang->replies}</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>{$lang->views}</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>{$lang->lastpost}</strong></span></td>
</tr>
{$similarthreadbits}
</table>]]></template>
The headerinclude template is shown in the <head> </head> section of the page. You probably do not want to put your news bar there. Instead you want to put it in the header template.
I meant the CSS for the newsbar, Dennis. Not the newsbar itself. Thanks for the tip anywaySmile Oh, thanks a lot for the help guys. I managed to get it solved with the host. They just asked for the URL where the problem was occurring and in an hour, I received an email containing one word: "Solved." Anyway, thanks a lot for the help, guys!Smile