vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to include PHP in a template via Plugins (https://vborg.vbsupport.ru/showthread.php?t=288141)

CoffeeLovesYou 09-23-2012 03:07 PM

Quote:

Originally Posted by kh99 (Post 2367860)
Hmm...the error looks like the code in table.php is trying to use the function compile_template() and isn't finding it, but I don't see why moving the code from table.php to the plugin would do that. It seems like you should be getting the same error if you include the file like you show in the first post. Also, I'm curious what the code is doing where it would need to call compile_template() - that seems a little strange for a plugin using global_start. That's really an adminCP function (unless it's trying to call a non-vbulletin function of the same name).

I will PM you my table.php
It is not calling compile_template() at all, I think it's the PHP script posted above several times lol

kh99 09-23-2012 03:18 PM

As I mentioned in the PM I just sent you, I think the problem is something I didn't think of - the table.php file has html at the very beginning and the very end, so instead of removing the <?php and ?>, you actually need to add ?> before the code and <?php after the code.

CoffeeLovesYou 09-23-2012 03:30 PM

Quote:

Originally Posted by kh99 (Post 2367915)
As I mentioned in the PM I just sent you, I think the problem is something I didn't think of - the table.php file has html at the very beginning and the very end, so instead of removing the <?php and ?>, you actually need to add ?> before the code and <?php after the code.

Oh wow, that did work!! Thank you so much :)


All times are GMT. The time now is 07:41 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.01266 seconds
  • Memory Usage 1,715KB
  • 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)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete