vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Use vBCms Widget everywhere (https://vborg.vbsupport.ru/showthread.php?t=245074)

john h 01-14-2011 09:51 PM

Watching this one with great interest!

ttuser 06-08-2011 04:23 AM

Hi,

The code looks like:

bootstrap_framework();
vBCms_View_Widget::registerTemplater(vB_View::OT_X HTML, new vB_Templater_vB());

$widgetID = 32; // the id of the widget

$widgettype = 'ExecPhp'; // type of the widget you want to output

$widget = vBCms_Widget::create('vBCms', $widgettype, $widgetID);
$output = $widget->getPageView()->render();

But it throws error for non object as:

Fatal error: Call to a member function getConfig() on a non-object in \packages\vbcms\widget\execphp.php on line 160

Can some body help me in this??

tintin74 08-11-2011 09:45 AM

same for me.

kh99 08-11-2011 11:54 AM

Looks like a bug to me, in packages/vbcms/widget/execphp.php. In function getPageView() the first line is

PHP Code:

        $config $this->widget->getConfig(); 


but the line that loads the widget doesn't get called until later:

PHP Code:

        $this->assertWidget(); 


so you could try moving the assertWidget() line to the beginning of that function, or in your code you could add a call to $widget->getConfigView() before the call to getPageView().

Bram H 09-03-2011 07:24 PM

Did somebody actually get this to work? I too am looking for the section widget to display on the forums

swatirajawat 11-24-2011 07:24 AM

I hv create the new plugin with below given Code with global start.
bootstrap_framework();

vBCms_View_Widget::registerTemplater(vB_View::OT_X HTML, new vB_Templater_vB());

$widgetID = 16; // the id of the widget

$widgettype = 'SectionNavExt'; // type of the widget you want to output

$widget = vBCms_Widget::create('vBCms', $widgettype, $widgetID);
$output = $widget->getPageView()->render();


But how to apply this on
all pages .
As i added {vb:raw widget} on the forum dispay page also. can u explain me full process .


--------------- Added [DATE]1322124074[/DATE] at [TIME]1322124074[/TIME] ---------------

I hv created the plugin from the above given code with global_start. And added {vb:raw widget} on forum display template.
After doing this form display is white page. I hope i m doing something wrong .so can u explain full process to add widget on each page.

swatirajawat 11-29-2011 11:23 AM

hi i have waited a lot for the help, i have posted this query over vbulletin site and they gave me reference for this side but i am not getting any reply yet,pls help me in this query
thankyou.


All times are GMT. The time now is 02:29 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.01102 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
  • (2)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
  • (7)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