Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks

Reply
 
Thread Tools
Use vBCms Widget everywhere
ragtek
Join Date: Mar 2006
Posts: 1,630

 

austria, croatia
Show Printable Version Email this Page Subscription
ragtek ragtek is offline 06-21-2010, 10:00 PM

Here is a method, how to use the widgets on own pages.

1. fix this bug: http://tracker.vbulletin.com/browse/VBIV-7640
2. Now you can use the following code where you want (plugin, own php page):
PHP Code:
bootstrap_framework();
vBCms_View_Widget::registerTemplater(vB_View::OT_XHTML, new vB_Templater_vB());

$widgetID 32// the id of the widget

$widgettype 'Static'// type of the widget you want to output

$widget vBCms_Widget::create('vBCms'$widgettype$widgetID);
$output $widget->getPageView()->render(); 
3. Now the output is saved in the $output variable, which can be placed where you want
Reply With Quote
  #12  
Old 01-14-2011, 09:51 PM
john h john h is offline
 
Join Date: Dec 2008
Location: Australia
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Watching this one with great interest!
Reply With Quote
  #13  
Old 06-08-2011, 04:23 AM
ttuser ttuser is offline
 
Join Date: Nov 2010
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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??
Reply With Quote
  #14  
Old 08-11-2011, 09:45 AM
tintin74 tintin74 is offline
 
Join Date: Jul 2007
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

same for me.
Reply With Quote
  #15  
Old 08-11-2011, 11:54 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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().
Reply With Quote
  #16  
Old 09-03-2011, 07:24 PM
Bram H Bram H is offline
 
Join Date: Jul 2007
Location: The Netherlands
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did somebody actually get this to work? I too am looking for the section widget to display on the forums
Reply With Quote
  #17  
Old 11-24-2011, 07:24 AM
swatirajawat swatirajawat is offline
 
Join Date: Oct 2011
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #18  
Old 11-29-2011, 11:23 AM
swatirajawat swatirajawat is offline
 
Join Date: Oct 2011
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools

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:53 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.04157 seconds
  • Memory Usage 2,264KB
  • Queries Executed 22 (?)
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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete