Skip to content

Commit dab76c4

Browse files
committed
Support for insertion of custom code into <head>
1 parent b80f9a2 commit dab76c4

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

config.sample.php

+8
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,14 @@ public static function orderlogDirectory()
345345
"UseDebug" => false // If this is set to true mail will be output to the browser instead of sent, useful for debugging
346346
);
347347

348+
/**
349+
* Something to add into the header, within <head></head>, as analytics now needs to be embedded there.
350+
*/
351+
public static function customHeader()
352+
{
353+
return '';
354+
}
355+
348356
/**
349357
* Something to add after everything else has been printed off (except '</body></html>'), useful for
350358
* things like Google Analytics, or web-rings

install/1.69-1.70/readme.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
Changelog
22
---------
3+
4+
- Added customHeader to config.php to allow injecting custom content into <head></head> (e.g. the new Google analytics)
5+
Warning: if you previously had a config.php you will need to copy this function from config.sample.php into your config.php

lib/html.php

+3
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ static public function prebody ( $title, $noindex = false )
553553
554554
<script type="text/javascript" src="'.l_j('javascript/desktopMode.js').'?ver='.JSVERSION.'"></script>
555555
<title>'.l_t('%s - webDiplomacy',$title).'</title>
556+
'.
557+
Config::customHeader()
558+
.'
556559
</head>';
557560
}
558561

0 commit comments

Comments
 (0)