Advertisement:

Author Topic: Server Side Includes - .php SMF 2.0.15  (Read 889 times)

Offline avwebsites

  • Semi-Newbie
  • *
  • Posts: 32
Server Side Includes - .php SMF 2.0.15
« on: February 15, 2019, 06:54:46 PM »
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!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,003
    • StoryBB/StoryBB on GitHub
Re: Server Side Includes - .php SMF 2.0.15
« Reply #1 on: February 15, 2019, 06:59:13 PM »
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)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline avwebsites

  • Semi-Newbie
  • *
  • Posts: 32
Re: Server Side Includes - .php SMF 2.0.15
« Reply #2 on: February 15, 2019, 07:33:18 PM »
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!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,003
    • StoryBB/StoryBB on GitHub
Re: Server Side Includes - .php SMF 2.0.15
« Reply #3 on: February 15, 2019, 07:36:33 PM »
ssi_recentTopics only does recent topics of one or more boards, it doesn't transplant an individual topic's replies...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline avwebsites

  • Semi-Newbie
  • *
  • Posts: 32
Re: Server Side Includes - .php SMF 2.0.15
« Reply #4 on: February 15, 2019, 08:55:28 PM »
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.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,256
  • Gender: Male
    • Kindred-999 on GitHub
Re: Server Side Includes - .php SMF 2.0.15
« Reply #5 on: February 15, 2019, 11:12:16 PM »
You don’t need the variable names

(8, null, 2, ‘echo’)

Will pull from board 2...    do you have a board 12?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,003
    • StoryBB/StoryBB on GitHub
Re: Server Side Includes - .php SMF 2.0.15
« Reply #6 on: February 16, 2019, 03:05:47 AM »
Moreover, the variable names explicitly do something different (they make new variables with those names!)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline avwebsites

  • Semi-Newbie
  • *
  • Posts: 32
Re: Server Side Includes - .php SMF 2.0.15
« Reply #7 on: February 16, 2019, 10:32:17 AM »
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,003
    • StoryBB/StoryBB on GitHub
Re: Server Side Includes - .php SMF 2.0.15
« Reply #8 on: February 16, 2019, 11:12:10 AM »
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 ;)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline avwebsites

  • Semi-Newbie
  • *
  • Posts: 32
Re: Server Side Includes - .php SMF 2.0.15
« Reply #9 on: February 16, 2019, 11:30:11 AM »
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! :)

Offline avwebsites

  • Semi-Newbie
  • *
  • Posts: 32
Re: Server Side Includes - .php SMF 2.0.15
« Reply #10 on: February 16, 2019, 11:34:11 AM »
...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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,003
    • StoryBB/StoryBB on GitHub
Re: Server Side Includes - .php SMF 2.0.15
« Reply #11 on: February 16, 2019, 05:26:38 PM »
Recommended PHP version for SMF, probably 7.0 unless you have mods that don’t work in that version.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,256
  • Gender: Male
    • Kindred-999 on GitHub
Re: Server Side Includes - .php SMF 2.0.15
« Reply #12 on: February 16, 2019, 05:36:53 PM »
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline avwebsites

  • Semi-Newbie
  • *
  • Posts: 32
Re: Server Side Includes - .php SMF 2.0.15
« Reply #13 on: February 16, 2019, 06:19:46 PM »
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!