Jump to content


This topic is now archived and is closed to further replies.


vertical calendar listings

Recommended Posts


I've been looking for a simplistic vertical calendar display. Don't mind paying for it.


I don't like the square calendar layouts where you have to click on a date to see what is listed in it or the ones that squash a lot of info into one square.


I'd like to find a vertical calendar listing (php/mysql) that sorts by month and then just does a simple listing of events. Skipping empty dates.


Hopefully it will only list the months/events for today to future and skip the ones that have already passed.



Any help in finding one would be greatly appreciated!!

Share this post

Link to post
Share on other sites

Here's the one I use. You can format the output as you see fit. And it only shows events that haven't passed. Database table construction should be evident from the code below (I hope).



echo "<h1>Events Calendar</h1>";

// show what's new as a separate page - all data
$nodat = "<p>The \"<em>events</em>\" database is currently empty.</p>";
$dbtable = "happening";
$today = date("Y-m-d");

mysql_connect($dbhost, $dblogin, $dbpass) or die ("Error: Unable to connect to the database."); 
mysql_select_db($dbname) or die ("Error: Unable to open the database."); 
$query = "SELECT * FROM $dbtable where ev_dat>'$today' order by ev_dat"; 
$result = mysql_query ($query);
$recs = mysql_num_rows($result); // any information in database?
if(!$recs) {
   echo $nodat;
else {
   while ($myrow = mysql_fetch_array($result)) // loop through all results
       echo "<h2>";
 $new_dt = strtotime($myrow['ev_dat']);
 echo date("l, F j, Y" , $new_dt);
 echo "</h2><p>";
       echo "Event: ". $myrow['ev_title']. "<br />Location: ". $myrow['ev_locn'];
 if ($myrow['ev_desc']!="") {
     echo "<br />Details: ". nl2br($myrow['ev_desc']);
 echo "</p><br />";


Database table:

CREATE TABLE happening (

  id smallint(4) NOT NULL auto_increment,

  ev_dat date NOT NULL default '0000-00-00',

  ev_locn varchar(60) NOT NULL default '',

  ev_title text NOT NULL,

  ev_desc text,



Share this post

Link to post
Share on other sites

BTW, this is a script I use on more than one client site, and there's a user-proof editor for it that allows those site owners to list, add, delete, and edit events from a protected admin area. Then again, maybe that's not what you were looking for.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.