The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
GeoIP condition
I have GeoIP installed on my website (not in vbulletin) and want to use a condition based on country
I have put this code in forums/index.php PHP Code:
PHP Code:
Any ideas how I can get this to work? |
#2
|
|||
|
|||
Try adding this to your code in index.php:
Code:
vB_Template::preRegister('FORUMDISPLAY', array('mygig' => $mygig, 'mycountry' => $mycountry)); |
#3
|
|||
|
|||
Still no go, when I try to add the condition in the template I get
Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3416 |
#4
|
|||
|
|||
Which version of vb are you running?
|
#5
|
|||
|
|||
4.1.2 Patch Level 3
I also got a server error with your code |
#6
|
|||
|
|||
I tried it and there doesn't seem to be any errors in it, but it does need to be somewhere after global.php is included.
ETA: There is something else you could try instead of adding my code: Code:
<vb:if condition="!in_array($GLOBALS['mygig'],$GLOBALS['mycountry'], true)"> |
#7
|
|||
|
|||
Moving your first code down the page removed the server error but still not liking my condition
With that removed and using your condition I get Could not find phrase ' The following template conditional expression contains function calls: GLOBALS('mygig') GLOBALS('mygig') |
#8
|
|||
|
|||
Oops - that's because I was being stupid. It should be $GLOBALS[] - I fixed the above code.
|
#9
|
|||
|
|||
That clears the function calls but gives my original error
Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3416 |
#10
|
|||
|
|||
Hmm...and that error goes away when you remove the condtion?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|