code du fantome

01-11-2006 à 19:34:45
[html]<!-- HALLOWEEN -->

<!-- Copy and paste just above </BODY> in your HTML -->

<SCRIPT TYPE="text/javascript">
/**
** Ghosts - Halloween - JavaScript
** This script and many more are free at
** http://rainbow.arch.scriptmania.com/scripts/
*/
if(!window.Halloween) Halloween=new Object();
Halloween.ghostImages = new Array(
"<img src='http://rainbow.arch.scriptmania.com/scripts/ghost3.gif'>"
"<img src='http://rainbow.arch.scriptmania.com/scripts/ghost1.gif'>"
"<img src='http://rainbow.arch.scriptmania.com/scripts/ghost2.gif'>"
"<img src='http://rainbow.arch.scriptmania.com/scripts/ghost2.gif'>"
);
var ns4 = document.layers;
var ie4 = document.all;
Halloween.makeLayer = function(id)
{
var el = document.getElementById ? document.getElementById(id) :
document.all ? document.all[id] :
document.layers[id];
if(ns4) el.style=el;
el.sP=function(x,y){this.style.left = x;this.style.top=y;};
el.show=function(){ this.style.visibility = "visible"; }
el.hide=function(){ this.style.visibility = "hidden"; }
if(ns4 || window.opera)
el.sO = function(pc){return 0;};
else if(ie4)
el.sO = function(pc)
{
if(this.style.filter=="")
this.style.filter="alpha(opacity=100);";
this.filters.alpha.opacity=pc;
}
else
el.sO = function(pc){this.style.MozOpacity=pc/100;}

return el;
}

if(window.innerWidth)
{
gX=function(){return innerWidth;};
gY=function(){return innerHeight;};
}
else
{
gX=function(){return document.body.clientWidth-30;};
gY=function(){return document.body.clientHeight-30;};
}
Halloween.ghostOutput=function()
{
for(var i=0 ; i<Halloween.ghostImages.length ; i++)
document.write(ns4 ? "<LAYER NAME='gh"+i+"'>"+Halloween.ghostImages+"</LAYER>" :
"<DIV id='gh"+i+"' style='position:absolute'>"+Halloween.ghostImages+"</DIV>" );

}
Halloween.ghostSprites = new Array();
Halloween.ghostStartAni = function()
{
for(var i=0 ;i<Halloween.ghostImages.length;i++)
{
var el=Halloween.makeLayer("gh"+i);
el.x=Math.random()*gX();
el.y=Math.random()*gY();
el.tx=Math.random()*gX();
el.ty=Math.random()*gY();
el.dx=-5+Math.random()*10;
el.dy=-5+Math.random()*10;
el.state="off";
el.op=0;
el.sO(el.op);
el.hide();
Halloween.ghostSprites = el;
}
setInterval("Halloween.ghostAni()", 40);
}
Halloween.ghostAni = function()
{
for(var i=0 ;i<Halloween.ghostSprites.length;i++)
{
el=Halloween.ghostSprites;

if(el.state == "off")
{
if(Math.random() > .99)
{
el.state="up";
el.show();
}
}
else if(el.state == "on")
{
if(Math.random() > .98)
el.state="down";
}
else if(el.state == "up")
{
el.op += 2;
el.sO(el.op);
if(el.op==100)
el.state = "on";
}
else if(el.state == "down")
{
el.op -= 2;
if(el.op==0)
{
el.hide();
el.state = "off";
}
else
el.sO(el.op);
}

var X = (el.tx - el.x);
var Y = (el.ty - el.y);
var len = Math.sqrt(X*X+Y*Y);
if(len < 1) len = 1;
var dx = 20 * (X/len);
var dy = 20 * (Y/len);
var ddx = (dx - el.dx)/10;
var ddy = (dy - el.dy)/10;
el.dx += ddx;
el.dy += ddy;
el.sP(el.x+=el.dx,el.y+=el.dy);

if(Math.random() >.95 )
{
el.tx = Math.random()*gX();
el.ty = Math.random()*gY();
}

}
}
Halloween.ghostStart = function()
{
if(Halloween.ghostLoad)Halloween.ghostLoad();
Halloween.ghostStartAni();
}
Halloween.ghostOutput();
Halloween.ghostLoad=window.onload;
window.onload=Halloween.ghostStart;

</SCRIPT>
<!-- FIN HALLOWEEN -->
[/html]
01-11-2006 à 19:34:45
blablabla et du bbcode ;)
Qui ne sera pas affiché !

