Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 04-04-2005, 10:35 PM
Claygp's Avatar
Claygp Claygp is offline
 
Join Date: Mar 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 04-07-2005, 12:16 AM
Claygp's Avatar
Claygp Claygp is offline
 
Join Date: Mar 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
Reply With Quote
  #3  
Old 04-07-2005, 12:19 AM
BamaStangGuy's Avatar
BamaStangGuy BamaStangGuy is offline
 
Join Date: Mar 2004
Location: Alabama
Posts: 521
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you tried a left join in showthread.php where it handles grabbing the information for the postbit?
Reply With Quote
  #4  
Old 04-08-2005, 09:41 PM
Claygp's Avatar
Claygp Claygp is offline
 
Join Date: Mar 2005
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 04-08-2005, 09:44 PM
tnguy3n's Avatar
tnguy3n tnguy3n is offline
 
Join Date: May 2003
Location: U of I, Iowa
Posts: 846
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can put the codes in includes/showthread.php, and call those vars in postbit(_lagacy) template.
Reply With Quote
  #6  
Old 04-11-2005, 06:46 AM
fabz fabz is offline
 
Join Date: Feb 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello,
I need this only to include a webservice when viewing a user profile.
Where can I include PHP script and use it ?
Regards
Reply With Quote
  #7  
Old 11-12-2005, 07:51 PM
mayhemmike mayhemmike is offline
 
Join Date: Feb 2005
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 11-13-2005, 05:52 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is no way to execute PHP in a template. You should place it in a plugin.
Reply With Quote
  #9  
Old 11-13-2005, 06:05 AM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:36 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04202 seconds
  • Memory Usage 2,231KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete