How To Create Own Galery Template?

Somebody asked me how to create a galery template, well here i am now trying to explain how to create your own galery template. It's not realy complicated, might you think it's complicated to create a galery template, don't you? You only need to include some codes to your template, and that is it.

Galery template does look good, as long as you include at least one pic for every single post you publish. Yeah, i understand if you want a galery template for you are website.

Speaking english my friends, the code that i'm going to share here does not belong to me, i just took it from my template.

Very well! Here is javascript code, put it in your template somewhere in betwen tag <head>

<script type='text/javascript'>
summary_img = 550;
summary_no_img = 650;
summary_img_width = 125;
summary_img_height = 95;
</script>
<script type='text/javascript'>
//<![CDATA[
function RemoveHtmlTag(strx,chop) {
if(strx.indexOf("<")!=-1) {
var s = strx.split("<"); for(var i=0;i<s.length;i++) {if(s[i].indexOf(">")!=-1) {s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2; while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++; strx = strx.substring(0,chop-1);
return strx+'...';
}

function CreateSummaryAndThumb(pID) {var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_no_img;
if(img.length>=1) {imgtag = '<span style="float:left; padding:0px 10px 5px 0px;">
<img src="'+img[0].src+'" width="'+summary_img_width+'px" height="'+summary_img_height+'px"/></span>';
summ = summary_img;
}
var summary = imgtag + '<div>' + RemoveHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary;
}
//]]>
</script>

Now that you done with the above code, find <data:post.body/> in your template. I will not tell you how to put the following code in your template exactly, but you have to replace the "data:post.body" tag with the code.

Sorry, but i forgot already what codes are before or after its "data:post.body" tag, if any. So, use your own imagination for it, anyhow you know that the main gol is you have to replace its data:post.body tag with the following code. So am i clear my friend? :)

<p>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<div expr:id='&quot;summary&quot; + data:post.id'><data:post.body/></div>
<script type='text/javascript'>CreateSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script>
</b:if>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'><data:post.body/></b:if>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'><data:post.body/></b:if>
</p>

Have you gotten done with the above? Well, now save your changes and see the magic happen..

Here are things that you may want to make a little change on.

*summary_img - defines how many characters to show if the post has image to show.
*summary_no_img - defines how many characters to show if the post has no image to show.
*summary_img_width - defines how wide the image to show.
*summary_img_height - defines how very high the image to show.

That is it my friends, that is it. If you have any question about the code, or if you face a bussiness with the code, or anything else, you tell me okay? We'll get it right together. Meanwhile, you have a try.. :)

Blogging: How To Create Random Text Quote And Image?

This methode is so rarely needed by bloggers, cause in general, most of contents are better to show just like that on website. If there are sorts of contents that are good, better to show as random, those would be text quotes, like-featured-content "images", or somekind. From millions, maybe billions of bloggers out there, there must be some of those are presenting, or just willing to present such contents on their website. So, here i am now, explain about how to create random text quotes or images, showing those the way to make real their imagination.

Might you've known that many bloggers out there are talking about this methode, give a lot options of style of the form, but very few of those are giving the simple methode like what i'm going to give to you.

If you prefer the simple style instead of those that are made "colorfull", like me, then this is just what you want. Code length no longer than 200, can be placed everywhere, and even you can still add your own code if you'd like.

Of course colorfull is good, but when colorfull takes code too much and thus add some additional loads to your blog, ask your self, should you make something like this colorfull?

Even sometimes colorfull is not good by the way.

Well, then, let's show you the code. Here you can define whether or not you want to use an image for the background, you can set as many contents as you want to include, and after all, you can add your own code to style its appearance if you'd like. And that, it's javascript code, there is no way you can create random contents with CSS.

<script type='text/javascript'>
var myTextQ=new Array();
var myTextQ[0]="Your Quote 1";
var myTextQ[1]="Your Quote 2";
var myTextQ[2]="Your Quote 3";
var random=Math.floor(3*Math.random());
document.write("<div style='background:#ffffff url(background image url) no-repeat;margin:1px;'>");
document.write("<b>");
document.write("Quote:");
document.write("</b>");
document.write(myTextQ[random]);
document.write("</div>");
</script>

Now listen to me.. If you could need this, you could be a newbie. Well, these are rules that you need to know. :)

1. To write text in javascript, you need to add backslash ("\") next to special characters like "'", ";", or somekind. Not realy many characters, just a few.

Pay attention on the following example:

<script>
myTextQ[0]="Do you like my blog? You\'ll be welcomed to follow up on facebook.";
</script>

2. var random=Math.floor(3*Math.random()), you need to set the number ("3") accordingly with the "quotes" (say it so) that you include into the script. Say your total quotes is 5, then you have to change the number to 5 too.
3. The number must start from 0 ("[0], [1], [2], [3]").
4. If you don't want to use an image for the background, remove the order " url(background image url) no-repeat".
5. If you use an image for the background and you want to repeat the image to show, change "no-repeat" with "repeat".

Here are some options for repeating image

- repeat: repeat as needed.
- repeat-x: repeat horizontal.
- repeat-y: repeat vertical.
- repeat top left: image placed and repeat from top left.
- repeat top right: image placed and repeat from top right.

That's it everybody. If you have any question about this, let me know that, maybe i can help you.

CSS Border Radius: Rounded Corner

These would be the keywords that people out there might use to find articles like this: "What Is Border Radius, How To Create Rounded Corner Using CSS Code? Can I make Image, Picture, Thumbnail On My Website Rounded On Corners?"

Well, for your information if you do not know what is border radius or rounded corner, border radius is a CSS3 property whose function is to make "items" rounded on corners. Items that i mean here could be images or any elements, like "div" element for example.

It's not any complicated to style items using border radius property, you only need to know a very few simple rules that won't make you even need to try to commit those into your brain to remember.

Here is an example:

-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;

The first line means "border radius for webkit", the second line "border radius for mozilla", the third line "border radius for any browser", while "5px" is the value where the higher the value the deeper rounded corner you have. Also, as you see, there are three lines of paramaters in the example code above, which all the three are actually prompting the same command. The reason for this is because some browsers do not yet support the code fully, in case of mozilla and webkit, for the latest versions, those still have some bugs to fix, so it's better to give those separate instructions. That's what i know.

Very well! The example code above is the very basic parameter, now what if you want to make only the bottom side, or top, or top right, or something like that, to be rounded? Well, the following code is the answer.

-webkit-border-top-right-radius:5px; -webkit-border-top-left-radius:10px; -webkit-border-bottom-radius:5px;
-moz-border-radius-topright:5px; -moz-border-radius-topleft:10px; -moz-border-radius-bottom:5px;
border-top-right-radius:5px; border-top-left-radius:10px; border-bottom-radius:5px;

Step further ahead, you can also write the code with shorthand, the following is good example.

-webkit-border-radius:5px 10px 5px 10px;
-moz-border-radius:5px 10px 5px 10px;
border-radius:5px 10px 5px 10px;

The following is another shorthand.

-webkit-border-top-right-radius:5px 10px;
-moz-border-radius-topright:5px 10px;
border-top-right-radius:5px 10px;

There are still some other shorthands if you realy want to learn more, the above examples are the common ways that people likely prefer to use. Here to learn more: http://www.css3.info/preview/rounded-border

#Things to remember

*CSS code moves like clock, means it reads the first value for the top side, as on shorthand: border-radius:5px 10px 15px 20px;
*You can also set the value with percentage instead of number, example: border-radius:1%;
*Most web browsers nowadays support border radius property, except mozilla and webkit, those still have something like bugs, but those can read this command: border-radius:5px;. But microsoft, internet explore, is not yet.
*Suppose that you specify the top right corner while the bottom left corner is not, the bottom left corner will be the same with the top corner. For the top left, use your imagination.

That is it, i've told you all things that you need to know about border radius, if you have any question due to the property, you speak up on comment section.

How To Create / Add Online Visitor Counter To Website?

Were you ever wondering if you could have a widget that would let you display the current online visitors on your website? Woohoo.. The gods heard your prayer my friend, those sent me down the earth just for you. "How To Add Online Visitors Counter Widget To Blogger", that's what i'm gonna talk about. Should we cheer for this? :)

Yeah, that seems not too bad if we can have an online visitors counter widget on our blogger blog, isn't? So far the only way that bloggers may know, a way to show the current visitors online, is by using widgets from third parties. That's not what we want, we agree that nobody love third parties in such case, to add some additional codes directly into the template is preferable, or at least we host the code ourselves.

The good news, there is a way to do that, it's using PHP script. However, we all know that blogger doesn't support PHP script, so for this way we need another web hosting to keep the code. There are many free PHP web hostings out there, just google out and you'll see that, or just take a look on my previous post and you'll have some options, here it is: http://j-smith-site.blogspot.com/2013/05/best-free-web-hostings-with-mysql-php.html > Best Free Web Hostings With PHP And MySQL Support

#Code To Show Online Visitors Counter Widget To Blogger

I'm not gonna tell you the detail way to execute the code, imma give you the code just like that with a short instruction, so if you know nothing about PHP script, then take a look on my previous post: http://j-smith-site.blogspot.com/2013/05/create-page-post-views-counter-widget_21.html > Individual Or Single Page Counter / Post Counter Widget For Blogger

Okay, i'm going.

1. Go to the PhpMyAdmin page of your host > Enter to database > Click Sql and insert the following paramater.

CREATE TABLE live_user (session char(100) NOT NULL default '', time int(11) NOT NULL default '0', file varchar(100) NOT NULL default '') TYPE=MyISAM;

2. Copypass the following script and Make it ".php" file.

<?php

session_start();
$session=session_id();
$time=time();
$time_check=$time-300;
$hostname="your_database_host";
$username="your_username";
$password="your_password";
$dbname="your_database_name";
$tblname="live_user";
mysql_connect("$hostname", "$username", "$password") or die("could not connect to the server");
mysql_select_db("$dbname") or die("Could not select Database");
$sql = "SELECT * FROM $tblname WHERE session='$session'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count=="0") {
$sql = "INSERT INTO $tblname(session, time) VALUES('$session', '$time')"; $result = mysql_query($sql);
}
else {
"$sql = UPDATE $tblname SET time='$time' WHERE session='$session'";
$result = mysql_query($sql);
}
$live_data = "SELECT * FROM $tblname";
$live_rows = mysql_query($live_data);
$live_user = mysql_num_rows($live_rows);
echo "document.write($live_user);";
$delete = "DELETE FROM $tblname WHERE time<$time_check";
$do = mysql_query($delete);
mysql_close();
?>


