Seite 1 von 1

Javaskribt einfügen

Verfasst: 18.02.2012 16:02
von merzi
Ich möchte auf jeder Seite ein Javaskribt das im Header läuft einfügen, habe das in der Index.php probiert, das Skript läuft auch, aber es werden Fehler angezeigt?

Muss ich das Skript wo anders einsetzen?

Vielen Dank!

Gruß
Peter

Re: Javaskribt einfügen

Verfasst: 18.02.2012 16:55
von Unimatrix_0

Re: Javaskribt einfügen

Verfasst: 18.02.2012 17:55
von merzi
Ich habe den folgenden Code in die Index.php eingefügt:

<html>
<head>
<title>Neue Seite 1</title>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4354053309600947";
/* HD-Qualität */
google_ad_slot = "9517291796";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</head>
<body>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4354053309600947";
/* HD-Qualität */
google_ad_slot = "9517291796";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<p align="center">&nbsp;</p>
</body>
</html>
<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
*/

/**
* @ignore
*/
define('IN_PHPBB', true);

Folgender Fehler wird angezeigt:
[phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at [ROOT]/index.php:4)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at [ROOT]/index.php:4)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at [ROOT]/index.php:4)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4668: Cannot modify header information - headers already sent by (output started at [ROOT]/index.php:4)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4670: Cannot modify header information - headers already sent by (output started at [ROOT]/index.php:4)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4671: Cannot modify header information - headers already sent by (output started at [ROOT]/index.php:4)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4672: Cannot modify header information - headers already sent by (output started at [ROOT]/index.php:4)

Was mache ich falsch? Kann das einer für mich programmieren und was kostet das?

Vielen Dank!

Gruß
Peter

Re: Javaskribt einfügen

Verfasst: 18.02.2012 18:23
von modernist
merzi hat geschrieben:Kann das einer für mich programmieren und was kostet das?
Dafür gibt es hier die Jobbörse: viewforum.php?f=57
Bitte verwende doch den BBCode Code für Codeteile oder stell die Sachen ins Pastebin, wenn's umfangreicherer Code ist.

Re: Javaskribt einfügen

Verfasst: 18.02.2012 18:32
von Unimatrix_0
verschiebe deinen Code von der index.php in den overall_header.html in deinem Style-Verzeichnis und leere danach die Forencache - fertig, danach sollte dein JS laufen - ohne Fehlermeldungen.

Und wenn du Code postest: https://www.phpbb.de/kb/knigge#code

Re: Javaskribt einfügen

Verfasst: 18.02.2012 18:34
von Helmut
Hallo merzi,

das Zeug hat in der index.php garnix verloren .....

Code: Alles auswählen

<html>
<head>
<title>Neue Seite 1</title>
<script type="text/javascript">// <!--
google_ad_client = "ca-pub-4354053309600947";
/* HD-Qualität */
google_ad_slot = "9517291796";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</head>
<body>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4354053309600947";
/* HD-Qualität */
google_ad_slot = "9517291796";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<p align="center">&nbsp;</p>
</body>
</html>
Wenn dann muss es in die overall_header.html rein und da auch nur der Teil

Code: Alles auswählen

<script type="text/javascript">
// <![CDATA[
google_ad_client = "ca-pub-4354053309600947";
/* HD-Qualität */
google_ad_slot = "9517291796";
google_ad_width = 728;
google_ad_height = 90;
// ]]> 
</script>

<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
Und warum hast die Scripts doppelt drinnen?

Gruß Helmut

Re: Javaskribt einfügen

Verfasst: 18.02.2012 19:05
von merzi
Hallo,

es ist doppelt drin, weil zwei Anzeigen nebeneinander erscheinen sollen.

Das mit der overall-header habe ich auch schon probiert, es tut sich gar nichts? Ich habe in style/prosilver alles mit Dateirechte 0 eingegeben, bis auf die Grafik, die dann weg ist, störrt das gar nicht?

Wenn ich prosilver die Dateirechte mit 0 eingebe, ist alles weg, also irgend etwas läuft da schief?

Gruß
Peter

Re: Javaskribt einfügen

Verfasst: 18.02.2012 19:12
von gloriosa
Hallo,
dazu
merzi hat geschrieben:Das mit der overall-header habe ich auch schon probiert, es tut sich gar nichts?
nach dem Einbau den Cache geleert ? :o

Re: Javaskribt einfügen

Verfasst: 18.02.2012 19:39
von merzi
Ja, wie geschrieben, ich kann die ganze Datei löschen, ohne Auswirkungen?

Gruß
Peter