News:

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

Main Menu

Title bar problems please help for new mod...

Started by Captain_Morrigan, June 15, 2006, 01:51:26 AM

Previous topic - Next topic

Captain_Morrigan

I am currently making a mod that you can click on a link and it popups up and shows you some awards that the person has gotten.

I'm almost done but I'm having a problem. The title bar will not get rid of the http://test.enchantinge.com from before it. It shows the Name of the forum and then I can't see anything else after that so I would appreciate some help for it.

This is the sources code:
<?php
/*
SMFAwards
Version 1.0

[email protected]
*/

if (!defined('SMF'))
die('Hacking attempt...');

function 
awards()
{
global $context$mbname$txt$memid$modSettings;
//Load the main staff template
loadtemplate('Awards');
loadLanguage('Awards');
$context['template_layers'] = array();
//Set the page title
$context['page_title'] = $mbname ' - ' $txt['awards_title'];
}
?>


And the Header for the popup:
function awards_header() {
global $txt, $context, $modSettings, $scripturl, $settings, $info, $memid;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />';



// The rc2 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?rc2" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<title>', $context['page_title'], '</title>';

echo '</head><body>';


}

winrules

You have the title displaying only if RSS feeds are enabled. You should get rid of these two lines:

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Captain_Morrigan

That didn't fix it. I am at work but it doesn't happen with other pages. I viewed it from home and it doesn't display. Could it be that I have IE 6.0 SP2? At home I just have the IE 6.0? Anyone else that is looking at it maybe confirm my suspisions?

winrules

Do you have an undifined index: awards_title in your error log (or something like that)


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Captain_Morrigan

No I get this for every page now that I look at it and that confuses me:
8: Use of undefined constant lastLogin - assumed 'lastLogin'
File: /home/morrigan/public_html/test/Sources/Load.php
Line: 945


It changes the constant to different member things but I don't understand the error, I'm going to have to look for that.

winrules

But with the mod, what is $txt['awards_title']?


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Captain_Morrigan

I don't think I have that, which file should I put it in?

winrules



winrules
SMF Developer
               
My Mods
Please do not PM me for support.


Captain_Morrigan

#8
Let me Try it.

$txt['award_title'] = 'Awards for';

Is what it is and it doesn't go in the file that it's supposed to so that doesn't work either.

Captain_Morrigan

It's SP2 acting weird so thanks for the help winrules but this is not an issue anymore.

Advertisement: