Tuesday, May 31, 2011

Create Joomla Component, Part 1

Step One:
Specify the name of the component. For example, components nyoba. Create a folder in a folder com_nyoba webname / components. Then, create two empty files. nyoba.php file and also nyoba.html.php file.

nyoba.php file is the file list of classes or functions. And the functions are created in the file nyoba.html.php. In making the joomla component must understand the concepts of OOP.

Step Two:
Open the file nyoba.php. Write the code like below:

defined( '_JEXEC' ) or die ( 'Restricted access' );
jimport('joomla.application.helper');
require_once(JApplicationHelper::getPath('html'));
jTable::addIncludePath(JPath_ADMINISTRATOR.DS.'components'.DS.$option.DS.'tables');

Don’t forget the beginning and end of coded file : <? php?>.

Step Three:
Write the following code nyoba.html.php file...

defined( '_JEXEC' ) or die ( 'Restricted access' );
jimport('joomla.application.helper');
jTable::addIncludePath(JPath_ADMINISTRATOR.DS.'components'.DS.$option.DS.'tables');


Step Four:
Open the file nyoba.php.
Write as a switch-case loop.

switch($task)
{


case 'home':
nyoba::home($option);
break;

default:
nyoba::home($option);
break;
}
Switch ($ task), considered as a link.
If we choose the home, to locate into the class nyoba - home function.

A content or programming of the class nyoba - home function, wrote in the file nyoba.html.php.

Step Five:
create a script in a file nyoba.html.php.
Write the classes and functions under the include’s

class nyoba
{
Function home()
{
Echo”hallo…..”;
}

}


Step Six (database):
Open phpmyadmin, open the joomla database, open the components table. Select insert.
Name --- name of the component (tried)
Link --- link on the web (option = com_nyoba)
Menuid --- 0
Parent --- 0
admin_menu_link --- option = com_nyoba
Admin_menu_alt --- Experiment
--- Option com_nyoba
Ordering --- 0
Admin_menu_img --- js / ThemeOffice / edit.png
Iscore --- 0
Params ---
Enabled --- 1

The components created, registered and entered into a database in joomla. Calling the component, headed the seventh step.

Step Seven:
Go to joomla administrator. Create an external link. Create a new menu, Nyoba. In the field Links insert: index.php? option = com_nyoba.

Monday, May 30, 2011

Create Simple Module Prestashop, EN

First, create a folder in the folder modules. For example, create a module allo. Create modules / allo. The files: allo.php, allo.tpl, config.xml, en.php.

Step 1:

Allo.php

<?php

if (!defined('_CAN_LOAD_FILES_'))
exit;

define('BLOCKTAGS_MAX_LEVEL', 3);

class Allo extends Module
{
function __construct()
{
$this->name = 'allo';
$this->tab = 'front_office_features';
$this->version = 1.0;
$this->author = 'My Name';

parent::__construct();

$this->displayName = $this->l('Allo');
$this->description = $this->l('Olla Allo.');
}


function hookLeftColumn($params)
{

return $this->display(__FILE__, 'allo.tpl');

}

}

Step 2:

Allo.tpl

<div id="allo_block_left" class="block allo_block">
<h4>{l s='Allo' mod='allo'}</h4>
<p class="block_content">
<font color=””>Contact Us</font>
<br>
<font color=””>Write it all in here
</font>

</p>


</div>


Step 3 :

Config.xml

<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>allo</name>
<displayName>Allo</displayName>
<version>1</version>
<description>Olla Allo.</description>
<author>PrestaShop</author>
<tab>front_office_features</tab>
<is_configurable>0</is_configurable>
<need_instance>1</need_instance>
</module>


Step 4:

En.php
<?php

global $_MODULE;
$_MODULE = array();




Step 5:

in addition to the above files, create a css file for it. In the folder themes_name/ css / allo. Files allo.css...


