Server Side Includes - .php SMF 2.0.15

Started by avwebsites, February 15, 2019, 06:54:46 PM

Previous topic - Next topic

avwebsites

Greetings, everyone:

I have been reading the SSI instructions here:

http://www.simplemachines.org/community/ssi_examples.php

I love how easy it is to integrate SMF.

The one thing I don't see is how to identify a single board.  I'm running a url mod that uses (I assume) a url rewrite for SEO friendly urls.

So I'm looking at this code here:

<?php ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo'); ?>

...and I'm wanting to specify ONLY one specific board to include.

1.  I'm not quite sure what the board identifier is

2.  I assume that I simply remove the exclusion code and use the $include_boards = "X".

If I'm right, then I simply need to know how to ID the board in question!

Thanks!

Arantor

Not quite.

If the board URL is index.php?board=1.0, the include board will be 1.

BUT, you have to include all the parameters up to that point, e.g.

ssi_recentTopics(8, null, 1);

(Please don't just have all the variables, it really doesn't do what people think it is does; you can't just change which thing PHP will care about just because you changed the name)

avwebsites

Hi Arantor:

Great, thanks for the tips!

The url rewrite mod has renamed (for example) a topic to:  /topic,12.0.html.  Based on your information, I can conclude that the topic identifier is simply '12'.  Simple enough!

Arantor

ssi_recentTopics only does recent topics of one or more boards, it doesn't transplant an individual topic's replies...

avwebsites

Ok, so:

<?php ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo'); ?>

...yielded the expected results of the last 8 topics.

<?php ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = 12, $output_method = 'echo'); ?>

This did not change the output at all.  Any changes I make to the variables above either have no effect, or crash the script.

Kindred

You don't need the variable names

(8, null, 2, 'echo')

Will pull from board 2...    do you have a board 12?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Moreover, the variable names explicitly do something different (they make new variables with those names!)

avwebsites

Yes, I tried the coding without the variable names first.  Then I simply copied and pasted the code from the SMF SSI examples page, because the code wasn't working.  I assumed that there was a problem with my syntax.  It's all usually user error. :)

....but no dice.

It's not critical that I embed the board, it just seemed like a good idea.

PHP version: 7.2.7

Arantor

SMF doesn't play nice on PHP 7.2.

Also, you say it doesn't work but you don't explain in what way it doesn't work, makes it hard to help ;)

avwebsites

What would be the recommended version of pHp?  This is good to know, as I should be able to change the pHp version.

I looked but I didn't see a system requirements page in the manual.

I haven't actually looked at the log for errors, I just noticed that there is no output at all.

Thanks! :)

avwebsites

...I found the server requirements page, but I didn't see a "recommended" pHp version... just a recommendation of a version greater than 5.5.

Arantor

Recommended PHP version for SMF, probably 7.0 unless you have mods that don't work in that version.

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

avwebsites

Hi -

Actually, it turns out I was trying to run an older pHp version.  As per your advice, I switched to version 7.0 and that solved the problem.

I'm actually surprised that this was the only problem I had run into!

I appreciate the help!

Advertisement: