Ciao, visto che fra poco è natale (che bello!) vorrei mettere sul sito dei fiocchi di neve che si muovono tipo quelli che ci sono in QUESTO sito.
Che codice html devo scrivere???
Printable View
Ciao, visto che fra poco è natale (che bello!) vorrei mettere sul sito dei fiocchi di neve che si muovono tipo quelli che ci sono in QUESTO sito.
Che codice html devo scrivere???
Guarda, ce ne sono QUI, sono tantissimi :shock:
ascolta, io ti dò dei codici ma nn sn sicuro ke fungano!
Effetto neve (media) (fiocco)
Codice:<!-- Prelevato nel Forum di Supporto di ForumFree.net e ForumCommunity.net -->
<!--webbot bot=HTMLMarkup startspan -->
<script type="text/javascript" language="JavaScript1.2"> //Configure below to change URL path to the snow image
var snowsrc="http://image.forumfree.it/3/4/2/3/3/6/4/1225536874.png"
// Configure below to change number of snow to render
var no = 10;
var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://dynamicdrive.com/\"><img src='"+snowsrc+"' border=\"0\"></a></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"></a></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"></div>");
}
}
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", 10);
}
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", 10);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
/* prelevato su http://www.grafikat.it */
</script><!--webbot bot="HTMLMarkup" endspan -->
Effetto neve (grossa) (fiocco)
CODICE<!-- Prelevato nel Forum di Supporto di ForumFree.net e ForumCommunity.net -->
<script type="text/javascript"> <!--
var no = 15;
var speed = 2;
var snowflake = "http://image.forumfree.it/3/4/2/3/3/6/4/1225536750.png";
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0;
xp[i] = Math.random()*(doc_width-50);
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
}
}
}
function snowNS() {
for (i = 0; i < no; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}
function snowIE() {
for (i = 0; i < no; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// -->
</script>
Quanti giorni mancano a Natale?
CODICE<!-- Prelevato nel Forum di Supporto di ForumFree.net e ForumCommunity.net -->
<script type="text/javascript">
//funzione che mostra un commento in base al periodo dell'anno in corso.
//si possono cambiare i commenti modificando il testo tra le virgolette (tenendo i tag <p>)
//si possono modificare le date di apparizione di un commento modificando solo i numeri dopo la parola mese
function calcmes() {
if (mese>0 && mese<5) {
document.write("<p><p>Non è un po' presto per pensare al Natale?")
}
if (mese>=5 && mese<9) {
document.write("<p><p>Non sarebbe meglio pensare all'estate?")
}
if (mese>=9 && mese<=12) {
document.write("<p><p>Non manca molto...")
}
}
//funzione di conversione dei giorni della settimana da numeri in lettere
function convgio() {
if (gset==0) { gset="domenica" }
if (gset==1) { gset="lunedi" }
if (gset==2) { gset="martedi" }
if (gset==3) { gset="mercoledi" }
if (gset==4) { gset="giovedi" }
if (gset==5) { gset="venerdi" }
if (gset==6) { gset="sabato" }
}
//funzione di conversione dei mesi dell'anno da numeri in lettere
function convmes() {
if (mese==0) { mese="gennaio" }
if (mese==1) { mese="febbraio" }
if (mese==2) { mese="marzo" }
if (mese==3) { mese="aprile" }
if (mese==4) { mese="maggio" }
if (mese==5) { mese="giugno" }
if (mese==6) { mese="luglio" }
if (mese==7) { mese="agosto" }
if (mese==8) { mese="settembre" }
if (mese==9) { mese="ottobre" }
if (mese==10) { mese="novembre" }
if (mese==11) { mese="dicembre" }
}
//funzione per il calcolo della data odierna
function dataoggi() {
oggi=new Date()
gset=oggi.getDay()
gmes=oggi.getDate()
mese=oggi.getMonth()
anno=oggi.getYear()
}
//funzione per il calcolo dei giorni mancanti a Natale
//per cambiare ricorrenza modificare il mese e il giorno del campo natale (formato inglese)
function natale() {
oggi=new Date()
natale=new Date("12/25/"+ anno)
giornims=natale.getTime() - oggi.getTime()
giorni=Math.floor(giornims / (1000 * 60 * 60 * 24))
return giorni
}
</script>
<script type="text/javascript">
//il testo all'interno delle virgolette e' modificabile (tranne i tag <h2> e </h2>)
document.write("<h2>NATALE</h2>")
//chiamata alla funzione che definisce l'oggetto data
dataoggi()
//chiamata alla funzione del commento
calcmes()
//chiamate alle funzioni di conversione dei numeri della data in testo
convmes()
convgio()
//visualizzazione della data odierna
document.write("<p><p>Oggi è " + gset + " " + gmes + " " + mese + " " + anno)
//visualizzazione dei giorni mancanti al prossimo Natale (o altra ricorrenza)
//il testo all'interno delle virgolette e' modificabile (tranne il richiamo +natale()+)
document.write(" e mancano " + natale() + " giorni a Natale")
</script>
Prova questo: effetto neve
Colgo al volo questa discussione,per vedere se finalmente riesco a capire quello hai scritto:
"Il codice, che va inserito interamente tra i tags <body> del documento"
Ma qual'è,esattamente la pagina dove inserire lo script;quella del template dove voglio che appaia? Io nella root del Sito non trovo molte pagina che hanno i tag<body> e </body> :roll:
Potresti farmi un esempio pratico,sapendo che ho un Forum con phpbb3.xx,quindi con una cartella "styles",dove sono installati tutti i Temi? Che non sia la buona volta che riesco a creare sto benedetto effetto ! magari prima di Natale :top:
Grazie
Un metodo semplice per inserire l'effetto in tutte le pagine del sito è il seguente:
1) copia tutto il codice javascript dell'articolo in un nuovo file con Notepad
2) salva il file con nome, es.: neve.php
3) richiama il file con il comando include ("neve.php");
il richiamo al file lo devi inserire in un file che è presente in ogni pagina del sito, come ad esempio header.php, o header.html . Cercalo nella directory del tema.
Se il file in cui inserisci il richiamo non ha estensione php, se ad esempio ha estensione html, ricorda di inserire i tags php.
Es.: <?php include("neve.php");?>
Fai attenzione ad inserire il percorso completo al file neve.php nell'istruzione include
Ad esempio se salvi il file neve.php nella directory effetti, la sintassi
del comando include sarà:
include("effetti/neve.php");
Ciao,oceano,ho provato a seguire alla lettera le tue spiegazioni,ma..............niente,non vorrei che uno dei problemi fosse qui, preso da un tuo ( credo),script :
grphcs=new Array(1)
Image0=new Image();
Image0.src=grphcs[0]="snow.gif"; devo indicare il path del file snow.gif ?
ho salvato il tuo script come neve.php ed ho messo il file nella dir styles/Prochristmas/template,ed inserito il "comando <?php include("styles/prochristmas/template/neve.php");?> ,così come lo vedi scritto, nell'overall_header del tema .Prochristmas
Ora,il file dell'imagine del fiocco di neve,snow.gif,dove lo inserisco? ed il quale punto dell'header,devo metter il comando include?Io ti allego il file,se hai voglia mi indichi il punto preciso? Ho marcato in rosso il punto dov'è ora.
Grazie
Edit:
Scusa non sapevo il procedimento !
Codice:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>
<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta
http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language"
content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<meta
name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta
name="copyright" content="2002-2006 phpBB Group" />
<meta name="keywords" content="" />
<meta
name="description" content="" />
{META}
<title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} •
<!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- ENDIF -->{PAGE_TITLE}</title>
<!--
phpBB style
name: prosilver
Based on style: prosilver (this is the default phpBB3 style)
Original author: Tom
Beddard ( http://www.subBlue.com/ )
Modified by:
NOTE: This page was generated by
phpBB, the free open-source bulletin board package.
The phpBB Group is not responsible for
the content of this page and forum. For more information
about phpBB please visit
http://www.phpbb.com
-->
<script type="text/javascript">
// <![CDATA[
var jump_page =
'{LA_JUMP_PAGE}:';
var on_page = '{ON_PAGE}';
var per_page = '{PER_PAGE}';
var
base_url = '{A_BASE_URL}';
var style_cookie = 'phpBBstyle';
var onload_functions = new
Array();
var onunload_functions = new Array();
<!-- IF S_USER_PM_POPUP -->
if
({S_NEW_PM})
{
var url = '{UA_POPUP_PM}';
window.open(url.replace(/&/g, '&'), '_phpbbprivmsg', 'height=225,resizable=yes,scrollbars=yes,
width=400');
<!-- ENDIF -->
/**
* Find a member
*/
function find_username(url)
{popup(url, 760, 570, '_usersearch');
return false;}
/**
* New function for handling multiple calls to window.onload and
window.unload by pentapenguin
*/
window.onload = function()
{for (i = 0; i <= onload_functions.length; i++)
{eval(onload_functions[i]);}}
window.onunload = function()
{or (i = 0; i <= onunload_functions.length; i++)
{eval(onunload_functions[i]);}}
/ ]]>
</script>
<script type="text/javascript"
src="{T_TEMPLATE_PATH}/styleswitcher.js"></script>
<script type="text/javascript"
src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
<link href="{T_THEME_PATH}/print.css"
rel="stylesheet" type="text/css" media="print" title="printonly" />
<link href="{T_STYLESHEET_LINK}"
rel="stylesheet" type="text/css" media="screen, projection" />
<link href="{T_THEME_PATH}/normal.css"
rel="stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="alternate
stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet"
type="text/css" title="A++" />
<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
<link
href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" />
<!-- ENDIF -->
</head>
<body id="phpbb" class="section-{SCRIPT_NAME}
{S_CONTENT_DIRECTION}">
<div id="wrap">
<a id="top" name="top" accesskey="t"></a>
<script
type="text/javascript">//<![CDATA[
google_color_border = "99CC66";
google_color_bg = "66CCFF";
google_color_link = "0033CC";
google_color_url = "008000";
google_color_text = "006666";
document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=728X90/r='+new
Date().getTime()+'"><\/s'+'cript>');
//]]></script><script type="text/javascript">
//<![CDATA[
var l='it';
document.write('<s'+'cript type="text/javascript" src="http://'+l+'.altervista.org/members_inc/cat.av?'+new
Date().getTime()+'"><\/s'+'cript>');
//]]>
</script> <div id="page-header">
<div class="headerbar">
<div class="inner"><span class="corners-top"><span></span></span>
<div
id="site-description">
<a href="{U_INDEX}" title="{L_INDEX}"
id="logo">{SITE_LOGO_IMG}</a>
<h1>{SITENAME}</h1>
<p><strong>{SITE_DESCRIPTION}</strong></p>
<p style="display: none;"><a href="#start_here">{L_SKIP}</a></p</div>
<!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH -->
<div id="search-box">
<form action="{U_SEARCH}" method="post" id="search">
<fieldset><input name="keywords"
id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search"
value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->"
onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';"
onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
<input class="button2" value="{L_SEARCH}" type="submit" /><br />
<a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a>
{S_SEARCH_HIDDEN_FIELDS}</fieldset></form></div><!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div></div>
<div class="navbar">
<div class="inner"><span
class="corners-top"><span></span></span>
<ul class="linklist navlinks">
<li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN
navlinks --> <strong>‹</strong> <a
href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li>
<li class="rightside"><a href="#" onclick="fontsizeup(); return false;" class="fontsize"
title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
<!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}"
class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
<!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}"
class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF -->
<!-- IF
U_PRINT_TOPIC --><li class="rightside"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}"
accesskey="p" class="print">{L_PRINT_TOPIC}</a></li><!-- ENDIF -->
<!-- IF U_PRINT_PM --><li class="rightside"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p"
class="print">{L_PRINT_PM}</a></li><!-- ENDIF --></ul>
<!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
<ul class="linklist leftside">
<li class="icon-ucp">
<a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="u">{L_PROFILE}</a>
<!-- IF S_DISPLAY_PM --> (<a
href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF --> •
<a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a>
<!-- IF U_RESTORE_PERMISSIONS --> •
<a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a>
<!-- ENDIF --></li></ul>
<!-- ENDIF -->
<ul class="linklist rightside">
<li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
<!-- IF not S_IS_BOT -->
<!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}"
title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->
<!-- IF not S_USER_LOGGED_IN --><li class="icon-register">
<a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
<li class="icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}"
accesskey="l">{L_LOGIN_LOGOUT}</a></li><!-- ENDIF --></ul>
<?include("styles/prochristmas/template/neve.php");?><span
class="corners-bottom"><span></span></span></div>
</div>
</div>
<a
name="start_here"></a>
<div id="page-body">
<!-- IF
S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
<div
id="message" class="rules">
<div class="inner"><span
class="corners-top"><span></span></span>
<strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
<span
class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
La tua osservazione è giusta, devi indicare il percorso al file snow.gif;
In alternativa puoi provare in questo modo:
1) copia il file neve.php e l'immagine snow.gif nella directory principale
del tuo sito.
2) inserisci la stringa <?php include("neve.php");?> nella prima riga
del file overall_header. Prima ancora di <!DOCTYPE ecc.
Il tutto senza modificare il codice del file neve.php
Fammi sapere se funziona :wink:
Nel pomeriggio,provo,ma dove devo inserire il path di snow.gif ? qui ?
Image0.src=grphcs[0]="snow.gif";
Sì, proprio lì. :wink:
Ho trasferito i 2 files nella root del Sito;il comando include,l'ho modificato così ,<?php include("/neve.php");?>,per dire che è nella root,ed il path per snow.gif l'ho scritto così:grphcs=new Array(1)
Image0=new Image();
Image0.src=grphcs[0]="/snow.gif";
E'corretto? se sì,non funge lo stesso !
Aprendo il Sito,mi da quest'errore:Parse error: syntax error, unexpected '?' in /membri/vilas/cache/tpl_proChristmas_overall_header.html.php on line 1
lo slash / non è necessario, se non viene definito il percorso il php cerca il file nella root
però ho visto che ti dà errore.
La pagina tpl_proChristmas_overall_heade r.html.php inizia con il tag <?
se sì devi inserire include("neve.php"); senza i tags <?php e ?>
se non funziona dovrai inserirlo in un altro file.
C'è una directory 'include' nel tuo sito?
l'Header .html,inizia con: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
C'è una dir "includes"
Per cui dovrei inserire questo? include("effetti/neve.php");
Edit:
Ho inserito include("effetti/neve.php"),sempre all'inizio,non da errore,ma nn funge!
Dimmi che file ci sono
se c'è un file tipo my_header.php lo inseriamo lì
oppure prova a inserire include("neve.php"); nel file tpl_proChristmas_overall_header.html.php dopo il tag <?php se c'è
P.S.
C'è un file header.php nella root?
Non c'è un "my_ header.php,nella dir "template" di ogni tema che ho installato sul sito,c'è un overall_header e footer.html
Il mio overall_header relatvo a "prochristmas,lo puoi vedere qualche post più sù
Ho un Forum phpbb 3.03
Nella root.non ci sono files header o footer
Questa è la configurazione della mia root
http://www.crazyup.net/immagini/60af...8ef027076b.jpg
Puoi farmi vedere anche il contenuto della dir includes
e il contenuto del file style.php
aspetta ora vado a scaricarmi phpbb3.03
Dir "includes"
http://www.crazyup.net/immagini/61f0...9f2e77eb03.jpg
http://www.crazyup.net/immagini/6549...2124bfef9a.jpg
questo è il contenuto del file style.php,contenuto nella dir "php" della root
Edit:
Scusa oceano,mi devo assentare fino alle 16.00 :wink:
Codice:<?php
/**
*
* @package phpBB3
* @version $Id: style.php 8780 2008-08-22 12:52:48Z acydburn $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
// Report all errors, except notices
error_reporting(E_ALL ^ E_NOTICE);
require($phpbb_root_path . 'config.' . $phpEx);
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
exit;
}
if (version_compare(PHP_VERSION, '6.0.0-dev', '<'))
{
@set_magic_quotes_runtime(0);
}
// Load Extensions
if (!empty($load_extensions))
{
$load_extensions = explode(',', $load_extensions);
foreach ($load_extensions as $extension)
{
@dl(trim($extension));
}
}
$sid = (isset($_GET['sid']) && !is_array($_GET['sid'])) ? htmlspecialchars($_GET['sid']) : '';
$id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
if (strspn($sid, 'abcdefABCDEF0123456789') !== strlen($sid))
{
$sid = '';
}
// This is a simple script to grab and output the requested CSS data stored in the DB
// We include a session_id check to try and limit 3rd party linking ... unless they
// happen to have a current session it will output nothing. We will also cache the
// resulting CSS data for five minutes ... anything to reduce the load on the SQL
// server a little
if ($id)
{
// Include files
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
require($phpbb_root_path . 'includes/cache.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
$db = new $sql_db();
$cache = new cache();
// Connect to DB
if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
{
exit;
}
unset($dbpasswd);
$config = $cache->obtain_config();
$user = false;
if ($sid)
{
$sql = 'SELECT u.user_id, u.user_lang
FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u
WHERE s.session_id = '" . $db->sql_escape($sid) . "'
AND s.session_user_id = u.user_id";
$result = $db->sql_query($sql);
$user = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
$recompile = $config['load_tplcompile'];
if (!$user)
{
$id = $config['default_style'];
$recompile = false;
$user = array('user_id' => ANONYMOUS);
}
$sql = 'SELECT s.style_id, c.theme_id, c.theme_data, c.theme_path, c.theme_name, c.theme_mtime, i.*, t.template_path
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i
WHERE s.style_id = ' . $id . '
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id
AND i.imageset_id = s.imageset_id';
$result = $db->sql_query($sql, 300);
$theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$theme)
{
exit;
}
if ($user['user_id'] == ANONYMOUS)
{
$user['user_lang'] = $config['default_lang'];
}
$user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang'];
$sql = 'SELECT *
FROM ' . STYLES_IMAGESET_DATA_TABLE . '
WHERE imageset_id = ' . $theme['imageset_id'] . "
AND image_filename <> ''
AND image_lang IN ('" . $db->sql_escape($user_image_lang) . "', '')";
$result = $db->sql_query($sql, 3600);
$img_array = array();
while ($row = $db->sql_fetchrow($result))
{
$img_array[$row['image_name']] = $row;
}
$db->sql_freeresult($result);
// gzip_compression
if ($config['gzip_compress'])
{
// IE6 is not able to compress the style (do not ask us why!)
$browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? strtolower(htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT'])) : '';
if ($browser && strpos($browser, 'msie 6.0') === false && @extension_loaded('zlib') && !headers_sent())
{
ob_start('ob_gzhandler');
}
}
// Expire time of seven days if not recached
$expire_time = 7*86400;
$recache = false;
// Re-cache stylesheet data if necessary
if ($recompile || empty($theme['theme_data']))
{
$recache = (empty($theme['theme_data'])) ? true : false;
$update_time = time();
// We test for stylesheet.css because it is faster and most likely the only file changed on common themes
if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
{
$recache = true;
$update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
}
else if (!$recache)
{
$last_change = $theme['theme_mtime'];
$dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
if ($dir)
{
while (($entry = readdir($dir)) !== false)
{
if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}"))
{
$recache = true;
break;
}
}
closedir($dir);
}
}
}
if ($recache)
{
include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
$theme['theme_data'] = acp_styles::db_theme_data($theme);
$theme['theme_mtime'] = $update_time;
// Save CSS contents
$sql_ary = array(
'theme_mtime' => $theme['theme_mtime'],
'theme_data' => $theme['theme_data']
);
$sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE theme_id = {$theme['theme_id']}";
$db->sql_query($sql);
$cache->destroy('sql', STYLES_THEME_TABLE);
}
// Only set the expire time if the theme changed data is older than 30 minutes - to cope with changes from the ACP
if ($recache || $theme['theme_mtime'] > (time() - 1800))
{
header('Expires: 0');
}
else
{
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + $expire_time));
}
header('Content-type: text/css; charset=UTF-8');
// Parse Theme Data
$replace = array(
'{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme',
'{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . $theme['template_path'] . '/template',
'{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset',
'{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset/' . $user_image_lang,
'{T_STYLESHEET_NAME}' => $theme['theme_name'],
'{S_USER_LANG}' => $user['user_lang']
);
$theme['theme_data'] = str_replace(array_keys($replace), array_values($replace), $theme['theme_data']);
$matches = array();
preg_match_all('#\{IMG_([A-Za-z0-9_]*?)_(WIDTH|HEIGHT|SRC)\}#', $theme['theme_data'], $matches);
$imgs = $find = $replace = array();
if (isset($matches[0]) && sizeof($matches[0]))
{
foreach ($matches[1] as $i => $img)
{
$img = strtolower($img);
$find[] = $matches[0][$i];
if (!isset($img_array[$img]))
{
$replace[] = '';
continue;
}
if (!isset($imgs[$img]))
{
$img_data = &$img_array[$img];
$imgsrc = ($img_data['image_lang'] ? $img_data['image_lang'] . '/' : '') . $img_data['image_filename'];
$imgs[$img] = array(
'src' => $phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $imgsrc,
'width' => $img_data['image_width'],
'height' => $img_data['image_height'],
);
}
switch ($matches[2][$i])
{
case 'SRC':
$replace[] = $imgs[$img]['src'];
break;
case 'WIDTH':
$replace[] = $imgs[$img]['width'];
break;
case 'HEIGHT':
$replace[] = $imgs[$img]['height'];
break;
default:
continue;
}
}
if (sizeof($find))
{
$theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']);
}
}
echo $theme['theme_data'];
if (!empty($cache))
{
$cache->unload();
}
$db->sql_close();
}
exit;
?>
Prova a copiare tutto il codice javascript nel file overall_header.html
dopo il tag </title>
prima del tag
<script type="text/javascript">
// <![CDATA[
var jump_page = '{LA_JUMP_PAGE}:'; ecc.
l'immagine snow.gif copiala nella root
dovrebbe funzionare, altrimenti dovrai modificare il percorso nel codice
Image0.src=grphcs[0]="snow.gif";
se non viene visualizzata l'immagine prova:
Image0.src=grphcs[0]="./snow.gif";
oppure prova a copiare l'immagine nella dir in cui si trova il file overall_header.html
Ho messo tutto il codice,( non il comando include),nel punto che mi hai indicato,dell'header,ed il file snow.gif,nella root, preceduto dallo slash,( ma si vede anche senza slash),ed il risultato è questo:
http://www.crazyup.net/immagini/5d18...bbf93f417c.jpg
Se il file gif.lo metto nella stessa dir dell'header nonsi vede nemmeno quel povero,isolato,ramingo fiocco di neve.....:lol:
:lol: Prova ad inserire il codice dopo il tag <body>
dopo <body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
Ho visto che finalmente funziona! :lol:
Ciao e Buon Natale
Ho messo il codice dove hai detto tu,
prima del tag
<script type="text/javascript">
// <![CDATA[
var jump_page = '{LA_JUMP_PAGE}:'; ecc.
però il codice non è il tuo ma un altro trovato in rete,e tra 5/6 provati andava bene solo uno.Lo snow.gif,invece l'ho messo su imageshack
Grazie di tutto lo stesso e scusa per il tempo che ti ho fatto perdere :lol:
Buon Natale anche a te!
Guarda nella tua pagina dove vuoi la neve scrivi questo codice
Ciao!Codice HTML:<script type="text/javascript" src="http://nokiagames.altervista.org/snow.js"></script>