3. Go to file manager and upload the file (.php) to public_html directory.

4. Take the url of the page > Cover it with javascript and put on the website that you want to add the widget, well done!

*This script is working, the one that i published a few times ago is not working.
*To change how long the visitor will be count online since the last click he made in seconds, change the number "300" in the code.

The last thing, if you face any trouble in connection to the widget, you tell me. :)

If you like the above post, you might like these posts too:

http://j-smith-site.blogspot.com/2013/05/create-page-post-views-counter-widget_21.html > Individual Or Single Page Counter / Post Counter Widget For Blogger
http://j-smith-site.blogspot.com/2013/05/page-post-view-counter-hit-stats.html > Daily Page / Post Counter For Blogger
http://j-smith-site.blogspot.com/2013/06/page-counter-post-counter-widget-weekly.html > Weekly Page / Post Counter For Blogger
http://j-smith-site.blogspot.com/2013/06/post-views-widget-based-on-yearly-hits.html > Yearly Page / Post Counter Widget
http://j-smith-site.blogspot.com/2013/05/best-free-web-hostings-with-mysql-php.html > Best Free Web Hostings With PHP And MySQL Support

How To Block (Ban / Restrict) Access To PHP Script Or Page? Yes, You Can Ban Everybody And Allow Only Your Website To Accessing The Page Of Your PHP Script

How To Block (Ban / Restrict) Access To PHP Script Or Page? Yes, You Can Ban Everybody And Allow Only Your Website To Accessing The Page Of Your PHP Script

Did you search for a way, PHP script, just to restricting access of your php page? If that is it my friend, Well, you have come to the right place. Here i'll let you know Just how can you do that with ease using a short line of PHP code. The code is working, and it doesn't require you to know your ip address or some kind, doesn't even require you to learn PHP script, all you need to know is just the address, url of the page that you want to let it able to access the PHP page, and that is it.

Usually, those who need such a code are those who host own PHP script on a limited hosting. The problem doesn't come by the quota or bandwith given, cause generally, at its bad they have approximately 2GB bandwith per month, and that 2GB is not gonna be completely spent out in a month. The problem comes by "bad bots", which the bots are intentially sent by somebody to suck out the bandwith, somebody that might doesn't like those people.

Script Code For Restricting / Banning / Blocking Access To PHP Script Or Page

I've told you, the code is short and so very short. The only thing that you may want to know about the code, about the placement of the code, is that it must be placed on very top line before any other code written. If you put the code after or below the other one, the code may work only on those that are written below it.

The only problem with the code is that you can set only one website to include into the code, if you have two websites to include then you'll need to know about the "if" statement, if you have many websites to include then you'll need to find another way, the code that i'm about to tell here is not intended for such need.

Very well! Here is the code.

<?
$block = getenv('HTTP_REFERER');
if (strpos($block, 'j-smith-site.blogspot.com') != 7) {die("Restricted Area: You got no permittion!"); }
?>

That's it my friend, just replace my blog url with your and well done. There are still many ways that you can find to restrict access of your PHP page, if it's not what you want then just google out. If you take my code but then you face any trouble, then tell me about it and let me help you out.

The following are some posts in relation to PHP script.

http://j-smith-site.blogspot.com/2013/05/create-page-post-views-counter-widget_21.html > Individual Or Single Page Counter / Post Counter Widget For Blogger
http://j-smith-site.blogspot.com/2013/05/page-post-view-counter-hit-stats.html > Daily Page / Post Counter For Blogger
http://j-smith-site.blogspot.com/2013/06/page-counter-post-counter-widget-weekly.html > Weekly Page / Post Counter For Blogger
http://j-smith-site.blogspot.com/2013/06/post-views-widget-based-on-yearly-hits.html > Yearly Page / Post Counter Widget For Blogger
http://j-smith-site.blogspot.com/2013/05/best-free-web-hostings-with-mysql-php.html > Best Free Web Hostings With PHP And MySQL Support