Do you need a PHP programmer?
Use my services as a freelance PHP programmer by hiring me to do PHP programming on your website project.

I have built many custom PHP applications like project managers, classified ad websites and content management systems. I also work with open source applications such as WordPress, online shopping cart websites like Magento and develop content management systems like Joomla.

Showing posts with label Blog Tutorial. Show all posts
Showing posts with label Blog Tutorial. Show all posts

Thursday, January 24, 2013

Get date of one week based on week number - php

Hi, ,
There are many kind of php function you can use for datetime manipulation. But today I will share a short code that you can use for get date of one week based on your week number.

I have created a function that you can use or develop
Let see my function below :

<?php
 function get_date_in_week($year,$week_number){
  $date = array();
  
  // 1 week 7 days
  for($day = 1; $day <= 7; $day++){
   
   $set_date = strtotime($year."W".($week_number<10?'0':'').$week_number.$day);
   
   if(date('Y',$set_date) == $year){
    $date['year-'.$year]['week-'.$week_number]['day-'.$day] = date('j', $set_date);
   }
   
  }
  
  return $date;
  
 }
?>


Now, you can simple to use, just call the function then you will get date of one week based on your week number.

<pre>
 <?php
  $year = '2013';
  $week_number = '2';
  print_r(get_date_in_week($year,$week_number));
 ?>
</pre>


The result will be like this :

Array
(
    [year-2013] => Array
        (
            [week-2] => Array
                (
                    [day-1] => 7
                    [day-2] => 8
                    [day-3] => 9
                    [day-4] => 10
                    [day-5] => 11
                    [day-6] => 12
                    [day-7] => 13
                )

        )

)

Hope it can helps.
But if you still need help, just write your comment below.
I will try to find out.

Kind regard,
Bayu Prawira

Saturday, September 8, 2012

How to Add Facebook Like Box on Blogger?

What is a Facebook Page?
Pages are for businesses, organizations and brands to share their stories and connect with people. Like timelines, you can customize Pages by adding apps, posting stories, hosting events and more. Engage and grow your audience by posting regularly. People who like your Page will get updates in their news feeds. Read more.

On this post I will share about "How to Add Facebook Like Box plugin on Blogger", so it is an effective way to ensure you keep in touch with your blog visitors on the world’s favorite social network.
Ok, let's follow the easy step.

First, make sure you already have or create Facebook fans page.
for example just use my facebook fans page, http://www.facebook.com/bywebsite .

1.  Click here to get started.
2.   Then put your url fans page on "Facebook Page URL" input form.






     Setting your Like box as you want by change the width, height, color schema and ect.
3.  Click on Get Code when done with the configuration.
4.  In your like box plugin code window, please select iframe tab, for get easy code to make it works.


5.  Copy all code for your like box.
6.  Login to your blogger account, then choose layout.
7.  Select Add a Gadget (HTML/Javascript) on the location you wish the facebook like box to appear.

8.  Paste your code and Save.


9.  View your blog and the Widget should appear at the very spot.
   



We have finished !!, wish your blog look more beauty :)
If you have suggest or any questions, just write your comment below.
Good luck !

Best Regard,
Bayu Prawira

Highlight Code/Scripts in Post Article

Someday, I confused when I tried to make some code tutorial in my post. I have made some code tutorial in my post but it didn't look nice when I displayed. On the other side when I have browsed and looked for the others blogs, They have made like highlight for their code tutorial.How have they make it?

I had googling for it and I got some tips to solve it.

You can use a simple way by put some css code to your template
  • Login to your blogspot account
  • Choose "Template" on your menu
  • On template page choose "Edit HTML"
  • push ctrl + f on your keyboard for search this code "]]></b:skin>"
  • Copy paste code below before "]]></b:skin>" code.

/* interface code */
.code{margin: 10px 10px 10px 10px;
padding: 10px 15px 10px 15px;
line-height: 1.6em;color: #000000;
background: #e0ffff;
border: 1px solid #000000;
border-style: dashed }

  • Ok, already done. You can save your template now.
  • For using this css, you can use <p> element for example
           <p class="code">{your script here}</p>

The result will display like the image below :


Ok, that's all,
If you have suggest or some questions, just write on comment form below,
Hope it helpful for all and good luck,

Best Regard,
Bayu Prawira

Thursday, April 5, 2012

Build New Category Widget for Your Website

Hallo , ,
Come back again,
On this post, I still share about how to make your website ( blogspot) look nicer.

Now we will build a new widget to grouping all of your article based on their categories.
Categories widget is very important thing for your website, otherwise it will group all of your article based on their categories, it also will make your visitors become easy when they read or just look for your articles.
So surely your website will look nicer and professional.

I have simple way to build it by using standard additional widget from blogspot platform
Ok, let's see how we will make it.
  1. Login to your website account
  2. Choose "Layout" on your menu
  3. Then choose "Add a Gadget" on your sidebar layout, it will show a pop up window with many gadget choices. On this part you should choose "Label" gadget. And new window will display an image below.

         Change the title become "Categories". yupss, finished.
         You can push Save button now.

Note : Categories widget will group your articles based on their labels, so don't forget to put labels when you create a new post for your website.

Hope it useful for all, Thank you :)

Hide Navbar Blogger by Using Simple CSS

When I built this website, I just used one of free template ( awesome inc template ) from Blogspot Platform and  its design was very simple. But I thought I should do some things to make it better and look nicer. Then I tried to make it different by hide navbar on header of my website.

How did I make it?

I just used simple way by added some css script,
let's look for the script :

/*  hide navbar header  */

#navbar-iframe {display:none;}

You can copy and paste the script above to your template.
I will point you how to use it,

  1. The first one you should login to your blogspot account.
  2. Click "Template" on menu
  3. Click "Edit Html" and then chose "Process"
  4. To make it easier, push ctrl + f button on keyboard and search for this script "]]></b:skin> ".
  5. Copy my script above and paste before  "]]></b:skin> " script.
  6. Ok, you can save your template now.


I think it enough, let's see how does your site look like !!
But if you still confused or need help or ask for something else,
don't hesitate to comment here,
if I know I will shared.


Good Luck :D