Leesa Posted July 5, 2004 Share Posted July 5, 2004 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!! Quote Link to comment https://forums.phpfreaks.com/topic/1890-vertical-calendar-listings/ Share on other sites More sharing options...
AndyB Posted July 6, 2004 Share Posted July 6, 2004 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; Quote Link to comment https://forums.phpfreaks.com/topic/1890-vertical-calendar-listings/#findComment-6151 Share on other sites More sharing options...
AndyB Posted July 6, 2004 Share Posted July 6, 2004 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. Quote Link to comment https://forums.phpfreaks.com/topic/1890-vertical-calendar-listings/#findComment-6155 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.