News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Global Headers and Footers

Started by SMFHacks.com Team, August 02, 2006, 10:39:07 PM

Previous topic - Next topic

CrazyChristina

Quote from: BoZilla on May 13, 2009, 02:50:48 PM
Quote from: BoZilla on May 11, 2009, 02:51:05 PM
Yes, I thought this as well. How do you put the "Header" above the smf logo and the "Footer" below the copyright and stuff?

I would really like to find a way to do the above please, if anyone could tell me how! Thanks! 8)

I figured that out! What a pain it ended up being... I will send u the info!

sombra

#501
im using this mod and its working fine for me but i got a little problem

im using smf 2. rc1-1
and simpleportal

and i dont want the global headers to show in the portal how can i take out from the portal the global headers and footers?

and i saw a link called settings but it dosent do nothing why?

can i make it not to show inside the admin section?

vbgamer45

Not at this time. Currently the global headers and footers are shown on any page but it would make a good feature request.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

rad1701

I am running SMF 1.1.9 and a custom theme.  My default language is set to English, but I get this error when I try and apply this Mod:

1.     Execute Modification     ./Themes/default/languages/Modifications.english.php     Test failed
2.    Execute Modification    ./index.php    Test successful
3.    Execute Modification    ./Sources/Subs.php    Test successful
4.    Extract File    ./Sources/globalhf.php    
5.    Extract File    ./Themes/default/globalhf.template.php    
6.    Extract File    ./smfheader.txt    
7.    Extract File    ./smffooter.txt

Do I have to do something special due to running a custom theme and not the default one?

vbgamer45

Open up that file and make sure that ?>
Is on its own line should be the very last line
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Joe N

Hi

I installed this mod.

Everything fine except the Admin.php got a fail.
I parced this mod but can't find the bit of edit you have to edit

I attached my Admin.php


Microsoft: "We Need to Imagine Life Without Walls."
I Say: "If There are No Walls Who needs Windows."



My Mods (6) All My Mods Updated To SMF 2.0 RC2 and SMF 1.1.10!


Sabre™

#506
Quote from: BoZilla on May 13, 2009, 02:50:48 PM
Quote from: BoZilla on May 11, 2009, 02:51:05 PM
Yes, I thought this as well. How do you put the "Header" above the smf logo and the "Footer" below the copyright and stuff?
I would really like to find a way to do the above please, if anyone could tell me how! Thanks! 8)

For the footer
search for this in your Subs.php
log_error('Copyright removed!!');
}
}


replace it with
log_error('Copyright removed!!');
}
// Global Footers
$footercontents = '';

$noheaders = false;
if (isset($_REQUEST['action']))
{
if ($_REQUEST['action'] == 'dlattach')
$noheaders = true;

}

if(!isset($_REQUEST['xml'])  && $noheaders == false)
if(file_exists($boarddir . '/smffooter.txt'))
{
$footercontents = file_get_contents($boarddir . '/smffooter.txt');
echo '<!--Footers-->';
echo $footercontents;
echo '<!--End Footers-->';

}
}


For the header may not work correct for some custom themes when using <center> tags
search for
foreach ($context['template_layers'] as $layer)

and replace with
// Global Headers
$headercontents = '';

$noheaders = false;
if (isset($_REQUEST['action']))
{
if ($_REQUEST['action'] == 'dlattach')
$noheaders = true;

}


if(!isset($_REQUEST['xml']) && $noheaders == false)
if(file_exists($boarddir . '/smfheader.txt'))
{
$headercontents = file_get_contents($boarddir . '/smfheader.txt');
echo '<!--Headers-->';
echo $headercontents;
echo '<!--End Headers-->';

}
foreach ($context['template_layers'] as $layer)


There's a number of places you could add this mods code.
Dont forget to place the $boarddir function in the required places if it isnt so already ;)

I just added text boxes in my settings.template.php and called for them in the index.template.php.
Less hassles and works for every custom theme tested.

@ Joe N
This mod does not touch the Admin.php
Could you copy the error message you're receiving?
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Joe N

Quote from: Sabre™ on June 27, 2009, 05:51:52 AM
@ Joe N
This mod does not touch the Admin.php
Could you copy the error message you're receiving?