[html]
<?
/****************************************************************************
* rss.php
* -------------------------
* rozpoczety : 02.05.2004 r.
* wersja : $Revision: 1.2 $
* zmiana : $Date: 2004/05/28 15:38:27 $
*
****************************************************************************/

DEFINE('COYOTE', true);

include_once ('../extension.inc');
include_once ('../functions' . PHP_EXT);
include_once ('xml' . PHP_EXT);

/* pobranie informacji na temat zrodel RSS */
$sql = 'SELECT * FROM coyote_rss';

if ( $db->sql_query($sql) && $db->sql_numfields() > 0 )
{
$result = $db->sql_result();

while ( $rss = $db->sql_fetch($result) )
{
/* odswiezamy zrodla - pobieramy instrukcje zapisane w XML */
$xml = new XmlDoc($rss['rss_link']);
$array = $xml->xml_parse(); // przeksztalcamy do tablicy

$tmp = Array();
$count = -1;

for ( $i = 0; $i < count($array); $i++ )
{
if ( $array[$i]['tag'] == 'ITEM' )
{
if ( $array[$i]['type'] == 'open' )
{
++$count;
$item = true; // znacznik otwarty
}
elseif ( $array[$i]['type'] == 'close' )
{
$item = false; // znacznik zamkniety

if ( $tmp[$count]['pubDate'] > $rss['rss_update'] )
{
/* jezeli mamy infomacje, ze znacznik zostal zamkniety, to oznacza, ze
mamy juz dane dotyczace jednego newsa - mozemy go dodac do bazy. Dodajemy
jedynie w przypadku, gdy news jest nowy (tj. data jego napisania jest wieksza
od daty ostatniej aktualizacji danego RSS
*/
$sql = 'INSERT INTO coyote_news SET news_rss = ' . $rss['rss_id'] . ',
news_link = "' . $tmp[$count]['link'] . '",
news_subject = "' . addslashes(strip_tags($tmp[$count]['title'])) . '",
news_content = "' . addslashes(strip_tags($tmp[$count]['description'])) . '",
news_time = ' . $tmp[$count]['pubDate'];
$db->sql_query($sql);

}
}
}

if ( $array[$i]['tag'] == 'IMAGE' )
{
// znacznik image - otwarty, czy zamkniety?
$image = ( $array[$i]['type'] == 'open' ) ? true : false;
}

if ( $array[$i]['tag'] == 'TITLE' )
{
// jezeli napotykamy znacznik TITLE...
if ( $array[$i]['level'] == '3' )
{
// jezeli jest on poziomu 3, to oznacza, ze jest to tytul strony
$rss_title = $array[$i]['value'];
}

if ( $item == true )
{
// jezeli znacznik item jest otwarty, to oznacza, ze mamy do czynienia z tytulem newsa
$tmp[$count]['title'] = $array[$i]['value'];
}

if ( $image == true )
{
// jezeli znacznik image jest otwarty - mamy do czynienia z tytulem obrazka (atrybut alt) strony, z ktoergo pochodzi RSS
$rss_source = $array[$i]['value'];
}
}

if ( $array[$i]['tag'] == 'LINK' )
{
if ( $array[$i]['level'] == '3' )
{
$rss_link = $array[$i]['value'];
}

if ( $item == true )
{
$tmp[$count]['link'] = $array[$i]['value'];
}
}

if ( $array[$i]['tag'] == 'DESCRIPTION' )
{
if ( $array[$i]['level'] == '3' )
{
$rss_description = $array[$i]['value'];
}
$tmp[$count]['description'] = $array[$i]['value'];
}

if ( $array[$i]['tag'] == 'PUBDATE' )
{
$tmp[$count]['pubDate'] = strtotime($array[$i]['value']);
}

if ( $array[$i]['tag'] == 'LANGUAGE' )
{
$rss_lang = $array[$i]['value'];
}

if ( $array[$i]['tag'] == 'URL' )
{
$rss_image = $array[$i]['value'];
}

}

// uaktualniamy informacje dotyczace strony RSS
$sql = 'UPDATE coyote_rss SET rss_title = "' . addslashes($rss_title) . '",
rss_description = "' . addslashes($rss_description) . '",
rss_lang = "' . $rss_lang . '",
rss_update = ' . time() . ',
rss_image = "' . $rss_image . '",
rss_source = "' . $rss_source . '" WHERE rss_id = ' . $rss['rss_id'];
$db->sql_query($sql);

$xml->Destroy();
}
}

// $Id: rss.php,v 1.2 2004/05/28 15:38:27 Adam Exp $

?>
[/html]