Customizing SMF > SMF Coding Discussion

Menu Integration

(1/2) > >>

colby2152:
I have read quite a bit on this topic but struggle to get anything to display on pages inside (or even outside) the SMF directory.  My goal is to actually use pieces of the SMF menu for display in another part of my website.  These are the Messages and Login/Logout active links.

** BONUS ** I also need a way to create a custom link that appends the SMF user's email address to the link.  For example, say the SMF forum is at mysite.com/smf and I am having this custom menu displayed at mysite.com/customapp/, this particular link should be mysite.com/customapp/findgroup.php?email=example@gmail.com

Marcus Forsberg:
I take it you've read up on SSI? SSI Readme How do I integrate SMF into my PHP coded website? How to use the SMF user system outside of SMF

The function you're after is ssi_menubar(). By default, however, it displays the entire menu. If you only want parts of it you can either call the function with the $output_method parameter set to anything but "echo", which will tell it to simply return the $context['menu_buttons'] array, or you could of course just use that array directly without calling ssi_menubar(), just make sure you globalize $context.

With that array you have full control of what to display and how to display it. Have a look at your index.template.php to see how it does it.

As for the email, just use $user_info['email'], I think.

colby2152:

--- Quote from: Marcus Forsberg on April 30, 2012, 07:46:42 AM ---With that array you have full control of what to display and how to display it. Have a look at your index.template.php to see how it does it.

As for the email, just use $user_info['email'], I think.

--- End quote ---

Thank you.  The problem that I am attempting to solve is automatically logging in SMF users to another program on my site.  This program is email address driven, so I want to use the SMF email address.  Here is what the third party vendor said..

If you can pass as a cookie an email address, we can direct a user to his league or all his leagues, and if we know he logged in from your end, we can have him login on our end automatically.

Does this sound possible?  I am not much of a developer (more of an editor if you know what I mean), so any possible feedback here is appreciated.

colby2152:

--- Quote from: colby2152 on May 29, 2012, 09:02:39 PM ---
--- Quote from: Marcus Forsberg on April 30, 2012, 07:46:42 AM ---With that array you have full control of what to display and how to display it. Have a look at your index.template.php to see how it does it.

As for the email, just use $user_info['email'], I think.

--- End quote ---

Thank you.  The problem that I am attempting to solve is automatically logging in SMF users to another program on my site.  This program is email address driven, so I want to use the SMF email address.  Here is what the third party vendor said..

If you can pass as a cookie an email address, we can direct a user to his league or all his leagues, and if we know he logged in from your end, we can have him login on our end automatically.

Does this sound possible?  I am not much of a developer (more of an editor if you know what I mean), so any possible feedback here is appreciated.

--- End quote ---

 :P

Arantor:
Yes, because pushing the user's email address back and forth is *nice and secure*.

Theoretically possible, but really not recommended. It's not that hard to integrate with SMF at all, and it sounds like the developer is being closed minded and/or naive about doing so.

Navigation

[0] Message Index

[#] Next page

Go to full version