Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: rsw686 on March 27, 2008, 07:00:32 PM

Title: SMF 2 SSI Calendar Functions
Post by: rsw686 on March 27, 2008, 07:00:32 PM
Both ssi_todaysEvents and ssi_todaysCalendar don't show the text for the upcoming event, just the red asterisk to edit the event. The event is shown on the forum index correctly.

There is no link key in the array in the functions in SSI.php. Replacing the below

' . $event['link'] . (!$event['is_last'] ? ', ' : '');

with

<a href="' . $event['href'] . '">' . $event['title'] . '</a> ' . (!$event['is_last'] ? ', ' : '');

lets the SSI function work correctly.
Title: Re: SMF 2 SSI Calendar Functions
Post by: SleePy on March 27, 2008, 10:41:46 PM
Thanks for the report. You can view it in our bug tracker: Bug #1848: [SSI] todaysEvents and todaysCalendar use non existant $event['link'] (http://dev.simplemachines.org/mantis/view.php?id=1848)
Title: Re: SMF 2 SSI Calendar Functions
Post by: SkyWarp on March 31, 2008, 08:46:55 PM
I had the same issue.  Is there a fix we can do?  I didn't find one on the bugtracker.
Title: Re: SMF 2 SSI Calendar Functions
Post by: rsw686 on March 31, 2008, 08:49:07 PM
Quote from: SkyWarp on March 31, 2008, 08:46:55 PM
I had the same issue.  Is there a fix we can do?  I didn't find one on the bugtracker.

Yes the fix is in the first post. Find that line in SSI.php and replace it. You should find and replace it twice.
Title: Re: SMF 2 SSI Calendar Functions
Post by: SleePy on March 31, 2008, 08:57:38 PM
The proper fix is to add it into the Subs-Calendar.php file in sources. I whipped up this diff file of the changes that where made. Please note it is a diff file and should be read as so and changes applied carefully.

Quote
Index: Subs-Calendar.php
===================================================================
+++ Subs-Calendar.php    (revision 7004)
--- Subs-Calendar.php    (revision 6981)
@@ -254,7 +254,6 @@
                     'allowed_groups' => explode(',', $row['member_groups']),
                     'id_board' => $row['id_board'],
                     'href' => $row['id_topic'] == 0 ? '' : $scripturl . '?topic=' . $row['id_topic'] . '.0',
+                    'link' => $row['id_topic'] == 0 ? $row['title'] : '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['title'] . '</a>',
                 );
         }
     }
Title: Re: SMF 2 SSI Calendar Functions
Post by: rsw686 on March 31, 2008, 09:00:51 PM
Thanks for the patch. Out of curiosity do charter members have access to the svn?
Title: Re: SMF 2 SSI Calendar Functions
Post by: SleePy on March 31, 2008, 09:31:48 PM
no...
Title: Re: SMF 2 SSI Calendar Functions
Post by: Eliana Tamerin on July 20, 2008, 10:27:23 AM
SleePy, maybe it'd be better to explain the changes in a more direct way. Not all of us here understand the diff structure, hell I can't even read that, I wouldn't know what to do.
Title: Re: SMF 2 SSI Calendar Functions
Post by: rsw686 on July 20, 2008, 11:25:42 AM
The goal behind diffs is to easily identify changes in code and be able to apply those changes with the patch program. Diffs can be made in multiple ways. The diff above is in unified format and the easiest to read. Others aren't so easy to read and are best just used with the patch program.

The unified diff shows a section of code and uses + and - marks to indicate lines that need to be removed or added.

Find this line in Subs-Calendar.php


                     'href' => $row['id_topic'] == 0 ? '' : $scripturl . '?topic=' . $row['id_topic'] . '.0',


Then the + means to add that line after.


                    'link' => $row['id_topic'] == 0 ? $row['title'] : '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['title'] . '</a>',