View Single Post
  #1  
Old 04-05-2005, 06:44 AM
rb2k1 rb2k1 is offline
 
Join Date: Sep 2004
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Today's Events Question

Hey Everyone.. ive made a mod to the code that grabs an event from the calendar and posts it.. here is the code i took from the main board php page to add to my vbindex code.. it works now but i just want to know how to do 1 thing... basically now all i have to do is call $upcomingevents and it puts the title and link to the calendar event but it includes the date which i do not want added.. ive searched through the code quite a bit but i cant figure out where its picking up the date.

example:
what it does....
Blah In The Mix Live - 04-05-2005

what i want it to do
Blah In The Mix Live

All help is very appreciated!

PHP Code:
// ### TODAY'S EVENTS #################################################
if ($vboptions['showevents'])
{
    require_once(
'./includes/functions_calendar.php');

    
$future gmdate('n-j-Y' TIMENOW 43200 + (86400 * ($vboptions['showevents'] - 1)));
    
$eventstore unserialize($datastore['eventcache']);

    if (!
is_array($eventstore) OR $future != $eventstore['date'])
    {
        
// Need to update!
        
require_once('./includes/functions_databuild.php');
        
$eventstore build_events();
        
DEVDEBUG('Updated Events');
    }

    unset(
$eventstore['date']);
    
$events = array();
    
$eventcount 0;
    foreach (
$eventstore AS $eventid => $eventinfo)
    {
        
$offset iif (!$eventinfo['utc'], $bbuserinfo['tzoffset'], $bbuserinfo['timezoneoffset']);
        
$eventinfo['dateline_from_user'] = $eventinfo['dateline_from'] + $offset 3600;
        
$eventinfo['dateline_to_user'] = $eventinfo['dateline_to'] + $offset 3600;
        
$gettime TIMENOW $vboptions['hourdiff'];
        
$iterations 0;

        if (
$bbuserinfo['calendarpermissions']["$eventinfo[calendarid]"] & CANVIEWCALENDAR OR ($eventinfo['holidayid'] AND $vboptions['showholidays']))
        {
            if (
$eventinfo['userid'] == $bbuserinfo['userid'] OR $bbuserinfo['calendarpermissions']["$eventinfo[calendarid]"] & CANVIEWOTHERSEVENT OR ($eventinfo['holidayid'] AND $vboptions['showholidays']))
            {
                while (
$iterations $vboptions['showevents'])
                {
                    
$addcache false;

                    
$todaydate getdate($gettime);
                    if (
$eventinfo['holidayid'] AND $eventinfo['recurring'] == 6)
                    {
                        if (
$eventinfo['recuroption'] == "$todaydate[mon]|$todaydate[mday]")
                        {
                            
$addcache true;
                        }
                    }
                    else if (
cache_event_info($eventinfo$todaydate['mon'], $todaydate['mday'], $todaydate['year']))
                    {
                        
$addcache true;
                    }

                    if (
$addcache)
                    {
                        if (!
$vboptions['showeventtype'])
                        {
                            
$events["$eventinfo[eventid]"][] = $gettime;
                        }
                        else
                        {
                            
$events["$gettime"][] = $eventinfo['eventid'];
                        }
                        
$eventcount++;
                    }

                    
$iterations++;
                    
$gettime += 86400;
                }
            }
        }
    }

    if (!empty(
$events))
    {
        
ksort($eventsSORT_NUMERIC);
        foreach(
$events AS $index => $value)
        {
            
$pastevent 0;
            
$pastcount 0;
            unset(
$eventdates$comma$daysevents);
            if (!
$vboptions['showeventtype'])
            {    
// Group by Event // $index = $eventid
                
unset($day);
                foreach(
$value AS $key => $dateline)
                {
                    if ((
$dateline 86400) == $pastevent AND !$eventinfo['holidayid'])
                    {
                        
$pastevent $dateline;
                        
$pastcount++;
                        continue;
                    }
                    else
                    {
                        if (
$pastcount)
                        {
                            
$eventdates construct_phrase($vbphrase['event_x_to_y'], $eventdatesvbdate($vboptions['dateformat'], $pasteventfalsetruefalse));
                        }
                        
$pastcount 0;
                        
$pastevent $dateline;
                    }
                    if (!
$day)
                    {
                        
$day vbdate('Y-n-j'$datelinefalsefalsefalse);
                    }
                    
$eventdates .= $comma vbdate($vboptions['dateformat'], $datelinefalsetruefalse);
                    
$comma ', ';
                    
$eventinfo $eventstore["$index"];
                }
                if (
$pastcount)
                {
                    
$eventdates construct_phrase($vbphrase['event_x_to_y'], $eventdatesvbdate($vboptions['dateformat'], $pasteventfalsetruefalse));
                }

                if (
$eventinfo['holidayid'])
                {
                    
$callink "<a href=\"calendar.php?$session[sessionurl]do=getinfo&amp;day=$day\">" $vbphrase['holiday_title_' $eventinfo['varname']] . "</a>";
                }
                else
                {
                    
$callink "<a href=\"calendar.php?$session[sessionurl]do=getinfo&amp;day=$day&amp;e=$eventinfo[eventid]&amp;c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
                }
            }
            else
            {    
// Group by Date
                
$eventdate vbdate($vboptions['dateformat'], $indexfalsetruefalse);
                
$day vbdate('Y-n-j'$indexfalsefalse);
                foreach(
$value AS $key => $eventid)
                {
                    
$eventinfo $eventstore["$eventid"];
                    if (
$eventinfo['holidayid'])
                    {
                        
$daysevents .= $comma "<a href=\"calendar.php?$session[sessionurl]do=getinfo&amp;day=$day\">" $vbphrase['holiday_title_' $eventinfo['varname']] . "</a>";
                    }
                    else
                    {
                        
$daysevents .= $comma "<a href=\"calendar.php?$session[sessionurl]do=getinfo&amp;day=$day&amp;e=$eventinfo[eventid]&amp;c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
                    }
                    
$comma ', ';
                }
            }
            eval(
'$upcomingevents .= "' fetch_template('forumhome_event') . '";');
        }
        
// memory saving
        
unset($events$eventstore);
    }
    
$show['upcomingevents'] = iif ($upcomingeventstruefalse);
    
$show['todaysevents'] = iif ($vboptions['showevents'] == 1truefalse);
}
else
{
    
$show['upcomingevents'] = false;

Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01677 seconds
  • Memory Usage 1,907KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete