vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Query to Get the Latest Events from a Specific Calendar (https://vborg.vbsupport.ru/showthread.php?t=64921)

LancerForums 05-09-2004 07:08 PM

Query to Get the Latest Events from a Specific Calendar
 
Hi,

Does anyone know what the query would be to select a list of events from a particular calendar?

Thanks,

Mark

mcahill 05-18-2004 08:17 PM

Not pretty code, not optimized code. But it does pull events from only the public folder for use on my homepage. No warranty expressed or implied...use at own risk...your mileage may vary.


PHP Code:

<?
            
            
            $fudgedate = strtotime("yesterday");
              //$eventdate = mktime($yesterday);
            
            

              $events = mysql_query("SELECT * FROM event where dateline_from = '$fudgedate' or dateline_from > '$fudgedate' and recurring !=3 and calendarid = 1 order by dateline_from asc limit 8") or die("oops3");
            
            $eventrow = mysql_fetch_array($events);
                    
            while ( $rowevents = mysql_fetch_array($events) ) { 
            
                    
            echo "<a href='http://sitename.com/forum/calendar.php?do=getinfo&e=" . $rowevents['eventid'] ."'>";
            echo $rowevents['title'];
            echo "</a> ";
            if ($rowevents['recurring'] == 0 and $rowevents['dateline_to'] == 0) {
            $fixdate = ($rowevents['dateline_from'] + 86400);
            } 
            else {
            $fixdate = $rowevents['dateline_from'] ;
            }
            echo date("D M j",$fixdate);
            echo "<br>";
            
                
    }

        
          ?>

It has a bit of trouble with some of the ranged date events, but it's good enough for what I use it for. If you improve it, post it back up here...

Cheers,

Mark


All times are GMT. The time now is 08:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01030 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete