SMFHacks.com

Modifications/Themes => Modifications Talk => Modification Showcase => Topic started by: Jump1979man on May 23, 2006, 03:11:08 pm

Title: 4. Global Headers and Footers
Post by: Jump1979man on May 23, 2006, 03:11:08 pm
Can someone show me a screen shot of this mod?

I have some idea of what it should be and would like to add it to my board but would like to check it out first.  Thanks.
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on May 23, 2006, 03:24:47 pm
(http://www.smfhacks.com/images/headerfooter.PNG)
Title: Re: 4. Global Headers and Footers
Post by: Jump1979man on May 23, 2006, 03:28:24 pm
Thanks for the pic!

Can you show me where it is located on the site?

Is it that google banner up top?


Where is the footer one located?
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on May 23, 2006, 03:47:07 pm
Header for most themes would be located under the menu bar.

Footer is right above the copyright line.
Title: Re: 4. Global Headers and Footers
Post by: Greyias on May 24, 2006, 04:30:52 pm
I keep getting an error when I try to use this mod, it looks like it's got a reversed backslash, but I don't know where it's located:

I keep getting this message:
An Error Has Occurred!
Can not open/home/lupous/public_html/candy\smfheader.php.
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on May 24, 2006, 05:51:43 pm
Updated the mod so it doesn't use the reverse backslash I used it mainly for Windows Servers.

Files it edits is: Subs.php

One more thing check the file permission on smfheader.php and smffooter.php and be sure it is able to read and write to it.
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on May 29, 2006, 09:15:18 pm
Ah. Just noticed the package.xml didn't copy over the two files needed. Updated mod should work now.
Title: Re: 4. Global Headers and Footers
Post by: Suke on June 05, 2006, 04:53:26 am
Code: [Select]
Can not write to/home/marksta/public_html/MgForum/smfheader.php.
**Sigh**

I downloaded teh latest file, what do I do?
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on June 05, 2006, 06:39:18 am
Make sure you have write and read permission to smfheader.php and smffooter.php
Title: Re: 4. Global Headers and Footers
Post by: Suke on June 05, 2006, 03:39:59 pm
You mean, I have to unzip teh file, check for "smfheader.php and smffooter.php" and then what?

Or, is it in teh admin panel?
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on June 05, 2006, 03:47:23 pm
Don't mean that. You have to make sure that both smfheader.php and smffooter.php exist in the root directory of your forum and if they do that those files have read and write permissions.
Title: Re: 4. Global Headers and Footers
Post by: Suke on June 06, 2006, 01:09:29 am
OH!!

I have to unzip them into teh Forum folder. And then upload it through Ftp.

How do you give them Read and Write privelages?
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on June 06, 2006, 07:38:24 am
Are you on a windows server or a linux server?
If linux you can use cpanel and find the file and edit its permssiosns.
Title: Re: 4. Global Headers and Footers
Post by: Suke on June 06, 2006, 08:25:51 am
Windows, I don't use Linux as far as I know.
Title: Re: 4. Global Headers and Footers
Post by: Suke on June 06, 2006, 07:23:04 pm
Ca you juss explain exactly what to do? From teh beginning? I installed it through Teh forum, not through uploading it from my Hdd.

Should I do it again?
Title: Re: 4. Global Headers and Footers
Post by: GameSocket on June 13, 2006, 12:22:22 am
Quote
smfheader.php and smffooter.php exist in the root directory of your forum and if they do that those files have read and write permissions.

Hi SMFHacks

I too have these files in my root folder but I get this error>>
Can not write to/home/infin11/public_html/gamesocket/smfheader.php.

Which is fine, as I didn't put aything in the header part, only the foot.

It all installed fine.
Title: Re: 4. Global Headers and Footers
Post by: GameSocket on June 13, 2006, 12:36:01 am
Ahh I see, it has to have both... I can't put a Footer in and not a header. Or vice verser.

Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on June 13, 2006, 08:53:29 am
Yeah I just noticed that. Fixed.

SMFHacks.com

Title: Re: 4. Global Headers and Footers
Post by: GameSocket on June 13, 2006, 03:44:20 pm
Good How do I fix it?  uninstal the reinstal the new one?
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on June 13, 2006, 03:46:52 pm
Yeah or just copy globalhf.php from the download.

Backup your smfheader.php and smffooter.php if you install with the new package.

SMFHacks.com
Title: Re: 4. Global Headers and Footers
Post by: GameSocket on June 14, 2006, 01:43:34 am
Thankyou very much... Very helpful.

Well done. Good support.
Title: Re: 4. Global Headers and Footers
Post by: rbh on June 14, 2006, 10:16:18 am
i love this mod, except one thing. it won't allow you to edit the header and footer data you placed. what i means is, i added a banner script to my footer. it works nicely, but when i went into the global header footer today to change the banner, the boxes are empty. you should make this similiar to how proboards works where the data entered remains static so that it can be easily edited. if it is suppose to be like that then i may have something not setup right.
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on June 14, 2006, 11:15:20 am
Hmm, It shouldn't be empty. It should always load the code that you last entered.

SMFHacks.com
Title: Re: 4. Global Headers and Footers
Post by: rbh on June 14, 2006, 03:26:47 pm
not sure what went wrong then......because it isnt loading my scripts i entered. i know everything went fine with the install, and the banners are working just fine. ???
Title: Re: 4. Global Headers and Footers
Post by: GameSocket on June 14, 2006, 03:52:48 pm
Yeah, Ive got that too. They are empty. You have to reload the codes again. I have them in notepad and just copy and paste each time I change it. Even if its one word. ;D But i wasn't going to worry about it.

But if its meant to be there...... :D
Title: Re: 4. Global Headers and Footers
Post by: rbh on June 15, 2006, 08:08:43 am
i have just been manually editing the smfheader smffooter for now, not so bad. still a nice mod and will watch for updates.
Title: Re: 4. Global Headers and Footers
Post by: Vinspire on August 03, 2006, 03:25:26 am
Is it possible for something to show me how this mod look like after u apply it ? Would like to have some idea of it before i install the mod :)