I parced the mod and said: Admin.php
Microsoft: "We Need to Imagine Life Without Walls."
I Say: "If There are No Walls Who needs Windows."



My Mods (6) All My Mods Updated To SMF 2.0 RC2 and SMF 1.1.10!


Sabre™

Oh ok...
What version of smf are you using?
It seems you're using the package for smf2 on a 1.x.x template
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Joe N

Quote from: Sabre™ on June 27, 2009, 06:57:53 AM
Oh ok...
What version of smf are you using?
It seems you're using the package for smf2 on a 1.x.x template

USING smf 1.1.9

http://thechill.icr38.net/smf
Microsoft: "We Need to Imagine Life Without Walls."
I Say: "If There are No Walls Who needs Windows."



My Mods (6) All My Mods Updated To SMF 2.0 RC2 and SMF 1.1.10!


Sabre™

Download or parse the package labeled globalheadersfooters.zip
The one named GlobalHFforSMF2.0.zip is for smf2, and uses the Admin.php.

Good luck :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Joe N

Quote from: Sabre™ on June 27, 2009, 07:36:11 AM
Download or parse the package labeled globalheadersfooters.zip
The one named GlobalHFforSMF2.0.zip is for smf2, and uses the Admin.php.

Good luck :)

I parced the 1.1.9 one but wouldn't let me
Microsoft: "We Need to Imagine Life Without Walls."
I Say: "If There are No Walls Who needs Windows."



My Mods (6) All My Mods Updated To SMF 2.0 RC2 and SMF 1.1.10!


Sabre™

Are you installing this manually, or via your admin panel?
The parser on the mod side will parse it as designed for a manual install, I dont see why it wouldn't parse in your admin panel, but that doesn't mean that it wouldn't ;)
What error does it show you?
If all else fails, I or another may find time to manually install this onto your templates if you'd like.
Its only a 2 minute job :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Shades.

Quote from: Sabre™ on June 27, 2009, 05:51:52 AM
Quote from: BoZilla on May 13, 2009, 02:50:48 PM
Quote from: BoZilla on May 11, 2009, 02:51:05 PM
Yes, I thought this as well. How do you put the "Header" above the smf logo and the "Footer" below the copyright and stuff?
I would really like to find a way to do the above please, if anyone could tell me how! Thanks! 8)

For the footer
search for this in your Subs.php
log_error('Copyright removed!!');
}
}


replace it with
log_error('Copyright removed!!');
}
// Global Footers
$footercontents = '';

$noheaders = false;
if (isset($_REQUEST['action']))
{
if ($_REQUEST['action'] == 'dlattach')
$noheaders = true;

}

if(!isset($_REQUEST['xml'])  && $noheaders == false)
if(file_exists($boarddir . '/smffooter.txt'))
{
$footercontents = file_get_contents($boarddir . '/smffooter.txt');
echo '<!--Footers-->';
echo $footercontents;
echo '<!--End Footers-->';

}
}


For the header may not work correct for some custom themes when using <center> tags
search for
foreach ($context['template_layers'] as $layer)

and replace with
// Global Headers
$headercontents = '';

$noheaders = false;
if (isset($_REQUEST['action']))
{
if ($_REQUEST['action'] == 'dlattach')
$noheaders = true;

}


if(!isset($_REQUEST['xml']) && $noheaders == false)
if(file_exists($boarddir . '/smfheader.txt'))
{
$headercontents = file_get_contents($boarddir . '/smfheader.txt');
echo '<!--Headers-->';
echo $headercontents;
echo '<!--End Headers-->';

}
foreach ($context['template_layers'] as $layer)


There's a number of places you could add this mods code.
Dont forget to place the $boarddir function in the required places if it isnt so already ;)

I just added text boxes in my settings.template.php and called for them in the index.template.php.
Less hassles and works for every custom theme tested.

@ Joe N
This mod does not touch the Admin.php
Could you copy the error message you're receiving?
Thanks! I will give this a try! :) 8)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Joe N

If all else fails, I or another may find time to manually install this onto your templates if you'd like.
Its only a 2 minute job :)
[/quote]

That would be fantastic! Will send you ftp details via pm if you like

You see, I am not install packages via package manager as it gives me an error.

At the moment, I have added the edits for:

