Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Kootch on November 21, 2018, 09:18:36 PM

Title: SSI.php integration
Post by: Kootch on November 21, 2018, 09:18:36 PM
I'm using Wordpress.  I'm trying to add Recent Topics or Recent Posts to my sidebar widgets.

I added this to the top of header.php in wordpress. <?php require("SSI.php"); ?>

In the siderbar widgets, I have a few instances where I'm calling stuff via SSI.php from my forums.

I need to get the Recent Topics or Recent Topics formatted properly.  I'm using <?php ssi_recentTopics(); ?> in the widget for topics, as an example.

Please see the sidebar at https://www.TMLfans.ca (https://www.tmlfans.ca)

Thoughts?
Title: Re: SSI.php integration
Post by: vbgamer45 on November 21, 2018, 09:21:44 PM
You want to use the output method property
https://www.simplemachines.org/community/ssi_examples.php

Which you can set to return an array in php which you can then format how you wish.
Title: Re: SSI.php integration
Post by: Kootch on November 21, 2018, 09:37:35 PM
Unless I'm missing something (which is very possible), I was using that?!
Title: Re: SSI.php integration
Post by: vbgamer45 on November 21, 2018, 09:45:07 PM
You were using the defaults you would do something like this

$data = ssi_recentTopics(8,null,null, 'return');
print_r($data);




That shows the contents of the array which you can then format as needed.
Title: Re: SSI.php integration
Post by: Kootch on November 21, 2018, 09:52:43 PM
Ahhh, thanks.  I'll try to figure that out.  Cheers!
Title: Re: SSI.php integration
Post by: Kootch on November 21, 2018, 10:04:07 PM
Thanks vbgamer45.

It's odd that the first four widgets on the TMLfans.ca sidebar that are using SSI.php have output formatted perfectly.  And they're just using standard calls:
<?php ssi_boardStats(); ?>
<?php ssi_whosOnline(); ?>
<?php ssi_topTopicsReplies(); ?>
<?php ssi_topBoards(); ?>

Sorry, I thought I understood this better than I obviously do ;)
Title: Re: SSI.php integration
Post by: vbgamer45 on November 21, 2018, 10:18:35 PM
It does depend on theme and how it is display. Recent topics is normally very wide which is why it does not look good in your sidebar.
Title: Re: SSI.php integration
Post by: Kootch on November 21, 2018, 10:25:04 PM
Quote from: vbgamer45 on November 21, 2018, 10:18:35 PM
It does depend on theme and how it is display. Recent topics is normally very wide which is why it does not look good in your sidebar.

That makes sense.  It is really wide.