Thx.
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on August 03, 2006, 09:22:06 am
Adds a section in the admin panel.
Then allows you to insert code either in header and or footer.
Title: Re: 4. Global Headers and Footers
Post by: GameSocket on August 03, 2006, 08:59:05 pm
Is it possible for something to show me how this mod look like after u apply it ? Would like to have some idea of it before i install the mod :)

Thx.

On the first page.

http://www.smfhacks.com/index.php?topic=24.msg69#msg69

Thats the Admin peice of it. The Google add at the top of the page here is a header
Title: Re: 4. Global Headers and Footers
Post by: Vinspire on August 07, 2006, 06:02:59 am
Is it possible for something to show me how this mod look like after u apply it ? Would like to have some idea of it before i install the mod :)

Thx.

On the first page.

http://www.smfhacks.com/index.php?topic=24.msg69#msg69

Thats the Admin peice of it. The Google add at the top of the page here is a header

Awesome ... This is another "must have" mod from vbgamer :P
Title: Re: 4. Global Headers and Footers
Post by: denaon on October 02, 2006, 05:41:56 pm
This mod does not work in 1.0.8, does it?  :-\

BTW, I'm so glad I found you!!! SMFHacks rocks!!!  ;D
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on October 02, 2006, 07:05:08 pm
Only for SMF 1.1
Title: Re: 4. Global Headers and Footers
Post by: brightstarpro on October 30, 2006, 06:35:30 am
i love this mod, except one thing. it won't allow you to edit the header and footer data you placed. what i means is, i added a banner script to my footer. it works nicely, but when i went into the global header footer today to change the banner, the boxes are empty. you should make this similiar to how proboards works where the data entered remains static so that it can be easily edited. if it is suppose to be like that then i may have something not setup right.

Yeah, same problem for me as well. Was a solution ever found for this?
Title: Re: 4. Global Headers and Footers
Post by: Nite on October 30, 2006, 12:51:54 pm
ftp into your account and edit smfheader.php or smffooter.php directly.
Title: Re: 4. Global Headers and Footers
Post by: GameSocket on October 30, 2006, 02:41:02 pm
If you are going to do that ya might as well do it to index.template and forget headers and footers mod.
Title: Re: 4. Global Headers and Footers
Post by: Nite on November 03, 2006, 08:19:19 pm
Yes, but if that's all you had to do, then this mod would have never been created in the first place. For the sake of ease, there are two files that are descriptively named.
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on November 03, 2006, 08:31:43 pm
I need to look into that one day not sure what causes that probably some kind of linux path issue that it is not reopening the file.
Title: Re: 4. Global Headers and Footers
Post by: Bill White on November 17, 2006, 02:12:34 pm
Hmm, It shouldn't be empty. It should always load the code that you last entered.

SMFHacks.com

I get the same problem. And maybe this will help to solve it:

When I navigate to index.php?action=globalhf;sesc I get an error message in the error log as follows:

<my name   Today at 01:47:54 PM 
<my IP address>     <my session number> 
http://<mysite.com/smf/index.php?action=globalhf;sesc 
8: Undefined index: sa
File: /.../.../public_html/smf/Sources/globalhf.php
Line: 29

That suggests that, when I go to edit the headers and footers, the routine is unable to successfully execute a line that locates existing data so that it can be pulled and presented for editing. Maybe the code can be adjusted?  :)
Title: Re: 4. Global Headers and Footers
Post by: Bill White on November 17, 2006, 02:38:44 pm
I ran into another little problem with Global Headers and Footers. I uninstalled and reinstalled the module. Now any header shows up twice. If I delete the header, nothing shows up, but when I reenter it, it shows up twice again.

Maybe the install enters some code, and the uninstall does not remove it, but removes the data. So then the reinstall enters duplicate code that displays whatever header data a second time. That's my guess.
Title: Re: 4. Global Headers and Footers
Post by: lplettie on November 23, 2006, 10:32:12 pm
i love this mod, except one thing. it won't allow you to edit the header and footer data you placed. what i means is, i added a banner script to my footer. it works nicely, but when i went into the global header footer today to change the banner, the boxes are empty. you should make this similiar to how proboards works where the data entered remains static so that it can be easily edited. if it is suppose to be like that then i may have something not setup right.

Yeah, same problem for me as well. Was a solution ever found for this?


Hmm, It shouldn't be empty. It should always load the code that you last entered.

SMFHacks.com

I get the same problem. And maybe this will help to solve it:

When I navigate to index.php?action=globalhf;sesc I get an error message in the error log as follows:

<my name   Today at 01:47:54 PM 
<my IP address>     <my session number> 
http://<mysite.com/smf/index.php?action=globalhf;sesc 
8: Undefined index: sa
File: /.../.../public_html/smf/Sources/globalhf.php
Line: 29

That suggests that, when I go to edit the headers and footers, the routine is unable to successfully execute a line that locates existing data so that it can be pulled and presented for editing. Maybe the code can be adjusted?  :)


I also have both problems.  Is there a cure for this yet?
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on November 23, 2006, 11:20:36 pm
No cure for linux servers.
Title: Re: 4. Global Headers and Footers
Post by: buhaychat.com on December 08, 2006, 11:48:49 pm
Header for most themes would be located under the menu bar.

Footer is right above the copyright line.

Is there a way we can change the location of the header that instead of beneath the menu bar, the entered header code goes someplace else towards the top of the page, say above all the user info, before any of the table for the board starts?

Thanks in advance...
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on December 09, 2006, 12:05:16 pm
You would need to edit the location of the code.
Title: Re: 4. Global Headers and Footers
Post by: buhaychat.com on December 09, 2006, 02:58:45 pm
You would need to edit the location of the code.

Thanks for the reply! It's the index.template.php that I should be editing right?

I did try that, but can't seem to have much success; I keep getting template parse errors... Is this the code we'd need to edit/move?

(located in <head> section):

Code: [Select]
// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

function shrinkHeader(mode)
{';

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>

I can't seem to locate it in the body... the place where I "think" it should be, but is not:

Code: [Select]
// Show the menu here, according to the menu sub template.
template_menu();
echo '
</div></div>';

//If the user is below the minimum required posts, then show the annoying message.
global $user_info;

if (($context['user']['is_logged']) && ($user_info['posts'] < $modSettings['MinReqPostCount']))
echo '
<div align="center"><table align="center" style="width: 650px; padding: 20px; text-align: left; vertical-align: middle; margin: 2ex 1ex 2ex 1ex; border: 2px dashed ', $modSettings['PostCountWarningBorderColor'],'; background-color: ', $modSettings['PostCountWarningBackgroundColor'],';">
<tr>
<td width="64">
<img style="vertical-align: middle;" src="'.$settings['images_url'].'/pcWarn.gif" alt="Attention!" />
</td>
<td style="color: ', $modSettings['PostCountWarningTextColor'],';">
<strong>', $modSettings['PostCountWarningMessageTitle'], '</strong><br />', $modSettings['PostCountWarningMessage'], '
</td>
</tr>
</table></div>
';

A little nudge in the right direction, maybe? What's the code I'd need to move around to where I want it to show?

Thanks again. :)
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on December 09, 2006, 03:12:31 pm
Its actually not in the index.template.php the code is located in Sources/Subs.php that's why it can work for every theme.
Title: Re: 4. Global Headers and Footers
Post by: buhaychat.com on December 09, 2006, 05:33:13 pm
Ahh okay let me look there, thanks.
Title: Re: 4. Global Headers and Footers
Post by: buhaychat.com on December 10, 2006, 12:02:52 am
I found the code in the Subs but I can't figure out where to move it so that it's above all the forum table :(

This is the code:

Code: [Select]
//Global Headers
$headercontents = '';
if(!isset($_REQUEST['xml']))
if(file_exists($boarddir . '/smfheader.php'))
{
$headercontents = file_get_contents($boarddir . '/smfheader.php');
echo '<!--Headers-->';
echo $headercontents;
echo '<!--End Headers-->';

}

}

