Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2010, 07:28 AM
doob doob is offline
 
Join Date: Dec 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default do notices support php or plugins? Its not working...

I'm trying to use a php includes function OR a vbulletin plugin within a "notice" in the notice manager so I can write once and reuse a short code in multiple notices.

Something like this is NOT working:

<?php include("http://www.website.com/file.php"); ?>

Also tried this
<?php readfile('http://www.website.com/file.php'); ?>

Plugin code is not working either. I created something like this in the plugin manager:

ob_start();
include('../notices/notice.php');
$include_notice = ob_get_contents();
ob_end_clean();

And then placed this into the notice manager field but it did not work either:
$include_notice

Instead, that code just printed.

Is there some reason that notices don't support php or plugins or am I missing somthing?
Reply With Quote
  #2  
Old 10-15-2010, 01:48 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may only put html in the notices.
Reply With Quote
  #3  
Old 10-18-2010, 04:13 AM
doob doob is offline
 
Join Date: Dec 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Lynn. Can you or anyone else offer any explanation as to why?

It seems like every other template system in VB supports php... In fact the notice system itself is running based on php code, so who won't php code run within it?

Also you didn't answer about notices supporting plugins. I'm still learning the plugin system so is it my plugin code that's not working or does the notice system not support plugins either?

thanks all.
Reply With Quote
  #4  
Old 10-18-2010, 04:20 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why? Because they are just supposed to be easy notices to add to the top of the forum. If you want php, write a plugin and spit out the content of that in the navbar template (isn't there a template_hook right at the bottom?).

And you can't use php in other templates either, so I'm not sure what you mean that other templates support php.

You may put html in the notices not variables that are derived from plugins.
Reply With Quote
  #5  
Old 10-18-2010, 05:33 AM
doob doob is offline
 
Join Date: Dec 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynn, the suggestion, then, is to not use the notice mechanism if I want to use php, but instead to code whatever php I want to use into the navbar template itself?

If that's the suggestion, yes I suppose I could do that, but I'd prefer to find a way to utilize the very handy management tool that the notices represent.

Does anyone else have any helpful suggestions as to how I might use an includes function within the notices to include an external page (php, html or otherwise) rather than having to paste complete html code into the notice manager??

I.e. If I want the same complex code in 12 different forums it would be much nicer to reference a single external page where any changes or updates could be made rather than editing 12 different notices for each change...

-Thanks.
Reply With Quote
  #6  
Old 10-18-2010, 05:40 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since you can use HTML in a notice you can use am <IFRAME> and then put all the php code you need on the page displayed in the IFRAME.

Also you can't put php in any template anywhere, including the navbar... php only goes in plugins and .php files.
Reply With Quote
  #7  
Old 10-19-2010, 06:36 AM
doob doob is offline
 
Join Date: Dec 2009
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the IFRAME suggestion. I haven't tried using Iframe's for years and when I did had some problems with them, perhpas with older browsers. I guess its time to give them a try again!

Not sure what I was thinking w/ regards to php in templates. Just a mental lapse I guess.

Thanks again.
Reply With Quote
  #8  
Old 10-19-2010, 11:51 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IFRAMES are very common these days and used all over in places you wouldn't expect (facebook like buttons for example)- IE6 and newer, maybe even older than that have no problems with IFRAMES.
Reply With Quote
Reply


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 07:19 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.03845 seconds
  • Memory Usage 2,219KB
  • Queries Executed 11 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_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