View Full Version : 4 Referer sites
CraiovaOnLine
17 Sep 2007, 10:52
I need to put somthing like
if ( strpos($_SERVER['HTTP_REFERER'], 'www.x.')
in my template
What sould this do? well it would show somthing new for the users that camed from that referer
can u help me translate that in vb template code?
Eikinskjaldi
17 Sep 2007, 13:20
I need to put somthing like
if ( strpos($_SERVER['HTTP_REFERER'], 'www.x.')
in my template
What sould this do? well it would show somthing new for the users that camed from that referer
can u help me translate that in vb template code?
You cannot put php in templates, they are just html with a bit of variable substitution.
Put the code in...well the code, basically. Use in if conditional to display differential data in the html
nico_swd
17 Sep 2007, 13:59
You can put PHP code in if conditions, like this.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
CraiovaOnLine
17 Sep 2007, 17:57
The following template conditional expression contains function calls:
<if condition="strpos($_SERVER['HTTP_REFERER'], 'www.x.') !== false">
Function Name Usage in Expression
strpos strpos($_SERVER[\'HTTP_REFERER\'], \'x.\')
With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.
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()
any other ideeas plzzz
WhaLberg
17 Sep 2007, 21:46
In where you want to use this code? Forumhome?
CraiovaOnLine
18 Sep 2007, 10:42
navbar
WhaLberg
18 Sep 2007, 20:10
Add a plugin to global_start template including these codes:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
In navbar use
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
By the way, I didn't test the php code but it should work. If you face any error, let me know.
CraiovaOnLine
18 Sep 2007, 21:42
works flawless
10x a lot.
Note 2 myself : When i get in turkey , gotta take u out for a beer .
You can put PHP code in if conditions, like this.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
You cannot use php functions that are not in the template safe functions list. I'm pretty sure strpos is not in the list.
WhaLberg
18 Sep 2007, 23:09
works flawless
10x a lot.
Note 2 myself : When i get in turkey , gotta take u out for a beer .
I'd love that.
Cheers! :)
Dismounted
19 Sep 2007, 06:49
You cannot use php functions that are not in the template safe functions list. I'm pretty sure strpos is not in the list.
Safe Functions List:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
vBulletin® v3.6.12, Copyright ©2000-2009, Jelsoft Enterprises Ltd.