Where should I put it so that that the global headers will appear above the start of the forum tables?  ???
Title: Re: 4. Global Headers and Footers
Post by: LegacysVodka on January 08, 2007, 09:41:56 pm
Using the Package Manager I downloaded the Global Header/Footer yet it won't let me "install" it. The page simple says List Files and Remove...

Is there something else i didn't do?
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on January 08, 2007, 10:16:27 pm
What's your SMF version?
Title: Re: 4. Global Headers and Footers
Post by: LegacysVodka on January 08, 2007, 10:20:57 pm
1.1.1


 the most current I believe
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on January 08, 2007, 10:29:03 pm
Did you installl the latest version
http://www.smfhacks.com/hacks/Global-Headers-and-Footers.html
And did you have installed before you upgraded?
Title: Re: 4. Global Headers and Footers
Post by: LegacysVodka on January 08, 2007, 10:33:38 pm
i'm not exactly sure what you mean...

However, from what it sounds like, Yes I have the latest version on my computer... and No I didn't have it before any other version... I have just recently become a Co-Owner on a board... it was 1.1.1 when I joined.
Title: Re: 4. Global Headers and Footers
Post by: simeon on January 09, 2007, 03:07:26 am
Hello SMFHacks.

First of all - thanks for the awesome mod. Regretfully I have the same problem, i.e. I simply can't install it! I have the latest version (1.1.1) of SMF and just got the mod off your site. Where do the files go?

Do I manually upload them as the following code says:
<require-file name="globalhf.php" destination="$sourcedir" />
      <require-file name="globalhf.template.php" destination="$themedir" />
      <require-file name="smfheader.php" destination="$boarddir" />
      <require-file name="smffooter.php" destination="$boarddir" />

???

Thanks in advance for your help. I really want to have it in my forum.
Title: Re: 4. Global Headers and Footers
Post by: simeon on January 09, 2007, 04:16:52 am
PLS IGNORE MY PREVIOUS POST.  I figured it out  :) 

I've been associated with SMF for entire 3 (three!) days and it finally crossed my mind that "packages" in the admin panel relate to "mods"  ;D

Cheers, man Keep up the good work!
Title: Re: 4. Global Headers and Footers
Post by: LegacysVodka on January 09, 2007, 02:13:54 pm
That's great but I still haven't a Clue how I am going to get the header/footer installed for my board lol.
Title: Re: 4. Global Headers and Footers
Post by: SMFHacks on January 09, 2007, 03:07:40 pm
Download the latest version from this site. Upload it the packages folder and try to install it.
Title: Re: 4. Global Headers and Footers
Post by: LegacysVodka on January 11, 2007, 08:54:25 pm
that's the thing i upload it and it doesn't give me the install option
Title: Re: 4. Global Headers and Footers
Post by: Iron IC on February 17, 2007, 06:43:16 pm
This mod won`t install from the package mananger. I get the zipfile uploadet and are asked to add the mod, but nothing happens when I proceed clicking that.

I run smf 1.1.2 and are on a unix server. I downloadet the latest version.

I gave write and read permissions to all folders on my server, and I copied smffooter.php and smfheader.php into forum root.

Any solutions? Is this mod compatible with smf 1.1.2?

Please respond. Thank you! :)
Title: Re: 4. Global Headers and Footers
Post by: tapsilog on March 14, 2007, 05:22:27 am
HI..  how do make a picture appear in my header. Thanks. I have a jpeg file in my hard disk. What should I do to make appear in my header.