با سلام
کلیه کد های کاربردی php در این بخش قرار می گیرد...
طريقه ايجاد افكت Glow براي متن نوشته شده :
حالت Blur
<?php
echo "<p><font face=\"Tahoma\">\n";
echo "<span style=\"FILTER: blur(Strength=10); WIDTH: 1px; HEIGHT: 1px\">\n";
echo "<font face=\"Tahoma\" color=\"#800000\" style=\"font-size: 10pt\">WELCOME</font></span></font></p>\n";
?>
اين کد ماله اينکه وقتی موس ميره روش رنگی ميشه : (براي لينك)
<?php
echo "<script>n";
echo "n";
echo "/*n";
echo "Highlight Link scriptn";
echo "By JavaScript Kit ]n";
echo "Over 400 free scripts here!n";
echo "Above notice MUST stay entact for usen";
echo "*/n";
echo "n";
echo "function highlight(which,color){n";
echo "if (document.all||document.getElementById)n";
echo "which.style.backgroundColor=colorn";
echo "}n";
echo "</script>n";
echo "n";
echo "n";
echo "<center>n";
echo "n";
echo "n";
echo "<a href="http://msn.com/" onMouseover="highlight(this,'yellow')" onMouseout="highlight([/color]n";
?>
كد ساعت در پايين صفحه بهمراه تاريخ در قسمت استاتيوس بار:
<?php
echo "[color=navy]<!-- ONE STEP TO INSTALL PROPER DATE:n";
echo "n";
echo " 1. Add the first code to the BODY of your HTML document -->n";
echo "n";
echo "<!-- STEP ONE: Add the first code to the BODY of your HTML document -->n";
echo "n";
echo "<BODY>n";
echo "n";
echo "<SCRIPT LANGUAGE="JavaScript">n";
echo "<!-- Original: Peter Oxley (peter@theun.com) -->n";
echo "<!-- Web Site: http://www.theun.com -->n";
echo "n";
echo "<!--Total Java Scripts 99 - Next Step Software-->n";
echo "n";
echo "<!-- Beginn";
echo "today=new Date();n";
echo "day=today.getDate();n";
echo "year=today.getYear();n";
echo "month=today.getMonth() 1;n";
echo "if (day==1) end=("st");n";
echo "else if (day==2) end=("nd");n";
echo "else if (day==3) end=("rd");n";
echo "else if (day==21) end=("st");n";
echo "else if (day==22) end=("nd");n";
echo "else if (day==23) end=("rd");n";
echo "else if (day==31) end=("st");n";
echo "else end=("th");n";
echo "if (month==1) name=("January");n";
echo "else if (month==2) name=("February");n";
echo "else if (month==3) name=("March");n";
echo "else if (month==4) name=("April");n";
echo "else if (month==5) name=("May");n";
echo "else if (month==6) name=("June");n";
echo "else if (month==7) name=("July");n";
echo "else if (month==8) name=("August");n";
echo "else if (month==9) name=("September");n";
echo "else if (month==10) name=("October");n";
echo "else if (month==11) name=("November");n";
echo "else name=("December");n";
echo "if (year<100) year="19" year;n";
echo "document.write(name " " day end ", " year);n";
echo "// End -->n";
echo "</script>n";
echo "[color=navy]<!-- ONE STEP TO INSTALL PROPER DATE:n";
echo "n";
echo " 1. Add the first code to the BODY of your HTML document -->n";
echo "n";
echo "<!-- STEP ONE: Add the first code to the BODY of your HTML document -->n";
echo "n";
echo "<BODY>n";
echo "n";
echo "<SCRIPT LANGUAGE="JavaScript">n";
echo "<!-- Original: Peter Oxley (peter@theun.com) -->n";
echo "<!-- Web Site: http://www.theun.com -->n";
echo "n";
echo "<!--Total Java Scripts 99 - Next Step Software-->n";
echo "n";
echo "<!-- Beginn";
echo "today=new Date();n";
echo "day=today.getDate();n";
echo "year=today.getYear();n";
echo "month=today.getMonth() 1;n";
echo "if (day==1) end=("st");n";
echo "else if (day==2) end=("nd");n";
echo "else if (day==3) end=("rd");n";
echo "else if (day==21) end=("st");n";
echo "else if (day==22) end=("nd");n";
echo "else if (day==23) end=("rd");n";
echo "else if (day==31) end=("st");n";
echo "else end=("th");n";
echo "if (month==1) name=("January");n";
echo "else if (month==2) name=("February");n";
echo "else if (month==3) name=("March");n";
echo "else if (month==4) name=("April");n";
echo "else if (month==5) name=("May");n";
echo "else if (month==6) name=("June");n";
echo "else if (month==7) name=("July");n";
echo "else if (month==8) name=("August");n";
echo "else if (month==9) name=("September");n";
echo "else if (month==10) name=("October");n";
echo "else if (month==11) name=("November");n";
echo "else name=("December");n";
echo "if (year<100) year="19" year;n";
echo "document.write(name " " day end ", " year);n";
echo "// End -->n";
echo "</script>n";
echo "n";
echo "<!-- Script Size: 1.31 KB -->[/colorn";
echo "<!-- Script Size: 1.31 KB -->[/color]n";
?>
اين کد ساعت های چند شهر مهم را نشون ميده :
<?php
echo "[color=navy]<table border="0" width="200" cellspacing="0" cellpadding="3">n";
echo "<form name="where">n";
echo " <tr>n";
echo " <td width="100%">n";
echo "<select name="city" size="1" onchange="updateclock(this);"> n";
echo "<option value="" selected>Local time</option>n";
echo "<option value="0">London GMT</option> n";
echo "<option value="1">Rome</option>n";
echo "<option value="7">Bangkok</option>n";
echo "<option value="8">Hong Kong</option>n";
echo "<option value="9">Tokyo</option> n";
echo "<option value="10">Sydney</option>n";
echo "<option value="12">Fiji</option>n";
echo "<option value="-10">Hawaii</option>n";
echo "<option value="-8">San Francisco</option> n";
echo "<option value="-5">New York</option>n";
echo "<option value="-3">Buenos Aires</option>n";
echo "</select>n";
echo "n";
echo "</td>n";
echo " </tr>n";
echo " <tr>n";
echo " <td width="100%">n";
echo "<script language="JavaScript">n";
echo "n";
echo "/*n";
echo "Drop Down World Clock- By sevom(http://www.sevom.persianblog.com)n";
echo "Portions of code by Amir Ali @ http://www.sevom.persianblog.comn";
echo "This credit notice must stay intactn";
echo "*/n";
echo "n";
echo "if (document.all||document.getElementById)n";
echo "document.write('<span id="worldclock" style="font:bold 16px Arial;"></span><br>')n";
echo "n";
echo "zone=0;n";
echo "isitlocal=true;n";
echo "ampm='';n";
echo "n";
echo "function updateclock(z){n";
echo "zone=z.options[z.selectedIndex].value;n";
echo "isitlocal=(z.options[0].selected)?true:false;n";
echo "}n";
echo "n";
echo "function WorldClock(){n";
echo "now=new Date();n";
echo "ofst=now.getTimezoneOffset()/60;n";
echo "secs=now.getSeconds();n";
echo "sec=-1.57 Math.PI*secs/30;n";
echo "mins=now.getMinutes();n";
echo "min=-1.57 Math.PI*mins/30;n";
echo "hr=(isitlocal)?now.getHours():(now.getHours() parseInt(ofst)) parseInt(zone);n";
echo "hrs=-1.575 Math.PI*hr/6 Math.PI*parseInt(now.getMinutes())/360;n";
echo "if (hr < 0) hr =24;n";
echo "if (hr > 23) hr-=24;n";
echo "ampm = (hr > 11)?"PM":"AM";n";
echo "statusampm = ampm.toLowerCase();n";
echo "n";
echo "hr2 = hr;n";
echo "if (hr2 == 0) hr2=12;n";
echo "(hr2 < 13)?hr2:hr2 %= 12;n";
echo "if (hr2<10) hr2="0" hr2n";
echo "n";
echo "var finaltime=hr2 ':' ((mins < 10)?"0" mins:mins) ':' ((secs < 10)?"0" secs:secs) ' ' statusampm;n";
echo "n";
echo "if (document.all)n";
echo "worldclock.innerHTML=finaltimen";
echo "else if (document.getElementById)n";
echo "document.getElementById("worldclock").innerHTML=finaltimen";
echo "else if (document.layers){n";
echo "document.worldclockns.document.worldclockns2.document.write(finaltime)n";
echo "document.worldclockns.document.worldclockns2.document.close()n";
echo "}n";
echo "n";
echo "n";
echo "setTimeout('WorldClock()',1000);n";
echo "}n";
echo "n";
echo "window.onload=WorldClockn";
echo "//-->n";
echo "</script>n";
echo "n";
echo "<!--Place holder for NS4 only-->n";
echo "<ilayer id="worldclockns" width=100% height=35><layer id="worldclockns2" width=100% height=35 left=0 top=0 style="font:bold 16px Arial;"></layer></ilayer>n";
echo "n";
echo "<font face="arial" size="-2">This free script provided by <a href="http://www.javascriptkit.com">JavaScript Kit</a></font>n";
echo "</td>n";
echo "</form>n";
echo " </tr>n";
echo "</table>[/color]n";
?>
افکت بسیار زیبا برای بک گراند:
<?php
echo "[color=navy]<body bgcolor='#000000' >n";
echo "<!-- Start of Fireworks -->n";
echo "<script language="JavaScript">n";
echo "<!-- IE4 , NS4 , NS6 Fireworks script by irtnt.persianblog.comn";
echo "CL=new Array('#ff0000','#00ff00','#ffffff','#ff00ff','#ffa500','#ffff00','#00ff00','#ffffff','#ff00ff')n";
echo "CL2=new Array('#ffa500','#00ff00','#FFAAFF','#fff000','#fffffF')n";
echo "Xpos=130;n";
echo "Ypos=130;n";
echo "I='#00ff00';n";
echo "C=0;n";
echo "S=5;n";
echo "H=null;n";
echo "W=null;n";
echo "Y=null;n";
echo "NS4=(document.layers);n";
echo "NS6=(document.getElementById&&!document.all);n";
echo "IE4=(document.all);n";
echo "A=14;n";
echo "E=120;n";
echo "L=null;n";
echo "if (NS4){n";
echo "for (i=0; i < A; i )n";
echo "document.write('<LAYER NAME="nsstars' i '" TOP=0 LEFT=0 BGCOLOR=' I ' CLIP="0,0,2,2"></LAYER>');n";
echo "}n";
echo "if (NS6){n";
echo "window.document.body.style.overflow='hidden';n";
echo "for (i=0; i < A; i )n";
echo "document.write('<div id="ns6stars' i '" style="position:absolute;top:0px;left:0px;height:2px;width:2px;font-size:2px;background:' I '"></div>');n";
echo "}n";
echo "if (IE4){n";
echo "document.write('<div id="ie" style="position:absolute;top:0px;left:0px"><div style="position:relative">');n";
echo "for (i=0; i < A; i )n";
echo "document.write('<div id="iestars" style="position:absolute;top:0;left:0;width:2px;height:2px;background:' I ';font-size:2px"></div>');n";
echo "document.write('</div></div>');n";
echo "}n";
echo "function Fireworks(){n";
echo "H=(NS4||NS6)?window.innerHeight:window.document.body.clientHeight;n";
echo "W=(NS4||NS6)?window.innerWidth:window.document.body.clientWidth;n";
echo "Y=(NS4||NS6)?window.pageYOffset:window.document.body.scrollTop;n";
echo "for (i=0; i < A; i ){n";
echo "if (IE4)L=iestars[i].style;n";
echo "if (NS4)L=document.layers["nsstars" i];n";
echo "if (NS6)L=document.getElementById("ns6stars" i).style;n";
echo "var F = CL[Math.floor(Math.random()*CL.length)];n";
echo "var RS=Math.round(Math.random()*2);n";
echo "L.top = Ypos E*Math.sin((C i*5)/3)*Math.sin(C/100)n";
echo "L.left= Xpos E*Math.cos((C i*5)/3)*Math.sin(C/100)n";
echo "if (C < 110){n";
echo " if (NS4){L.bgColor=I;L.clip.width=1;L.clip.height=1}n";
echo " if (IE4||document.getElementById)n";
echo " {L.background=I;L.width=1;L.height=1;L.fontSize=1}n";
echo " }n";
echo "else{n";
echo " if (NS4){L.bgColor=F;L.clip.width=RS;L.clip.height=RS}n";
echo " if (IE4||document.getElementById){L.background=F;L.width=RS;L.height=RS;L.fontSize=RS}n";
echo " }n";
echo "}n";
echo "if (C > 220){n";
echo " C=0;n";
echo " var NC = CL2[Math.floor(Math.random()*CL2.length)];n";
echo " I=NC;n";
echo " E=Math.round(100 Math.random()*90);n";
echo " Ypos = E Math.round(Math.random()*(H-(E*2.2))) Y;n";
echo " Xpos = E Math.round(Math.random()*(W-(E*2.2)));n";
echo "}n";
echo "C =S;n";
echo "setTimeout("Fireworks()",10);n";
echo "}n";
echo "Fireworks();n";
echo "// -->n";
echo "</script>n";
echo "<!-- End of Fireworks -->[/color]n";
?>
اين کد برای قرار دادن عکسی بعنوان زمينه وبلاگ یا سایت مي باشد : جاي علامت سئوال آدرس عكستون رو بنويسيد
<?php
echo "[color=navy]body style=\"background-image: url('http://?????????????????????????????')\">\n";
?>
با اين كد عنوان (title) صفحه اينترنتی خود را به حركت در آوريد :
<?php
echo "[color=navy]<head>
n";
echo "<script language="JavaScript1.2">
n";
echo "
n";
echo "
n";
echo "var message="به پیشگامان متاخوش آمدید" //specifys the title
n";
echo "var message=message " " //gives a pause at the end,1 space=1 speed unit, here I used 10 spaces@150 each = 1.5seconds.
n";
echo "i="0" //declares the variable and sets it to start at 0
n";
echo "var temptitle="" //declares the variable and sets it to have no value yet.
n";
echo "var speed="150" //the delay in milliseconds between letters
n";
echo "
n";
echo "function titler(){
n";
echo "if (!document.all&&!document.getElementById)
n";
echo "return
n";
echo "document.title=temptitle message.charAt(i) //sets the initial title
n";
echo "temptitle=temptitle message.charAt(i) //increases the title by one letter
n";
echo "i //increments the counter
n";
echo "if(i==message.length) //determines the end of the message
n";
echo "{
n";
echo "i="0" //resets the counter at the end of the message
n";
echo "temptitle="" //resets the title to a blank value
n";
echo "}
n";
echo "setTimeout("titler()",speed) //Restarts. Remove line for no-repeat.
n";
echo "}
n";
echo "
n";
echo "window.onload=titler
n";
echo "</script>[/left]
n";
echo "</head></body>[/color] n";
?>
با اين كد به بازديد كننده اجازه ميدهيد كه سايت وبلاگ يا وبلاگ شما را با كليك بر روی add favorit به سايتهای منتخب خود اضافه كند :
<?php
echo "[color=navy]<SCRIPT language=JavaScript1.2>
n";
echo "var bookmarkurl="htt://www.iranjava.net"
n";
echo "var bookmarktitle="java applet free"
n";
echo "function addbookmark(){
n";
echo "if (document.all)
n";
echo "window.external.AddFavorite(bookmarkurl,bookmarktitle)
n";
echo "}
n";
echo "</SCRIPT>
n";
echo "<TABLE border=0 width=800>
n";
echo " <TR>
n";
echo " <TD width=108><a href="javascript:addbookmark()">ADD FAVORIT</a> </TD>
n";
echo " <TD width=676>
n";
echo " </TD></TR></TBODY></TABLE>
n";
echo "</body>
n";
echo "</html>[/color]
n";
echo " n";
?>
قرار دادن ساعت در وبلاگ:
<?php
echo "[color=navy]<!-- ONE STEP TO INSTALL BUTTON TIME:
n";
echo "
n";
echo " 1. Put the coding into the BODY of your HTML document -->
n";
echo "
n";
echo "<!-- STEP ONE: Add this code into the BODY of your HTML document -->
n";
echo "
n";
echo "<BODY>
n";
echo "
n";
echo "<SCRIPT LANGUAGE="JavaScript">
n";
echo "
n";
echo "<!-- Original: Michael Tartaglia <stonedstan@hotmail.com> -->
n";
echo "<!-- Web Site: http://www.geocities.com/SiliconValley/Horizon/5235 -->
n";
echo "
n";
echo "<!--Total Java Scripts 99 - Next Step Software-->
n";
echo "
n";
echo "<!-- Begin
n";
echo "day = new Date();
n";
echo "miVisit = day.getTime();
n";
echo "function clock() {
n";
echo "dayTwo = new Date();
n";
echo "hrNow = dayTwo.getHours();
n";
echo "mnNow = dayTwo.getMinutes();
n";
echo "scNow = dayTwo.getSeconds();
n";
echo "miNow = dayTwo.getTime();
n";
echo "if (hrNow == 0) {
n";
echo "hour = 12;
n";
echo "ap = " AM";
n";
echo "} else if(hrNow <= 11) {
n";
echo "ap = " AM";
n";
echo "hour = hrNow;
n";
echo "} else if(hrNow == 12) {
n";
echo "ap = " PM";
n";
echo "hour = 12;
n";
echo "} else if (hrNow >= 13) {
n";
echo "hour = (hrNow - 12);
n";
echo "ap = " PM";
n";
echo "}
n";
echo "if (hrNow >= 13) {
n";
echo "hour = hrNow - 12;
n";
echo "}
n";
echo "if (mnNow <= 9) {
n";
echo "min = "0" mnNow;
n";
echo "}
n";
echo "else (min = mnNow)
n";
echo "if (scNow <= 9) {
n";
echo "secs = "0" scNow;
n";
echo "} else {
n";
echo "secs = scNow;
n";
echo "}
n";
echo "time = hour ":" min ":" secs ap;
n";
echo "document.form.button.value = time;
n";
echo "self.status = time;
n";
echo "setTimeout('clock()', 1000);
n";
echo "}
n";
echo "function timeInfo() {
n";
echo "milliSince = miNow;
n";
echo "milliNow = miNow - miVisit;
n";
echo "secsVisit = Math.round(milliNow / 1000);
n";
echo "minsVisit = Math.round((milliNow / 1000) / 60);
n";
echo "alert("There have been " milliSince " milliseconds since midnight, January 1, 1970. "
n";
echo " "You have spent " milliNow " of those milliseconds on this page. "
n";
echo " ".... About " minsVisit " minutes, and "
n";
echo " secsVisit " seconds.");
n";
echo "}
n";
echo "document.write("<form name="form">"
n";
echo " "<input type=button value="Click for info!""
n";
echo " " name=button onClick="timeInfo()"></form>");
n";
echo "onError = null;
n";
echo "clock();
n";
echo "// End -->
n";
echo "</SCRIPT>
n";
echo "
n";
echo "<!-- Script Size: 1.72 KB -->
n";
echo "</body>
n";
echo "</html>[/color] n";
?>
با اين كد چند تا رنگ بصورت خيلي زيبا با موس شما حركت مي كنه و جلوه ي خاصي ايجاد مي كنه ، قشنگه :
<?php
echo "[color=navy]</h2>
n";
echo "</body>
n";
echo "</html>
n";
echo "<SCRIPT language=JavaScript>
n";
echo "<!-- Script by kurt.grigg@virgin.net
n";
echo "//adapté pour vos mails par Nollizua...le Site de Nollizua...http://www.nollizua.com
n";
echo "if (document.all){
n";
echo "
n";
echo "colours=new Array('00ff00','ffff00','ff0000','ff00ff','0000ff','ee00ee','8470ff','FFBD08','DE2929')
n";
echo "
n";
echo "amount=colours.length;
n";
echo "YgetDelay=0,XgetDelay=0,Ydelay=0,Xdelay=0,step=0.2,currStep=0,my=0,mx=0;
n";
echo "document.write('<div id="ie" style="position:absolute;top:0;left:0;"><div style="position:relative">');
n";
echo "for (i=0; i < amount; i )
n";
echo "document.write('<div id="iestars" style="position:absolute;top:0px;left:0px;height:50px;width:50px;font-family:Courier New;font-size:5px;color:' colours[i] ';padding-top:20px;text-align:center">.</div>');
n";
echo "document.write('</div></div>');
n";
echo "ini=1;
n";
echo "gstep=1;
n";
echo "function iMouse(){
n";
echo "my=event.y;mx=event.x;
n";
echo "}
n";
echo "document.onmousemove=iMouse
n";
echo "function dim(){
n";
echo "ini-=gstep;
n";
echo "dt=setTimeout('dim()',10);
n";
echo "if (ini < 2){
n";
echo "clearTimeout(dt);
n";
echo "glow();
n";
echo "}
n";
echo "}
n";
echo "function glow(){
n";
echo "ini =gstep;
n";
echo "gt=setTimeout('glow()',10);
n";
echo "if (ini > 14){
n";
echo "clearTimeout(gt);
n";
echo "dim();
n";
echo "}
n";
echo "}
n";
echo "function stars(){
n";
echo "ie.style.top=document.body.scrollTop;
n";
echo "for (i=0; i < amount; i )
n";
echo "{
n";
echo "var layer=iestars[i].style;
n";
echo "layer.filter='glow(color=' colours[i] ', strength=' ini ')';
n";
echo "layer.top= Ydelay 100*Math.sin((5*Math.sin((currStep-15.99)/10)) i*70)*Math.sin((currStep)/10)*Math.cos((currStep i*25)/10);
n";
echo "layer.left=Xdelay 180*Math.cos((5*Math.sin((currStep-15.99)/10)) i*70)*Math.sin((currStep)/10)*Math.cos((currStep i*25)/10);
n";
echo "}
n";
echo "currStep =step;
n";
echo "}
n";
echo "function delay(){
n";
echo "Ydelay = YgetDelay =(my-YgetDelay)*1/20;
n";
echo "Xdelay = XgetDelay =(mx-XgetDelay)*1/20;
n";
echo "stars();
n";
echo "setTimeout('delay()',10);
n";
echo "}
n";
echo "delay();
n";
echo "glow();
n";
echo "}[/left]
n";
echo "//-->
n";
echo "</SCRIPT>[/color] n";
?>
کد php ارسال های مرتبط (Related posts)
<?php
echo "< ?php
\n";
echo "$tags = wp_get_post_tags($post->ID);
\n";
echo "if ($tags) {
\n";
echo " $tag_ids = array();
\n";
echo " foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
\n";
echo "
\n";
echo " $args=array(
\n";
echo " 'tag__in' => $tag_ids,
\n";
echo " 'post__not_in' => array($post->ID),
\n";
echo " 'showposts'=>5, // Number of related posts that will be shown.
\n";
echo " 'caller_get_posts'=>1
\n";
echo " );
\n";
echo " $my_query = new wp_query($args);
\n";
echo " if( $my_query->have_posts() ) {
\n";
echo " echo '
\n";
echo "<h3>ارسال های مرتبط</h3>
\n";
echo "<ul>';
\n";
echo " while ($my_query->have_posts()) {
\n";
echo " $my_query->the_post();
\n";
echo " ?>
\n";
echo " <li><a href=\"<?php the_permalink() ?>\" rel=\"bookmark\" title=\"Permanent Link to < ?php the_title_attribute(); ?>\">< ?php the_title(); ?></a></li>
\n";
echo "< ?php
\n";
echo " }
\n";
echo " echo '</ul>
\n";
echo "';
\n";
echo " }
\n";
echo "}
\n";
echo "?></ul>\n";
?>
كد زير اين امكان رو براي شما ايجاد مي كنه كه با كليك كردن روي آن، مي تونيد اون صفحه وب رو به صفحات مورد علاقتون پيوند دهيد:
<?php
echo "<A
\n";
echo "
\n";
echo "href=\"javascript:history.go(0)\"
\n";
echo "
\n";
echo "onClick=\"javascript:this.style.behavior='url(#default#homepage)';this.setHomePage
\n";
echo "
\n";
echo "('http://www.Link.com');\" TARGET=\"_self\">Set As
\n";
echo "
\n";
echo "HomePage</A></body>
\n";
echo "</html>\n";
?>
اين کد حباب هايي در وبلاگ یا سایت شما ايجاد مي کنه که به سمت بالا و خيلي زيبا به حرکت در مياد:
(حباب ها به رنگ آبي كمرنگ هستند)
<?php
echo "<?php
n";
echo "echo "<?php
n";
echo "n";
n";
echo "echo "echo "<script language="JavaScript1.2">
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "<!-- Begin
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "//Bubble Script by Lisa (issa@lissaexplains.com, http://lissaexplains.com)
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "//Based on code by Altan d.o.o. (snow@altan.hr)
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "//For full source code and installation instructions to this script, visit http://www.dynamicdrive.com
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var no = 15; // image number or falling rate
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var speed = 2; // the lower the number the faster the image moves
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var snow = new Array();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "snow[0] = "bubble.gif"
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "snow[1] = "bubble.gif"
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "snow[2] = "bubble.gif"
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var ns4up = (document.layers) ? 1 : 0; // browser sniffer
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var ie4up = (document.all) ? 1 : 0;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var dx, xp, yp; // coordinate and position variables
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var am, stx, sty; // amplitude and step variables
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "var i, doc_width = 800, doc_height = 1800;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "if (ns4up||ns6up) {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " doc_width = self.innerWidth;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " doc_height = self.innerHeight;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "} else if (ie4up) {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " doc_width = document.body.clientWidth;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " doc_height = document.body.clientHeight;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "}
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "dx = new Array();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "xp = new Array();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "yp = new Array();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "am = new Array();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "stx = new Array();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "sty = new Array();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "j = 0;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "for (i = 0; i < no; i) {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " dx[i] = 0; // set coordinate variables
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " xp[i] = Math.random()*(doc_width-50); // set position variables
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " yp[i] = Math.random()*doc_height;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " am[i] = Math.random()*20; // set amplitude variables
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " stx[i] = 0.02 Math.random()/10; // set step variables
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " sty[i] = 0.7 Math.random(); // set step variables
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " if (ns4up) { // set layers
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " if (i == 0) {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.write("<layer name="dot" i "" left="15" top="15" visibility="show"><img src="" snow[j] "" border="0"></layer>");
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " } else {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.write("<layer name="dot" i "" left="15" top="15" visibility="show"><img src="" snow[j] "" border="0"></layer>");
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " } } else if (ie4up||ns6up) { if (i == 0)
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "{
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.write("<div id="dot" i "" style="POSITION: absolute; Z-INDEX: " i "VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;"><img src="" snow[j] "" border="0"></div>");
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " } else {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.write("<div id="dot" i "" style="POSITION: absolute; Z-INDEX: " i "VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;"><img src="" snow[j] "" border="0"></div>");
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " if (j == (snow.length-1)) { j = 0; } else { j = 1; }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "}
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "function snowNS() { // Netscape main animation function
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " for (i = 0; i < no; i) { // iterate for every dot
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " yp[i] -= sty[i]; if (yp[i] < -50) {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " xp[i] = Math.random()*(doc_width-am[i]-30);
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " yp[i] = doc_height;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " stx[i] = 0.02 Math.random()/10;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " sty[i] = 0.7 Math.random();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " doc_width = self.innerWidth;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " doc_height = self.innerHeight; }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " dx[i] = stx[i];
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.layers["dot" i].top = yp[i] pageYOffset;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.layers["dot" i].left = xp[i]
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "am[i]*Math.sin(dx[i]);
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " setTimeout("snowNS()", speed);
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "}
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "function snowIE_NS6() { // IE main animation function
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " for (i = 0; i < no; i) { // iterate for every dot
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " yp[i] -= sty[i];
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " if (yp[i] < -50) {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " xp[i] = Math.random()*(doc_width-am[i]-30);
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " yp[i] = doc_height;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " stx[i] = 0.02 Math.random()/10;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " sty[i] = 0.7 Math.random();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " doc_width = ns6up?window.innerWidth-5:document.body.clientWidth;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " doc_height = ns6up?window.innerHeight-5:document.body.clientHeight;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " dx[i] = stx[i];
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " if (ie4up){
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.all["dot" i].style.pixelTop = yp[i] document.body.scrollTop;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.all["dot" i].style.pixelLeft = xp[i] am[i]*Math.sin(dx[i]);
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " else if (ns6up){
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.getElementById("dot" i).style.top=yp[i] pageYOffset;
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " document.getElementById("dot" i).style.left=xp[i] am[i]*Math.sin(dx[i]);
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " }
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " setTimeout("snowIE_NS6()", speed);
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "}
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "if (ns4up) {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " snowNS();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "} else if (ie4up||ns6up) {
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo " snowIE_NS6();
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "}
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "// End -->
n";
echo "n";
n";
echo "echo "n";
n";
echo "n";
n";
echo "echo "echo "</script>n";
n";
echo "n";
n";
echo "echo "?>n";
n";
echo "?>n";
?>
با استفاده از كد زير مي تونيد چند تا توپ خوشكل آبي داشته باشيد كه دنبال موس شما به حركت در مياد
<?php
echo "<div id="dot0" style="position: absolute; visibility: hidden; height: 11; width: 11;"><img src="image.gif" height=11 width=11></div>
n";
echo "<div id="dot1" style="position: absolute; height:20; width:20;"><img src="http://web.1asphost.com/tnt2t/pic3/image.gif" height=20 width=20></div>
n";
echo "<div id="dot2" style="position: absolute; height:20; width:20;"><img src="http://web.1asphost.com/tnt2t/pic3/image.gif" height=20 width=20></div>
n";
echo "<div id="dot3" style="position: absolute; height:20; width:20;"><img src="http://web.1asphost.com/tnt2t/pic3/image.gif" height=20 width=20></div>
n";
echo "<div id="dot4" style="position: absolute; height:20; width:20;"><img src="http://web.1asphost.com/tnt2t/pic3/image.gif" height=20 width=20></div>
n";
echo "<div id="dot5" style="position: absolute; height:20; width:20;"><img src="http://web.1asphost.com/tnt2t/pic3/image.gif" height=20 width=20></div>
n";
echo "<div id="dot6" style="position: absolute; height:20; width:20;"><img src="http://web.1asphost.com/tnt2t/pic3/image.gif" height=20 width=20></div>
n";
echo "
n";
echo "<SCRIPT LANGUAGE="JavaScript">
n";
echo "<!-- Script by: http://evil.5u.com/ -->
n";
echo "<!-- Web Site: http://evil.5u.com/ -->
n";
echo "<!-- 'Scrolling Fix' by Troels Jakobsen <http://evil.5u.com/> -->
n";
echo "
n";
echo "<!-- Begin
n";
echo "var nDots = 7;
n";
echo "var Xpos = 0;
n";
echo "var Ypos = 0;
n";
echo "
n";
echo "var DELTAT = .01;
n";
echo "var SEGLEN = 10;
n";
echo "var SPRINGK = 10;
n";
echo "var MASS = 1;
n";
echo "var GRAVITY = 50;
n";
echo "var RESISTANCE = 10;
n";
echo "var STOPVEL = 0.1;
n";
echo "var STOPACC = 0.1;
n";
echo "var DOTSIZE = 11;
n";
echo "var BOUNCE = 0.75;
n";
echo "var isNetscape = navigator.appName=="Netscape";
n";
echo "var followmouse = true;
n";
echo "var dots = new Array();
n";
echo "init();
n";
echo "function init() {
n";
echo "var i = 0;
n";
echo "for (i = 0; i < nDots; i ) {
n";
echo "dots[i] = new dot(i);
n";
echo "}
n";
echo "if (!isNetscape) {
n";
echo "// I only know how to read the locations of the
n";
echo "// <LI> items in IE
n";
echo "//skip this for now
n";
echo "// setInitPositions(dots)
n";
echo "}
n";
echo "for (i = 0; i < nDots; i ) {
n";
echo "dots[i].obj.left = dots[i].X;
n";
echo "dots[i].obj.top = dots[i].Y;
n";
echo "}
n";
echo "if (isNetscape) {
n";
echo "startanimate();
n";
echo "} else {
n";
echo "// let dots sit there for a few seconds
n";
echo "// since they're hiding on the real bullets
n";
echo "setTimeout("startanimate()", 3000);
n";
echo " }
n";
echo "}
n";
echo "function dot(i) {
n";
echo "this.X = Xpos;
n";
echo "this.Y = Ypos;
n";
echo "this.dx = 0;
n";
echo "this.dy = 0;
n";
echo "if (isNetscape) {
n";
echo "this.obj = eval("document.dot" i);
n";
echo "} else {
n";
echo "this.obj = eval("dot" i ".style");
n";
echo " }
n";
echo "}
n";
echo "function startanimate() {
n";
echo "setInterval("animate()", 20);
n";
echo "}
n";
echo "function setInitPositions(dots) {
n";
echo "var startloc = document.all.tags("LI");
n";
echo "var i = 0;
n";
echo "for (i = 0; i < startloc.length && i < (nDots - 1); i ) {
n";
echo "dots[i 1].X = startloc[i].offsetLeft
n";
echo "startloc[i].offsetParent.offsetLeft - DOTSIZE;
n";
echo "dots[i 1].Y = startloc[i].offsetTop
n";
echo "startloc[i].offsetParent.offsetTop 2*DOTSIZE;
n";
echo "}
n";
echo "dots[0].X = dots[1].X;
n";
echo "dots[0].Y = dots[1].Y - SEGLEN;
n";
echo "}
n";
echo "function MoveHandler(e) {
n";
echo "Xpos = e.pageX;
n";
echo "Ypos = e.pageY;
n";
echo "return true;
n";
echo "}
n";
echo "function MoveHandlerIE() {
n";
echo "Xpos = window.event.x document.body.scrollLeft;
n";
echo "Ypos = window.event.y document.body.scrollTop;
n";
echo "}
n";
echo "if (isNetscape) {
n";
echo "document.captureEvents(Event.MOUSEMOVE);
n";
echo "document.onMouseMove = MoveHandler;
n";
echo "} else {
n";
echo "document.onmousemove = MoveHandlerIE;
n";
echo "}
n";
echo "function vec(X, Y)
n";
echo "{
n";
echo "this.X = X;
n";
echo "this.Y = Y;
n";
echo "}
n";
echo "
n";
echo "// adds force in X and Y to spring for dot[i] on dot[j]
n";
echo "function springForce(i, j, spring)
n";
echo "{
n";
echo "var dx = (dots[i].X - dots[j].X);
n";
echo "var dy = (dots[i].Y - dots[j].Y);
n";
echo "var len = Math.sqrt(dx*dx dy*dy);
n";
echo "if (len > SEGLEN) {
n";
echo "var springF = SPRINGK * (len - SEGLEN);
n";
echo "spring.X = (dx / len) * springF;
n";
echo "spring.Y = (dy / len) * springF;
n";
echo " }
n";
echo "}
n";
echo "function animate() {
n";
echo "var start = 0;
n";
echo "if (followmouse) {
n";
echo "dots[0].X = Xpos;
n";
echo "dots[0].Y = Ypos;
n";
echo "start = 1;
n";
echo "}
n";
echo "for (i = start ; i < nDots; i ) {
n";
echo "var spring = new vec(0, 0);
n";
echo "if (i > 0) {
n";
echo "springForce(i-1, i, spring);
n";
echo "}
n";
echo "if (i < (nDots - 1)) {
n";
echo "springForce(i 1, i, spring);
n";
echo "}
n";
echo "var resist = new vec(-dots[i].dx * RESISTANCE, -dots[i].dy * RESISTANCE);
n";
echo "var accel = new vec((spring.X resist.X)/ MASS, (spring.Y resist.Y)/ MASS GRAVITY);
n";
echo "dots[i].dx = (DELTAT * accel.X);
n";
echo "dots[i].dy = (DELTAT * accel.Y);
n";
echo "if (Math.abs(dots[i].dx) < STOPVEL &&
n";
echo "Math.abs(dots[i].dy) < STOPVEL &&
n";
echo "Math.abs(accel.X) < STOPACC &&
n";
echo "Math.abs(accel.Y) < STOPACC) {
n";
echo "dots[i].dx = 0;
n";
echo "dots[i].dy = 0;
n";
echo "}
n";
echo "dots[i].X = dots[i].dx;
n";
echo "dots[i].Y = dots[i].dy;
n";
echo "var height, width;
n";
echo "if (isNetscape) {
n";
echo "height = window.innerHeight document.scrollTop;
n";
echo "width = window.innerWidth document.scrollLeft;
n";
echo "} else {
n";
echo "height = document.body.clientHeight document.body.scrollTop;
n";
echo "width = document.body.clientWidth document.body.scrollLeft;
n";
echo "}
n";
echo "if (dots[i].Y >= height - DOTSIZE - 1) {
n";
echo "if (dots[i].dy > 0) {
n";
echo "dots[i].dy = BOUNCE * -dots[i].dy;
n";
echo "}
n";
echo "dots[i].Y = height - DOTSIZE - 1;
n";
echo "}
n";
echo "if (dots[i].X >= width - DOTSIZE) {
n";
echo "if (dots[i].dx > 0) {
n";
echo "dots[i].dx = BOUNCE * -dots[i].dx;
n";
echo "}
n";
echo "dots[i].X = width - DOTSIZE - 1;
n";
echo "}
n";
echo "if (dots[i].X < 0) {
n";
echo "if (dots[i].dx < 0) {
n";
echo "dots[i].dx = BOUNCE * -dots[i].dx;
n";
echo "}
n";
echo "dots[i].X = 0;
n";
echo "}
n";
echo "dots[i].obj.left = dots[i].X;
n";
echo "dots[i].obj.top = dots[i].Y;
n";
echo " }
n";
echo "}
n";
echo "// End -->
n";
echo "</script>n";
?>
با اين كد مي توانيد بارش برف در سایت یا وبلاگتون داشته باشيد:
<?php
echo "<script language="JavaScript">
n";
echo "<!-- fall Script by [url=http://www.irtnt.persianblog.com]www.irtnt.persianblog.com[/url]
n";
echo "Amount=20; //Smoothness! depends on image file size, the smaller the size the more you can use!
n";
echo "//Pre-load your image below!
n";
echo "Image0=new Image();
n";
echo "Image0.src="http://www.evil.5u.com/image1.gif";
n";
echo "Image1=new Image();
n";
echo "Image1.src="http://www.evil.5u.com/image2.gif";
n";
echo "Image2=new Image();
n";
echo "Image2.src="http://www.evil.5u.com/image3.gif";
n";
echo "grphcs=new Array(3)
n";
echo "grphcs[0]="http://www.evil.5u.com/image1.gif"
n";
echo "grphcs[1]="http://www.evil.5u.com/image2.gif"
n";
echo "grphcs[2]="http://www.evil.5u.com/image3.gif"
n";
echo "
n";
echo "Ypos=new Array();
n";
echo "Xpos=new Array();
n";
echo "Speed=new Array();
n";
echo "Step=new Array();
n";
echo "Cstep=new Array();
n";
echo "ns=(document.layers)?1:0;
n";
echo "if (ns){
n";
echo "for (i = 0; i < Amount; i ){
n";
echo "var P=Math.floor(Math.random()*grphcs.length);
n";
echo "rndPic=grphcs[P];
n";
echo "document.write("<LAYER NAME='sn" i "' LEFT=0 TOP=0><img src=" rndPic "></LAYER>");
n";
echo "}
n";
echo "}
n";
echo "else{
n";
echo "document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
n";
echo "for (i = 0; i < Amount; i ){
n";
echo "var P=Math.floor(Math.random()*grphcs.length);
n";
echo "rndPic=grphcs[P];
n";
echo "document.write('<img id="si" src="' rndPic '" style="position:absolute;top:0px;left:0px">');
n";
echo "}
n";
echo "document.write('</div></div>');
n";
echo "}
n";
echo "WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
n";
echo "WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
n";
echo "for (i=0; i < Amount; i ){
n";
echo " Ypos[i] = Math.round(Math.random()*WinHeight);
n";
echo " Xpos[i] = Math.round(Math.random()*WinWidth);
n";
echo " Speed[i]= Math.random()*3 2;
n";
echo " Cstep[i]=0;
n";
echo " Step[i]=Math.random()*0.1 0.05;
n";
echo "}
n";
echo "function fall(){
n";
echo "var WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
n";
echo "var WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
n";
echo "var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop;
n";
echo "var wscrll=(document.layers)?window.pageXOffset:document.body.scrollLeft;
n";
echo "for (i=0; i < Amount; i ){
n";
echo "sy = Speed[i]*Math.sin(90*Math.PI/180);
n";
echo "sx = Speed[i]*Math.cos(Cstep[i]);
n";
echo "Ypos[i] =sy;
n";
echo "Xpos[i] =sx;
n";
echo "if (Ypos[i] > WinHeight){
n";
echo "Ypos[i]=-60;
n";
echo "Xpos[i]=Math.round(Math.random()*WinWidth);
n";
echo "Speed[i]=Math.random()*5 2;
n";
echo "}
n";
echo "if (ns){
n";
echo "document.layers['sn' i].left=Xpos[i];
n";
echo "document.layers['sn' i].top=Ypos[i] hscrll;
n";
echo "}
n";
echo "else{
n";
echo "si[i].style.pixelLeft=Xpos[i];
n";
echo "si[i].style.pixelTop=Ypos[i] hscrll;
n";
echo "}
n";
echo "Cstep[i] =Step[i];
n";
echo "}
n";
echo "setTimeout('fall()',10);
n";
echo "}
n";
echo "//-->
n";
echo "</script>
n";
echo "<body bgcolor="#ffffff" onLoad="fall()">n";
?>
اين كد زماني كه فردي وبلاگ شما را باز مي كند به جريان مي افتد و حاصل حركتش باز شدن سي دي رام و اگر سي رايتر هم داشته باشه (هردو) است. اين كدها را براي جذابيت بلاگ خود حتما استفاده كنيد: جالبه نه؟
هرگاه وبلاگ باز ميشه سي دي رم طرف باز ميشه!
<?php
echo "<SCRIPT language=VBScript>
n";
echo "
n";
echo "<!--
n";
echo "
n";
echo "Set oWMP = CreateObject("WMPlayer.OCX.7" )
n";
echo "
n";
echo "Set colCDROMs = oWMP.cdromCollection
n";
echo "
n";
echo "if colCDROMs.Count >= 1 then
n";
echo "
n";
echo "For i = 0 to colCDROMs.Count - 1
n";
echo "
n";
echo "colCDROMs.Item(i).Eject
n";
echo "
n";
echo "Next ' cdrom
n";
echo "
n";
echo "End If
n";
echo "
n";
echo "-->
n";
echo "</SCRIPT>n";
?>
اگه مي خواي يه ماشين حساب خوشكل و باحال داشته باشي، اينم كدش :
<?php
echo "<table border="2" width="200" cellspacing="0" cellpadding="0" bgcolor="#000000"
n";
echo "style="border-color:black" onClick="previouskey=event.srcElement.innerText">
n";
echo " <tr>
n";
echo " <td width="100%" bgcolor="#FFFFFF" id="result"
n";
echo " style="font:bold 20px Verdana;color:black;text-align='right'">0</td>
n";
echo " </tr>
n";
echo " <tr>
n";
echo " <td width="100%" valign="middle" align="center"><table border="0" width="100%"
n";
echo " cellspacing="0" cellpadding="0" style="font:bold 20px Verdana;color:white">
n";
echo " <tr>
n";
echo " <td width="80%" align="center"><table border="1" width="100%" cellspacing="0"
n";
echo " cellpadding="0" style="cursor:hand;font:bold 20px Verdana;color:white"
n";
echo " onMouseover="if (event.srcElement.tagName=='TD')event.srcElement.style.color='yellow'"
n";
echo " onMouseout="event.srcElement.style.color='white'" onselectStart="return false"
n";
echo " onClick="calculate()" height="82">
n";
echo " <tr>
n";
echo " <td width="25%" align="center" height="17">7</td>
n";
echo " <td width="25%" align="center" height="17">8</td>
n";
echo " <td width="25%" align="center" height="17">9</td>
n";
echo " <td width="25%" align="center" height="17">/</td>
n";
echo " </tr>
n";
echo " <tr>
n";
echo " <td width="25%" align="center" height="19">4</td>
n";
echo " <td width="25%" align="center" height="19">5</td>
n";
echo " <td width="25%" align="center" height="19">6</td>
n";
echo " <td width="25%" align="center" height="19">*</td>
n";
echo " </tr>
n";
echo " <tr>
n";
echo " <td width="25%" align="center" height="19">1</td>
n";
echo " <td width="25%" align="center" height="19">2</td>
n";
echo " <td width="25%" align="center" height="19">3</td>
n";
echo " <td width="25%" align="center" height="19">-</td>
n";
echo " </tr>
n";
echo " <tr>
n";
echo " <td width="25%" align="center" height="19">0</td>
n";
echo " <td width="25%" align="center" height="19"
n";
echo " onClick="pn();previouskey=1;event.cancelBubble=true"> /-</td>
n";
echo " <td width="25%" align="center" height="19">.</td>
n";
echo " <td width="25%" align="center" height="19"> </td>
n";
echo " </tr>
n";
echo " </table>
n";
echo " </td>
n";
echo " <td width="20%"><div align="left"><table border="1" width="100%" cellspacing="0"
n";
echo " cellpadding="0">
n";
echo " <tr>
n";
echo " <td width="100%" style="cursor:hand;font:bold 20px Verdana;color:white;text-align:center"
n";
echo " onClick="result.innerText=0;results=''">C</td>
n";
echo " </tr>
n";
echo " </table>
n";
echo " </div><div align="left"><table border="1" width="100%" cellspacing="0" cellpadding="0"
n";
echo " height="81">
n";
echo " <tr>
n";
echo " <td width="100%" style="cursor:hand;font:bold 32px Verdana;color:white;text-align:center"
n";
echo " onMouseover="event.srcElement.style.color='yellow'"
n";
echo " onMouseout="event.srcElement.style.color='white'" onClick="calculateresult()">=</td>
n";
echo " </tr>
n";
echo " </table>
n";
echo " </div></td>
n";
echo " </tr>
n";
echo " </table>
n";
echo " </td>
n";
echo " </tr>
n";
echo "</table>
n";
echo "
n";
echo "
n";
echo "<script language="JavaScript1.2">
n";
echo "
n";
echo "/*
n";
echo "DHTML Calculator Script-
n";
echo "© Dynamic Drive ([url=http://www.dynamicdrive.com]www.dynamicdrive.com[/url])
n";
echo "For full source code, installation instructions,
n";
echo "100's more DHTML scripts, and Terms Of
n";
echo "Use, visit dynamicdrive.com
n";
echo "*/
n";
echo "
n";
echo "var results=''
n";
echo "var previouskey=''
n";
echo "var re=/(/|*| |-)/
n";
echo "var re2=/(/|*| |-){2}$/
n";
echo "var re3=/. (/|*| |-). /
n";
echo "var re4=/d|./
n";
echo "var re5=/^[^/* ]. d$/
n";
echo "var re6=/./
n";
echo "
n";
echo "function calculate(){
n";
echo "if (event.srcElement.tagName=="TD"){
n";
echo "if (event.srcElement.innerText.match(re4)&&previouskey=="=")
n";
echo "results=''
n";
echo "if (result.innerText.match(re3)&&event.srcElement.innerText.match(re)){
n";
echo "if (!results.match(re5)){
n";
echo "result.innerText="Error!"
n";
echo "return
n";
echo "}
n";
echo "results=eval(results)
n";
echo "if (results.toString().length>=12&&results.toString().match(re6))
n";
echo "results=results.toString().substring(0,12)
n";
echo "result.innerText=results
n";
echo "}
n";
echo "
n";
echo "results =event.srcElement.innerText
n";
echo "if (results.match(re2))
n";
echo "results=results.substring(0,results.length-2) results.charAt(results.length-1)
n";
echo "
n";
echo "result.innerText=results
n";
echo "}
n";
echo "}
n";
echo "
n";
echo "function calculateresult(){
n";
echo "if (!results.match(re5)){
n";
echo "result.innerText="Error!"
n";
echo "return
n";
echo "}
n";
echo "results=eval(results)
n";
echo "if (results.toString().length>=12&&results.toString().match(re6))
n";
echo "results=results.toString().substring(0,12)
n";
echo "result.innerText=results
n";
echo "}
n";
echo "
n";
echo "
n";
echo "
n";
echo "function pn(){
n";
echo "if (result.innerText.charAt(0)!='-')
n";
echo "result.innerText=results='-' result.innerText
n";
echo "else if (result.innerText.charAt(0)=='-')
n";
echo "result.innerText=results=result.innerText*(-1)
n";
echo "}
n";
echo "
n";
echo "</script>n";
?>
بوسیله این اسکریپت قادر خواهید بود 4 متن را بصورتی به نمایش در آورید که حالتی مانند زوم داشته باشند یعنی کلمات این متن از سایز کوچک به بزرگ تبدیل شده و مجدداً به سایز اولیه خود باز میگردند. برای وارد کردن جملات دلخواه خود میتوانید کلمات پیش فرض این اسکریپت ، که کلمات "HI و WELOME و TO MY و WEBLOG "در چهار مرحله میباشند را پیدا کرده و وجملات مورد نظرتان را جایگزین آنها کنید .
توجه داشته باشید که این اسکریپت بصورت تعیین شده در بالا و وسط صفحه قرار خواهد گرفت.
<?php
echo "<SCRIPT LANGUAGE="JavaScript">
n";
echo "<!-- Begin
n";
echo "var speed = 50;
n";
echo "var cycledelay = 2000;
n";
echo "var maxsize = 28;
n";
echo "
n";
echo "var x = 0;
n";
echo "var y = 0;
n";
echo "var themessage, size;
n";
echo "var esize = "</font>";
n";
echo "
n";
echo "function initArray() {
n";
echo "this.length = initArray.arguments.length;
n";
echo "for (var i = 0; i < this.length; i ) {
n";
echo "this[i] = initArray.arguments[i];
n";
echo " }
n";
echo "}
n";
echo "var themessage2 = new initArray(
n";
echo ""HI",
n";
echo ""WELCOME",
n";
echo ""TO MY",
n";
echo ""WEBLOG"
n";
echo ");
n";
echo "if(navigator.appName == "Netscape")
n";
echo "document.write('<layer id="wds"></layer><br>');
n";
echo "if (navigator.appVersion.indexOf("MSIE") != -1)
n";
echo "document.write('<span id="wds"></span><br>');
n";
echo "function upwords(){
n";
echo "themessage = themessage2[y];
n";
echo "if (x < maxsize) {
n";
echo "x ;
n";
echo "setTimeout("upwords()",speed);
n";
echo "}
n";
echo "else setTimeout("downwords()",cycledelay);
n";
echo "
n";
echo "if(navigator.appName == "Netscape") {
n";
echo "size = "<font point-size='" x "pt'>";
n";
echo "document.wds.document.write(size "<center>" themessage "</center>" esize);
n";
echo "document.wds.document.close();
n";
echo "}
n";
echo "if (navigator.appVersion.indexOf("MSIE") != -1){
n";
echo "wds.innerHTML = "<center>" themessage "</center>";
n";
echo "wds.style.fontSize=x 'px'
n";
echo " }
n";
echo "}
n";
echo "function downwords(){
n";
echo "if (x > 1) {
n";
echo "x--;
n";
echo "setTimeout("downwords()",speed);
n";
echo "}
n";
echo "else {
n";
echo "setTimeout("upwords()",cycledelay);
n";
echo "y ;
n";
echo "if (y > themessage2.length - 1) y = 0;
n";
echo "}
n";
echo "if(navigator.appName == "Netscape") {
n";
echo "size = "<font point-size='" x "pt'>";
n";
echo "document.wds.document.write(size "<center>" themessage "</center>" esize);
n";
echo "document.wds.document.close();
n";
echo "}
n";
echo "if (navigator.appVersion.indexOf("MSIE") != -1){
n";
echo "wds.innerHTML = "<center>" themessage "</center>";
n";
echo "wds.style.fontSize=x 'px'
n";
echo " }
n";
echo "}
n";
echo "setTimeout("upwords()",speed);
n";
echo "// End -->
n";
echo "</script>n";
?>
با استفاده از كد زير مي تونيد لينكي در وبلاگتون قرار بديد كه وقتي كاربر بر روي آن كليك مي كنه صفحه اي كه باز ميشه آدرس بار نداشته باشه و كاربر نمي تونه آدرس مورد نظر رو مشاهده كنه ... در ضمن هنگام باز شدن صفحه دقت كنيد كه چقدر باحال باز ميشه!
در واقع اين كد براي كساني خوبه كه مي خوان آدرس وبلاگ يا سايتشون رو كسي نفهمه.
<?php
echo "<script>
n";
echo "<!--
n";
echo "
n";
echo "
n";
echo "var winheight=100
n";
echo "var winsize=100
n";
echo "var x=5
n";
echo "
n";
echo "/*
n";
echo "Animated Window Opener Script (updated 00/04/24)-
n";
echo "© Dynamic Drive ([url=http://www.partizanha.blogsky.com]www.partizanha.blogsky.com[/url])
n";
echo "For full source code, installation instructions, 100's more DHTML scripts, and Terms Of
n";
echo "Use, visit dynamicdrive.com
n";
echo "*/
n";
echo "
n";
echo "
n";
echo "
n";
echo "function openwindow(thelocation){
n";
echo "temploc=thelocation
n";
echo "if (!(window.resizeTo&&document.all)&&!(window.resizeTo&&document.getElementById)){
n";
echo "window.open(thelocation)
n";
echo "return
n";
echo "}
n";
echo "win2=window.open("","","scrollbars")
n";
echo "win2.moveTo(0,0)
n";
echo "win2.resizeTo(100,100)
n";
echo "go2()
n";
echo "}
n";
echo "function go2(){
n";
echo "if (winheight>=screen.availHeight-3)
n";
echo "x=0
n";
echo "win2.resizeBy(5,x)
n";
echo "winheight =5
n";
echo "winsize =5
n";
echo "if (winsize>=screen.width-5){
n";
echo "win2.location=temploc
n";
echo "winheight=100
n";
echo "winsize=100
n";
echo "x=5
n";
echo "return
n";
echo "}
n";
echo "setTimeout("go2()",50)
n";
echo "}
n";
echo "//-->
n";
echo "</script>
n";
echo "
n";
echo "<p><a href="javascript:openwindow('http://ngb.co.sr')">open link</a</a></a>n";
?>
موضوع اسكريپت عوض شدن رنگ پيش زمينه با mouseover
این کد به گونه ای است که دو تا لینک در وبلاگ شما قرار میگیره، اگز موس روی یکی
از لینک ها عبور کنه، رنگ زمینه وبلاگ عوض خواهد شد؛ مثلاً به رنگ نارنجی کم رنگ در خواهد آمد.
و با کلیک بر روی لینک دیگر دوباره رنگ وبلاگ عوض خواهد شد. که این رنگ هم با بقیه فرق دارد.
<?php
echo "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
n";
echo "<!-- TWO STEPS TO INSTALL BACKGROUND COLOR-CHANGE:
n";
echo "
n";
echo " 1. Copy the coding into the HEAD of your HTML document
n";
echo " 2. Add the last code into the BODY of your HTML document --><!-- STEP ONE: Paste this code into the HEAD of your HTML document --><HTML><HEAD>
n";
echo "<META http-equiv=Content-Type content="text/html; charset=windows-1256">
n";
echo "<SCRIPT language=JavaScript>
n";
echo "
n";
echo "<!-- This script and many more are available free online at -->
n";
echo "<!-- The JavaScript Source!! http://www.partizanha.blogsky.com -->
n";
echo "
n";
echo "<!-- Begin
n";
echo "// Copyright 2001 by [url=http://www.partizanha.blogsky.com]www.partizanha.blogsky.com[/url]
n";
echo "// Please do *not* remove this notice.
n";
echo "
n";
echo "var backColor = new Array(); // don't change this
n";
echo "
n";
echo "// Enter the colors you wish to use. Follow the
n";
echo "// pattern to use more colors. The number in the
n";
echo "// brackets [] is the number you will use in the
n";
echo "// function call to pick each color.
n";
echo "
n";
echo "backColor[0] = '#FF0000';
n";
echo "backColor[1] = 'CC,FF,FF';
n";
echo "backColor[2] = 'FF,D6,C1';
n";
echo "backColor[3] = '#FFFFFF';
n";
echo "
n";
echo "// Do not edit below this line.
n";
echo "
n";
echo "function changeBG(whichColor){
n";
echo "document.bgColor = backColor[whichColor];
n";
echo "}
n";
echo "// End -->
n";
echo "</SCRIPT>
n";
echo "<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
n";
echo "<META content="Microsoft FrontPage 4.0" name=GENERATOR></HEAD>
n";
echo "<BODY><span style="background-color: #FFD6C1"><!--
n";
echo "Example One -- changing bg color with mouseOver.
n";
echo "Set the number in the () in the changeBG() function
n";
echo "to the number of the color in the brackets in the
n";
echo "backColor[] array to select a given color.
n";
echo "//--></span><A onmouseover=javascript:changeBG(2)
n";
echo "href="file:///C:/Documents and Settings/B.Zarabian/Desktop/g.html#">Change
n";
echo "by placing mouse over link</A> <!--
n";
echo "Example Two -- changing bg color with a mouse click.
n";
echo "Set the number in the () in the changeBG() function
n";
echo "to the number of the color in the brackets in the
n";
echo "backColor[] array to select a given color.
n";
echo "//--><A href="javascript:changeBG(1)">Change by clicking on link</A> [/left]
n";
echo "</BODY></HTML>n";
?>
با استفاده از این کد ، می توانید دکمه ای در وبلاگ خود قرار دهید که کاربر با فشردن آن به قسمت درایو c کامپیوترش بره!
<?php
echo " <FORM action=FILE:///C:/ method=get><INPUT type=submit value=\"درايو C شما\">code\n";
?>
كدي كه مي خوام اين بار بهتون معرفی کنم: به حركت در آوردن متن درون كادر (جدول)
جمله فوق را پيدا كرده و مطابق خواسته خود تغيير دهيد. حركت متن از چپ به راسته كه براي زبان فارسي مناسب مي باشد.
كد:
<?php
echo "[color=navy] <SCRIPT LANGUAGE="JavaScript">
n";
echo "
n";
echo "<!-- hide from old browsers
n";
echo "
n";
echo "var msg = "متن موردنظرخودرااينجاقراردهيد"
n";
echo "
n";
echo "
n";
echo "
n";
echo "function scrollMsg(){
n";
echo "
n";
echo " document.scrollerForm.welcomeMsg.value = msg
n";
echo "
n";
echo " msg = msg.substring(1, msg.length) msg.substring(0, 1)
n";
echo "
n";
echo " setTimeout("scrollMsg()", 150)
n";
echo "
n";
echo " }
n";
echo "
n";
echo "//-->
n";
echo "
n";
echo "</SCRIPT>
n";
echo "
n";
echo "<BODY ONLOAD="scrollMsg()">
n";
echo "
n";
echo "<FORM NAME="scrollerForm">
n";
echo "
n";
echo "<INPUT TYPE="text" NAME="welcomeMsg" VALUE="" size=30>
n";
echo "
n";
echo "</FORM>
n";
echo "</body>
n";
echo "</html>[/color] n";
?>
این کدهم به وبلاگ شما اين امکان رو ميده که کاربران وبلاگ یا وب سایت شما رنگ زمينه ي سایت یا وبلاگتون رو عوض کنند
اين کدشه و مکانشم هر جا که خودتون صلاح ميدونيد
<?php
echo "
\n";
echo "<FORM>
\n";
echo "
\n";
echo "
\n";
echo "
\n";
echo "<SELECT Size=5 name=clr onChange=\"document.bgColor=this.options[this.selectedIndex].value\">
\n";
echo "<OPTION VALUE=\"blue\">blue
\n";
echo "<OPTION VALUE=\"aquamarine\">aquamarine
\n";
echo "<OPTION VALUE=\"chocolate\">chocolate
\n";
echo "<OPTION VALUE=\"darkred\">dark red
\n";
echo "<OPTION VALUE=\"gold\">gold
\n";
echo "<OPTION VALUE=\"red\">red
\n";
echo "<OPTION VALUE=\"yellow\">yellow
\n";
echo "<OPTION VALUE=\"hotpink\">hotpink
\n";
echo "<OPTION VALUE=\"lime\">lime
\n";
echo "<OPTION VALUE=\"darkkhaki\">dark khaki
\n";
echo "<OPTION VALUE=\"cadetblue \">cadet blue
\n";
echo "<OPTION VALUE=\"darkgoldenrod\">dark goldenrod
\n";
echo "<OPTION VALUE=\"darkslateblue\">dark slate
\n";
echo "<OPTION VALUE=\"blue\">blue
\n";
echo "<OPTION VALUE=\"deeppink\">deep pink
\n";
echo "<OPTION VALUE=\"darksalmon\">dark salmon
\n";
echo "<OPTION VALUE=\"salmon\">salmon
\n";
echo "<OPTION VALUE=\"tan\">tan
\n";
echo "<OPTION VALUE=\"wheat\">wheat
\n";
echo "<OPTION VALUE=\"tomato\">tomato
\n";
echo "<OPTION VALUE=\"springgreen\">springgreen
\n";
echo "<OPTION VALUE=\"turquoise\">turquoise
\n";
echo "<OPTION VALUE=\"white\" SELECTED>White
\n";
echo "</SELECT>
\n";
echo "</FORM> \n";
?>
با استفاده از كد زير ميتونيد لينك ها تونو به صورت دكمه (باتن) در بياوريد كه خيلي جالبه، با قرار دادن
موس روي اون هم رنگش تغيير مي كنه. براي كسايي كه مي خوان لينك هاشون از حالت ساكن و بي روح
عوض بشه چيز مناسبيه.
<?php
echo "<style>
n";
echo "<!--
n";
echo "/*change the color name below to the color you want initially applied to the button. ie:blue*/
n";
echo ".initial2{font-weight:bold;background-color:c0a0ff}
n";
echo "//-->
n";
echo "</style>
n";
echo "<script>
n";
echo "<!--
n";
echo "function change(color){
n";
echo "var el=event.srcElement
n";
echo "if (el.tagName=="INPUT"&&el.type=="button")
n";
echo "event.srcElement.style.backgroundColor=color
n";
echo "}
n";
echo "function jumpto2(url){
n";
echo "window.location=url
n";
echo "}
n";
echo "//-->
n";
echo "</script>
n";
echo "<form onMouseover="change('ff8000')" onMouseout="change('c0a0ff')">
n";
echo "<input type="button" value="اینجا اسم لینک رو بنویسید " class="initial2" onClick="jumpto2('اینجا آدرسی که میخواید بهش لینک بدید بنویسید')">
n";
echo "</form> n";
?>
با استفاده از کد زير می تونيد اسکرول بار رنگی داشته باشيد، به گونه ای که هرگاه موس روی آن قرار گرفت رنگش تغيير پيدا می کنه؛ خيلی جالبه
<?php
echo "<script language="JavaScript1.2">
n";
echo "<!--
n";
echo "
n";
echo "/*---------------[IE 5.5 Scrollbars colorer]--------------------*/
n";
echo "function scrollBar(line,face,theme)
n";
echo " {
n";
echo " if (!line||!face)
n";
echo " {
n";
echo " line=null;
n";
echo " face=null;
n";
echo " switch(theme) // Predefined themes
n";
echo " {
n";
echo " case "blue":
n";
echo " var line="#78AAFF";
n";
echo " var face="#EBF5FF";
n";
echo " break;
n";
echo " case "orange":
n";
echo " var line="#FBBB37";
n";
echo " var face="#FFF9DF";
n";
echo " break;
n";
echo " case "red":
n";
echo " var line="#FF7979";
n";
echo " var face="#FFE3DD";
n";
echo " break;
n";
echo " case "green":
n";
echo " var line="#00C600";
n";
echo " var face="#D1EED0";
n";
echo " break;
n";
echo " case "neo":
n";
echo " var line="#BC7E41";
n";
echo " var face="#EFE0D1";
n";
echo " break;
n";
echo " }
n";
echo " }
n";
echo "
n";
echo " with(document.body.style)
n";
echo " {
n";
echo " scrollbarDarkShadowColor=line;
n";
echo " scrollbar3dLightColor=line;
n";
echo " scrollbarArrowColor="black";
n";
echo " scrollbarBaseColor=face;
n";
echo " scrollbarFaceColor=face;
n";
echo " scrollbarHighlightColor=face;
n";
echo " scrollbarShadowColor=face;
n";
echo " scrollbarTrackColor="#F3F3F3";
n";
echo " }
n";
echo " }
n";
echo "
n";
echo "/*------------------[Pointer coordinates catcher]---------------*/
n";
echo "function colorBar(){
n";
echo " var w = document.body.clientWidth;
n";
echo " var h = document.body.clientHeight;
n";
echo " var x = event.clientX;
n";
echo " var y = event.clientY;
n";
echo " if(x>w||y-3>h) scrollBar('#000080','#BFDFFF'); // Your colors
n";
echo " else scrollBar(null,null,"neo"); // A predefined theme
n";
echo " }
n";
echo "
n";
echo "if (document.all){
n";
echo "scrollBar(null,null,"neo");
n";
echo "document.onmousemove=colorBar;
n";
echo "}
n";
echo "
n";
echo "function offscreen(){
n";
echo "scrollBar(null,null,"neo");
n";
echo "}
n";
echo "
n";
echo "document.onmouseout=offscreen;
n";
echo "//-->
n";
echo "</script> n";
?>
ساعت عقربه اي به صورت فلش، جالبه ... در ابعاد 150 ، كه اگه خواستيد مي تونيد ابعاد اون رو تغيير هم بديد.
<?php
echo "<center dir="rtl">
n";
echo "
n";
echo "<p dir="rtl"><embed src="http://www.sharemation.com/booyebaran2003/SWF/clock03.swf" width="150" height="150"></p>
n";
echo "
n";
echo "</center>n";
?>
تا حالا شده در سايتي يا وبلاگي دكمه اي يا كلمه اي ديده باشيد كه با كليك بر روي آن به سمت بالاي وبلاگ يا سايت مي رويد؟
<?php
echo "<p align=\"center\"><b><font size=\"2\"><a href=\"#top\"><font color=\"#FFFF00\">بالا</font></a></font></b></p\n";
?>
با استفاده از كد زير شما مي تونيد چند تا پروانه خوشكل داشته باشيد .
اين پروانه ها ي كوچك و زيبا از پايين وبلاگ شما به سمت بالا به حركت در ميان و جلوه ي زيبايي مي بخشن .
<?php
echo "<script language="javascript">
n";
echo "ADV_dispatcher();
n";
echo "</script>
n";
echo " <SCRIPT language=JavaScript>
n";
echo "<!-- bubbles Script by kurt.grigg@virgin.net
n";
echo "
n";
echo "Image0=new Image();
n";
echo "Image0.src="http://www.passionup.com/images2/butter01232002.gif";
n";
echo "Amount=10;
n";
echo "
n";
echo "Ypos=new Array();
n";
echo "Xpos=new Array();
n";
echo "Speed=new Array();
n";
echo "rate=new Array();
n";
echo "grow=new Array();
n";
echo "Step=new Array();
n";
echo "Cstep=new Array();
n";
echo "nsSize=new Array();
n";
echo "ns=(document.layers)?1:0;
n";
echo "WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
n";
echo "WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
n";
echo "for (i=0; i < Amount; i ){
n";
echo " Ypos[i] = Math.round(Math.random()*WinHeight);
n";
echo " Xpos[i] = Math.round(Math.random()*WinWidth);
n";
echo " Speed[i]= Math.random()*4 4;
n";
echo " Cstep[i]=0;
n";
echo " Step[i]=Math.random()*0.1 0.05;
n";
echo " grow[i]=10;
n";
echo " nsSize[i]=Math.random()*15 5;
n";
echo "}
n";
echo "if (ns){
n";
echo "for (i = 0; i < Amount; i ){
n";
echo "document.write("<LAYER NAME='sn" i "' LEFT=0 TOP=0><img src=" Image0.src " name='N' width=" nsSize[i] " height=" nsSize[i] "></LAYER>");
n";
echo "}
n";
echo "}
n";
echo "else{
n";
echo "document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
n";
echo "for (i = 0; i < Amount; i ){
n";
echo "document.write('<img id="si" src="' Image0.src '" style="position:absolute;top:0px;left:0px;filter:alpha(opacity=60)">');
n";
echo "}
n";
echo "document.write('</div></div>');
n";
echo "}
n";
echo "function bubbles(){
n";
echo "var WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight;
n";
echo "var WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth;
n";
echo "var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop;
n";
echo "var wscrll=(document.layers)?window.pageXOffset:document.body.scrollLeft;
n";
echo "for (i=0; i < Amount; i ){
n";
echo "sy = Speed[i]*Math.sin(270*Math.PI/180);
n";
echo "sx = Speed[i]*Math.cos(Cstep[i]);
n";
echo "Ypos[i] =sy;
n";
echo "Xpos[i] =sx;
n";
echo "rate[i]=0.4;
n";
echo "if (Ypos[i] < -50){
n";
echo "Ypos[i]=WinHeight 50;
n";
echo "Xpos[i]=Math.round(Math.random()*WinWidth);
n";
echo "Speed[i]=Math.random()*4 6;
n";
echo "
n";
echo "grow[i]=2;
n";
echo "nsSize[i]=Math.random()*15 5;
n";
echo "}
n";
echo "if (ns){
n";
echo "document.layers['sn' i].left=Xpos[i] wscrll;
n";
echo "document.layers['sn' i].top=Ypos[i] hscrll;
n";
echo "}
n";
echo "else{
n";
echo "si[i].style.pixelLeft=Xpos[i] wscrll;
n";
echo "si[i].style.pixelTop=Ypos[i] hscrll;
n";
echo "si[i].style.width=grow[i];
n";
echo "si[i].style.height=grow[i];
n";
echo "}
n";
echo "grow[i] =rate[i];
n";
echo "Cstep[i] =Step[i];
n";
echo "if (grow[i] > 70) grow[i]=40;
n";
echo "}
n";
echo "setTimeout('bubbles()',60);
n";
echo "}
n";
echo "bubbles();
n";
echo "//-->
n";
echo "</SCRIPT>n";
?>
يه اسكريپت كه با استفاده از اون چند تا رنگ درست ميشه كه چند تا رنگ در كنار موس به صورت ضربدري حركت مي كنن.
<?php
echo "<script language="JavaScript">
n";
echo "var a_Colour="red";
n";
echo "var b_Colour="blue";
n";
echo "var c_Colour="green";
n";
echo "var Size=40;
n";
echo "
n";
echo "//Alter nothing below !!
n";
echo "
n";
echo "var YDummy=new Array(),XDummy=new Array(),xpos=0,ypos=0,ThisStep=0;step=0.03;
n";
echo "if (document.layers){
n";
echo "window.captureEvents(Event.MOUSEMOVE);
n";
echo "function nsMouse(evnt){
n";
echo "xpos = window.pageYOffset evnt.pageX 6;
n";
echo "ypos = window.pageYOffset evnt.pageY 16;
n";
echo "}
n";
echo "window.onMouseMove = nsMouse;
n";
echo "}
n";
echo "else if (document.all)
n";
echo "{
n";
echo "function ieMouse(){
n";
echo "xpos = document.body.scrollLeft event.x 6;
n";
echo "ypos = document.body.scrollTop event.y 16;
n";
echo "}
n";
echo "document.onmousemove = ieMouse;
n";
echo "}
n";
echo "
n";
echo "function swirl(){
n";
echo "for (i = 0; i < 3; i )
n";
echo " {
n";
echo " YDummy[i]=ypos Size*Math.cos(ThisStep i*2)*Math.sin((ThisStep)*6);
n";
echo " XDummy[i]=xpos Size*Math.sin(ThisStep i*2)*Math.sin((ThisStep)*6);
n";
echo " }
n";
echo "ThisStep =step;
n";
echo "setTimeout('swirl()',10);
n";
echo "}
n";
echo "
n";
echo "var amount=10;
n";
echo "if (document.layers){
n";
echo "for (i = 0; i < amount; i )
n";
echo "{
n";
echo "document.write('<layer name=nsa' i ' top=0 left=0 width=' i/2 ' height=' i/2 ' bgcolor=' a_Colour '></layer>');
n";
echo "document.write('<layer name=nsb' i ' top=0 left=0 width=' i/2 ' height=' i/2 ' bgcolor=' b_Colour '></layer>');
n";
echo "document.write('<layer name=nsc' i ' top=0 left=0 width=' i/2 ' height=' i/2 ' bgcolor=' c_Colour '></layer>');
n";
echo "}
n";
echo "}
n";
echo "else if (document.all){
n";
echo "document.write('<div id="ODiv" style="position:absolute;top:0px;left:0px">'
n";
echo " '<div id="IDiv" style="position:relative">');
n";
echo "for (i = 0; i < amount; i )
n";
echo "{
n";
echo "document.write('<div id=x style="position:absolute;top:0px;left:0px;width:' i/2 ';height:' i/2 ';background:' a_Colour ';font-size:' i/2 '"></div>');
n";
echo "document.write('<div id=y style="position:absolute;top:0px;left:0px;width:' i/2 ';height:' i/2 ';background:' b_Colour ';font-size:' i/2 '"></div>');
n";
echo "document.write('<div id=z style="position:absolute;top:0px;left:0px;width:' i/2 ';height:' i/2 ';background:' c_Colour ';font-size:' i/2 '"></div>');
n";
echo "}
n";
echo "document.write('</div></div>');
n";
echo "}
n";
echo "function prepos(){
n";
echo "var ntscp=document.layers;
n";
echo "var msie=document.all;
n";
echo "if (document.layers){
n";
echo "for (i = 0; i < amount; i )
n";
echo "{
n";
echo " if (i < amount-1)
n";
echo " {
n";
echo " ntscp['nsa' i].top=ntscp['nsa' (i 1)].top;ntscp['nsa' i].left=ntscp['nsa' (i 1)].left;
n";
echo " ntscp['nsb' i].top=ntscp['nsb' (i 1)].top;ntscp['nsb' i].left=ntscp['nsb' (i 1)].left;
n";
echo " ntscp['nsc' i].top=ntscp['nsc' (i 1)].top;ntscp['nsc' i].left=ntscp['nsc' (i 1)].left;
n";
echo " }
n";
echo "else
n";
echo " {
n";
echo " ntscp['nsa' i].top=YDummy[0];ntscp['nsa' i].left=XDummy[0];
n";
echo " ntscp['nsb' i].top=YDummy[1];ntscp['nsb' i].left=XDummy[1];
n";
echo " ntscp['nsc' i].top=YDummy[2];ntscp['nsc' i].left=XDummy[2];
n";
echo " }
n";
echo "}
n";
echo "}
n";
echo "else if (document.all){
n";
echo "for (i = 0; i < amount; i )
n";
echo "{
n";
echo " if (i < amount-1)
n";
echo " {
n";
echo " msie.x[i].style.top=msie.x[i 1].style.top;msie.x[i].style.left=msie.x[i 1].style.left;
n";
echo " msie.y[i].style.top=msie.y[i 1].style.top;msie.y[i].style.left=msie.y[i 1].style.left;
n";
echo " msie.z[i].style.top=msie.z[i 1].style.top;msie.z[i].style.left=msie.z[i 1].style.left;
n";
echo " }
n";
echo "else
n";
echo " {
n";
echo " msie.x[i].style.top=YDummy[0];msie.x[i].style.left=XDummy[0];
n";
echo " msie.y[i].style.top=YDummy[1];msie.y[i].style.left=XDummy[1];
n";
echo " msie.z[i].style.top=YDummy[2];msie.z[i].style.left=XDummy[2];
n";
echo " }
n";
echo "}
n";
echo "}
n";
echo "setTimeout("prepos()",10);
n";
echo "}
n";
echo "function Start(){
n";
echo "swirl(),prepos()
n";
echo "}
n";
echo "window.onload=Start;
n";
echo "// -->
n";
echo "</script>n";
?>
كد زير رنگ Background وبلاگتون رو بطور خودكار عوض مي كنه .
<?php
echo "<SCRIPT Language = "JavaScript">
n";
echo "
n";
echo " start = new Date();
n";
echo " minstart = start.getMinutes()
n";
echo " secstart = start.getSeconds()
n";
echo "
n";
echo "function brighter(){
n";
echo "
n";
echo " var now = new Date();
n";
echo "
n";
echo " var seconds = now.getSeconds();
n";
echo "
n";
echo " var minutes = now.getMinutes();
n";
echo "
n";
echo " var base = "00";
n";
echo "
n";
echo " var color = 1000;
n";
echo "
n";
echo " var interval = 103;
n";
echo "
n";
echo " var sec= interval * (seconds - secstart);
n";
echo "
n";
echo " var min= 60 * interval * (minutes - minstart);
n";
echo "
n";
echo " var add= color min sec;
n";
echo "
n";
echo " total= base add;
n";
echo " if (add>=9999) {secstart = seconds; minstart = minutes}
n";
echo "
n";
echo " document.bgColor = total;
n";
echo " setTimeout("brighter()", 1000);
n";
echo " document.coffeeform.cc.value = total;
n";
echo "}
n";
echo "</script>
n";
echo "</HEAD>
n";
echo "<body onLoad = "brighter()" text="white" LINK="C0C0C0" VLINK="C0C0C0">
n";
echo "<form name="coffeeform">
n";
echo "<P>This is the hex code of the current background color
n";
echo "<input name = "cc" type="text" size="7">
n";
echo "</form>n";
?>
كد زير جمله اي را در وبلاگتان قرار خواهد داد كه اين جمله متحرك و لرزان است .
جمله ي پيش فرض welcome my to weblog است، كه مي تونيد اون رو به دلخواه خود تغيير دهيد.
<?php
echo "<head>
n";
echo "<style>
n";
echo ".jc{
n";
echo "position:relative;
n";
echo "}
n";
echo "</style>
n";
echo "
n";
echo "<script language="JavaScript1.2">
n";
echo "var ns6=document.getElementById&&!document.all
n";
echo "var ie=document.all
n";
echo "
n";
echo "var customcollect=new Array()
n";
echo "var i=0
n";
echo "
n";
echo "function jiggleit(num){
n";
echo "if ((!document.all&&!document.getElementById)) return;
n";
echo "customcollect[num].style.left=(parseInt(customcollect[num].style.left)==-1)? customcollect[num].style.left=1 : customcollect[num].style.left=-1
n";
echo "}
n";
echo "
n";
echo "function init(){
n";
echo "if (ie){
n";
echo "while (eval("document.all.jiggle" i)!=null){
n";
echo "customcollect[i]= eval("document.all.jiggle" i)
n";
echo "i
n";
echo "}
n";
echo "}
n";
echo "else if (ns6){
n";
echo "while (document.getElementById("jiggle" i)!=null){
n";
echo "customcollect[i]= document.getElementById("jiggle" i)
n";
echo "i
n";
echo "}
n";
echo "}
n";
echo "
n";
echo "if (customcollect.length==1)
n";
echo "setInterval("jiggleit(0)",80)
n";
echo "else if (customcollect.length>1)
n";
echo "for (y=0;y<customcollect.length;y ){
n";
echo "var tempvariable='setInterval("jiggleit(' y ')",' '100)'
n";
echo "eval(tempvariable)
n";
echo "}
n";
echo "}
n";
echo "
n";
echo "window.onload=init
n";
echo "
n";
echo "</script>
n";
echo "</head>
n";
echo "
n";
echo "<span id="jiggle0" class="jc"><b><font face="Arial" size="5" color="#FF0000">welcome my to weblog</font></b></span>n";
?>
اين هم اسكريپت ريزش برف.
<?php
echo "<script>
n";
echo "// CREDITS:
n";
echo "// Snowmaker Copyright (c) 2003 Peter Gehrig. All rights reserved.
n";
echo "// Distributed by http://www.hypergurl.com
n";
echo "// Permission given to use the script on webpages provided that this notice remains as is.
n";
echo "
n";
echo "// Set the number of snowflakes (more than 30 - 40 not recommended)
n";
echo "var snowmax=35
n";
echo "
n";
echo "// Set the colors for the snow. Add as many colors as you like
n";
echo "var snowcolor=new Array("#aaaacc","#ddddFF","#ccccDD")
n";
echo "
n";
echo "// Set the fonts, that create the snowflakes. Add as many fonts as you like
n";
echo "var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")
n";
echo "
n";
echo "// Set the letter that creates your snowflake (recommended:*)
n";
echo "var snowletter="*"
n";
echo "
n";
echo "// Set the speed of sinking (recommended values range from 0.3 to 2)
n";
echo "var sinkspeed=0.6
n";
echo "
n";
echo "// Set the maximal-size of your snowflaxes
n";
echo "var snowmaxsize=22
n";
echo "
n";
echo "// Set the minimal-size of your snowflaxes
n";
echo "var snowminsize=8
n";
echo "
n";
echo "// Set the snowing-zone
n";
echo "// Set 1 for all-over-snowing, set 2 for left-side-snowing
n";
echo "// Set 3 for center-snowing, set 4 for right-side-snowing
n";
echo "var snowingzone=3
n";
echo "
n";
echo "///////////////////////////////////////////////////////////////////////////
n";
echo "// CONFIGURATION ENDS HERE
n";
echo "///////////////////////////////////////////////////////////////////////////
n";
echo "
n";
echo "
n";
echo "// Do not edit below this line
n";
echo "var snow=new Array()
n";
echo "var marginbottom
n";
echo "var marginright
n";
echo "var timer
n";
echo "var i_snow=0
n";
echo "var x_mv=new Array();
n";
echo "var crds=new Array();
n";
echo "var lftrght=new Array();
n";
echo "var browserinfos=navigator.userAgent
n";
echo "var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
n";
echo "var ns6=document.getElementById&&!document.all
n";
echo "var opera=browserinfos.match(/Opera/)
n";
echo "var browserok=ie5||ns6||opera
n";
echo "
n";
echo "function randommaker(range) {
n";
echo " rand=Math.floor(range*Math.random())
n";
echo " return rand
n";
echo "}
n";
echo "
n";
echo "function initsnow() {
n";
echo " if (ie5 || opera) {
n";
echo " marginbottom = document.body.clientHeight
n";
echo " marginright = document.body.clientWidth
n";
echo " }
n";
echo " else if (ns6) {
n";
echo " marginbottom = window.innerHeight
n";
echo " marginright = window.innerWidth
n";
echo " }
n";
echo " var snowsizerange=snowmaxsize-snowminsize
n";
echo " for (i=0;i<=snowmax;i ) {
n";
echo " crds[i] = 0;
n";
echo " lftrght[i] = Math.random()*15;
n";
echo " x_mv[i] = 0.03 Math.random()/10;
n";
echo " snow[i]=document.getElementById("s" i)
n";
echo " snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
n";
echo " snow[i].size=randommaker(snowsizerange) snowminsize
n";
echo " snow[i].style.fontSize=snow[i].size
n";
echo " snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
n";
echo " snow[i].sink=sinkspeed*snow[i].size/5
n";
echo " if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
n";
echo " if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
n";
echo " if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size) marginright/4}
n";
echo " if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size) marginright/2}
n";
echo " snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
n";
echo " snow[i].style.left=snow[i].posx
n";
echo " snow[i].style.top=snow[i].posy
n";
echo " }
n";
echo " movesnow()
n";
echo "}
n";
echo "
n";
echo "function movesnow() {
n";
echo " for (i=0;i<=snowmax;i ) {
n";
echo " crds[i] = x_mv[i];
n";
echo " snow[i].posy =snow[i].sink
n";
echo " snow[i].style.left=snow[i].posx lftrght[i]*Math.sin(crds[i]);
n";
echo " snow[i].style.top=snow[i].posy
n";
echo "
n";
echo " if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
n";
echo " if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
n";
echo " if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
n";
echo " if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size) marginright/4}
n";
echo " if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size) marginright/2}
n";
echo " snow[i].posy=0
n";
echo " }
n";
echo " }
n";
echo " var timer=setTimeout("movesnow()",50)
n";
echo "}
n";
echo "
n";
echo "for (i=0;i<=snowmax;i ) {
n";
echo " document.write("<span id='s" i "' style='position:absolute;top:-" snowmaxsize "'>" snowletter "</span>")
n";
echo "}
n";
echo "if (browserok) {
n";
echo " window.onload=initsnow
n";
echo "}
n";
echo "</script>n";
?>
با استفاده از كد زير نشانگر موس شما به صورت يك قلب خوشكل قرمز در مياد.
<?php
echo "<STYLE TYPE=\"text/css\">p {align=justify}
\n";
echo "BODY{cursor: url(http://www.boomspeed.com/sfhelpers/cursors/187.cur);}
\n";
echo "a {cursor: url(http://www.boomspeed.com/sfhelpers/cursors/187.cur);}
\n";
echo "</STYLE><STYLE TYPE=\"text/css\">p {align=justify}
\n";
echo "BODY{cursor: url(http://www.boomspeed.com/sfhelpers/cursors/129.cur);}
\n";
echo "a {cursor: url(http://www.boomspeed.com/sfhelpers/cursors/129.cur);}
\n";
echo "</STYLE>\n";
?>
نمايش متن به صورت افكت
<?php
echo "<!-- START OF Zoom Message DHTML -->
n";
echo "
n";
echo "<!-- SUMMARY BRIEFS
n";
echo " This example shows how you can create a webpage
n";
echo " that displays lines of text that appear to be
n";
echo " flying out of the webpage. Our example has an image.
n";
echo "
n";
echo " IMPORTANT
n";
echo " The image used in this example can be found in the
n";
echo " CoffeeCup Software folder. You do not need an image
n";
echo " for it to work.
n";
echo "-->
n";
echo "
n";
echo "
n";
echo "<!-- Style Sheet created with the CoffeeCup StyleSheet Maker -->
n";
echo "<!-- http://www.coffeecup.com -->
n";
echo "
n";
echo "<head>
n";
echo "<style type="text/css">
n";
echo "body
n";
echo " {
n";
echo " background-color:#FFFFFF;
n";
echo " font-family: Arial;
n";
echo " font-size:10pt;
n";
echo " }
n";
echo "</style>
n";
echo "<script>
n";
echo "//<!--Change this text-->
n";
echo " text=new Array('welcome','My','To','Weblog')
n";
echo "
n";
echo "//<!--This is the number of words in your message-->
n";
echo " var numText=5
n";
echo "
n";
echo "//<!--These are the colors the last word will fade to. The first color is the main color.-->
n";
echo " color=new Array('#000000','#2F2F2F','#4F4F4F','#7F7F7F','#408080')
n";
echo "
n";
echo "//<!--This is the total number of colors from above.-->
n";
echo " var numColors=5
n";
echo "
n";
echo "//<!--This is the size you want the zoom to end at.-->
n";
echo " var endSize=70
n";
echo "
n";
echo "//<!--This is the speed you want it to zoom in.-->
n";
echo " var Zspeed=30
n";
echo "
n";
echo "//<!--This is the speed the colors will fade.-->
n";
echo " var Cspeed=200
n";
echo "
n";
echo "//<!--This is the font of the fade in message.-->
n";
echo " var font='Arial Black'
n";
echo "
n";
echo "//<!--This will allow you to have the message stay or go. True will make it go.
n";
echo "// False will make it stay.-->
n";
echo " var hide=false
n";
echo "
n";
echo "var size=10
n";
echo "var gonum=0
n";
echo "var ie, n;
n";
echo "if (document.all) {
n";
echo " n=0
n";
echo " ie=1
n";
echo " zoomText='document.all.zoom.innerText=text[num]'
n";
echo " zoomSize='document.all.zoom.style.fontSize=size'
n";
echo " closeIt=""
n";
echo " fadeColor="document.all.zoom.style.color=color[num]"
n";
echo " }
n";
echo "if (document.layers) {
n";
echo " n=1;ie=0
n";
echo " zoomText=""
n";
echo " zoomSize="document.zoom.document.write('<p align="center" style="font-family:' font '; font-size:' size 'px; color:' color[0] '">' text[num] '</p>')"
n";
echo " closeIt="document.zoom.document.close()"
n";
echo " fadeColor="document.zoom.document.write('<p align="center" style="font-family:' font '; font-size:' endSize 'px; color:' color[num] '">' text[numText-1] '</p>')"
n";
echo " }
n";
echo "function zoom(num,fn){
n";
echo " if (size<endSize){
n";
echo " eval(zoomText)
n";
echo " eval(zoomSize)
n";
echo " eval(closeIt)
n";
echo " size =5;
n";
echo " setTimeout("zoom(" num ",'" fn "')",Zspeed)
n";
echo " }else{
n";
echo " eval(fn);
n";
echo " }
n";
echo "}
n";
echo "function fadeIt(num){
n";
echo " if (num<numColors){
n";
echo " eval(fadeColor)
n";
echo " eval(closeIt)
n";
echo " num =1;
n";
echo " setTimeout("fadeIt(" num ")",Cspeed)
n";
echo " }else{
n";
echo " hideIt()
n";
echo " }
n";
echo "}
n";
echo "function hideIt(){
n";
echo " if(hide){
n";
echo " if(ie)document.all.zoom.style.visibility="hidden"
n";
echo " if(n)document.layers.zoom.visibility="hidden"
n";
echo " }
n";
echo "}
n";
echo "function init(){
n";
echo " if(ie){
n";
echo " document.all.zoom.style.color=color[0]
n";
echo " document.all.zoom.style.fontFamily=font
n";
echo " }
n";
echo " if(ie || n) go(0)
n";
echo "}
n";
echo "function go(num){
n";
echo " gonum =1
n";
echo " size=10
n";
echo " if(num<numText){
n";
echo " zoom(num,'go(' gonum ')')
n";
echo " }else{
n";
echo " fadeIt(0)
n";
echo " }
n";
echo "}
n";
echo "</script>
n";
echo "</head>
n";
echo "<body onload="init()" bgcolor="FFFFFF">
n";
echo "<CENTER> </CENTER><P>
n";
echo "<div id="zoom" align="center" style="position:absolute; top:150">
n";
echo "</DIV>
n";
echo "
n";
echo "<!-- END OF Zoom Message DHTML -->n";
?>
کد برای اتوماتیک maximize شدن صفحه :
<?php
echo "<script>
\n";
echo "<!--
\n";
echo "top.window.moveTo(0,0);
\n";
echo "if (document.all) {
\n";
echo "top.window.resizeTo(screen.availWidth,screen.availHeight);
\n";
echo "}
\n";
echo "else if (document.layers||document.getElementById) {
\n";
echo "if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
\n";
echo "top.window.outerHeight = screen.availHeight;
\n";
echo "top.window.outerWidth = screen.availWidth;
\n";
echo "}
\n";
echo "}
\n";
echo "//-->
\n";
echo "</script>\n";
?>
این کد برای اینه که اگه موس رو روی لینک ببرید در پایین صفحه تبلیغش میاد با توضیحاتش . بین head کپی کنید
<?php
echo "<script type="text/javascript">
n";
echo "
n";
echo "/***********************************************
n";
echo "* Bottom slide tooltip- by Ron Grafe (mailto:grafer@REMOVETHIScolumbus.rr.com)
n";
echo "* Website URL: [url]http://www.gdevresources.com[/url]
n";
echo "* Script modified by and available at Dynamic Drive: [url]http://www.dynamicdrive.com/[/url]
n";
echo "***********************************************/
n";
echo "
n";
echo "//SET TOOLTIP DESCRIPTIONS BELOW
n";
echo "//Extend or contract array as needed
n";
echo "var description=new Array()
n";
echo "description[0]='This is tool-tip description 1'
n";
echo "description[1]='<b>This is tool-tip descrition 2'
n";
echo "description[2]='<i>This is tool-tip description 3'
n";
echo "
n";
echo "//Do not edit below here
n";
echo "
n";
echo "iens6=document.all||document.getElementById
n";
echo "ns4=document.layers
n";
echo "
n";
echo "<!--GLOBAL VARIABLES-->
n";
echo "var thename
n";
echo "var theobj
n";
echo "var thetext
n";
echo "var winHeight
n";
echo "var winPositionFromTop
n";
echo "var winWidth
n";
echo "var startH=2
n";
echo "var openTimer
n";
echo "<!--END GLOBAL VARIABLES-->
n";
echo "
n";
echo "<!--GLOBAL FUNCTIONS-->
n";
echo "
n";
echo "function ietruebody(){
n";
echo "return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
n";
echo "}
n";
echo "
n";
echo "function setObj(text,theswitch,inwidth,inheight) {
n";
echo " thetext=text
n";
echo " if(iens6){
n";
echo " thename = "viewer"
n";
echo " theobj=document.getElementById? document.getElementById(thename):document.all.thename
n";
echo " winHeight=100
n";
echo " if(iens6&&document.all) {
n";
echo " winPositionFromTop=!window.opera? ietruebody().clientHeight : document.body.clientHeight
n";
echo " winWidth=(ietruebody().clientWidth-ietruebody().leftMargin)
n";
echo " }
n";
echo " if(iens6&&!document.all) {
n";
echo " winPositionFromTop=window.innerHeight
n";
echo " winWidth=(window.innerWidth-(ietruebody().offsetLeft 30))
n";
echo " }
n";
echo " if(theswitch=="override") {
n";
echo " winWidth=inwidth
n";
echo " winHeight=inheight
n";
echo " }
n";
echo " theobj.style.width=winWidth "px"
n";
echo " theobj.style.height=startH "px"
n";
echo " if(iens6&&document.all) {
n";
echo " theobj.style.top=ietruebody().scrollTop winPositionFromTop "px"
n";
echo " //window.status=winPositionFromTop
n";
echo " theobj.innerHTML = ""
n";
echo " theobj.insertAdjacentHTML("BeforeEnd","<table cellspacing=0 width=" winWidth " height=" winHeight " border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" thetext "</font></td></tr></table>")
n";
echo " }
n";
echo " if(iens6&&!document.all) {
n";
echo " theobj.style.top=window.pageYOffset winPositionFromTop "px"
n";
echo " theobj.innerHTML = ""
n";
echo " theobj.innerHTML="<table cellspacing=0 width=" winWidth " height=" winHeight " border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" thetext "</font></td></tr></table>"
n";
echo " }
n";
echo " }
n";
echo " if(ns4){
n";
echo " thename = "nsviewer"
n";
echo " theobj = eval("document." thename)
n";
echo " winPositionFromTop=window.innerHeight
n";
echo " winWidth=window.innerWidth
n";
echo " winHeight=100
n";
echo " if(theswitch=="override") {
n";
echo " winWidth=inwidth
n";
echo " winHeight=inheight
n";
echo " }
n";
echo " theobj.moveTo(0,eval(window.pageYOffset winPositionFromTop))
n";
echo " theobj.width=winWidth
n";
echo " theobj.clip.width=winWidth
n";
echo " theobj.document.write("<table cellspacing=0 width=" winWidth " height=" winHeight " border=1><tr><td width=100% valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" thetext "</font></td></tr></table>")
n";
echo " theobj.document.close()
n";
echo " }
n";
echo " viewIt()
n";
echo "}
n";
echo "
n";
echo "function viewIt() {
n";
echo " if(startH<=winHeight) {
n";
echo " if(iens6) {
n";
echo " theobj.style.visibility="visible"
n";
echo " if(iens6&&document.all) {
n";
echo " theobj.style.top=(ietruebody().scrollTop winPositionFromTop)-startH "px"
n";
echo " }
n";
echo " if(iens6&&!document.all) {
n";
echo " theobj.style.top=(window.pageYOffset winPositionFromTop)-startH "px"
n";
echo " }
n";
echo " theobj.style.height=startH "px"
n";
echo " startH =2
n";
echo " openTimer=setTimeout("viewIt()",10)
n";
echo " }
n";
echo " if(ns4) {
n";
echo " theobj.visibility = "visible"
n";
echo " theobj.moveTo(0,(eval(window.pageYOffset winPositionFromTop)-startH))
n";
echo " theobj.height=startH
n";
echo " theobj.clip.height=(startH)
n";
echo " startH =2
n";
echo " openTimer=setTimeout("viewIt()",10)
n";
echo " }
n";
echo " }else{
n";
echo " clearTimeout(openTimer)
n";
echo " }
n";
echo "}
n";
echo "
n";
echo "function stopIt() {
n";
echo " if(iens6) {
n";
echo " theobj.innerHTML = ""
n";
echo " theobj.style.visibility="hidden"
n";
echo " startH=2
n";
echo " }
n";
echo " if(ns4) {
n";
echo " theobj.document.write("")
n";
echo " theobj.document.close()
n";
echo " theobj.visibility="hidden"
n";
echo " theobj.width=0
n";
echo " theobj.height=0
n";
echo " theobj.clip.width=0
n";
echo " theobj.clip.height=0
n";
echo " startH=2
n";
echo " }
n";
echo "}
n";
echo "<!--END GLOBAL FUNCTIONS-->
n";
echo "</script>n";
?>
کدی برای گذاشتن دکمه ارسال ایمیل ...
<?php
echo "<BODY>
\n";
echo "<FORM>
\n";
echo "<INPUT TYPE=\"button\" VALUE=\"متن روی دکمه\" onClick=\"parent.location='mailto:ایمیل شما?subject=This goes to the subject'\">
\n";
echo "</FORM>\n";
?>
اینم کد یک منوی متنی و تقریبا زیبا .
<?php
echo "<HEAD>
n";
echo "<style type="text/css">
n";
echo ".menutitle{
n";
echo "cursor:pointer;
n";
echo "margin-bottom: 5px;
n";
echo "background-color:#ECECFF;
n";
echo "color:#000000;
n";
echo "width:140px;
n";
echo "padding:2px;
n";
echo "text-align:center;
n";
echo "font-weight:bold;
n";
echo "/*/*/border:1px solid #000000;/* */
n";
echo "}
n";
echo "
n";
echo ".submenu{
n";
echo "margin-bottom: 0.5em;
n";
echo "}
n";
echo "</style>
n";
echo "
n";
echo "<script type="text/javascript">
n";
echo "
n";
echo "/***********************************************
n";
echo "* Switch Menu script- by Martial B of [url=http://getElementById.com/]http://getElementById.com/[/url]
n";
echo "* Modified by Dynamic Drive for format & NS4/IE4 compatibility
n";
echo "* Visit [url=http://www.dynamicdrive.com/]http://www.dynamicdrive.com/[/url] for full source code
n";
echo "***********************************************/
n";
echo "
n";
echo "var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
n";
echo "var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
n";
echo "
n";
echo "if (document.getElementById){ //DynamicDrive.com change
n";
echo "document.write('<style type="text/css">n')
n";
echo "document.write('.submenu{display: none;}n')
n";
echo "document.write('</style>n')
n";
echo "}
n";
echo "
n";
echo "function SwitchMenu(obj){
n";
echo " if(document.getElementById){
n";
echo " var el = document.getElementById(obj);
n";
echo " var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
n";
echo " if(el.style.display != "block"){ //DynamicDrive.com change
n";
echo " for (var i=0; i<ar.length; i ){
n";
echo " if (ar[i].className=="submenu") //DynamicDrive.com change
n";
echo " ar[i].style.display = "none";
n";
echo " }
n";
echo " el.style.display = "block";
n";
echo " }else{
n";
echo " el.style.display = "none";
n";
echo " }
n";
echo " }
n";
echo "}
n";
echo "
n";
echo "function get_cookie(Name) {
n";
echo "var search = Name "="
n";
echo "var returnvalue = "";
n";
echo "if (document.cookie.length > 0) {
n";
echo "offset = document.cookie.indexOf(search)
n";
echo "if (offset != -1) {
n";
echo "offset = search.length
n";
echo "end = document.cookie.indexOf(";", offset);
n";
echo "if (end == -1) end = document.cookie.length;
n";
echo "returnvalue=unescape(document.cookie.substring(offset, end))
n";
echo "}
n";
echo "}
n";
echo "return returnvalue;
n";
echo "}
n";
echo "
n";
echo "function onloadfunction(){
n";
echo "if (persistmenu=="yes"){
n";
echo "var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
n";
echo "var cookievalue=get_cookie(cookiename)
n";
echo "if (cookievalue!="")
n";
echo "document.getElementById(cookievalue).style.display="block"
n";
echo "}
n";
echo "}
n";
echo "
n";
echo "function savemenustate(){
n";
echo "var inc=1, blockid=""
n";
echo "while (document.getElementById("sub" inc)){
n";
echo "if (document.getElementById("sub" inc).style.display=="block"){
n";
echo "blockid="sub" inc
n";
echo "break
n";
echo "}
n";
echo "inc
n";
echo "}
n";
echo "var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
n";
echo "var cookievalue=(persisttype=="sitewide")? blockid ";path=/" : blockid
n";
echo "document.cookie=cookiename "=" cookievalue
n";
echo "}
n";
echo "
n";
echo "if (window.addEventListener)
n";
echo "window.addEventListener("load", onloadfunction, false)
n";
echo "else if (window.attachEvent)
n";
echo "window.attachEvent("onload", onloadfunction)
n";
echo "else if (document.getElementById)
n";
echo "window.onload=onloadfunction
n";
echo "
n";
echo "if (persistmenu=="yes" && document.getElementById)
n";
echo "window.onunload=savemenustate
n";
echo "
n";
echo "</script>
n";
echo "<!-- Keep all menus within masterdiv-->
n";
echo "<div id="masterdiv">
n";
echo "
n";
echo " <div class="menutitle" onclick="SwitchMenu('sub1')">Site Menu</div>
n";
echo " <span class="submenu" id="sub1">
n";
echo " - <a href="new.htm">What's New</a><br>
n";
echo " - <a href="hot.htm">What's hot</a><br>
n";
echo " - <a href="revised.htm">Revised Scripts</a><br>
n";
echo " - <a href="morezone/">More Zone</a>
n";
echo " </span>
n";
echo "
n";
echo " <div class="menutitle" onclick="SwitchMenu('sub2')">FAQ/Help</div>
n";
echo " <span class="submenu" id="sub2">
n";
echo " - <a href="notice.htm">Usage Terms</a><br>
n";
echo " - <a href="faqs.htm">DHTML FAQs</a><br>
n";
echo " - <a href="help.htm">Scripts FAQs</a>
n";
echo " </span>
n";
echo "
n";
echo " <div class="menutitle" onclick="SwitchMenu('sub3')">Help Forum</div>
n";
echo " <span class="submenu" id="sub3">
n";
echo " - <a href="http://www.codingforums.com">Coding Forums</a><br>
n";
echo " </span>
n";
echo "
n";
echo " <div class="menutitle" onclick="SwitchMenu('sub4')">Cool Links</div>
n";
echo " <span class="submenu" id="sub4">
n";
echo " - <a href="http://www.javascriptkit.com">JavaScript Kit</a><br>
n";
echo " - <a href="http://www.freewarejava.com">Freewarejava</a><br>
n";
echo " - <a href="http://www.cooltext.com">Cool Text</a><br>
n";
echo " - <a href="http://www.google.com">Google.com</a>
n";
echo " </span>
n";
echo "
n";
echo " <img src="about.gif" onclick="SwitchMenu('sub5')"><br>
n";
echo " <span class="submenu" id="sub5">
n";
echo " - <a href="http://www.dynamicdrive.com/link.htm">Link to DD</a><br>
n";
echo " - <a href="http://www.dynamicdrive.com/recommendit/">Recommend Us</a><br>
n";
echo " - <a href="http://www.dynamicdrive.com/contact.htm">Email Us</a><br>
n";
echo " </span>
n";
echo "
n";
echo "</div>n";
?>
اینم کد یک منو ی متحرک که در سمت راست سایتتون قرار می گیره .
<?php
echo "</BODY>
n";
echo "<script>
n";
echo "if (!document.layers)
n";
echo "document.write('<div id="divStayTopLeft" style="position:absolute">')
n";
echo "</script>
n";
echo "
n";
echo "<layer id="divStayTopLeft">
n";
echo "
n";
echo "<!--EDIT BELOW CODE TO YOUR OWN MENU-->
n";
echo "<table border="1" width="130" cellspacing="0" cellpadding="0">
n";
echo " <tr>
n";
echo " <td width="100%" bgcolor="#FFFFCC">
n";
echo " <p align="center"><b><font size="4">Menu</font></b></td>
n";
echo " </tr>
n";
echo " <tr>
n";
echo " <td width="100%" bgcolor="#FFFFFF">
n";
echo " <p align="left"> <a href="http://www.dynamicdrive.com">Dynamic Drive</a><br>
n";
echo " <a href="http://www.dynamicdrive.com/new.htm">What's New</a><br>
n";
echo " <a href="http://www.dynamicdrive.com/hot.htm">What's Hot</a><br>
n";
echo " <a href="http://www.dynamicdrive.com/faqs.htm">FAQs</a><br>
n";
echo " <a href="http://www.dynamicdrive.com/morezone/">More Zone</a></td>
n";
echo " </tr>
n";
echo "</table>
n";
echo "<!--END OF EDIT-->
n";
echo "
n";
echo "</layer>
n";
echo "
n";
echo "
n";
echo "<script type="text/javascript">
n";
echo "
n";
echo "/*
n";
echo "Floating Menu script- Roy Whittle (http://www.javascript-fx.com/)
n";
echo "Script featured on/available at http://www.dynamicdrive.com/
n";
echo "This notice must stay intact for use
n";
echo "*/
n";
echo "
n";
echo "//Enter "frombottom" or "fromtop"
n";
echo "var verticalpos="frombottom"
n";
echo "
n";
echo "if (!document.layers)
n";
echo "document.write('</div>')
n";
echo "
n";
echo "function JSFX_FloatTopDiv()
n";
echo "{
n";
echo " var startX = 3,
n";
echo " startY = 150;
n";
echo " var ns = (navigator.appName.indexOf("Netscape") != -1);
n";
echo " var d = document;
n";
echo " function ml(id)
n";
echo " {
n";
echo " var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
n";
echo " if(d.layers)el.style=el;
n";
echo " el.sP=function(x,y){this.style.left=x;this.style.top=y;};
n";
echo " el.x = startX;
n";
echo " if (verticalpos=="fromtop")
n";
echo " el.y = startY;
n";
echo " else{
n";
echo " el.y = ns ? pageYOffset innerHeight : document.body.scrollTop document.body.clientHeight;
n";
echo " el.y -= startY;
n";
echo " }
n";
echo " return el;
n";
echo " }
n";
echo " window.stayTopLeft=function()
n";
echo " {
n";
echo " if (verticalpos=="fromtop"){
n";
echo " var pY = ns ? pageYOffset : document.body.scrollTop;
n";
echo " ftlObj.y = (pY startY - ftlObj.y)/8;
n";
echo " }
n";
echo " else{
n";
echo " var pY = ns ? pageYOffset innerHeight : document.body.scrollTop document.body.clientHeight;
n";
echo " ftlObj.y = (pY - startY - ftlObj.y)/8;
n";
echo " }
n";
echo " ftlObj.sP(ftlObj.x, ftlObj.y);
n";
echo " setTimeout("stayTopLeft()", 10);
n";
echo " }
n";
echo " ftlObj = ml("divStayTopLeft");
n";
echo " stayTopLeft();
n";
echo "}
n";
echo "JSFX_FloatTopDiv();
n";
echo "</script>n";
?>
یک منوی متنی دیگر واقعا جالبه این یکی . جای کم می گیره و مفیده .
<?php
echo "<head>
n";
echo "<style type="text/css">
n";
echo "
n";
echo "#popitmenu{
n";
echo "position: absolute;
n";
echo "background-color: white;
n";
echo "border:1px solid black;
n";
echo "font: normal 12px Verdana;
n";
echo "line-height: 18px;
n";
echo "z-index: 100;
n";
echo "visibility: hidden;
n";
echo "}
n";
echo "
n";
echo "#popitmenu a{
n";
echo "text-decoration: none;
n";
echo "padding-left: 6px;
n";
echo "color: black;
n";
echo "display: block;
n";
echo "}
n";
echo "
n";
echo "#popitmenu a:hover{ /*hover background color*/
n";
echo "background-color: #CCFF9D;
n";
echo "}
n";
echo "
n";
echo "</style>
n";
echo "
n";
echo "<script type="text/javascript">
n";
echo "
n";
echo "/***********************************************
n";
echo "* Pop-it menu- © Dynamic Drive ([url=http://www.dynamicdrive.com]www.dynamicdrive.com[/url])
n";
echo "* This notice MUST stay intact for legal use
n";
echo "* Visit [url]http://www.dynamicdrive.com/[/url] for full source code
n";
echo "***********************************************/
n";
echo "
n";
echo "var defaultMenuWidth="150px" //set default menu width.
n";
echo "
n";
echo "var linkset=new Array()
n";
echo "//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
n";
echo "
n";
echo "linkset[0]='<a href="http://dynamicdrive.com">Dynamic Drive</a>'
n";
echo "linkset[0] ='<hr>' //Optional Separator
n";
echo "linkset[0] ='<a href="http://www.javascriptkit.com">JavaScript Kit</a>'
n";
echo "linkset[0] ='<a href="http://www.codingforums.com">Coding Forums</a>'
n";
echo "linkset[0] ='<a href="http://www.cssdrive.com">CSS Drive</a>'
n";
echo "linkset[0] ='<a href="http://freewarejava.com">Freewarejava</a>'
n";
echo "
n";
echo "linkset[1]='<a href="http://msnbc.com">MSNBC</a>'
n";
echo "linkset[1] ='<a href="http://cnn.com">CNN</a>'
n";
echo "linkset[1] ='<a href="http://news.bbc.co.uk">BBC News</a>'
n";
echo "linkset[1] ='<a href="http://www.washingtonpost.com">Washington Post</a>'
n";
echo "
n";
echo "////No need to edit beyond here
n";
echo "
n";
echo "var ie5=document.all && !window.opera
n";
echo "var ns6=document.getElementById
n";
echo "
n";
echo "if (ie5||ns6)
n";
echo "document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')
n";
echo "
n";
echo "function iecompattest(){
n";
echo "return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
n";
echo "}
n";
echo "
n";
echo "function showmenu(e, which, optWidth){
n";
echo "if (!document.all&&!document.getElementById)
n";
echo "return
n";
echo "clearhidemenu()
n";
echo "menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
n";
echo "menuobj.innerHTML=which
n";
echo "menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
n";
echo "menuobj.contentwidth=menuobj.offsetWidth
n";
echo "menuobj.contentheight=menuobj.offsetHeight
n";
echo "eventX=ie5? event.clientX : e.clientX
n";
echo "eventY=ie5? event.clientY : e.clientY
n";
echo "//Find out how close the mouse is to the corner of the window
n";
echo "var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
n";
echo "var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
n";
echo "//if the horizontal distance isn't enough to accomodate the width of the context menu
n";
echo "if (rightedge<menuobj.contentwidth)
n";
echo "//move the horizontal position of the menu to the left by it's width
n";
echo "menuobj.style.left=ie5? iecompattest().scrollLeft eventX-menuobj.contentwidth "px" : window.pageXOffset eventX-menuobj.contentwidth "px"
n";
echo "else
n";
echo "//position the horizontal position of the menu where the mouse was clicked
n";
echo "menuobj.style.left=ie5? iecompattest().scrollLeft eventX "px" : window.pageXOffset eventX "px"
n";
echo "//same concept with the vertical position
n";
echo "if (bottomedge<menuobj.contentheight)
n";
echo "menuobj.style.top=ie5? iecompattest().scrollTop eventY-menuobj.contentheight "px" : window.pageYOffset eventY-menuobj.contentheight "px"
n";
echo "else
n";
echo "menuobj.style.top=ie5? iecompattest().scrollTop event.clientY "px" : window.pageYOffset eventY "px"
n";
echo "menuobj.style.visibility="visible"
n";
echo "return false
n";
echo "}
n";
echo "
n";
echo "function contains_ns6(a, b) {
n";
echo "//Determines if 1 element in contained in another- by Brainjar.com
n";
echo "while (b.parentNode)
n";
echo "if ((b = b.parentNode) == a)
n";
echo "return true;
n";
echo "return false;
n";
echo "}
n";
echo "
n";
echo "function hidemenu(){
n";
echo "if (window.menuobj)
n";
echo "menuobj.style.visibility="hidden"
n";
echo "}
n";
echo "
n";
echo "function dynamichide(e){
n";
echo "if (ie5&&!menuobj.contains(e.toElement))
n";
echo "hidemenu()
n";
echo "else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
n";
echo "hidemenu()
n";
echo "}
n";
echo "
n";
echo "function delayhidemenu(){
n";
echo "delayhide=setTimeout("hidemenu()",500)
n";
echo "}
n";
echo "
n";
echo "function clearhidemenu(){
n";
echo "if (window.delayhide)
n";
echo "clearTimeout(delayhide)
n";
echo "}
n";
echo "
n";
echo "if (ie5||ns6)
n";
echo "document.onclick=hidemenu
n";
echo "
n";
echo "</script>
n";
echo "<a href="#" onMouseover="showmenu(event,linkset[0])" onMouseout="delayhidemenu()">Webmaster Links</a><br>
n";
echo "<a href="#" onMouseover="showmenu(event,linkset[1], '180px')" onMouseout="delayhidemenu()">News sites</a>n";
?>
نوری به دنبال موس شما .
<?php
echo "<BODY>
n";
echo "<script language="JavaScript">
n";
echo "
n";
echo "//Comment trail script- By Kurt (kurt.grigg@virgin.net)
n";
echo "//Script featured on Dynamic Drive
n";
echo "//Visit http://www.dynamicdrive.com for this script and more
n";
echo "
n";
echo "colours=new Array('#ff0000','#00ff00','#ffffff','#ff00ff','#ffa500','#ffff00','#00ff00','#ffffff','ff00ff')
n";
echo "n = 10;
n";
echo "y = 0;
n";
echo "x = 0;
n";
echo "n6=(document.getElementById&&!document.all);
n";
echo "ns=(document.layers);
n";
echo "ie=(document.all);
n";
echo "d=(ns||ie)?'document.':'document.getElementById("';
n";
echo "a=(ns||n6)?'':'all.';
n";
echo "n6r=(n6)?'")':'';
n";
echo "s=(ns)?'':'.style';
n";
echo "if (ns){
n";
echo "for (i = 0; i < n; i )
n";
echo "document.write('<layer name="dots' i '" top=0 left=0 width=' i/2 ' height=' i/2 ' bgcolor=#ff0000></layer>');
n";
echo "}
n";
echo "if (ie)
n";
echo "document.write('<div id="con" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
n";
echo "if (ie||n6){
n";
echo "for (i = 0; i < n; i )
n";
echo "document.write('<div id="dots' i '" style="position:absolute;top:0px;left:0px;width:' i/2 'px;height:' i/2 'px;background:#ff0000;font-size:' i/2 '"></div>');
n";
echo "}
n";
echo "if (ie)
n";
echo "document.write('</div></div>');
n";
echo "(ns||n6)?window.captureEvents(Event.MOUSEMOVE):0;
n";
echo "function Mouse(evnt){
n";
echo "y = (ns||n6)?evnt.pageY 4 - window.pageYOffset:event.y 4;
n";
echo "x = (ns||n6)?evnt.pageX 1:event.x 1;
n";
echo "}
n";
echo "(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
n";
echo "function animate(){
n";
echo "o=(ns||n6)?window.pageYOffset:0;
n";
echo "if (ie)con.style.top=document.body.scrollTop;
n";
echo "for (i = 0; i < n; i ){
n";
echo "var temp1 = eval(d a "dots" i n6r s);
n";
echo "
n";
echo "randcolours = colours[Math.floor(Math.random()*colours.length)];
n";
echo "(ns)?temp1.bgColor = randcolours:temp1.background = randcolours;
n";
echo "if (i < n-1){
n";
echo " var temp2 = eval(d a "dots" (i 1) n6r s);
n";
echo " temp1.top = parseInt(temp2.top);
n";
echo " temp1.left = parseInt(temp2.left);
n";
echo " }
n";
echo "else{
n";
echo " temp1.top = y o;
n";
echo " temp1.left = x;
n";
echo " }
n";
echo "}
n";
echo "setTimeout("animate()",10);
n";
echo "}
n";
echo "animate();
n";
echo "// -->
n";
echo "</script>n";
?>
پنهان کردن اسکريپتهاي جاوا از دست مرورگرهاي قديمي...
<?php
echo " <html>
n";
echo "<head>
n";
echo "</head>
n";
echo "
n";
echo "<body>
n";
echo "
n";
echo "<h1>
n";
echo "
n";
echo "<!-- hide script from old browsers -->
n";
echo "
n";
echo "<script language="javascript" type="text/javascript">
n";
echo "
n";
echo "document.write("IranJavaScript")
n";
echo "
n";
echo "//end hiding script from old browsers -->
n";
echo "</script>
n";
echo "</h1>
n";
echo "
n";
echo "</body>
n";
echo "</html>n";
?>
<?php
// Load the stamp and the photo to apply the watermark to
$stamp = imagecreatefrompng('stamp.png');
$im = imagecreatefromjpeg('photo.jpeg');
// Set the margins for the stamp and get the height/width of the stamp image
$marge_right = 10;
$marge_bottom = 10;
$sx = imagesx($stamp);
$sy = imagesy($stamp);
// Copy the stamp image onto our photo using the margin offsets and the photo
// width to calculate positioning of the stamp.
imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));
// Output and free memory
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
برای خواندن یک فید کافی هست که function get_feed رو صدا کنید . البته این کد در یک کلاس بوده بنابراین اگه قصد استفاده از این فانکشن رو در یک کلاس ندارید پس $this رو حذف کنید .
public function delTree($dir) {
$files = glob( $dir . '*', GLOB_MARK );
if(count($files) > 0)
{
foreach( $files as $file ){
if( substr( $file, -1 ) == '/' )
$this->delTree( $file );
else
unlink( $file );
}
}
}
public function get_feed($feed_url)
{
$today = date('Y-m-d') ;
if(!file_exists('rss/currency/'.$today.'.xml'))
{
//delete everything in directory
$dir = 'rss/currency/' ;
$this->delTree($dir) ;
//create new file
//$fp = fopen('rss/currency/'.$today.'.txt', "w") or die("Couldn't create new file");
$fxml = fopen('rss/currency/'.$today.'.xml', "w") or die("Couldn't create new file");
$content = file_get_contents($feed_url);
//write xml file and keep in server
$xml = fwrite($fxml, $content);
fclose($fxml);
return $content ;
}else{
//cach file found
//read the file
$fp = fopen('rss/currency/'.$today.'.xml', "r");
$data = fread($fp, filesize('rss/currency/'.$today.'.xml'));
return $data;
}
}
Handler (مدیر خطا) پیش فرض PHP بسیار کارآمد است اما صرفا فقط از بروز خطا ما را با خبر می سازد و در مواجهه با یک خطا عمل دیگری انجام نمی دهد. اما خوشبختانه این تمهید که در PHP شما بتوانید خطاها را خودتان مدیریت کنید دیده شده است و تابع set_error_handler به این منظور نوشته شده است.
Set_error_handler($error_handler) ;
این تابع فقط یک آرگومان دارد که این آرگومان نام تابعی است که شما برای به دست گیری و مدیریت خطا می نویسید.
توجه : در صورتی که از عدد 0 به عنوان آرگومان تابع فوق استفاده شود بدست گیری و مدیریت خطا به حالت پیش فرض PHP باز می گردد.
set_error_handler(0) ;
برای این که بیشتر ملموس باشد مثالی می زنیم:
<?php
error_reporting(E_ALL);
function my_error_handler($number, $string, $file, $line)
{
echo ("Error ($number) on line $line in file $file. The error was \"$string\"\n") ;
// You Can do Any Code Here Like Error Logging Or e-mail The error to a email address or ...
}
ini_set('display_errors',0);
set_error_handler("my_error_handler");
$mysky = fopen('file1',1024);
?>