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: Custom Headers  (Read 6772 times)

0 Members and 1 Guest are viewing this topic.

rvblog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Custom Headers
« on: January 18, 2005, 10:38:26 pm »

Trying to integrate hardwired theme in CPG 1.3.2

I read the FAQ at:

http://coppermine.sourceforge.net/faq.php#customHeader

I read the thread at:

http://forum.coppermine-gallery.net/index.php?topic=9863.msg44244#msg44244

and followed all the instructions as far as I know.


But I'm getting this error:

Fatal error: Call to undefined function: theme_main_menu() in /usr/local/psa/home/vhosts/rvadventure.ca/httpdocs/photos/themes/hardwired/theme.php on line 931

This is line 931 in theme.php:      '{MAIN_MENU}' => theme_main_menu(),


Any ideas what I need to add or correct ??

Thanks

« Last Edit: January 20, 2005, 06:27:38 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Custom Headers
« Reply #1 on: January 19, 2005, 07:14:14 am »

What do you mean by saying
Trying to integrate hardwired theme in CPG 1.3.2
Hardwired already comes with coppermine, there's no need to use a custom header, what exactly do you want to accomplish? Please post a link to your site.

Joachim
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Custom Headers
« Reply #2 on: January 19, 2005, 07:57:56 am »

If I'm not mistaken hardwired uses a split menu, so it doesn't have a $theme_main_menu; it has a $theme_main_menu1 and $theme_main_menu2.

You probably shouldn't be messing with the tokens {MAIN_MENU1}{MAIN_MENU2)

you should be adding your custom header token to the pageheader section such as the docs imply:

theme.php pageheader function
Code: [Select]
     '{CUSTOM_HEADER}' => $custom_header,

theme.php somewhere near the top
Code: [Select]
$custom_header=<<<EOT

whatever I want it to say

EOT;

