SMF 2 SSI Calendar Functions

Started by rsw686, March 27, 2008, 07:00:32 PM

Previous topic - Next topic

rsw686

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.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

SkyWarp

I had the same issue.  Is there a fix we can do?  I didn't find one on the bugtracker.

rsw686

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.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

SleePy

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>',
                 );
         }
     }
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

rsw686

Thanks for the patch. Out of curiosity do charter members have access to the svn?
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

SleePy

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Eliana Tamerin

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.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

rsw686

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>',
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Advertisement: