The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Problem execute PHP script plug-in ahead of other Vbulletin php code. PLEASE HELP.
Hi everyone,
Upon a customer request, I've created a new plug-in (php script) which based on an ip address, URL forwards people to a different pages of his forum. (btw. just so you know, upon his instructions, I am unable to use .htaccess mod redirect) Anyhow, I've referenced this plug-in on a first line of header template and my php script works and does properly redirect visitors, but I experience a very strange behaviour. Even that my plug-in is a global variable and referenced on a first line of header template, it doesn't execute in a proper sequence, forum always loads first (and completely) and only afterwards person experiences a redirect. So, how do I execute a php script ahead of any other vbulletin php code? Please let me know and thanks for your help. Joe |
#2
|
||||
|
||||
Use init_startup, and kill the script after you set your redirect header.
|
#3
|
|||
|
|||
Could you please contemplate a little more on this.
I am not sure I follow. Thanks a lot for your time. Any more help you could provide, I really appreciate it. |
#4
|
||||
|
||||
Do you know how to use the PHP header() function?
|
#5
|
|||
|
|||
This is still the same problem I mentioned before in another thread.
I need to execute php ahead of any other vbulletin php. How could header() help me? |
#6
|
||||
|
||||
Create a plugin at init_startup. You use header() to set a redirect header. Then call exit(), and there you go.
|
#7
|
|||
|
|||
I use hmtl redirect to a different URL using the Meta Refresh Tag.
Does it make any difference to use header? |
#8
|
||||
|
||||
Using header(), you do not need any page output, which fixes your issue.
|
#9
|
|||
|
|||
Quote:
PHP header() can redirect the browser somewhere else before any html is loaded, this way you'll notice an instant redirect as dismounted said. |
#10
|
|||
|
|||
Great, just tested it and it works like a charm.
Thank you guys, I really appreciate all your help. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|