Jump to content

Recommended Posts

Hi,

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!!

Link to comment
https://forums.phpfreaks.com/topic/1890-vertical-calendar-listings/
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).

 

<?
include("local_includes/top.php");

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>";
include("local_includes/db_conn.php");
$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 />";
   }
}

include("local_includes/bottom.php");
?>

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,

  PRIMARY KEY  (id)

) TYPE=MyISAM;

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.