vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to Add PHP Code within vB Templates System? (https://vborg.vbsupport.ru/showthread.php?t=191028)

King Justice 09-16-2008 02:36 AM

How to Add PHP Code within vB Templates System?
 
Hello.

I would like to add a few lines of PHP code into my templates/styles in vB, within the admin panel.

How can I do this? :confused:

Lynne 09-16-2008 02:51 AM

You don't add php to the templates. You add php to a plugin which adds it to the page.

King Justice 09-16-2008 03:22 AM

Why can I not add PHP to a page template? For example, I want to add PHP code to in the ad templates..

So I can make a plugin with PHP code in it? Then how would I put the plugin in the template?

Lynne 09-16-2008 03:29 AM

Templates are for html, plugins are for php. However, if you really want to add php to a template, you may put it in a file and then include the external file in the template. See this - Including External Files

King Justice 09-16-2008 04:01 AM

Quote:

Originally Posted by Lynne (Post 1623128)
Templates are for html, plugins are for php. However, if you really want to add php to a template, you may put it in a file and then include the external file in the template. See this - Including External Files

Don't know what any of the content means.. I am no coder..
I just want to basically put PHP in a template..using different advertising system, please help..

soundboy 09-16-2008 04:03 AM

If im right, you can just go to Plugins > Create New Plugin and enetr your php code.. then enter a title like custom_fld (or whatever you want) and then go to your templates and enter $custom_fld or whatever you put in. And it should be there. BUT be careful, it can cause errors if you dont know what your doing!

King Justice 10-01-2008 02:00 AM

Quote:

Originally Posted by soundboy (Post 1623143)
If im right, you can just go to Plugins > Create New Plugin and enetr your php code.. then enter a title like custom_fld (or whatever you want) and then go to your templates and enter $custom_fld or whatever you put in. And it should be there. BUT be careful, it can cause errors if you dont know what your doing!

Sweet, easy enough! :)


All times are GMT. The time now is 05:00 PM.

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.01024 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)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