rss

About Me

My Photo
irnanto dwi saputra
View my complete profile

24 September 2011

Using the Echo or Print

Hello, this time I will try to discuss two functions that we often use, ie, echo and print, we made dizzy sometimes between two options, using echo or print when you want to display the contents of a variable, or just display as plain text alerts of a process that has been done. Echo or Print? Echo or Print? Echo or Print? and so on ... A little confused indeed.

In addition to print php echo and also provides many alternatives for the syntax of another, different function but the task remains the same, plus dizziness, more confused.

The author himself is quite confused to choose one of them, echo or print? echo or print? but after studying the various existing CMS like joomla, drupal, wordpress, it turns out they are the web developers tend to use echo rather than print, then what is the reason?

Let us go into. Php language a developer ever do the testing, and the result is the echo is 15% faster process than the print function (in millisecond). And it is common knowledge that if the print is a function that returns the value in it (returning value). And there is another reason why most developers prefer to use echo rather than print, another reason is, time efficiency, because the echo was only requires 4 letters to be typed, while the print it has 5 letters to be typed. But this is reality. A lazy programmer to write the letter 't'. And this has become a natural human instinct, choose a shorter. Still the same.

Okay, for further efficiency is the use of:
echo "$ variable1 and". "$ Variable2 to be displayed". "Put here";

it takes a lot of resources, because the dot has a function to mengadd / add the contents of a variable, instead of connecting or forwarding. The difference between adding a forward is like this:

Adding it to have meaning, opening up a new variable and then add the contents into the variable, then closes the variable. While the connect or continue to have meaning, its variable was content to continue living variablenya opened. Adding consists of three processes, while connecting or meneruskaan just doing one process.

Good use of echo is as follows:
echo $ variable, "and", $ variable2, "which will be displayed", "put here";

I separate each word here only as a simulation of actual cases. Echo is good it's not use a dot to connect each variable, or display text, but use a comma. So the process is faster, and fewer and fewer resources required.

Read more.....

23 September 2011

Create a JQuery Slide show Recent Post

Salam blogger, before I would berterimakasi to visitors and lovers of bloggers in particular sekalin shabat - blogger friend, on the occasion tonight I'll share one for a simple trick, simple but fun hehe, how to install was very easy.

OK, the trick that I will give is how to create a "Recent Post JQuery Slide Show" with the name "Recent Post Slide Show"

this blog we will be more beautiful and interesting, hopefully our visitors were also felt at home.

OK, since I do not want to talk at length because it is still much to do, simply:

1. As usual Log into your Blogger account, select "Layout" then "Page Elements", 2. Click the "Add a Gadget" (whatever okay), then select "HTML / JavaScript", 3. Copy-paste the code below:
<script src="https://sites.google.com/site/efekefek/file-js/recentpostslide.js" type="text/javascript"></script>
<style type="text/css" media="screen">
<!--

#spylist {
overflow:hidden;
margin-top:5px;
padding:0px 0px;
height:350px;
}
#spylist ul{
width:220px;
overflow:hidden;
list-style-type: none;
padding: 0px 0px;
margin:0px 0px;
}
#spylist li {
width:208px;
padding: 5px 5px;
margin:0px 0px 5px 0px;
list-style-type:none;
float:none;
height:70px;
overflow: hidden;
background:#fff url(http://i879.photobucket.com/albums/ab351/bloggerblogimage/blogger/post.jpg) repeat-x;
border:1px solid #ddd;
}

#spylist li a {
text-decoration:none;
color:#4B545B;
font-size:11px;
height:18px;
overflow:hidden;
margin:0px 0px;
padding:0px 0px 2px 0px;
}
#spylist li img {
float:left;
margin-right:5px;
background:#EFEFEF;
border:0;
}
.spydate{
overflow:hidden;
font-size:10px;
color:#0284C2;
padding:2px 0px;
margin:1px 0px 0px 0px;
height:15px;
font-family:Tahoma,Arial,verdana, sans-serif;
}

.spycomment{
overflow:hidden;
font-family:Tahoma,Arial,verdana, sans-serif;
font-size:10px;
color:#262B2F;
padding:0px 0px;
margin:0px 0px;
}

-->
</style>

<script language='javascript'>

imgr = new Array();

imgr[0] = "http://i43.tinypic.com/orpg0m.jpg";

imgr[1] = "http://i43.tinypic.com/orpg0m.jpg";

imgr[2] = "http://i43.tinypic.com/orpg0m.jpg";

imgr[3] = "http://i43.tinypic.com/orpg0m.jpg";

imgr[4] = "http://i43.tinypic.com/orpg0m.jpg";
showRandomImg = true;

boxwidth = 255;

cellspacing = 6;

borderColor = "#232c35";

bgTD = "#000000";

thumbwidth = 70;

thumbheight = 70;

fntsize = 12;

acolor = "#666";

aBold = true;

icon = " ";

text = "comments";

showPostDate = true;

summaryPost = 40;

summaryFontsize = 10;

summaryColor = "#666";

icon2 = " ";

numposts = 10;

home_page = "http://weblearning27.blogspot.com/";

limitspy=4
intervalspy=4000

</script>

<div id="spylist">
<script src=https://sites.google.com/site/efekefek/file-js/recentpostslide2.js' type='text/javascript'></script>
</div>

CAUTION

Replace the red code with your link address, OK.

After all the measures passed, the store and see the results!

Read more.....

22 September 2011

How to Create a Slideshow With Jquery Cycle Plug In

jQuery Cycle Plugin is a Plug In Slideshow light and pretty awesome. This plugin provides a method of calling in cycles that are involved in a container element, in which each element of the container into a slide.

If you are interested in using jquery slideshow with the cycle plugin for bloggers in particular friend or website please follow the steps below.

1. As usual my friend must log in first to blogger

2. select design

3. Then select Edit HTML

4. check the Expand Widget Templates and backup first your templete (to avoid the event of any errors)

5. Copy the code below and paste the code above </ head> or below the code ]]></ b: skin>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"> </script>
<script type="text/javascript" src="http://my-slideshow.googlecode.com/files/jquery.cycle.all.min.js"> </script>
<script type="text/javascript">
$(document).ready(function(){
$('#myslides').cycle({
fx: 'cover',
speed: 500,
timeout: 2000
});
});
</script>

6. For the CSS code below, copy and paste this code above ]]></ b: skin>

#myslides {
width: 370px;
height: 220px;
padding: 0;
margin: 0 auto;
}

#myslides img {
padding: 10px;
border: 1px solid rgb(100,100,100);
background-color: rgb(230,230,230);
width: 350px;
height: 200px;
top: 0;
left: 0
}

CAUTION

You can edit the CSS code above in accordance with the width you want for example (width slidshow / image) and height (height slideshow / images)

7. The last step is to install the HTML code below where you want to put SlidShow by adding gadgets.

<div id="myslides">
<img src="http://weblearning27.blogspot.com/files/water.jpg" />
<img src="http://weblearning27.blogspot.com/files/fire.jpg" />
<img src="http://weblearning27.blogspot.com/files/air.jpg" />
<img src="http://weblearning27.blogspot.com/files/ground.jpg" />
<img src="http://weblearning27.blogspot.com/files/lightning.jpg" />
</div>

CAUTION

code yellow is the address of the image. Please change the address of your image.

Read more.....
 

Site Info

Google Pagerank Powered by  MyPagerank.Net My Ping in TotalPing.com TopOfBlogs My Zimbio Blog Directory