Advertisement:

Author Topic: SMF 2 SSI Calendar Functions  (Read 8044 times)

Offline rsw686

  • Sophist Member
  • *****
  • Posts: 1,008
    • The Reptile File
SMF 2 SSI Calendar Functions
« 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.
« Last Edit: March 29, 2008, 12:34:21 AM by SleePy »
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: SMF 2 SSI Calendar Functions
« Reply #1 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']
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline SkyWarp

  • Semi-Newbie
  • *
  • Posts: 77
  • Gender: Male
    • SkyWarp Productions
Re: SMF 2 SSI Calendar Functions
« Reply #2 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.

Offline rsw686

  • Sophist Member
  • *****
  • Posts: 1,008
    • The Reptile File
Re: SMF 2 SSI Calendar Functions
« Reply #3 on: March 31, 2008, 08:49:07 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

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: SMF 2 SSI Calendar Functions
« Reply #4 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>',
                 );
         }
     }
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline rsw686

  • Sophist Member
  • *****
  • Posts: 1,008
    • The Reptile File
Re: SMF 2 SSI Calendar Functions
« Reply #5 on: March 31, 2008, 09:00:51 PM »
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

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,341
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: SMF 2 SSI Calendar Functions
« Reply #6 on: March 31, 2008, 09:31:48 PM »
no...
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: SMF 2 SSI Calendar Functions
« Reply #7 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.
Do NOT PM me for support.

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

Offline rsw686

  • Sophist Member
  • *****
  • Posts: 1,008
    • The Reptile File
Re: SMF 2 SSI Calendar Functions
« Reply #8 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

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

Then the + means to add that line after.

Code: [Select]
                    '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