vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   PHP include within postbit (https://vborg.vbsupport.ru/showthread.php?t=79363)

Claygp 04-04-2005 10:35 PM

PHP include within postbit
 
I know that I can't include php in the templates (other than header and footer).

I need to include additional information for each user with each post.

Example: When a user posts, I need it to say:

Posts: 1245 (normal)
Comments: 346 (new custom)
Classified Ads: 2 (new custom)

These values are calculated for each user. (I already have the php code for this)

I'm currently moving from phpbb to vB .. and I have always had this working with phpBB .. now I need to make it work for vB.

So .. I tried editting the postbit template to spit out a custom variable .. and then I tried setting this variable in the showthread.php file .. but I am not having any luck.

Can anyone help me out here? .. or point me in the right direction?

I know php really well .. I'm just not sure where the best place is to put the code and make it work in the vB template system. This is my first time messing around in vB.

Thanks in advance!

I just read the announcement in this forum. Sorry ... I guess I posted in the wrong place.

Can someone please move this to General vBulletin questions for me?

Claygp 04-07-2005 12:16 AM

Anyone?

BamaStangGuy 04-07-2005 12:19 AM

Have you tried a left join in showthread.php where it handles grabbing the information for the postbit?

Claygp 04-08-2005 09:41 PM

Quote:

Originally Posted by BrentWilson
Have you tried a left join in showthread.php where it handles grabbing the information for the postbit?

This isn't standard information from vB .. its custom tables from other features of my site. No big deal at all .. I have all the php code .. and SQL.

I just need to know where to put this code .. how to set a template variable in postbit .. and then display the value that I need to display.

I figured this would be a fairly common thing to do. Its so easy in phpbb .. I'm sure its pretty simple in vB too .. I just wanted to make sure I was doing it right, without hacking the vB code too much.

tnguy3n 04-08-2005 09:44 PM

you can put the codes in includes/showthread.php, and call those vars in postbit(_lagacy) template.

fabz 04-11-2005 06:46 AM

hello,
I need this only to include a webservice when viewing a user profile.
Where can I include PHP script and use it ?
Regards

mayhemmike 11-12-2005 07:51 PM

Has anyone figured out how to call a PHP fumction in the postbit template?

The php code is in teh php includes file and I was trying a call like:
phpadsraw1

Thanx,

Mike

Marco van Herwaarden 11-13-2005 05:52 AM

There is no way to execute PHP in a template. You should place it in a plugin.

JohnBee 11-13-2005 06:05 AM

You can call a php include function through a $variable in a template I beleive.


All times are GMT. The time now is 05:43 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.01071 seconds
  • Memory Usage 1,724KB
  • 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
  • (9)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