And add the token to the template.html where you would like it in the final output.
template.html between <body> and {GALLERY}    (If it's below {GALLERY} then it needs to go into the pagefooter function)
Code: [Select]
{CUSTOM_HEADER}
Logged

rvblog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Custom Headers
« Reply #3 on: January 19, 2005, 10:14:58 pm »

@GauGau:

I said: Trying to integrate hardwired theme in CPG 1.3.2
I did not say: Trying to integrate hardwired theme into CPG 1.3.2

Quote
Hardwired already comes with coppermine
I got the theme from inside of coppermine to begin working on it - so obviously I knew that it comes with coppermine.

Ever since I started asking questions in here you've been giving me a hard time - maybe you don't like helping old retired guys - but I can't help that.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Custom Headers
« Reply #4 on: January 19, 2005, 10:30:06 pm »

@GauGau:

I said: Trying to integrate hardwired theme in CPG 1.3.2
I did not say: Trying to integrate hardwired theme into CPG 1.3.2
Actually, the key word is integrate, which implied hardwired was separate from cpg. So it's like saying "Take that thing away to me." GauGau was merely (and politely) asking for clarification of a statement. Since in your own mind it made sense, you didn't take into consideration it might not make sense to someone else. People aren't trying to make things hard on you but trying to help you. GauGau could have just passed on helping you but no, he asked for clarification and for more information on your site so that he could take the time to help you.
Logged

rvblog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Custom Headers
« Reply #5 on: January 19, 2005, 10:52:42 pm »

@donnoman:

Thanks for the answer - but my problem is not with the menu - at least not yet because I haven't got that far.  My problem is:  I cannot get coppermine to include my header and footer files.

I'll try and give you as much detail as I can:


I'm trying to use Coppermine version 1.3.2 and I want to use the hardwired theme to start with.

My Coppermine files were installed on my server in the following directory:  http://www.rvadventure.ca/photos

The hardwired theme is in the default directory:    http://www.rvadventure.ca/photos/themes/hardwired


I am also using Wordpress version 1.5 for my website - I am new to that as well but I learned enough about over the past coupleof months to understand the fundamentals - retired guys have a lot of time on their hands.

A page in Wordpress 1.5 is split up into 3 files (actually 4 if you count the sidebar menu - but I'm planning on using a 1 column layout on my site).

I has an index.php file that includes separate header.php and footer.php files.

Wordpress is installed in the root directory . My header and footer files are located in the following theme directory:

http://www.rvadventure.ca/wp-content/themes/lilbit/header.php    and    http://www.rvadventure.ca/wp-content/themes/lilbit/footer.php

I would like my coppermine hardwired theme to include my header and footer files but I keep getting errors.

I've included the header and footer files in a text file below ( the index.php files starts with <div id="content"> and ends with </div> so I didn't think you would need that file) - I had to put send a text file because I can't upload .rar files.



If you could provide andy direction I would appreciate it

Thanks
Logged

rvblog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Custom Headers
« Reply #6 on: January 19, 2005, 11:22:32 pm »

@TranzNDance

Listen,

I'm not here to fight - I just want to get coppermine up and running because my site has been down for 2 months and I want to share some photos with the family back home ( we are spending the winter down in Texas)

Maybe I'm a bit testy (it could be old age you know) - but maybe it's also because I've read so many topics in this forum, while I was trying to figure this issue out, that I just grew tired of seeing so many new people put down for some of the questions that they ask, or given hell because they did not understand or failed to follow an instruction properly.

But I have also been on the other side as well - and I know how tiresome it can get answering the same questions over and over again - I was a fulltime union official for 25 of the 32 yrs that I worked in a BIG 3 factory - and I took part in 7 sets of negotiations with the corporation that I worked for - so I do know a little bit about diplomacy - and that patience is a virtue that some do not possess.

Anyways, I don't know what I did personally, but I'm man enough to apoligize whatever it was - so, I'm sorry for being such a newbie and I apoligize for the unclear questions, and the typos, etc etc etc.
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Custom Headers
« Reply #7 on: January 20, 2005, 04:18:01 am »

@ryblog

I don't see how your'e gonna be able to add those headers and footers to coppermine, as they are calling wordpress functions that won't be available when coppermine is including those sections.

It's not gonna work right.

I would just suggesting taking the peices you can hardcode, and stick them into your template.html.

Theres a lot of replacement's going on that probably don't need to happen, as you KNOW what those values should be for your site.

I saw some things in there that you can't replace using the custom header method that you are using, such as the doctype. You can only put that in your template.html.

You'll wreak havoc on the page if you begin including <head> and <body> tags in your custom header.

My best suggestion would be for you to take and strip out the sections from a page that wordpress generated by doing a view source. Then sticking the appropriate pieces in your template.html and don't worry about the php and doing a custom header/footer inside theme.php.
Logged

rvblog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Custom Headers
« Reply #8 on: January 20, 2005, 06:22:13 am »

I really appreciate the help donnoman,

I would have preferred using my header and footer files because future changes to the website would have been a snap, but now that I know it can't be done that way, I can start working on the other way. Adding code sections to the coppermine theme template is the easy part. I know my way around html and css enough to get it to mimic my site in a couple of hours. It was all the php includes etc, something I know very little about, that was really screwing me up.

Now I can stop racking my brains out.

Thanks for taking the time to work with me on this issue - and hopefully, I can return the favour by helping someone else down the road.



Logged

rvblog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 62
Re: Custom Headers
« Reply #9 on: January 20, 2005, 03:57:43 pm »

Just out of curiosity:

As I said earlier, I had all kinds of problems getting coppermine to include my wordpress header.php and footer.php files. I dropped that idea on the advice of donnoman.

Late last night I tried the reverse. Yes, I got the dumb idea to try to get wordpress to include coppermine using a wordpress template to avoid all the function calling issues using the other method. Yes, I sure am a sucker for punishment I guess.

Anyways, I made this wordpress template:

Code: [Select]
<?php /*
         Template Name: Photo
      */
?>

<?php include "header.php"?>
<div id="content">
<h2>Coppermine Test Page</h2>
<?php include ("http://www.rvadventure.ca/photos/index.php"); ?>
</div>
<?php include('footer.php'); ?>

The results were:

The wordpress template loaded ok, my header and footer files were both intact, as was the overall layout structure of my webpage, and the hardwired theme was included inside of my content div along with all the empty boxes for my thumbnails etc.  (although hardwired's width would have to be adjusted later using css along with other things).

When I first saw it on the screen, I thought I finally had it, and almost knocked my coffee off the table - but I soon discovered that the links did not work.

Clicking on "user galleries" brought me to http://rvadventure.ca/index.php?cat=1 which was a category archive inside wordpress.

Clicking on "most viewed" brought me to a not found page.

So it appears that wordpress can include coppermine but once it is included, coppermine looks for its files within the wordpress structure. When I looked inside of the hardwired theme file, I checked out the links and noticed a lot of href= tags.


I understand wordpress ok, but you guys understand how coppermine works. So now my question is:

Is there some kind of code in the hardwired theme.php that can be added, removed, or changed that would allow coppermine, when included into the wordpress template, to look for files back in its own directory - in other words, all href= tags would link back to the coppermine directory.

I'm going to try over the next couple of days to change all href tags manually to see what happens.

It would be nice however, if there was one piece of code that you could add at the beginning of a theme.php that would redirect all link paths back to the coppermine directory.

This is closer than I got trying the other method, and now I'm hooked again on trying to resolve the problem.

If I'm lucky enough to get this working, I'm sure there would be several wordpress users who would move to coppermine. I could even post a "how to" on my website regarding wordpress and coppermine - again, as a way to return a favour and pass on the help that I got.

Any help would be appreciated

Thank you.
Logged

haxn

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Custom Headers
« Reply #10 on: September 19, 2005, 12:32:10 am »

If I'm not mistaken hardwired uses a split menu, so it doesn't have a $theme_main_menu; it has a $theme_main_menu1 and $theme_main_menu2.

You probably shouldn't be messing with the tokens {MAIN_MENU1}{MAIN_MENU2)

you should be adding your custom header token to the pageheader section such as the docs imply:

theme.php pageheader function
Code: [Select]
      '{CUSTOM_HEADER}' => $custom_header,

theme.php somewhere near the top
Code: [Select]
$custom_header=<<<EOT

whatever I want it to say

EOT;

And add the token to the template.html where you would like it in the final output.
template.html between <body> and {GALLERY}    (If it's below {GALLERY} then it needs to go into the pagefooter function)
Code: [Select]
{CUSTOM_HEADER}

I know this is a pretty old post, but I Just wanted to say for other people looking for a solution to include a custom header in the hardwired-theme:

Yes, it uses a split menu,that means  if you replace this:

Code: [Select]
'{MAIN_MENU}' => theme_main_menu(),

with this:

Code: [Select]
      '{MAIN_MENU1}' => theme_main_menu1(),
      '{MAIN_MENU2}' => theme_main_menu2(),

..it should work fine  :)
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 21 queries.