vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to use custom php in templates? (https://vborg.vbsupport.ru/showthread.php?t=320116)

Xarwin 09-05-2015 10:50 AM

How to use custom php in templates?
 
Okay,

I'm going to throw up this new thread because of this and I still have some other php scripts I want to use.

Could someone inform me how to use custom php in vBulletin templates?

Honestly, I've been searching a lot and I can't find a proper guide or explanation to it :(.

HM666 09-06-2015 07:54 AM

Er, your post does not really help us out much. Need to know what you are trying to do because there maybe a mod already created for what you are doing and you cannot just randomly stick PHP into the HTML templates without great difficulties.

cellarius 09-06-2015 08:30 PM

You can't use php in templates. Roughly said, templates contain HTML plus variables that vB fills in. PHP goes into plugins, which in turn can save their output into variables, which need to be properly registered and then can be accessed in templates.

Xarwin 09-13-2015 09:11 PM

Hi,

thanks for the replies.
I kind of got the idea how vBulletin works because of Scandal's work for me.

I generally wanted to know how it would work to pull something out of the database and for example how to call it as {vb:raw example} on a page.

HM666 09-13-2015 11:16 PM

I'm not 100% sure but you would probably need a plugin at least for that. You have to have code to tell the database what it is pulling out and what to do with it, you can do that with PHP code and a plugin would probably be your best bet.

ozzy47 09-13-2015 11:33 PM

You would also need to register the variable.

HM666 09-14-2015 12:53 AM

Quote:

Originally Posted by ozzy47 (Post 2555012)
You would also need to register the variable.

Yeah pretty much what I thought. Its more complicated than just calling one thing.


All times are GMT. The time now is 09:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01058 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete