PHP in vBulletin

Discussion in 'PHP' started by browie, May 20, 2007.

  1. #1
    I'm trying to have certain ads show only to people that come from search engines. vBulletin is not helping out. Maybe it's my 3.5 version idk. Some want to help?

    After giving some one the raw php code he came up with this.
    <if condition="preg_match('/^http:\/\/(\w+\.)?(google|msn|yahoo|aol)\./',$_SERVER['HTTP_REFERER']) == 1"><!-- Google AdSense HTML --></if>
    Code (markup):
    I implemented it an for some reason vBulletin does not like preg_match i guess. Here's some of the error message.

    preg_match is not allowed.....

    The following functions are allowed in template conditional expressions:
    in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of()
     
    browie, May 20, 2007 IP
  2. DeViAnThans3

    DeViAnThans3 Peon

    Messages:
    785
    Likes Received:
    83
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well I guess we must find out a way to allow preg_match in template conditional expressions. As I don't have vBulletin, I don't know in which file or so you must search, but could you maybe check if there's somewhere a file called template.php or template.class.php or something similar. Probably it is in a directory called includes or inc or similar to that.
     
    DeViAnThans3, May 20, 2007 IP