vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Displaying HTML file in widget and Forum Block (https://vborg.vbsupport.ru/showthread.php?t=286651)

karlm 08-15-2012 01:19 AM

Displaying HTML file in widget and Forum Block
 
Currently I am updating a forum block & a widget as two separate instances even though both reflect identical information.

Both are made of plain HTML.

I would like it if could simply edit a *.htm file and have the widget and forum-block both update automatically according to the contents of the *.htm file.

Is this possible and if so, could you give me rough direction on how to achieve this?

karlm 08-20-2012 10:47 PM

Wow, who'd have thought a request like this was so complicated or out of people's abilities... I figured it would be a lot easier.

kh99 08-21-2012 11:37 AM

You might be able to make your block/widget an iframe that loads your htm file. Another way would be to use a php type widget/block and include an external file, like:

Code:

ob_start();
include('something.htm');
$output = ob_get_contents();
ob_end_clean();

// forum block needs a return, widget doesn't (but it might work anyway)
return $output;


Remember that widgets and forum block content is cached so when you change your htm file you won't see the changes until the cache expires (unless you set cache time to 0. But it's probably good to leave it set to at least 1 minute if possible).


All times are GMT. The time now is 02:31 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.00947 seconds
  • Memory Usage 1,708KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete