Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: How 2 add new {CUSTOM_...}? Trying 2 work around omitted <body> in custom header  (Read 3579 times)

0 Members and 1 Guest are viewing this topic.

TwilightRealm

  • Coppermine newbie
  • Offline Offline
  • Posts: 17

Not always fond of netspeak but had to in order to fit what I wanted to express in the subject.

I have a template for my site. It's header.php and header1.php.

header.php contains the html and head info, and header1.php contains the end head info and body layout. I have them as two separate info so that each page can call the two, and if need be, I can put information between the includes for something the page may require in the head area.

At first I thought it was easy enough just to put both includes in the custom header.php in the root of my gallery, until I read that it omits <head>, <body>, </head>. Now in view source it has everything but those.

Now, thanks Coppermine (...), I've put the top html information like doctype in template.html and then put {CUSTOM_HEADER}, and in header.php I have it linked to something now called header-extra.php, which is header.php without that top html information. For the rest of my site, so it won't interfere, I have now in header.php the top information and then header-extra.php in an include.

If this doesn't make sense for people, just focus on someone doing extra work, grumbling and grunting until they've semi-accomplished trying to get tags in. Now I have the html, the head stuff from the include that counts as my custom header, and the <body> tag in template.html.

I figured I could do the same with my header1.php thing, put <body> in there and link the rest of the layout scripting from an include file. And for the purposes of the gallery, from a custom file link the extra include file (and not header1.php but something like header1-extra.php).

However, in order to do this, I figured I'd have to do this (please correct me if I'm wrong):

themes/----/templates.html
just after <body>:
insert {CUSTOM_HEADER1}

includes/themes.inc.php
just after
'{CUSTOM_HEADER}' => $custom_header,
insert
'{CUSTOM_HEADER1}' => $custom_header1,

just after
$custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);
insert
$custom_header1 = cpg_get_custom_include($CONFIG['custom_header1_path']);

english.php

just after
//cpg1.4
  array('Path to custom header include', 'custom_header_path', 0, 'f=index.htm&amp;as=admin_theme_include_path_start&amp;ae=admin_theme_include_path_end'),

insert
//cpg1.4
  array('Path to custom header1 include', 'custom_header1_path', 0, 'f=index.htm&amp;as=admin_theme_include_path_start&amp;ae=admin_theme_include_path_end'),

In SQL:
INSERT INTO CPG_config VALUES ('custom_header1_path', '');

then create header1.php
insert
<?php
include("../header1-extra.php");
?>

Am I close?
« Last Edit: July 09, 2006, 11:42:06 am by GauGau »
Logged

TwilightRealm

  • Coppermine newbie
  • Offline Offline
  • Posts: 17

Close but no cigar, just tested it.

Isn't there some way I can remove whatever's taking the head and body tags out? If not, then this is what I have to go for:

template.html
doctype info
<html>
{CUSTOM_HEADER} (has php include to meta tags)
</head>
<body>
{CUSTOM_HEADER1} (has page layout)
rest of template.html
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de

I don't understand everything you're trying to say, but why don't you just leave the {CUSTOM_HEADER} token as it is and make the custom header include to a file that actually contains the includes to your two other files? This way, you won't have to fiddle with the code in future updates and keep things nice'n easy.
Logged

TwilightRealm

  • Coppermine newbie
  • Offline Offline
  • Posts: 17

My site template spans from <html> to past <body> to include the layout. If I can only include </head><body> then that would mean I'd have to split it into two parts, correct? But if even putting </head><body> in header.php is going to make it disappear, if it HAS to be in template.html, then that would split what I want in two parts, wouldn't it?
Logged

TwilightRealm

  • Coppermine newbie
  • Offline Offline
  • Posts: 17

Nevermind, I just ended up commenting out the things that were taking out the <body> and other tags.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.