Recent Topics

1 Jun 28, 2015 15:21    

Version 6.5 http://elf.calstock.org.uk

I've noticed somewhere the notion not to have a modified [_html_header..inc.php] file in a custom folder as the file may be updated and the site won't come up.

I have been doing so for years and now have tried to use the option under Settings > Advanced but come across a few problems

I can add a tag to call an external js file and that works fine but I can't call one of the functions.
The idea is that I should be able to
<script>startclock()</script>
once the call to the script has been done, clearly the script hasn't been called so I'm back to placing the function call in the body tag and customising [_html_header..inc.php]

Is there an option to adding functions to the body tag? I can't see one.

A link tag to a favicon is a problem due to the closing syntax.
I'm using HTML5 but have to put &lt;/link> not to get an error "Tag <script> is not allowed within tag &lt;link"> if it is anywhere but the last item. If it is the last item it gets added automatically but then it will not validate as HTML5 as it has a stray end tag.

So I'm back to modifying the [_html_header..inc.php] again

EDIT UPDATE:

Don't know what's happening now but the javascript tags are not being picked up via the back office option so it's all go on modifying [_html_header..inc.php]

2 28 Jun 2015 16:05

Ok I've learnt calling from the body tag is old school and removed it with a new script
<script type="text/javascript">window.onload=startclock</script>
but this is still using [_html_header..inc.php]

If we call the script(s) in the body element we have achieved nothing, as we still mix markup and event calls.
http://onlinetools.org/articles/unobtrusivejavascript/chapter4.html

Now all I have to do is to get it working from the back office

EDIT UPDATE 30th June
Can't get this to work. Although the back office seems to accept three separate script lines they don't show in the source code.

It seems they are called in the [_html_header.inc.php] file
include_headlines()

So either the code is not being uploaded to the database and doesn't get included or some other reason it's not included.

Anyone an idea wher in the data base this info is kept and how it gets there and where and how the include_headlines() is and functions.

UPDATE 00:30
OK I have found where it is in the database by searching it as a text file. table is evo_coll_settings

For some reason there was javascript in the [footer_includes] row which should have been in the [head_includes]. So I deleted the footer content.In the head data I edited the link line, to remove the html4 closing tag so it conforms to html5, and added the three lines of javascript all to no avail.

Last UPDATE tonight
I'm getting into deep waters here.
I've just download the database and my code is where I expect it to be after manually editing it earlier, but the back office doesn't show it under Settings > Advanced but it did show an earlier version of the code I'd entered form the back office, So the back office isn't reading from the database for this feature. I can't see it being a cache issue.

So I'm back to adding the code the the [_html_header.inc.php] again

Obviously not the last edit.

I think I have it all working, I'd manually added the code to the wrong blog in the database so I ahve the end result now of not modifying the [_html_header.inc.php] file but I had to input the info manually via phpMyAdmin.

The strange thing is I have 4 blogs on that install and on at least one of the others it did accept a dummy meta tag with dummy name and contents.

Anyway will give this a miss as to what is wrong

So worked around for now

Thanks if any of you got around to reading this.

Bye

3 30 Jun 2015 03:51

Nope false alarm

It seems to work but it will not validate. I have my own [_html_header.inc.php] I made ages ago with an html5 doc type and reworked all the site to comply but having got the scripts in manually so as not to have a modified [_html_header.inc.php] it falls back to a preset in the fallback folders.

The problem then i it will not validate and if I get it to I will be back at XHTML4*

So I back to my own [_html_header.inc.php] file yet again.

Problems are that
1. The back office wants XHTML code I want to enter HTML5 code and I have to do that via a direct insert into the database
2. The default [_html_header.inc.php] files fall back to V5 and XHTML 1.0 Transitional

4 01 Jul 2015 18:42

Can you please copy/paste the exact code you'd like to insert into your HTML header so we can make tests?

Also please use the codespan and codeblock buttons here in the forums to mark your code and/or filenames. It will be much more readable.

5 02 Jul 2015 13:20

Hi Thanks

I know I've been asking a lot lately so it's very much appreciated.

This is the bit I been talking about that I add to my [_html_header.inc.php]


<link rel="icon" type="image/gif" href="http://calstock.org.uk/media/blogs/<?php echo $Blog->name  ?>/favicon.ico" />
<script type="text/javascript" src="http://calstock.org.uk/rsc/js/calendar.js"></script>
<script type="text/javascript" src="http://rogerlovejoy.net/search/scripts/search.js"></script>
<script type="text/javascript">window.onload=startclock</script>

CONTINUED IN NEXT POST as all wasn't accepted when I submitted my full reply??

6 02 Jul 2015 13:22

Continuation from previous post

and of course; as I can't get the header to be HTML5 I insert

<!DOCTYPE html>
<html lang="<?php locale_lang() ?>">


before the header

and I also have this so where the full url links are used I can have a local version and when I edit a file the header adjusts the path although I don't use my local host version that often anymore. It used to be important to work off-line.

<?php
if ($_SERVER['HTTP_HOST'] == "localhost")
  {
    $root = "http://localhost/basic/";
   }
  else
   {
   $root = "http://calstock.org.uk/";
   }


?>
So I would like to be able to insert bits of code in multiple places.
1. In the <head> section
2. Before the <head> tag
3. Before the <DOCTYPE> tag

I'm not asking for this functionality but have just come across the problem inserting what I want into the <head> section

It my be that I should just continue to keep my old [_html_header.inc.php] in my custom folder and hope there's nothing important in any newer version of that file.

Thanks

7 02 Jul 2015 23:06

Ok, so the way you would normally handle that would be to make an _html_header.inc.php that is NOT a duplication of the original one, but a wrapper around it. (This way, when we make mods to the original _html_header.inc.php , you automatically benefit from them)

So your _html_header.inc.php should basically do this:

  • execute the PHP it wants and set the variables it wants
  • use require_js() to set the scripts it wants to load
  • use 'add_headline()` if it absolutely has to inject other stuff in the header
  • skin_include() the original _html_header.inc.php by passing the appropriate params (like requesting an HTML5 doctype, etc.)

Is this detailed enough?

8 03 Jul 2015 22:58

OK I'll think on that and see if I can implement it.

Thank you


Form is loading...