/* Allo */
div.allo_block .alo_content { padding: 3px 6px 0 }
div.allo_block p {
text-align: justify;
font-size: 0.9em
}
div.allo_block p a {
margin: 0 0.1em;
line-height: 1.5em
}
div.allo_block p a:hover {
color: white!important;
background-color: #5D717E;
text-decoration: none
}
a.allo_level3 { font-size: 1.8em; font-weight: bold }
a.allo_level2 { font-size: 1.4em }
a.allo_level1 { font-size: 1em; color: #888!important }

activated the module from the backend first.

Step 6:

Going to the administrator area, tabs module, search module allo. If there are click enabled. If not, going to phpmyadmin, to bring the module to module list. Select the table _module, search exist or not allo. If not, insert new fields, with names allo, active field contents with 1. and then, go to admin, enable the module.

Pada frontend, klik refresh apa ada module allo?. Kalo tidak ada, halaman admin - tab preference, klik perfomance, pada Smarty.... Force compile ganti yes. coba di frontend, sudah muncul? Kalo belum pada backend cachenya kita ganti no. refresh lagi, sudah muncul? Kalo sudah muncul, ke admin lagi, kita ubah ke default semula force compile dan cache. fungsinya merubah force compile untuk mengcompile ulang prestashop. Kalo force compilenya no, akan mengcompile dari smarty-nya. Kalo yes, akan decompile semuanya (dari file-file tpl yang baru dibuat). Makanya waktu ngerefresh lumayan berat.

On the frontend, click refresh, module allo appears?. If not available, admin pages - preference tab, click Perfomance, on Smarty .... Force compile replace yes. Trying on the frontend, it appears? If not yet in its cache backend we replace the no. refresh again, it appears? If it appears, to the admin again, we change it to default compile and cache the original force. to change force its function re-compile to compile prestashop. If force compile is no, will compile from his smarty. If yes, will decompile all of them (from the tpl files newly created). So then to refresh, is slow.


to display something of writing in the module and can be in the link. To display a word use the function like this: {ls = 'Halooo .... hehehehe. '}. Create a file in the root folder allo.php


Step 7:

Allo.php

<?php
$task=$_GET['task'];

include(dirname(__FILE__).'/config/config.inc.php');

if (Tools::getValue('ajaxSearch') AND $query = urldecode(Tools::getValue('q')) AND !is_array($query))
{
include(dirname(__FILE__).'/init.php');
$link = new Link();
$search = Search::find(intval(Tools::getValue('id_lang')), $query, 1, 10, 'position', 'desc', true);
foreach ($search as $product)
echo $product['id_product'].'|'.$product['pname'].'|'.$product['cname'].'|'.$link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite'])."n";
die;
}

include(dirname(__FILE__).'/header.php');
include(dirname(__FILE__).'/product-sort.php');

if ($task=='one')
{
echo"This number one
<br><br>
Module:<br>
";
$a1=mysql_query("select *from ps_module limit 10");
while($a=mysql_fetch_array($a1))
{
echo"$a[name]<hr>";
}

}

else
{
echo"what your choice?";
}

include(dirname(__FILE__).'/footer.php');

?>


In row if ($ task = 'one'). if click the link to one on the module will display on if ($ task = one), if you want add other functions means that if ($ task = two), etc ....

Saturday, May 28, 2011

Chart May 28 2011

Pop Songs

1. E.T – Katy Perry Feat. Kanye West

2. Just Can’t Get Enough – The Black Eyed Peas

3. Rolling In The Deep – Adele

4. Till The World Ends – Britney Spears

5. On The Floor – Jennifer Lopez Feat. Pitbull

6. The Lazy Song – Bruno Mars

7. Written In Stars – Tinie Tempah Feat Eric Tunner

8. Blow – Ke$ha

9. S&M – Rihanna

10. Give Me Everything – Pitbull Feat Ne-Yo, AfroJack & Nayer

Rock Songs

1. Rope – Foo Fighters

2. Country Song – Seether

3. Help Is On The Way – Rise Against

4. The Cave – Mumford & Sons

5. Shake Me Down – Cage The Elephant

6. You Are A Tourist – Death Cab For Cutie

7. Pumped Up Kicks – Foster The People

8. Adolescents – Incubus

9. Howlin’ For You – The Black Keys

10. Rip Tide – Sick Puppies

Country Songs

1. Old Alabama – Brad Paisley Ft. Alabama

2. I Won’t Let Go – Rascal Flatts

3. Heart Like Mine – Miranda Lambert

4. Without You – Keith Urban

5. Mean – Taylor Swift

6. A Little Bit Stronger – Sara Evans

7. You Lie – The Band Perry

8. Honey Bee – Blake Shelton

9. Tomorrow – Chris Young

10. Bleed Red– Ronnie Dunn

HOT 100

1. Rolling In The Deep – Adele

2. E.T – Katy Perry Feat. Kanye West

3. Give Me Everything – Pitbull Feat Ne-Yo, AfroJack & Nayer

4. Just Can’t Get Enough – The Black Eyed Peas

5. On The Floor – Jennifer Lopez Feat. Pitbull

6. The Lazy Song – Bruno Mars

7. Till The World Ends – Britney Spears

8. Party Rock Anthem - LMFAO Featuring Lauren Bennett & GoonRock

9. The Snow Goes On – Lupe Fiasco

10. Look At Me Now – Chris Brown Feat. Lil Wayne & Busta Rhymes

Friday, May 27, 2011

Create Calendar Showing Active Day, EN

So many tutorials about creating calendar using php, but not show the current date. Here are examples of programs that can show the active date. Obtained from various sources on the Internet and developed again (on active) with simple logic.

Here are examples of php code to create a simple calendar:

<html>
<head>

</head>
<body>
<?php
$monthnames = Array("January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December");
?>

<?php
if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n");
if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y");
?>

<?php
$cMonth = $_REQUEST["month"];
$cYear = $_REQUEST["year"];

$prevyear = $cYear;
$nextyear = $cYear;
$prevmonth = $cMonth-1;
$nextmonth = $cMonth+1;

if ($prevmonth == 0 ) {
$prevmonth = 12;
$prevyear = $cYear - 1;
}
if ($nextmonth == 13 ) {
$nextmonth = 1;
$nextyear = $cYear + 1;
}
?>

<table width="100">
<tr align="center">
<td bgcolor="#AAAAAA" style="color:#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left">&nbsp;&nbsp;<a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $prevmonth . "&year=" . $prevyear; ?>" style="color:#FFFFFF">Previous</a></td>
<td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $nextmonth . "&year=" . $nextyear; ?>" style="color:#FFFFFF">Next</a>&nbsp;&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="2" bgcolor="#eeeeee">
<tr align="center">
<td colspan="7" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong><?php echo $monthnames[$cMonth-1].' '.$cYear; ?></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>S</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>M</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>T</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>W</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>T</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>F</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>S</strong></td>
</tr>


<?php
$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
$skr=date('d');
for ($i=0; $i<($maxday+$startday); $i++) {
if($skr==$i-$startday+1){$font='#FF0000'; $strong='<strong>';}
else {$font='#000099'; $strong='';}
if(($i % 7) == 0 ) echo "<tr>";
if($i < $startday) echo "<td></td>";
else

echo "
<td align='center' valign='middle' height='20px'>".$strong."<font color='$font'>" .($i - $startday + 1) . "</font></strong></td>";
if(($i % 7) == 6 ) echo "</tr>";
}
?>

</table>
</td>
</tr>
</table>
</body>
</html>



This code to determine the current date by using simple logic:

for ($i=0; $i<($maxday+$startday); $i++) {
if($skr==$i-$startday+1){$font='#FF0000'; $strong='<strong>';}
else {$font='#000099'; $strong='';}

Wednesday, May 25, 2011

Mean - Taylor Swift

You, with your words like knives
And swords and weapons that you use against me,
You, have knocked me off my feet again,
Got me feeling like I’m nothing.
You, with your voice like nails on a chalkboard
Calling me out when I’m wounded.
You, pickin’ on the weaker man.

Well you can take me down,
With just one single blow.
But you don’t know, what you don’t know,

Someday, I’ll be living in a big old city,
And all you’re ever gonna be is mean.
Someday, I’ll be big enough so you can’t hit me,
And all you’re ever gonna be is mean.
Why you gotta be so mean?

You, with your switching sides,
And your walk by lies and your humiliation
You, have pointed out my flaws again,
As if I don’t already see them.
I walk with my head down,
Trying to block you out cause I’ll never impress you
I just wanna feel okay again.

I bet you got pushed around,
Somebody made you cold,
But the cycle ends right now,
You can’t lead me down that road,
You don’t know, what you don’t know

Someday, I’ll be, living in a big old city,
And all you’re ever gonna be is mean.
Someday, I’ll be big enough so you can’t hit me,
And all you’re ever gonna be is mean.
Why you gotta be so mean?

And I can see you years from now in a bar,
Talking over a football game,
With that same big loud opinion but,
Nobody’s listening,
Washed up and ranting about the same old bitter things,
Drunk and grumbling on about how I can’t sing.

But all you are is mean,
All you are is mean.
And a liar, and pathetic, and alone in life,
And mean, and mean, and mean, and mean

But someday, I’ll be, living in a big old city,
And all you’re ever gonna be is mean. Yeah,
Someday, I’ll be big enough so you can’t hit me,
And all you’re ever gonna be is mean.
Why you gotta be so ?
Someday, I’ll be, living in a big old city,
And all you’re ever gonna be is mean. Yeah,
Someday, I’ll be big enough so you can’t hit me,
And all you’re ever gonna be is mean.
Why you gotta be so mean?

Link for download: Mean - Taylor Swift

Monday, May 23, 2011

Chart May, 23 2011

Pop Songs

1. E.T – Katy Perry Feat. Kanye West

2. Just Can’t Get Enough – The Black Eyed Peas

3. Rolling In The Deep – Adele

4. Till The World Ends – Britney Spears

5. On The Floor – Jennifer Lopez Feat. Pitbull

6. The Lazy Song – Bruno Mars

7. Blow – Ke$ha

8. S&M – Rihanna

9. Written In Stars – Tinie Tempah Feat Eric Tunner

10. Down On Me – Jeremih Feat. 50 Cent Featuring Eric Turner

Rock Songs

1. Rope – Foo Fighters

2. Country Song – Seether

3. Help Is On The Way – Rise Against

4. The Cave – Mumford & Sons

5. Adolescents – Incubus

6. Howlin’ For You – The Black Keys

7. You Are A Tourist – Death Cab For Cutie

8. Shake Me Down – Cage The Elephant

9. Rip Tide – Sick Puppies

10. Pumped Up Kicks – Foster The People

Country Songs

1. Heart Like Mine – Miranda Lambert

2. Old Alabama – Brad Paisley Ft. Alabama

3. A Little Bit Stronger – Sara Evans

4. I Won’t Let Go – Rascal Flatts

5. Without You – Keith Urban

6. Mean – Taylor Swift

7. Live A Little – Kenny Chesney

8. You Lie – The Band Perry

9. Honey Bee – Blake Shelton

10. If Heaven Wasn’t So Far Away – Justin Moore

HOT 100

1. Rolling In The Deep – Adele

2. E.T – Katy Perry Feat. Kanye West

3. The Edge of Glory – Lady Gaga

4. Give Me Everything – Pitbull Feat Ne-Yo, AfroJack & Nayer

5. Just Can’t Get Enough – The Black Eyed Peas

6. On The Floor – Jennifer Lopez Feat. Pitbull

7. The Lazy Song – Bruno Mars

8. Till The World Ends – Britney Spears

9. Look At Me Now – Chris Brown Feat. Lil Wayne & Busta Rhymes

10. Down On Me – Jeremih Feat. 50 Cent Featuring Eric Turner

Tuesday, May 17, 2011

A Little Bit Stronger lyrics

A Little Bit Stronger lyrics
Songwriters: Barker Aaron Gayle; Harbin Ronald Steven;



Woke up late today and I still feel the sting of the pain
But I brushed my teeth anyway
I got dressed through the mess and put a smile on my face
I got a little bit stronger

Riding in the car to work and I'm trying to ignore the hurt
So I turned on the radio, stupid song made me think of you
I listened to it for minute but I changed it
I'm getting a little bit stronger, just a little bit stronger

And I'm done hoping that we could work it out
I'm done with how it feels, spinning my wheels
Letting you drag my heart around
And, oh, I'm done thinking that you could ever change

I know my heart will never be the same
But I'm telling myself I'll be okay
Even on my weakest days
I get a little bit stronger

Doesn't happen overnight but you turn around
And a month's gone by and you realize you haven't cried
I'm not giving you a hour or a second or another minute longer
I'm busy getting stronger

And I'm done hoping that we can work it out
I'm done with how it feels, spinning my wheels
Letting you drag my heart around
And, oh, I'm done thinking, that you could ever change

I know my heart will never be the same
But I'm telling myself I'll be okay
Even on my weakest days, I get a little bit stronger
I get a little bit stronger

Getting along without you, baby
I'm better off without you, baby
How does it feel without me, baby?
I'm getting stronger without you, baby

And I'm done hoping we could work it out
I'm done with how it feels, spinning my wheels
Letting you drag my heart around
And, oh, I'm done thinking that you could ever change

I know my heart will never be the same
But I'm telling myself I'll be okay
Even on my weakest days
I get a little bit stronger

I get a little bit stronger
Just a little bit stronger
A little bit, a little bit, a little bit stronger
I get a little bit stronger

Saturday, May 14, 2011

Chart 14 Mei 2011

Pop Songs

1. E.T – Katy Perry Feat. Kanye West

2. Just Can’t Get Enough – The Black Eyed Peas

3. S&M – Rihanna

4. Till The World Ends – Britney Spears

5. Blow – Ke$ha

6. Rolling In The Deep – Adele

7. On The Floor – Jennifer Lopez Feat. Pitbull

8. The Lazy Song – Bruno Mars

9. Written In Stars – Tinie Tempah Feat Eric Tunner

10. Down On Me – Jeremih Feat. 50 Cent Featuring Eric Turner

Rock Songs

1. Rope – Foo Fighters

2. Help Is On The Way – Rise Against

3. Country Song – Seether

4. The Cave – Mumford & Sons

5. Howlin’ For You – The Black Keys

6. Shake Me Down – Cage The Elephant

7. Adolescents – Incubus

8. You Are A Tourist – Death Cab For Cutie

9. Pumped Up Kicks – Foster The People

10. Rip Tide – Sick Puppies

Country Songs

1. A Little Bit Stronger – Sara Evans

2. Heart Like Mine – Miranda Lambert

3. Old Alabama – Brad Paisley Ft. Alabama

4. I Won’t Let Go – Rascal Flatts

5. Live A Little – Kenny Chesney

6. Without You – Keith Urban

7. What Do You Want – Jarrod Niemann

8. Mean – Taylor Swift

9. You Lie – The Band Perry

10. Bleed Red – Ronnie Dunn

HOT 100

1. Rolling In The Deep – Adele

2. E.T – Katy Perry Feat. Kanye West

3. On The Floor – Jennifer Lopez Feat. Pitbull

4. Just Can’t Get Enough – The Black Eyed Peas

5. The Lazy Song – Bruno Mars

6. Till The World Ends – Britney Spears

7. Just A Kiss – Lady Antebellum

8. Give Me Everything – Pitbull Feat Ne-Yo, AfroJack & Nayer

9. S&M – Rihanna

10. Look At Me Now – Chris Brown Feat. Lil Wayne & Busta Rhymes

Tuesday, May 10, 2011

Shania Twain - From This Moment On

(I do swear that I'll always be there. I'd give anything
and everything and I will always care. Through weakness
and strength, happiness and sorrow, for better, for worse,
I will love you with every beat of my heart.)

From this moment life has begun
From this moment you are the one
Right beside you is where I belong
From this moment on

From this moment I have been blessed
I live only for your happiness
And for your love I'd give my last breath
From this moment on

I give my hand to you with all my heart
Can't wait to live my life with you, can't wait to start
You and I will never be apart
My dreams came true because of you

From this moment as long as I live
I will love you, I promise you this
There is nothing I wouldn't give
From this moment on

You're the reason I believe in love
And you're the answer to my prayers from up above
All we need is just the two of us
My dreams came true because of you

From this moment as long as I live
I will love you, I promise you this
There is nothing I wouldn't give
From this moment
I will love you as long as I live
From this moment on

Monday, May 9, 2011

Seether - Country Song Lyric

Well I can't stand to look at you now
This revelation's out of my hands
Still I can't bear the thought of you now
This complication's leaving me scared

Stay when you think you want me
Pray when you need advice
Hey keep your sickness off me; tryin to get through
Blame all your weakness on me
Shame that I'm so contrite
Hey keep your fingers off me; why can't I get through?

You think you have the best of intentions
I cannot shake the taste of blood in my mouth

[Chorus]
(Hey) I keep on thinking that it's
(Hey) all done and all over now (whoa)
You keep on thinking you can save me, save me
(Hey) My ship is sinking but it's
(Hey) all good and I can go down (whoa)
You got me thinking that the party's all over

Well I can't stand to be with myself
This liberation's seemingly rare
And I can't stand the taste of your mouth
This sublimation's out of my hands

You stay 'cause you think you want me
Pray when you need advice
Hey keep your sickness off me; I'm tryin to get through
Shame you could take this from me
Pain on an empty mind
Hey keep your fingers off me; why can't I get through?



[Chorus]
(Hey) I keep on thinking that it's
(Hey) all done and all over now (whoa)
You keep on thinking you can save me, save me
(Hey) My ship is sinking but it's
(Hey) all good and I can go down (whoa)
You got me thinking that the party's all over

Lay down
Just stay down
Lay down, because I'm tryin' to get through

Say what you want, but you're not gonna win this time
Take what you want, but just leave me alive
Say what you want, but you're not gonna win this time
Take what you want, but just leave me a life

[Chorus]
(Hey) I keep on thinking that it's
(Hey) all done and all over now (whoa)
You keep on thinking you can save me, save me
(Hey) My ship is sinking but it's
(Hey) all good and I can go down (whoa)
Still you believe that we can start it all over

Lay down
Just stay down
Lay down, because they party's all over

Lay down
Just stay down
Lay down, because I'm tryin' to get through

Saturday, May 7, 2011

Chart 7 Mei 2011

Chart 7 Mei 2011

Pop Songs

1. E.T – Katy Perry Feat. Kanye West

2. S&M – Rihanna

3. Just Can’t Get Enough – The Black Eyed Peas

4. Blow – Ke$ha

5. Till The World Ends – Britney Spears

6. On The Floor – Jennifer Lopez Feat. Pitbull

7. Fk You (Forget You) – Cee Lo Green

8. Down On Me – Jeremih Feat. 50 Cent Featuring Eric Turner

9. The Lazy Song – Bruno Mars

10. Rolling In The Deep – Adele

Rock Songs

1. Rope – Foo Fighters

2. Help Is On The Way – Rise Against

3. Country Song – Seether

4. The Cave – Mumford & Sons

5. Howlin’ For You – The Black Keys

6. Shake Me Down – Cage The Elephant

7. Adolescents – Incubus

8. Burn – Papa Roach

9. Waiting For The End – Linkin Park

10. Rip Tide – Sick Puppies

Country Songs

1. A Little Bit Stronger – Sara Evans

2. Heart Like Mine – Miranda Lambert

3. Live A Little – Kenny Chesney

4. What Do You Want – Jarrod Niemann

5. Old Alabama – Brad Paisley Ft. Alabama

6. I Won’t Let Go – Rascal Flatts

7. Without You – Keith Urban

8. This – Darius Rucker

9. Mean – Taylor Swift

10. You Lie – The Band Perry

HOT 100

1. E.T – Katy Perry Feat. Kanye West

2. Rolling In The Deep – Adele

3. Till The World Ends – Britney Spears

4. Just Can’t Get Enough – The Black Eyed Peas S&M – Rihanna

5. The Lazy Song – Bruno Mars

6. S&M – Rihanna

7. On The Floor – Jennifer Lopez Feat. Pitbull

8. Blow – Ke$ha

9. Down On Me – Jeremih Feat. 50 Cent

10. Look At Me Now – Chris Brown Feat. Lil Wayne & Busta Rhymes

Thursday, May 5, 2011

Create Calendar Showing Active Day

Berikut contoh kode php untuk buat calendar. Begitu banyak tutorial tentang pembuatan calendar dengan menggunakan php, tapi masih belum menunjukkan tanggal sekarang/ aktif. Berikut contoh program yang dapat menunjukkan tanggal aktif. Didapat dari berbagai sumber di internet dan dikembangkan lagi (tanggal aktif) dengan logika sederhana.

<html>
<head>

</head>
<body>
<?php
$monthnames = Array("January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December");
?>

<?php
if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n");
if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y");
?>

<?php
$cMonth = $_REQUEST["month"];
$cYear = $_REQUEST["year"];

$prevyear = $cYear;
$nextyear = $cYear;
$prevmonth = $cMonth-1;
$nextmonth = $cMonth+1;

if ($prevmonth == 0 ) {
$prevmonth = 12;
$prevyear = $cYear - 1;
}
if ($nextmonth == 13 ) {
$nextmonth = 1;
$nextyear = $cYear + 1;
}
?>

<table width="100">
<tr align="center">
<td bgcolor="#AAAAAA" style="color:#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="left">&nbsp;&nbsp;<a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $prevmonth . "&year=" . $prevyear; ?>" style="color:#FFFFFF">Previous</a></td>
<td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $nextmonth . "&year=" . $nextyear; ?>" style="color:#FFFFFF">Next</a>&nbsp;&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="2" bgcolor="#eeeeee">
<tr align="center">
<td colspan="7" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong><?php echo $monthnames[$cMonth-1].' '.$cYear; ?></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>S</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>M</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>T</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>W</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>T</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>F</strong></td>
<td align="center" bgcolor="#AAAAAA" style="color:#FFFFFF"><strong>S</strong></td>
</tr>


<?php
$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];
$skr=date('d');
for ($i=0; $i<($maxday+$startday); $i++) {
if($skr==$i-$startday+1){$font='#FF0000'; $strong='<strong>';}
else {$font='#000099'; $strong='';}
if(($i % 7) == 0 ) echo "<tr>";
if($i < $startday) echo "<td></td>";
else

echo "
<td align='center' valign='middle' height='20px'>".$strong."<font color='$font'>" .($i - $startday + 1) . "</font></strong></td>";
if(($i % 7) == 6 ) echo "</tr>";
}
?>

</table>
</td>
</tr>
</table>
</body>
</html>

Tuesday, May 3, 2011

Lazy Song - Bruno Mars

Today I don't feel like doing anything
I just wanna lay in my bed
Don't feel like picking up my phone, so leave a message at the tone
'Cause today I swear I'm not doing anything

I'm gonna kick my feet up then stare at the fan
Turn the TV on, throw my hand in my pants
Nobody's gon' tell me I can't

I'll be lounging on the couch just chilling in my Snuggie
Click to MTV so they can teach me how to dougie
'Cause in my castle I'm the freaking man

Oh yes, I said it, I said it
I said it 'cause I can

Today I don't feel like doing anything
I just wanna lay in my bed
Don't feel like picking up my phone, so leave a message at the tone
'Cause today I swear I'm not doing anything
Nothing at all, nothing at all

Tomorrow I'll wake up, do some P90X
Find a really nice girl, have some really nice sex
And she's gonna scream out

This is great
(Oh my god, this is great)

Yeah, I might mess around
And get my college degree
I bet my old man will be so proud of me
But sorry pops, you'll just have to wait

Oh yes, I said it, I said it
I said it 'cause I can

Today I don't feel like doing anything
I just wanna lay in my bed
Don't feel like picking up my phone, so leave a message at the tone
'Cause today I swear I'm not doing anything

No, I ain't gonna comb my hair
'Cause I ain't going anywhere
No, no, no, no, no, no, no, no, no

I'll just strut in my birthday suit
And let everything hang loose
Yeah, yeah, yeah, yeah, yeah
Yeah, yeah, yeah, yeah, yeah, yeah

Oh, today I don't feel like doing anything
I just wanna lay in my bed
Don't feel like picking up my phone, so leave a message at the tone
'Cause today I swear I'm not doing anything

Nothing at all
Nothing at all
Nothing at all

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Best Web Hosting