FAQ |
Kalender |
![]() |
#1 | |||
|
||||
Har WN som tidsfördriv
|
Någon PHP-Guru som kan förklara för mig hur jag kan lägga in denna kodsnutt i <head> ?
Citat:
<head>-kod: Citat:
|
|||
![]() |
![]() |
![]() |
#2 | ||
|
|||
Har WN som tidsfördriv
|
vad ska du med php till? det där är ju conditional css och javascript. det är väl bara att lägga in det direkt innan </head>...
för att komma ur php om det är så.. så gör såhär ?> din kod här <? |
||
![]() |
![]() |
![]() |
#3 | |||
|
||||
Har WN som tidsfördriv
|
Skriv aldrig <? ... ?>
Det är riktigt dålig kod tycker jag. Det är ingen riktig start-tag. Använd <?php ... ?> |
|||
![]() |
![]() |
![]() |
#4 | |||
|
||||
Har WN som tidsfördriv
|
Njaää, att lägga in direkt kodsnutten direkt i <head> som i vanlig XHTML ger parsing error. Har provat ett flertal varianter utan framgång. Google ger ingenting som man blir klokare av heller...
|
|||
![]() |
![]() |
![]() |
#5 | ||
|
|||
Har WN som tidsfördriv
|
Citat:
Det är dock ot. pitbull vad säger parsern? |
||
![]() |
![]() |
![]() |
#6 | |||
|
||||
Administratör
|
Escapea ' så löser det sig. Sedan kan du klistra in koden precis innan </head>.
Kod:
<!--[if IE]> <script> window.onload = function() { if (!window.location.search) { setTimeout("window.location+=\'?\';", .1000); } } </script> <![endif]--> Kod:
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" xml:lang="sv"', $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'], '" />', empty($context['robot_no_index']) ? '' : ' <meta name="robots" content="noindex" />', ' <meta name="keywords" content="" /> <meta http-equiv="content-language" content="sv" /> <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script> <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ var smf_theme_url = "', $settings['theme_url'], '"; var smf_images_url = "', $settings['images_url'], '"; var smf_scripturl = "', $scripturl, '"; var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', '; var smf_charset = "', $context['character_set'], '"; // ]]></script> <title>', $context['page_title'], '</title>'; // The ?fin11 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?fin11" /> <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" 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 ' <link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />'; // If we're viewing a topic, these should be the previous and next topics, respectively. if (!empty($context['current_topic'])) echo ' <link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" /> <link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />'; // If we're in a board, or a topic for that matter, the index will be the board's index. if (!empty($context['current_board'])) echo ' <link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />'; // We'll have to use the cookie to remember the header... if ($context['user']['is_guest']) { $options['collapse_header'] = !empty($_COOKIE['upshrink']); $options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']); } // 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" : ""; document.getElementById("upshrinkHeader2").style.display = mode ? "none" : ""; current_header = mode; } // ]]></script>'; // the routine for the info center upshrink echo ' <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', '; function shrinkHeaderIC(mode) {'; if ($context['user']['is_guest']) echo ' document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'; else echo ' smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");'; echo ' document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif"); document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : ""; current_header_ic = mode; } // ]]></script> <!-- Ändrat! --> <!--[if IE]> <script> window.onload = function() { if (!window.location.search) { setTimeout("window.location+=\'?\';", .1000); } } </script> <![endif]--> <!-- / Ändrat! --> </head>
__________________
@Zn4rK - Börja blogga - Paintball i Göteborg Det jag skriver är mina personliga åsikter och återspeglar inte vad WN eller andra företag jag representerar tycker. |
|||
![]() |
![]() |
![]() |
#7 | |||
|
||||
Har WN som tidsfördriv
|
Sitter lite illa till just nu, så jag har ingen tillgång till eftermiddagens felkoder för tillfället.
Citat:
|
|||
![]() |
![]() |
![]() |
#8 | |||
|
||||
Har WN som tidsfördriv
|
"Escapea" ger följande:
Citat:
|
|||
![]() |
![]() |
![]() |
#9 | |||
|
||||
Har WN som tidsfördriv
|
Provat
Citat:
Citat:
|
|||
![]() |
![]() |
![]() |
#10 | |||
|
||||
Mycket flitig postare
|
Citat:
|
|||
![]() |
![]() |
Svara |
|
|