Modifications.english.php
globalhf.php to Sources
globalhf.template.php To Themes/default
smfheader.txt
smffooter.txt  Both to root


Microsoft: "We Need to Imagine Life Without Walls."
I Say: "If There are No Walls Who needs Windows."



My Mods (6) All My Mods Updated To SMF 2.0 RC2 and SMF 1.1.10!


Joe N

Microsoft: "We Need to Imagine Life Without Walls."
I Say: "If There are No Walls Who needs Windows."



My Mods (6) All My Mods Updated To SMF 2.0 RC2 and SMF 1.1.10!


Lord Feste

#516
Awesome mod, I think(?) should be core.

so... this mod, once installed correctly, will allow for single lines of .js to be added across all templates?

Also, what happens if your Modifications.english-utf8.php is empty is that the installation gives a warning on that modification:


Find [Select]
?>
Add Before [Select]
// Begin Global Headers and Footers Text Strings $txt['globalhf_title'] = 'Global Headers and Footers'; $txt['globalhf_globalheaders'] = 'Global Headers:'; $txt['globalhf_globalfooters'] = 'Global Footers:'; $txt['globalhf_settings'] = 'Settings'; $txt['globalhf_saveglobal'] = 'Save Headers Footers'; // END Global Headers and Footers Text Strings


I added the tags to teh file manunally, but is that why it doesn't work?

I tried to insert

<script type="text/javascript" src="hxxp:www.aionarmory.com/js/extooltips.js [nonactive]"></script>

in the header, but it hasn't worked.

<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="description" content="|MA| WAR &amp; DF - Index" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="http://www.mystical-awakening.net/forum/Themes/default/scripts/script.js?rc1"></script>
<script language="JavaScript" type="text/javascript" src="http://www.mystical-awakening.net/forum/Themes/default/scripts/theme.js?rc1"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "http://www.mystical-awakening.net/forum/Themes/BlackBox20rc1";
var smf_default_theme_url = "http://www.mystical-awakening.net/forum/Themes/default";
var smf_images_url = "http://www.mystical-awakening.net/forum/Themes/BlackBox20rc1/images";
var smf_scripturl = "http://www.mystical-awakening.net/forum/index.php";
var smf_iso_case_folding = false;
var smf_charset = "ISO-8859-1";
var ajax_notification_text = "Loading...";
var ajax_notification_cancel_text = "Cancel";
// ]]></script>

<title>|MA| WAR &amp; DF - Index</title>
<link rel="stylesheet" type="text/css" href="http://www.mystical-awakening.net/forum/Themes/BlackBox20rc1/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="http://www.mystical-awakening.net/forum/Themes/default/css/print.css?rc1" media="print" />
<link rel="stylesheet" type="text/css" href="http://www.mystical-awakening.net/forum/Themes/default/css/ff.css" />
<link rel="help" href="http://www.mystical-awakening.net/forum/index.php?action=help" />
<link rel="search" href="http://www.mystical-awakening.net/forum/index.php?action=search" />
<link rel="contents" href="http://www.mystical-awakening.net/forum/index.php" />
<link rel="stylesheet" type="text/css" id="index_css" href="http://www.mystical-awakening.net/forum/Themes/BlackBox20rc1/css/index.css" />

<link rel="stylesheet" type="text/css" id="forum_css" href="http://www.mystical-awakening.net/forum/Themes/BlackBox20rc1/css/forum.css" />
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// Create the main header object.
var mainHeader = new smfToggle("upshrink", false);
mainHeader.useCookie(0);
mainHeader.setOptions("collapse_header", "a75e79fed89fef8d2dbfb4b2335ef092");
mainHeader.addToggleImage("upshrink", "/upshrink.gif", "/upshrink2.gif");
mainHeader.addTogglePanel("user_section");
mainHeader.addTogglePanel("news_section");
// ]]></script>
</head>

The Man Who

I'm installing it and it says everything is passed the tests - but it doesnt create the link in my admin side panels at all.

I am currently using 1.1.10.  Pretty urls and ad management have created side links for their admin control but nothing for this mod.  I'm sure I am being daft but what is wrong?

Installed via the admin panel and everything says it should be working correctly

vbgamer45

Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Lord Feste

Awesome, your update works a treat, and though it's not going in to the page head, it still works as intended. Great mod.


Advertisement: