Skip to main content
  • Home
  • Tags
OpenView360
Think Smart, Be Free, Choose Open Source
Home

Blogs

Simple PHP Calendar

In:
  • calendar
  • coding
  • php
12Nov2009

I was searching today for a pre-made script for a simple php calendar and after a bit of search I've found this.

The code is a bit old, and the author's website doesn't seem to work anymore, so I decided to clean it up a bit.
You can see the result below.

  1. <?php
  2. // This gets today's date
  3. $date = time ();
  4.  
  5. // This puts the day, month, and year in seperate variables
  6. $day  = date('d', $date);
  7. $month= date('m', $date);
  8. $year = date('Y', $date);
  9.  
  10. // Here we generate the first day of the month
  11. $first_day = mktime(0,0,0,$month, 1, $year);
  12.  
  13. //This gets us the month name
  14. $title = date('F', $first_day);
  15.  
  16. //Here we find out what day of the week the first day of the month falls on
  17. $day_of_week = date('D', $first_day);
  18.  
  19. //Once we know what day of the week it falls on, we know how many blank days occure before it. If the first day of the week is a Sunday then it would be zero
  20. switch($day_of_week) {
  21.   case "Sun": $blank = 0; break;
  22.   case "Mon": $blank = 1; break;
  23.   case "Tue": $blank = 2; break;
  24.   case "Wed": $blank = 3; break;
  25.   case "Thu": $blank = 4; break;
  26.   case "Fri": $blank = 5; break;
  27.   case "Sat": $blank = 6; break;
  28. }
  29.  
  30. // We then determine how many days are in the current month
  31. $days_in_month = cal_days_in_month(0, $month, $year);
  32. ?>
  33.  
  34. <table cellpadding="0" cellspacing="0">
  35.   <tr>
  36.     <th colspan="7"><?php print $month; ?> <?php print $year; ?></th>
  37.   </tr>
  38.   <tr>
  39.     <td>Sun</td>
  40.     <td>Mon</td>
  41.     <td>Tue</td>
  42.     <td>Wed</td>
  43.     <td>Thu</td>
  44.     <td>Fri</td>
  45.     <td>Sat</td>
  46.   </tr>
  47.    <?php $day_count = 1;// This counts the days in the week, up to 7 ?>
  48.   <tr>
  49.   <?php while ($blank > 0): //first we take care of those blank days ?>
  50.     <td>&nbsp;</td> <?php $blank = $blank-1; $day_count++; ?>
  51.   <?php endwhile; ?>
  52.   <?php $day_num = 1; //sets the first day of the month to 1 ?>  
  53.  
  54.   <?php while ($day_num <= $days_in_month): //count up the days, until we've done all of them in the month ?>
  55.     <td><?php print $day_num; ?></td>
  56.     <?php $day_num++; $day_count++; ?>
  57.     <?php if ($day_count > 7): //Make sure we start a new row every week ?>
  58.   </tr>
  59.   <tr>
  60.     <?php $day_count = 1; ?>
  61.     <?php endif; ?>
  62.   <?php endwhile; ?>
  63.    
  64.   <?php while ($day_count >1 && $day_count <=7): //Finaly we finish out the table with some blank details if needed ?>
  65.     <td>&nbsp;</td>
  66.     <?php $day_count++; ?>
  67.   <?php endwhile; ?>
  68.   </tr>
  69. </table>

  • CoolGoose's blog
  • Add new comment

Michael Jackson tribute flash mob Bucharest, Romania (Romana Square)

In:
  • michael jackson
  • music
4Sep2009
  • CoolGoose's blog
  • Add new comment

Inger sau demon

In:
  • in
  • madness
  • poem
  • random
  • thoughts
31Jul2009

Esti un inger ce in noapte,
te cobori pe-acest Pamant
vii la geam , imi spui dulci soapte,
nu te pot scoate din gand
caci tu esti a noptii zana
cum nici-unul n-am vazut
dar nu esti sortita mie
ca destinul nu a vrut

Ca o floare de cristal
Vii si-n suflet te topesti
Mi-ai lasat un gust amar
Tu, ca toate, ofilesti.

  • CoolGoose's blog
  • Add new comment

