Announcement

Collapse
No announcement yet.

Anyone know which hook to use for this?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Anyone know which hook to use for this?

    I want to fetch the referal url from the users browser.

    $_HTTP('POST_SERVER')

    or something like that.

    and put it into a $var
    and then use that var around my site... anyone know how that is possible?

    which hook should i get that information in?
    My site
    www.coolservice.dk

  • #2
    Add something like this to the beginning of your page (or your global_start hook):
    PHP Code:
    $referrer $_SERVER['HTTP_REFERER']; 
    Then, use the $referrer variable.
    Best Regards
    Colin Frei

    Please don't contact me per PM.

    Comment


    • #3
      oh of course...

      in order to use it in any templates, i need to put it into a global variable right? Could u tell me how? or where i can see which?
      My site
      www.coolservice.dk

      Comment


      • #4
        You don't need to use a global variable, if $referrer is set at the top of the page it'll be available throughout the script.
        Best Regards
        Colin Frei

        Please don't contact me per PM.

        Comment


        • #5
          but $referrer is set at the top of index.php

          and I want to use it in the whos online template... will that work??
          My site
          www.coolservice.dk

          Comment


          • #6
            Place it in the global_start hook, and it should work.
            Best Regards
            Colin Frei

            Please don't contact me per PM.

            Comment


            • #7
              I put $referrer = 'testing'; in the global_start hook

              then in my whosonline template i use $referrer
              but the variable is empty...

              did I forget something???
              My site
              www.coolservice.dk

              Comment


              • #8
                aww damn.. it's because im trying to use the $var in the whosonlinebit

                :s

                how would I get the referrer put into the user $var?
                My site
                www.coolservice.dk

                Comment


                • #9
                  I'm not sure what you mean... could you rephrase it?
                  Best Regards
                  Colin Frei

                  Please don't contact me per PM.

                  Comment


                  • #10
                    Originally posted by Colin F
                    I'm not sure what you mean... could you rephrase it?
                    My goal is to show the referal url for each user in the who is online page.

                    To do this i need the url for each user, and save it in the $userinfo[referalsomething] variable i think...

                    And then in the whosonlinebit-template, i can extract the referal url for each user again.

                    What we did above worked, but not for each user...

                    I hope you understand what i mean now
                    My site
                    www.coolservice.dk

                    Comment


                    • #11
                      Ah, ok.
                      That's a bit more complicated and requires modifying the code.
                      I recommend you search or ask for help at vBulletin.org
                      Best Regards
                      Colin Frei

                      Please don't contact me per PM.

                      Comment


                      • #12
                        I do something similar to this with Smart Announcements (click-to-disappear). While you may get away without modifying files, you definitely will need to run queries against the database, so as Colin said -> vb.org
                        HFT Online - Professional computer help ... with a personal touch

                        Comment

                        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                        Working...
                        X