vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Php parsing in templates (https://vborg.vbsupport.ru/showthread.php?t=50525)

smokey 03-20-2003 05:50 PM

Php parsing in templates
 
Hello, i created my own little stars addon for my forums, a quite simple addon for when i do upgrades, i wont have to re-edit any of my vb files. The problem is not with the php or mysql, it is calling the php in the template. I added the variable '$stars' in the postbit template and it isent comming up. It worked on the earlier versions of vbulletin 2 but now that i try it now, it will not show up on my users posts. Basicly the problem im having is calling a php file in a template. I added the following line in my showthreads.php:

PHP Code:

include('stars.php'); 

I dont understand exacly how these templates are setup. Any suggestions? My current vb version is 2.2.9 and you may find it at http://www.c2kforums.net/vb/index.php

Thank you for your time.

Xenon 03-20-2003 05:57 PM

just the template phpinclude will be executed and there phpcode can be used, in no other templates!

smokey 03-21-2003 12:18 AM

I still get nothin, i want to put the stars right under the usertitle in the postbit template, i have the phpcoding in showthreads.php and i added $stars in postbit. Is there anyway i can accually get them to show up? i even tried adding replacements and doing the coding in the phpinclude template

filburt1 03-21-2003 12:54 AM

You virtually never can edit bit templates via phpinclude. You almost always have to hack.

smokey 03-21-2003 01:07 AM

this i know, i added my script in showthread.php and i cant figure out how to make the variable $stars come up. I never really had a problem with phpscripting but i cant quite figure this out

filburt1 03-21-2003 01:08 AM

Make sure $stars is in a global scope (the scope in which all templates are eval'ed AFAIK).

smokey 03-21-2003 01:12 AM

a global scope? like eval()? and should this be done in showthread.php and do you have an example so i can understand exacly what you mean?

smokey 03-22-2003 02:20 AM

heh, nevermind, guess i will have to figure it out my self...

smokey 03-25-2003 12:24 AM

last time im asking a simple question here, thanks for nothing

mr e 03-25-2003 12:37 AM

by global scope he means right above where the file does it's final dooutput('postbit') for example


All times are GMT. The time now is 11:05 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.01038 seconds
  • Memory Usage 1,728KB
  • 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_php_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
  • (10)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