How may I exclude.... (vbulletin question)

Discussion in 'PHP' started by mecho, Aug 21, 2008.

  1. #1
    Hi

    I'm wondering How may I exclude a ADS in showthread.php for visitors coming from a certain domain? I've heard you can do this with an <if condition ...> and $_SERVER. Can you please show me how to do this for example for www.x.com ?

    Thanks in advance.
     
    mecho, Aug 21, 2008 IP
  2. William[ws]

    William[ws] Peon

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    probably wanna do

    <if condition="$_SERVER['HTTP_REFERER'] != "www.x.com"">
    code
    </if>
    something like that
     
    William[ws], Aug 21, 2008 IP
  3. mecho

    mecho Active Member

    Messages:
    538
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    75
    #3
    Thanks but it doesn't work .

    the ads shows up for normal users and the referrers from that website .
    btw that code suppose to Show the ads to those guests or not showing it ?

    i want to not Showing ads to them .

    I dont know that it is different or not but my linkS in their website are like this : wvvw.x.com/something/something
    and that link would redirect to my website but my website is in a Iframe so still in browser u can see their website link (x.com/.....) .


    thanks in advance.


    p.s. x.com is not my website . its their website.
     
    mecho, Aug 27, 2008 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,981
    Likes Received:
    4,572
    Best Answers:
    124
    Trophy Points:
    665
    #4
    I'd create a plugin to detect the referrer and set a cookie if they've come from there or else the check will only work on the first page at your site that they visit.

    Then check for the cookie and set a variable and use that in the <if condition="">
     
    sarahk, Aug 27, 2008 IP
  5. mecho

    mecho Active Member

    Messages:
    538
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    75
    #5
    Sounds great ...

    can't wait to try it out.
     
    mecho, Aug 28, 2008 IP
  6. brassdragon

    brassdragon Guest

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    use the <if ...> function
     
    brassdragon, Aug 28, 2008 IP
  7. mecho

    mecho Active Member

    Messages:
    538
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    75
    #7

    any Success ??

    :p
     
    mecho, Sep 4, 2008 IP
  8. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #8
    If your website is inside an iframe of another domain, then most of the times the cookie will not work. This is in IE settings. You should use sessions instead.
    regards :)
     
    JEET, Sep 4, 2008 IP
  9. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #9
    I would create a plugin that has the PHP code to check the refer and set a certain variable to true/false.

    I will then check for that condition on the template.

    Please note that $_SERVER['HTTP_REFERER'] can be many values depending on your system, so it will not always be www.x.com, it might be http://www.x.com, http://x.com or x.com.

    Peace,
     
    Barti1987, Sep 4, 2008 IP