News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Anyway To Display Latest Posts Out Of The Forum?

Started by _.EvilExecutor._, July 13, 2020, 05:36:42 AM

Previous topic - Next topic

_.EvilExecutor._

Hello SMF Community,

I started building a User Control Panel to a game server using PHP, HTML and stuff. The Forum of the game server is made with SMF. Now I want to display the last posts (about 5) of the forum in a certain page of the user control panel. And the Forum I'm talking about is Hidden For Guests.

Because of that I was unable to use SSI to get the relevant information. I mean SSI works fine only for people who logged into the forum but not for guests who are logged into the User Control Panel. So I wanna know if there is anyway I can display the Last Posts of the forum out of it (In The User Control Panel) while the forum is hidden for guests.

Thanks.
_.EE._

Arantor

Use the $ssi_guest_access variable, I forgot exactly how but if you search for that you should find hoe to set it up to do guest access for SSI just where configured.
Holder of controversial views, all of which my own.


_.EvilExecutor._

I've done it already. All the other SSI (Who's online, top poster, newest memeber.) stuff are working. But yet if I try to display something related to Boards, Topics, Posts it doesn't show up anything.


Arantor

You already have ssi_guest_access set? Then the issue is that the forum content is not visible to guests. You will have to change that for it to work (but the "guests browsing the site" still restricts and requires login for things generally)
Holder of controversial views, all of which my own.


_.EvilExecutor._

Quote from: Arantor on July 13, 2020, 12:05:10 PM
You already have ssi_guest_access set? Then the issue is that the forum content is not visible to guests. You will have to change that for it to work (but the "guests browsing the site" still restricts and requires login for things generally)

Means I have to open the forum for guests if I want to show the recent posts/topics in an external site using SSI? Or is there any other alternative way I can take?

Arantor

No, that is not what I said.

The forum is locked down at the site level AND board level. If you add guests to boards, SSI will work but since the site as a whole is locked down, that still happens first.

Assuming you have $ssi_guest_access set correctly.
Holder of controversial views, all of which my own.


_.EvilExecutor._

I don't think I got you. Can you please explain me again.

Quote from: Arantor on July 13, 2020, 12:57:12 PM
The forum is locked down at the site level AND board level.

Well yeah I disabled "Allow guests to browse the forum" also from boards I restricted the guests viewing them.
Quote from: Arantor on July 13, 2020, 12:57:12 PM
Assuming you have $ssi_guest_access set correctly.

Yep that's set without problem and that's the reason I can display all the other SSI functions except things related boards, topics, posts.

Arantor

-sigh- No, that's explicitly NOT what I told you to do.

"Allow guests to browse the forum" is the thing that makes the *entire* site need a login. You want to leave that enabled, and just add guests to each board.
Holder of controversial views, all of which my own.


_.EvilExecutor._

Quote from: Arantor on July 13, 2020, 02:20:01 PM
-sigh- No, that's explicitly NOT what I told you to do.

LOL. I didn't do that. It was done by me when I setup the forum for the first time. Just told you to make the situation clear but nvm.

And Arantor,  Thanks alot I've done it finally.

For others who are interested what I did is, setting up $ssi_guest_access, and then closing the forum to guests by disabling "Allow guests to browse the forum", then allowing the permission for the guests to view the boards.

This allows to display the recent stats while maintaining the forum privacy because the "Allow guests to browse the forum" is disabled still the guests are redirected to the login page if they try to access boards.

Advertisement: