Advertisement:

Author Topic: Trying to display SMF Welcome or Login on a Wordpress frontend  (Read 6274 times)

Offline RL

  • Newbie
  • *
  • Posts: 3
Hi guys

So this is the setup I have:
Wordpress site: site.com
SMF forum: site.com/forum

Just trying to get a "Hello <username>" to display on the Wordpress site's homepage with username being filled in from the SMF forum. Not looking to integrate logins or databases here, just want to display the text plainly.

Using SSI.php on a plain PHP file, eg: site.com/test.php I am able to get the welcome message correctly (if I am logged in on the forum, it shows the username, if not shows the login link) but when I put the same code to the Wordpress site it always shows me as a guest. I have tried everything available to no avail. What am I doing wrong.

Appreciate the help.

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,628
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #1 on: May 07, 2018, 06:12:47 AM »
What is the code you are using right now exactly? I know WP and SMF don't always like to play nice together, but I'd think what you are trying to do should be fairly easy to achieve.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline RL

  • Newbie
  • *
  • Posts: 3
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #2 on: May 07, 2018, 06:55:54 AM »
What is the code you are using right now exactly? I know WP and SMF don't always like to play nice together, but I'd think what you are trying to do should be fairly easy to achieve.

Thank you for the reply. Using the same code on both the Wordpress page and the PHP page test.php:

require("/var/www/html/site/forum/SSI.php");
ssi_welcome();

On the Wordpress page it only shows up as a guest regardless of being logged in on the SMF forum, on the test.php it shows up correctly.

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,284
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #3 on: May 07, 2018, 07:44:21 AM »
are you running the test.php file from the same location as the wordpress install?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,502
  • Gender: Male
    • Kindred-999 on GitHub
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #4 on: May 07, 2018, 10:35:32 AM »
you are going to have issues....   there are known collisions between SMF and wordpress variable names.


however, in SMF
turn ON subdomain independent cookies
turn OFF local cookies
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 GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #5 on: May 07, 2018, 05:31:14 PM »
But then he has to change the address of the forum, right? From site.com/forum to forum.site.com ???.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,284
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #6 on: May 07, 2018, 05:49:11 PM »
nope. it should work either way.

Offline GigaWatt

  • The Smiley Guy
  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,104
  • Gender: Male
    • Macedonian electronics forum
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #7 on: May 07, 2018, 05:58:29 PM »
Mhm, got it... it's a general setting for the script. It works regardless of what's the address of the forum, right?
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,284
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #8 on: May 08, 2018, 05:06:29 AM »
as long as it is on your domain.

Offline LopkSLap

  • Semi-Newbie
  • *
  • Posts: 11
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #9 on: August 14, 2019, 12:08:34 PM »
Hi, im sorry for late raply but i have same issue.

My forum : site.com/forum
Wordpress : site.com/portal

I have a test file in wordpress directory and work succesful, but when i try to same code in my header file doesnt work. Actually it's work, but same result everytime even if you are logged in ( Hi Guest, please login or register ) Can anyone help me ?

Test file is :
Code: [Select]
<?php require("/home/lhrg/public_html/forum/SSI.php"); ?>
<div><?php ssi_welcome(); ?></div>

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,284
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #10 on: August 14, 2019, 12:13:28 PM »
do you have subdomain independent cookies enabled or disabled? since it is not working switch that to the other and see if that fixes it.

Offline LopkSLap

  • Semi-Newbie
  • *
  • Posts: 11
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #11 on: August 14, 2019, 01:03:27 PM »
I dont use subdomain and Wordpress cache enable and smf cache enable

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,284
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #12 on: August 14, 2019, 01:05:58 PM »
it does not matter if you do or not, try it anyway, it can solve the issue.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,639
    • StoryBB/StoryBB on GitHub
Re: Trying to display SMF Welcome or Login on a Wordpress frontend
« Reply #13 on: August 14, 2019, 01:27:05 PM »
it does not matter if you do or not, try it anyway, it can solve the issue.

You will need to, without it SMF cookies will be bound to the forum folder exclusively and not available to the WP folder.
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.