Results 1 to 10 of 15

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Adding HTTP_SERVER to who's online

    So I can more easily identify the subdomain of the last url in Who's Online (using multisite - multiple subdomains on same ZC install) I'm trying to include HTTP_SERVER in Admin/whos_online.php to get the full url, I'm assuming that's the way to go.

    Changing, around line 413

    PHP Code:
    $lastURLlink '<a href="' zen_output_string_protected($whos_online->fields['last_page_url']) . '" target="_blank">' '<u>' zen_output_string_protected($whos_online->fields['last_page_url']) . '</u>' '</a>'
    to

    PHP Code:
    $lastURLlink '<a href="' HTTP_SERVER zen_output_string_protected($whos_online->fields['last_page_url']) . '" target="_blank">' '<u>' zen_output_string_protected($whos_online->fields['last_page_url']) . '</u>' '</a>'
    has no effect, any ideas on what I need to do?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Adding HTTP_SERVER to who's online

    Quote Originally Posted by simon1066 View Post
    So I can more easily identify the subdomain of the last url in Who's Online (using multisite - multiple subdomains on same ZC install) I'm trying to include HTTP_SERVER in Admin/whos_online.php to get the full url, I'm assuming that's the way to go.

    Changing, around line 413

    PHP Code:
    $lastURLlink '<a href="' zen_output_string_protected($whos_online->fields['last_page_url']) . '" target="_blank">' '<u>' zen_output_string_protected($whos_online->fields['last_page_url']) . '</u>' '</a>'
    to

    PHP Code:
    $lastURLlink '<a href="' HTTP_SERVER zen_output_string_protected($whos_online->fields['last_page_url']) . '" target="_blank">' '<u>' zen_output_string_protected($whos_online->fields['last_page_url']) . '</u>' '</a>'
    has no effect, any ideas on what I need to do?
    While notsure that returning HTTP_SERVER will identify the correct server for each of your runs, what you have inserted/changed is the link to which clicking on the path will go to. If you want to see the information more easily, you need to add information between the < u > and < /u > (spaces added so that would display on screen p as couldn't get it typed in with no spaces, some sort of autocorrect.)

    If you were to hover mouse over the link, ushould see additional information compared to before.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: Adding HTTP_SERVER to who's online

    Ah yes, I see you're right. What you've described works - thank you.

    Unfortunately, with some testing, I see that the HTTP_SERVER is taken from the mystore.com/admin/includes/configure.php (as I guess one would expect) rather than the mystore.com/includes/configure.php which is where my subdomains are referenced (allbeit indirectly)

    Not entirely sure there's a way around this

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Adding HTTP_SERVER to who's online

    Quote Originally Posted by simon1066 View Post
    Ah yes, I see you're right. What you've described works - thank you.

    Unfortunately, with some testing, I see that the HTTP_SERVER is taken from the mystore.com/admin/includes/configure.php (as I guess one would expect) rather than the mystore.com/includes/configure.php which is where my subdomains are referenced (allbeit indirectly)

    Not entirely sure there's a way around this
    So, as seems usual for me recently, I am not at a computer and review of the whose_online code isn't easy from this device, but... The fact that there is a fields[] variable with the last_url, uld think there is also a similar fields value for the server being accessed (which would be different than the server to which you are currently connected (which I believe is what happened with HTTP_SERVER above.) You need to refernece a variable that is specific to the server(s) in question.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: Adding HTTP_SERVER to who's online

    Yes, I see this is going to be tricky, I'll dig around a bit more and see what I can come up with.

    Thanks again

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Adding HTTP_SERVER to who's online

    Quote Originally Posted by simon1066 View Post
    Yes, I see this is going to be tricky, I'll dig around a bit more and see what I can come up with.

    Thanks again
    Instead of using ZenCarts' HTTP_SERVER CONSTANT, try using one of the Global variables.


    $_SERVER['HTTP_HOST']
    or
    $_SERVER['SERVER_NAME']

    Cheers
    RodG

 

 

Similar Threads

  1. Who's Online
    By SaMortensen in forum General Questions
    Replies: 8
    Last Post: 19 May 2008, 04:04 PM
  2. Who's Online
    By qisahn in forum General Questions
    Replies: 5
    Last Post: 25 Sep 2007, 03:47 PM
  3. Who's Online - User gone, but Admin says online
    By johnd in forum General Questions
    Replies: 2
    Last Post: 23 Sep 2007, 01:57 AM
  4. Who is online...side admin vs online group pricing mod
    By csfound in forum General Questions
    Replies: 8
    Last Post: 18 Jul 2007, 04:27 AM
  5. Who's Online
    By TecBrat in forum General Questions
    Replies: 1
    Last Post: 2 Jun 2006, 08:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg