Simple Machines Community Forum

General Community => Scripting Help => Topic started by: jdispensa on October 16, 2006, 02:21:42 PM

Title: Using SMF code to help external site
Post by: jdispensa on October 16, 2006, 02:21:42 PM
I want to use the code inside SMF to help with the whole rest of the site.
Basicaly I want to use the ability to show the number of online viewers and increment the count... from outside of the forum.
I have included the ssi.php in the php page and the code <?php ssi_logOnline(); ?>
Title: Re: Using SMF code to help external site
Post by: Kindred on October 16, 2006, 03:14:07 PM
yes?    You have the way to do it...  use the various SSI functions...

Quote from: jdispensa on October 16, 2006, 02:21:42 PM
I want to use the code inside SMF to help with the whole rest of the site.
Basicaly I want to use the ability to show the number of online viewers and increment the count... from outside of the forum.
I have included the ssi.php in the php page and the code <?php ssi_logOnline(); ?>


Doing that should show the online users...
Title: Re: Using SMF code to help external site
Post by: jdispensa on October 16, 2006, 03:26:33 PM
Thanks for the quick response. The count only seems to show forum hits not the general website. I would like to see the pages they are on inside the admin page of the forum.
such as - Forum
  Who's Online
User   Time    Action

admin (83.147.xxx.xxx)   08:15:44 PM   Viewing Who's Online.
Guest (66.249.66.47)   07:58:41 PM   Viewing the board index of Forum.
Guest (66.249.65.142)   07:43:05 PM   Viewing the board index of Forum.
Guest (192.168.1.239)   07:21:19 PM   Viewing the board index of Forum.
Pages: [1]
But from external pages of the site itself.
To do this properly I would need to declare to the SMF a name of the page they are on, and to increment it.
I am using 1.1 rc3 at the moment.
I do see the hits but only for the forum. IE if I put the code on our main index.php the online hits do not change for the smf.
www.gracefellowship.ie is the site, www.gracefellowship.ie/grace/index.php is the main index page.
Any help would be greatly appreciated and just to let you know we would purchase this when we get it working 100% I have tried many many others and this is by far one of the best I have seen. I am also just tired of trying to get online users to show properly and my own code attempts were too buggy. So again.. thanks in advance for help!
Title: Re: Using SMF code to help external site
Post by: Kindred on October 16, 2006, 05:17:28 PM
1- yes. The SMF who's online only shows people who are logged in to SMF.  That's the nature of it...   It can't track sites/pages outside of SMF.

2- Showing the actual LOCATION of someone is slightly more difficult, but you can probably steal some code from the who.template.php


however, this will still not track people's connections to any page on the site that is NOT part of SMF...