Installing SMF Using the Sites 'Current' USer Info

Started by ajt2326, December 11, 2015, 06:47:34 AM

Previous topic - Next topic

ajt2326

Morning All,

Looking for a bit of advice more than anything.

I am looking for a forum solution for a website i have but as my site already has 'Users' which have signed up, I am keen to not have to have people signing up for the forum in addition to the current site.

Are there solutions out there for SMF to be installed using the current user details I have?

ANy advice would be appreciated.


Illori

what is your site running? some more details might help otherwise we can guess all day at what you have setup.

margarett

It highly depends. There are really few functional bridges nowadays even for major CMSs so, if your site is custom built, changes of you having an already establish bridge are... close to none :(

What we usually recommend is to go the other way around. Use SMF's testes and hardened user management it provides and then integrate SSI in your code and you'll have all the user details available. But I understand that, at this point this is not really an option for you (if your site is already established).

So the question is: is your site custom coded or is it a standard CMS/portal/etc?

edit: ninja'd :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

ajt2326

Quote from: Illori on December 11, 2015, 07:21:10 AM
what is your site running? some more details might help otherwise we can guess all day at what you have setup.

Just a simple MySql Database.

Quote from: margarett on December 11, 2015, 07:27:05 AM
It highly depends. There are really few functional bridges nowadays even for major CMSs so, if your site is custom built, changes of you having an already establish bridge are... close to none :(

What we usually recommend is to go the other way around. Use SMF's testes and hardened user management it provides and then integrate SSI in your code and you'll have all the user details available. But I understand that, at this point this is not really an option for you (if your site is already established).

So the question is: is your site custom coded or is it a standard CMS/portal/etc?

edit: ninja'd :P

The site is custom coded with no CMS or Portal Software installed. If I am entirely honest with you, It would not be too late to take on your advice installing the forum and then going from there BUT there my knowledge of SSI is non existent basic to be honest. Is it pretty straight forward? Is there a resource here for this?

margarett

http://wiki.simplemachines.org/smf/Category:Integrating_SMF

There are several integration options but, if your site and SSI live in the same server, SSI is the easiest to use.
Overall you just need to
<?php
require("/home/simple/public_html/forum/SSI.php"); 
?>

And immediately all SMF variables are available to you, especially (in your case) $context and $user_info. When you need users to login, either forward them to SMF or use the included ssi_login function which will show you a login box where you want it. After that, just pick whatever you need to your custom coding from SMF's globals ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

http://wiki.simplemachines.org/smf/Category:SSI
;D

Basically, you use
ssi_login() on your age to extend the SMF login and put the login box where ever you want

you can then also use the $context and $userinfo arrays to get user data and control access to things outside of SMF

How large is your current userlist?
if it's just a few users -- then ask them to register again.
If it's a significant number, then there is a chance that we can help you create an importer to drop your existing users into SMF's members table.
Сл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."

ajt2326

Quote from: margarett on December 11, 2015, 07:44:25 AM
http://wiki.simplemachines.org/smf/Category:Integrating_SMF

There are several integration options but, if your site and SSI live in the same server, SSI is the easiest to use.
Overall you just need to
<?php
require("/home/simple/public_html/forum/SSI.php"); 
?>

And immediately all SMF variables are available to you, especially (in your case) $context and $user_info. When you need users to login, either forward them to SMF or use the included ssi_login function which will show you a login box where you want it. After that, just pick whatever you need to your custom coding from SMF's globals ;)

Quote from: Kindred on December 11, 2015, 07:46:56 AM
http://wiki.simplemachines.org/smf/Category:SSI
;D

Basically, you use
ssi_login() on your age to extend the SMF login and put the login box where ever you want

you can then also use the $context and $userinfo arrays to get user data and control access to things outside of SMF

How large is your current userlist?
if it's just a few users -- then ask them to register again.
If it's a significant number, then there is a chance that we can help you create an importer to drop your existing users into SMF's members table.

There are users but I can just ask them to register again. The only reason I was a bit Cautious about this is because I am pretty new to the world of PHP and MySql etc and I was being cautious about adding more features but with the excellent answers I have been given so far, I think I will try and give it a go.

Just to ask one more 'Quick' question, on the subject. I have specific information I need to have Users Profiles show, Now in my experience of moderating an SMF a few years ago, There are only a limited amount of fields the smf Offers, Am I able to add more myself? or would there be a better way of showing this additional Profile information? (Perhaps from another table)?

margarett

SMF offers Custom Profile Fields which you can configure at will
http://wiki.simplemachines.org/smf/SMF2.0:Features_and_Options#Profile_Fields

Some time ago I explained how to get to them in the tables. It should give you an idea
http://www.simplemachines.org/community/index.php?topic=518203.msg3666696#msg3666696
(but if you only need those fields inside SMF, then you don't need any of this)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

ajt2326

Quote from: margarett on December 11, 2015, 09:22:07 AM
SMF offers Custom Profile Fields which you can configure at will
http://wiki.simplemachines.org/smf/SMF2.0:Features_and_Options#Profile_Fields

Some time ago I explained how to get to them in the tables. It should give you an idea
http://www.simplemachines.org/community/index.php?topic=518203.msg3666696#msg3666696
(but if you only need those fields inside SMF, then you don't need any of this)

Wow, Some great resources, I guess SMF has come a long way since my days of first using it years ago.

Just to clarify, Am I right in saying that users register to the site through SMF (where the details will be stored in the tables) and then when I include the SSI into the Non SMF part of the site, I can pull all the info from the tables in SMF, including the cutom fields I choose to add?

margarett

Yup. That :)

SSI offers no "ready to use" registration method out of SMF, so you need to use it inside.

Alternatively, you can still use SSI (which will make SMF's "environment" available to your custom code) and code your own registration function/template, as long as you fill all the necessary registration parameters and call Subs-Members.php --> registerMember. In this case, you have to deal with, eg, error management and user input sanitation
(for an example, check how $regOptions is built in Register.php ;) )

You can make the integration as straightforward (or complex :P ) as you want to ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

ajt2326

Quote from: margarett on December 11, 2015, 10:40:25 AM
Yup. That :)

SSI offers no "ready to use" registration method out of SMF, so you need to use it inside.

Alternatively, you can still use SSI (which will make SMF's "environment" available to your custom code) and code your own registration function/template, as long as you fill all the necessary registration parameters and call Subs-Members.php --> registerMember. In this case, you have to deal with, eg, error management and user input sanitation
(for an example, check how $regOptions is built in Register.php ;) )

You can make the integration as straightforward (or complex :P ) as you want to ;)

I'm a guy, SO obviously more complex is the way it needs to be done.  8)  ;D

Seriously though, Easier is definitely better so I will try and keep it that way.

Thanks for all your help with this.

Advertisement: