Trouble Including Files in Templates

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
profpete
Registered User
Posts: 140
Joined: Wed Dec 08, 2004 10:49 pm
Location: Wales, UK

Re: Trouble Including Files in Templates

Post by profpete » Fri Jan 05, 2007 10:26 am

chmod 660 on normal files would surely be better and more secure than giving the whole world write access!

JoSch
Registered User
Posts: 5
Joined: Sun Dec 24, 2006 8:47 am

Re: Trouble Including Files in Templates

Post by JoSch » Fri Jan 05, 2007 3:30 pm

Unfortunately this is not possible.
I don't have root access on my server so I'm not able to change the owner of my uploaded files from me to 'apache'.
Therefore I have to change it to xx7 - yes, write access for everybody, but only on a few files/foldes.

User avatar
Acyd Burn
Posts: 1838
Joined: Tue Oct 08, 2002 5:18 pm
Location: Behind You
Contact:

Re: Trouble Including Files in Templates

Post by Acyd Burn » Fri Jan 05, 2007 3:37 pm

why not 644? :o

Image

TechnoBuddhist
Registered User
Posts: 3
Joined: Mon Mar 19, 2007 4:15 pm

Re: Trouble Including Files in Templates

Post by TechnoBuddhist » Mon Mar 19, 2007 5:06 pm

Hi,

I've gone through this thread and tried everything suggested and nothing is working. A couple of weeks ago when I installed phpBB3 and was working on our site, I managed to create an include file that works no problem;

Code: Select all

'adsense1.html'

<div style="text-align:center;">
	<script type="text/javascript"><!--
		google_ad_client = "pub-xxxxxxxx";
		google_ad_width = 728;
		google_ad_height = 90;
		google_ad_format = "728x90_as";
		google_ad_type = "text_image";
		google_ad_channel = "";
		google_color_border = "FFFFFF";
		google_color_bg = "FFFFFF";
		google_color_link = "006699";
		google_color_url = "006699";
		google_color_text = "000000"; //-->
	</script>
	<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</div>
When I use the ACP to edit the template pages, I can see 'adsense1' in the dropdown list of templates and it is also in the DB table 'styles_template_data'.

This shows my adsense ads no problem when used with <!-- INCLUDE adsense1.html -->. Problem is I honestly don't remember how I created adsense1.html, probably created locally and FTP'd it.

I want a different styled version of my adsense ads, so I created 'adsense2.html' and dropped it in the templates folder. It is an exact copy of 'adsense1' and is in the same folder. Both have the same permissions of 604(as do all other template files).

When using <!-- INCLUDE adsense2.html --> I get nothing! 'adsense2' isn't in the list of cached files either. This is exactly the same result I get when using the example for the Ipsum Lorum myfile.html example given above.

Is it something to do do with the DB table 'styles_template_data'? Using MySQL Administrator I am unable to add an entry for adsense2 because it is write protected, are the permissions somehow screwed up and is this the problem? Is there a way in ACP to create a template which adds it to the DB rather than creating a template offline and FTP'ing it to the template folder?

FYI, I'm on a windows server, using SQL.

[edit] I've also tried doing a 'Refresh' of templates and that hasn't made any difference, which is probably unsurprising given the permissions on the table.

TechnoBuddhist
Registered User
Posts: 3
Joined: Mon Mar 19, 2007 4:15 pm

Re: Trouble Including Files in Templates

Post by TechnoBuddhist » Mon Mar 19, 2007 6:54 pm

A fix! The permission on my DB are a temporary issue. I've managed to add an entry to the 'styles_template_data' table called adsense2. This now appears in the dropdown of templates. I pasted in the code et voila it works!

It's obviously not supposed to be this way, does anybody have any ideas why it doesn't work using the methods above?

plasticmind
Registered User
Posts: 8
Joined: Thu Dec 07, 2006 10:50 pm

Re: Trouble Including Files in Templates

Post by plasticmind » Mon Mar 19, 2007 9:42 pm

Wow, great find. I'll try it and let you know if it works with my issues.

TechnoBuddhist
Registered User
Posts: 3
Joined: Mon Mar 19, 2007 4:15 pm

Re: Trouble Including Files in Templates

Post by TechnoBuddhist » Tue Mar 20, 2007 9:49 pm

Hmmmm.... just reinstalled on the server and everything is working fine!! I can see my 2 files in the dropdown in 'Edit template'.

My 2 files adsense1.html and adsense2.html were in the templates folder before I started the installation, but I've just confirmed that a new test file added after installation can now also be seen in the dropdown too.

Moral of this tale...... try and test as much as you can with your new install, before adding mods and changing things.

Post Reply