[EventCalendar] permalink instead of daylink in calendar

Julian Eckes ezcalator at gmx.de
Wed May 30 10:31:30 UTC 2007


hey!

i'm using worpdress 2.0.3, eventcalendar 3.1.0 and livecalendar  
1.9rc4-hoyhoy.
i have both an eventcalendar and an upcoming event section in my  
sidebar.
when i click on an event in the upcoming events section, a page with  
the event-post will be opened, for example http://www.bitsunbeach.de/ 
2007/05/24/mittwoch-30-mai-2007-reggae-mit-treva-massive-soundz/.  
(permalink for this post-id).
when i click on a day in the calendar where an event is postet, a  
wordpress page for this day is shown, for example http:// 
www.domain.com?m=20070530&cat=5 (day-link for this day).
in the permalink opened page everything is shown - header, text and  
images. the problem is: in the day-link opened page only header and  
text is shown. no images.
therefor i wanted to make some changes in the code, so that the  
calendar also uses permalinks to the right post-id (same as the  
upcoming events do).
i found out, that in line 440 in the template-functions.php (in  
the ../plugins/eventcalendar folder) the permalink for the upcoming  
section is created. i also found out, that in line 233 of the same  
file, the link for the calendar day is created. what i wanted to do  
now is to change the code in line 233, so that the link also consists  
of a permalink to a certain post-id. the get_permalink function needs  
one input argument (the post id). a tried with a fix id and it  
worked. but i don't know you to get a variable post-id so that the  
permalink isn't the same but the right for each day.
here is the code (.../plugins/eventcalendar3/template-functions.php):

from line 227 on:
if(array_key_exists($day_id,$calendar_days))
     {
       echo ' class="ec3_postday';
       if($calendar_days[$day_id]->is_event)
           echo ' ec3_eventday';
       echo '">';

       echo '<a href="' . $date->day_link() // -> creates the day- 
link in the calendar; '<a href=" . get permalink(116)' creates a link  
to the post with id = 116 for each day -> how to make the id variable???
          . '" title="' . $calendar_days[$day_id]->get_titles() . '"';
       if($calendar_days[$day_id]->is_event)
           echo ' class="eventday"';
       echo ">$date->day_num</a>";
     }
     else
     {
       echo '>' . $date->day_num;
     }

     echo '</td>';

from line 434 on:

       if($entry->allday)
           $data['TIME']=__('all day','ec3');
       else
           $data['TIME']=mysql2date($time_format,$entry->start);

       $data['TITLE'] =$entry->post_title;
       $data['LINK']  =get_permalink($entry->id); //creates the  
permalink for the event-post; i have tried to copy '. get_permalink 
($entry->id)' to the line where the link in the calendar is created,  
but the variable $entry seemes to be defined later in the code so  
that this doesn't work...
       $data['AUTHOR']=$entry->author;
       echo " <li>".ec3_format_str($template_event,$data)."</li>\n";
     }
     if($current_date)
         echo "</ul></li>\n";
     if($current_month)
         echo "</ul></li>\n";

does anybody know how to make a permalink to the right event-post in  
the calendar (just like in the upcoming events section)???
or maybe there is another way to get the images shown in the day-page???

hope you understood my problem.

thanks a lot!

julian*






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://penguin.firetree.net/pipermail/eventcalendar/attachments/20070530/952d5629/attachment.html


More information about the EventCalendar mailing list