|
Post by Lucas on Sept 6, 2006 3:40:27 GMT -5
I was wondering if I could let GM fetch the data from an external document to be used as header for the control panel, like an include function. Currently the header is fixed in the gm-library.cgi file ($gmheadtag). Can someone explain to me how I can combine it with an include command? e.g. $gmheadtag = include file="../httpdocs/header.html" but then in working code ? I have no scripting knowledge whatsoever so every help will be much appreciated!
|
|
|
Post by coldstone on Sept 7, 2006 11:57:41 GMT -5
hmm, I am sure there are better ways that I am about to suggest (like perl server-side includes), but I think this code should work:
open MYFILE "../httpdocs/header.html" || gm_dangermouse("Could open header file!"); my @headerfile = <MYFILE>; close MYFILE; $gmheadtag = join( '', @headerfile );
Basically this will slurp in your header file and then create a single line out of it. I am relying on my memory here, so you will want to look at other examples of opening a file and taking it in (search for 'open').
Also, you might have to modify more than one variable, I found that there was another variable that held the gm admin header information (I think it was gmheader2 or something). If it doesn't seem to be using your new header, just view source and find some bit of text to identify the header then look around gm-library.cgi for that same text.
|
|
|
Post by petefinnigan on Sept 7, 2006 15:45:34 GMT -5
|
|
|
Post by coldstone on Sept 7, 2006 22:05:13 GMT -5
Neat, that is kinda cool. That definatly makes gm even more flexible.
|
|
|
Post by Lucas on Sept 12, 2006 3:11:50 GMT -5
Sweet, thanks for the replies, I`ll start experimenting right away!
|
|