Revert to cached template

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Mai
Registered User
Posts: 12
Joined: Wed Sep 08, 2010 5:36 am

Revert to cached template

Post by Mai »

Well, it seems one of our staff members got a little too hasty with a color scheme of a theme, and installed that theme on our board. Well...somehow, someway...when he did this templates were...how should I say..."ghosted" for lack of a better expression.

Basically, I am using templates from prosilver on the board.
Those templates are being echoed across one style as I had them modified.
However, when I go to edit those templates, the template for the alternative theme, Modestus comes up, instead of the modified prosilver theme that is being displayed on the forum.

This seems really hard to explain, and I hope I've done a good enough job with it.

Is there anyway, to restore the templates so that the modified prosilver template comes up instead of the now-deleted Modestus template file? I'm not sure how this happened, it all seems awry to me. (I think my being tired has also impacted my ability to explain as well. :? )
Last edited by stevemaury on Wed Oct 13, 2010 1:33 am, edited 2 times in total.
Reason: Topic icon changed

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51350
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Revert to cached template

Post by stevemaury »

ACP, Styles tab, Refresh template, theme and imageset for your style.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Mai
Registered User
Posts: 12
Joined: Wed Sep 08, 2010 5:36 am

Re: Revert to cached template

Post by Mai »

Okay, so refresh's function is designed to restore templates to what they are in the cache?
I was under the impression that was designed to make sure templates stored in the system reflect on the live board.

Pit$Bull
Former Team Member
Posts: 23099
Joined: Sat Dec 02, 2006 4:08 pm
Name: Can't Remember

Re: Revert to cached template

Post by Pit$Bull »

Mai wrote:so refresh's function is designed to restore templates to what they are in the cache?
No, it reflects the changes made to the files.

EDIT: You need to be making edits to the actual files not through the ACP editor.

Mai
Registered User
Posts: 12
Joined: Wed Sep 08, 2010 5:36 am

Re: Revert to cached template

Post by Mai »

Pit$Bull wrote:No, it reflects the changes made to the files.

EDIT: You need to be making edits to the actual files not through the ACP editor.
Can I ask what phpBB's template editing system is designed for then?
That seems a little redundant.

So, in short there's noway to pull files from the cache and restore them back onto the site? The correct files have been cached by the board, is there no way to pull them?

Pit$Bull
Former Team Member
Posts: 23099
Joined: Sat Dec 02, 2006 4:08 pm
Name: Can't Remember

Re: Revert to cached template

Post by Pit$Bull »

The ACP edit is for testing and can be used but if you need to purge your cache they will be gone forever.
The proper way to make permanent changes is by editing the files using a good text editor like Notepad++ saving all files using UTF-8 without BOB, and using a FTP client such as FileZilla for upload/downloads.

Mai
Registered User
Posts: 12
Joined: Wed Sep 08, 2010 5:36 am

Re: Revert to cached template

Post by Mai »

I can edit them outside of the board just fine, was just a generic question. Sorry.

In the meantime, are these files strait-shot gone?

Pit$Bull
Former Team Member
Posts: 23099
Joined: Sat Dec 02, 2006 4:08 pm
Name: Can't Remember

Re: Revert to cached template

Post by Pit$Bull »

What files?

Mai
Registered User
Posts: 12
Joined: Wed Sep 08, 2010 5:36 am

Re: Revert to cached template

Post by Mai »

(I'm so used to calling templates, files...I'm sorry).

The templates. As said, the templates that are being displayed in the acp editor show completely different from the ones that are being displayed on the forum. I can't find the files that the forum is actually using anywhere, except in the cache.

Those templates which are in the cache are the correct files that I want to use, but these templates all use the raw php strings...I'm not so much for turning php on in templates if I don't have to either.

What I've been asking is, if there is a way to restore the templates being used to the templates which are in the cache?

Pit$Bull
Former Team Member
Posts: 23099
Joined: Sat Dec 02, 2006 4:08 pm
Name: Can't Remember

Re: Revert to cached template

Post by Pit$Bull »

You can revert back to your hard coded files by clearing the board cache or following these instructions
stevemaury wrote:ACP, Styles tab, Refresh template, theme and imageset for your style.

User avatar
PlanetStyles.net
Former Team Member
Posts: 4573
Joined: Wed Nov 04, 2009 11:16 pm
Location: UK
Name: Christian
Contact:

Re: Revert to cached template

Post by PlanetStyles.net »

Mai wrote:What I've been asking is, if there is a way to restore the templates being used to the templates which are in the cache?
The best way to do this is to copy / paste the contents from the specific template files in the ACP, into the actual template file in the file system. So for example, if you've edited overall_header.html in the ACP, you need to go to the same screen in the ACP where you'd edit overall_header.html, but copy all of the code into the overall_header.html file on the file system. You need to do this for every file you've edited. Once you've done this, refresh the template cache.

The same kind of applies for stylesheets. If you haven't made any significant edits to the stylesheets I would recommend just clearing the theme cache to revert to the style info in the actual stylesheets. If you have made significant edits, then copy everything from the ACP "theme" editor, and paste it into stylesheet.css (overwriting all of the includes).
Mai wrote:Can I ask what phpBB's template editing system is designed for then?
That seems a little redundant.
I definitely agree and see where you're coming from, it's not brilliant by any means. I've heard a couple of reasons as to why its there including "It's better to have some kind of editor as opposed to no editor", "It's there for emergencies" and "It's there for people who don't have FTP access". The problem is (as you now know), any edits made through the editor are cached, so when the cache is cleared they all disappear. The ACP editor was probably designed with the Development Team expecting people to use either the ACP editor or edit template files directly, not both.

Theme caching is being removed in phpBB 3.1, though I don't know about the template editor. I've heard a few mentions of "the ACP editor will be removed completely in future versions of phpBB" , though as I'm not active on our Development Board (Area51) I'm not 100%. If you're wondering about the future of the ACP editor, you're welcome to sign up and ask over at Area51.

If you need any other help or information, please feel free to ask. :)
🚀 Premium phpBB StylesPremium phpBB 3.3 StylesphpBB sidebar Extension
Previously known as Christian 2.0

Mai
Registered User
Posts: 12
Joined: Wed Sep 08, 2010 5:36 am

Re: Revert to cached template

Post by Mai »

Well, what it appears is I'll have to do a makeshift backup and perform the steps that Christian has outlined.
As there are excessive modifications to the templates, will have to pull those cached templates out of the system and temporarily turn php in templates on while I reimpliment the else and if statements back into the templates themselves.

I know what I'll be doing Friday.

Thanks for the help guys. Looks like I will be making a few tweaks to that editor though, I'm too used to doing things via the board when it comes to styles.

Thanks again. :)

User avatar
PlanetStyles.net
Former Team Member
Posts: 4573
Joined: Wed Nov 04, 2009 11:16 pm
Location: UK
Name: Christian
Contact:

Re: Revert to cached template

Post by PlanetStyles.net »

Mai wrote:will have to pull those cached templates out of the system and temporarily turn php in templates on while I reimpliment the else and if statements back into the templates themselves.
Woah woah woah, stop there.

You needn't go anywhere near the /cache/ directory. Whatever you see in the ACP editor is the cached template file, which is then compiled into index.php, viewtopic.php etc... So rather than copying the code from the template files cached in the /cache/[c] directory, you just need to take the code from the edit page in the ACP.
🚀 Premium phpBB StylesPremium phpBB 3.3 StylesphpBB sidebar Extension
Previously known as Christian 2.0

narqelion
I've Been Banned!
Posts: 7235
Joined: Sat Dec 13, 2008 5:00 pm
Contact:

Re: Revert to cached template

Post by narqelion »

Mai wrote:Can I ask what phpBB's template editing system is designed for then? That seems a little redundant.
The ACP Style editor was designed to ....edit styles via the ACP. I know that is shocking, right? :P What you have to remember is that templates and stylesheets can be stored in two places, the filesystem or the db. Whether phpBB (specifically the web server user PHP is running as) has write access to the template files will determine what happens when you edit them via the ACP. If PHP can, it will write those changes directly to the files stored on the filesystem.
phpBB3 ACP wrote:Here you can edit your template set directly. Please remember that these edits are permanent and cannot be undone once submitted. If PHP can write to the template files in your styles directory any changes here will be written directly to those files. If PHP cannot write to those files they will be copied into the database and all changes will only be reflected there.
The same is true for stylesheets except in the case of multiple stylesheets parsed into one, i.e. Prosilver, which because of how it is parsed can only be stored in the database.
Mai wrote:Looks like I will be making a few tweaks to that editor though, I'm too used to doing things via the board when it comes to styles.
You don't have to do much tweaking, just make sure PHP can write to the files and don't use parsed stylesheets. ;)

Mai
Registered User
Posts: 12
Joined: Wed Sep 08, 2010 5:36 am

Re: Revert to cached template

Post by Mai »

That's just the thing though Christian, the code in the admin cp IS NOT the code in the cache or even the code that is being used to display the page.

It is also not the code in the files in /templates/.

Allow me to show you:

This is from the beginning of the body to 10 lines after that shows in the ACP editor:

Code: Select all

<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
	
<div id="wrap">
	<a id="top" name="top" accesskey="t"></a>
	<div id="page-header">
		<div class="headerbar">
                    <div class="inner">
			<div id="site-description">
				<!-- IF $ENABLE_MODESTUS_LOGO -->
				<a href="<!-- IF $MODESTUS_LOGO_LINK -->{$MODESTUS_LOGO_LINK}<!-- ELSE -->{U_INDEX}<!-- ENDIF -->" title="{L_INDEX}" id="logo"></a>
				<!-- ENDIF -->
This is the first 10 lines after body in the templates stored on the server:

Code: Select all

<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">

<div id="wrap">
	<a id="top" name="top" accesskey="t"></a>
	<div id="page-header">
		<div class="headerbar">
			<div class="inner"><span class="corners-top"><span></span></span>

			<div id="site-description">
				<a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>
				<h1>{SITENAME}</h1>
and here's the kicker, the first ten lines of the raw code (granted I'm aware that this is parsed data, but it will prove my point)

Code: Select all

<body id="phpbb" class="section-forums ltr">
<script language="JavaScript" type="text/javascript" src="/styles/wz_tooltip.js"></script>
<div id="wrap">
	<a id="top" name="top" accesskey="t"></a>
	<div id="page-header">
		<div class="headerbar">
			<div class="inner"><span class="corners-top"><span></span></span>
 
			<div id="site-description">
				<a href="/" title="Board index" id="logo"><img src="./styles/prosilver/imageset/site_logo.gif" width="655" height="136" alt="" title="" /></a>
				<p class="skiplink"><a href="#start_here">Skip to content</a></p>
As I said, not a one is the same. This is why I'm confused.

Locked

Return to “[3.0.x] Support Forum”