The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Use of PHP function to load extra css
Hi,
an Agency is programming an Smartphone App for our Webseite with the possibility to load the VB 5 Board in an Web Container. The app is sending an special header. In VB I want to hide some Elements with css, only when it's loading over the app. We get an PHP function that return true or false to do so over this header. Something like that: function detect_app() { ******* } But i can't use such PHP in VB Template? I guess i have to program it as hook? But don't know why. And how can I use the rerun of this PHP function in template over vb:if then? I'm really new with vbulletin and fond nothing about this for VB5 in the forum or Documentation. I have skills in PHP and CSS. But I really don't know how to start this. Thank you, Tobi |
#2
|
||||
|
||||
Thinking about it quickly, vb5 lets you call API methods from the templates. So, if you put your code into an api call, you could grab it from the templates.
The call would look like: {vb:data varName, apiClass, apiMethod, parameter1, parameter2} where varName is what you want to call in your template apiClass is the last part of the API class (if it's vB_Api_MyCustomAPI, apiClass would be MyCustomAPI) apiMethod is the class method you're calling There hasn't been much released to developers on vb5. |
Благодарность от: | ||
Lynne |
#3
|
|||
|
|||
Hi,
thank you for the quick answer. In wish file I have to place the PHP CODE? Have a nice day. |
#4
|
||||
|
||||
create a new file in core/vb/api called apheadcheck.php
within that file, add this code: PHP Code:
(warning...untested) |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|