Pitch black

In:
  • poem
20Jul2009

Pitch black night, the sky turns gray
I'm a hunter who's found pray.
I'm a demon from the night,
I won't loose you from my sight;
I will follow you around
You won't hear me make a sound.

/ps
A bit on draft, no idea how to continue though.

  • CoolGoose's blog
  • Add new comment

The dream

In:
  • gall
  • lass
  • poem
  • quest
  • soul
4May2009

Beyond the river of flames
A young gall lived her life
Embraced herself in pitiful games
That only made her strife

A bed of roses I lay at her feet
Watching for a sign of distress
But only when our eyes meet
I can see she's not flawless

Her big blue eyes that make me dream
Of skies that make the heavens cry
I understand her pain within
I understand her soul will die

I leave the lass alone to stay
Being rejected in my quest
To make her mine and only mine
For her to be my dearest.

  • CoolGoose's blog
  • Add new comment

Vrei sa devii webdesigner ?

In:
  • css
  • design
  • html
24Apr2009

Ca raspuns la articolul (vreau sa devin webdesigner) scris pe zoomxsolutions.

Un designer din punctul meu de vedere ar trebui sa stie doar chestiile de baza din html deoarece el nu trebuie sa fie programator ci designer.

Teoria culorilor, compositie in pagina, workflow, usability, trenduri in design ar trebui sa fie de fapt target-ul / ocupatia unui designer.

Sa pierzi timp sa inveti html + css la un nivel in care nu stai 2 zile ca sa faci un design + reparatul de bug-uri de pe cele x la n browsere iti ia timp pe care ai putea sa-l folosesti ca-ti imbunatatesti design-urile.

Apoi. daca incepi sa fii programator, o sa incepi sa gandesti ca unul.
Sa vezi atunci cum incepi sa te limitezi de la gradienti, soft shadows, positionari mai ciudate in pagina doarece incepi sa te gandesti "dar eu cum as implementa asta".

  • CoolGoose's blog
  • Add new comment

To be continued

In:
  • poem
30Mar2009

Pitch black wings no angel had
Pitch black soul a daemon's mad
Wings that spread across the earth
Soul that's filthier than dirt

  • CoolGoose's blog
  • Add new comment

Google Safe Browsing system failure

In:
  • google
  • safe
  • safe browser
31Jan2009

Google Safe Browsing system failure
Restarting firefox has no effect.

Initial: 16:49
Update: 17:20 - It works again.

  • CoolGoose's blog
  • Add new comment
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • next ›
  • last »
Entries (RSS)

About

Just your average goose.

Activity Stream

  • Fri, 12/03/2010 - 00:26

  • Digg CoolGoose dugg Why you'll never be able to legally rip your DVDs 12:26am#
  • Digg CoolGoose dugg Google's Own Stated List of Competitors Grows from 2 to 10 11:54pm#
  • Digg CoolGoose dugg Mozilla Wants You To Help Rewrite Its Public License 11:54pm#
  • Digg CoolGoose dugg Commercial Gaming, Coming Soon to Linux? 11:54pm#
  • Digg CoolGoose dugg Why (I think) Ubuntu is Better Than Windows 11:29pm#
  • Digg CoolGoose dugg Android Crushes the Competition, iPhone Stands Still 11:28pm#
  • Digg CoolGoose dugg The Reasons Why Your Boss is Always Right 10:48pm#
  • Digg CoolGoose dugg CNET: Android phones get Opera Mini 5 beta 10:34pm#

Tags in Tags

boris akunin carti css demon design devils digg erast fandorin gand general gnome iubire joey goebel kde linux love melancolie open source party php plugins poem power user problem protest quest random random thoughts regex regina noptii remorse renastere site tristete ubuntu windows
more tags

Search

Community

belletristisch.com - Online Literature
OS Revolution - Living in a matrix
At-byte.com - Stay Sharp
Linux PHP IDE

Who's online

There are currently 0 users and 2 guests online.

Syndicate

Syndicate content
Copyright alexandrubucur.com

Drupal port by 3rdWorld : Created by Design Disease