Announcement

Collapse
No announcement yet.

show certain code if firefox is detected?

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

  • show certain code if firefox is detected?

    How would I show a certain code if firefox is detected.

    say my code is this.

    $googleads if browser = firefox then

    Code:
    <a href=blah><img =blah>

    thanks!

  • #2
    Let me revise this. Lets say if the user does't have javascript enabled and is in usergroups 1 and 2 then it will redirect them to a page telling them to enable javascript and they can't use the forums.

    I found some code to help.

    Code:
    <script language="javascript" type="text/javascript">
    // crucial JavaScript goes here
    </script>
    <noscript>You do not have JavaScript enabled.</noscript>

    Comment


    • #3
      Try something from this site.
      http://www.jsmadeeasy.com/javascript...rect/index.htm

      Comment


      • #4
        It will show up on Who's Online if you select yes for Show User Agent.
        I don't know if this is quite what you're looking for, but here's an example
        of what's listed after the IP address, from one of our users- minus the IP#:

        Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

        Comment


        • #5
          vBulletin has build in detection for this, and template conditionals. Combining the two will make your templates quite dynamic, and no additional js has to be loaded.
          is_browser('x')';

          replace x with the browser in the <if condition> template conditional.

          Comment


          • #6
            thanks a lot, with

            <if condition="is_browser('firefox')">
            text
            </if>

            is working!
            MusicaDigitale.net - Italian Biggest Computer Music Board

            Comment

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