View Single Post
  #317  
Old 03-16-2014, 03:02 AM
Disco_Stu Disco_Stu is offline
 
Join Date: Apr 2012
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by aaronhaul View Post
Can Sidebar Anywhere display 2 Sidebars (Left and Right) with fixed or flexible width at same time?

I want to have 2 Sidebars on same forum or article page display together in the right and left column.

Example: 240px, 100%, 240px

I have search all forums for this and could not find an answer to this.

Please let me know.

I asked that same question but didn't get a response so I figured it out for myself.

You need to have your page content displayed in a table with 2 columns. Reserve the left column for the left sidebar and put the rest of your page content in the second table column.

Then create an HTML CMS widget for whatever you want. I created one that I use for several different functions.

Next, you need to change the php file that is used for the template you are adding the widget to. What this code does is allow a CMS Static widget to be made available to a template. Here's the php code:

PHP Code:
// add cms widget to template. 

bootstrap_framework();
vBCms_View_Widget::registerTemplater(vB_View::OT_XHTML, new vB_Templater_vB());
$widgetID 48// the id of the widget
$widgettype 'Static';
$widget vBCms_Widget::create('vBCms'$widgettype$widgetID);
$outputwidget $widget->getPageView()->render(); 
You can get the widget id number by looking at the cms widget table in your database. I should point out that I was only able to make this work with HTML widgets (Static). It would not work with PHP or specialized widgets like the poll or recent posts widget. For this I created my own version in html.

Then in the same php file you need to add a line to the list of variables being registered to the template:

PHP Code:
$templater->register('widget'$outputwidget); 
Now in the template you can reference the widget with {vb:raw widget}

You can also write code to add the fade in/fade out ability and have the main page content slide to the left when the widget is collapsed.

This should give you a good starting point. Good luck. I strongly suggest you back up your website including php files and database before you make any changes. I am not responsible for any changes you make based on my suggestions.

Updated 4/30/14:
You can avoid changing the php files if you want by creating a plugin like this one to add a CMS widget to a couple of pages:

PHP Code:
ob_start();
bootstrap_framework();
vBCms_View_Widget::registerTemplater(vB_View::OT_XHTML, new vB_Templater_vB());
$widgetID 48// the id of the widget
$widgettype 'Static';
$widget vBCms_Widget::create('vBCms'$widgettype$widgetID);
$output $widget->getPageView()->render();

  
ob_end_clean();
vB_Template::preRegister('ARCADE',array('widget' => $output));
vB_Template::preRegister('SHOWTHREAD',array('widget' => $output)); 
Then in the template simply add {vb:raw widget} wherever you want the widget to appear.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01578 seconds
  • Memory Usage 1,794KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete