Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Dynamic Joomla!VB wrapper Details »»
Dynamic Joomla!VB wrapper
Version: 1.00, by shadowraith shadowraith is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.6.8 Rating:
Released: 03-06-2008 Last Update: Never Installs: 57
Uses Plugins
Re-useable Code Translations Is in Beta Stage  
No support by the author.

NB: This add-on is not a single sign-on solution.

This add-on provides a means for dynamically wrapping your vbulletin in a Joomla! 1.0.15 portal implementation. This add-on does not touch the core files of either system and there is no requirement to do anything on the Joomla! side unless you've created wrappers for several templates and want to switch between those templates. At which point, you'll simply switch your Joomla! templates via in the Joomla! template manager. And finally, this add-on assumes that your forum is located directly below your joomla implementation directory and is sharing its database. The following instructions include example code snippets to (hopefully) assist in making this add-on proceed as smoothly as possible.
Before attempting to install this add-on, disable your forum and back up your database!!!. This is to ensure you have a working copy in case you run into problems.
.

If you install this PLEASE
Click Install

Preparation:
Step 1: Create a subdirectory in your current template directory (both locally and on your target site) called, vbulletin. For example, if you're using one of the default templates for Joomla! 1.0.15... say... madeyourweb, you would create your vbulletin directory as follows:
joomla-root-dir/templates/madeyourweb/vbulletin
Step 2: Create three files (head.php, header.php, & footer.php). These will contain content from your index.php file in your selected template directory. So, if you are using the default (madeyourweb), you would use the index.php file in that directory to create the three vbulletin wrapper files. These files should be formatted as follows:
head.php
This file is for your joomla template content between the <head> [...] </head> tags. This is also where you initialize theme variables and add any include statements, for example, from a Rocket Theme ...

Code:
<!-- Begin Joomla Head Wrapper -->
<?
	$default_style = "style3";			//[style1... style10]
	$enable_rokzoom = "true";			  // true | false
	$template_width = "fluid";			// width in px | fluid
	$sidebar_width = "25%";					// width in px or %
	$sidebar_side = "right";				// left | right
	$menu_name = "mainmenu";				// mainmenu by default, can be any Joomla menu name
	$menu_type = "moomenu";					// moomenu | suckerfish | splitmenu | module
	$default_font = "default";      // smaller | default | larger
	$show_pathway = "true";					// true | false

	require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/rt_styleloader.php");
  $myjoomlacontent   = array();
	$myjooomlacontent[] = '<meta http-equiv="Content-Type" content="text/html; '._ISO.'" />';
	$myjooomlacontent[] = '<link href="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/css/template_css.css" rel="stylesheet" type="text/css" />';
	$myjooomlacontent[] = '<link href="'.$mosConfig_live_site.'/templates/'.$mainframe->getTemplate().'/css/'.$tstyle.'.css" rel="stylesheet" type="text/css" />';
  echo implode( "\n", $myjoomlacontent );
?>
<!-- End Joomla Head Wrapper -->

header.php
This file is for your joomla template content between the <body> tag and the php mosMainbody function call.

Code:
<!-- Begin Joomla Header Wrapper -->
<?
  $myjoomlacontent   = array();
  $myjoomlacontent[] = '<div id="outer-800" >';
  $myjoomlacontent[] = '<div id="pathway">';
  echo implode( "\n", $myjoomlacontent );
	mospathway();
  $myjoomlacontent   = array();
  $myjoomlacontent[] = '</div>';
  $myjoomlacontent[] = '<div id="leftcol">';
  $myjoomlacontent[] = '<a name="menu"></a>';
	if (mosCountModules( "left" )) {
	  echo implode( "\n", $myjoomlacontent );
		mosLoadModules ( 'left',-3);
	  $myjoomlacontent   = array();
	}
  $myjoomlacontent[] = '</div>';

	[...]
	  
  echo implode( "\n", $myjoomlacontent );
?>
<!-- End Joomla Header Wrapper -->

footer.php
This file is for your joomla template content between the php mosMainbody function call and the </body> tag.

Code:
<!-- Begin Joomla Footer Wrapper -->
			</div>
		</div>
		<div class="clr"></div>
	</div>
</div>
<!-- End Joomla Footer Wrapper -->
Step 3: Upload your files to the new vbulletin directory that you just created


Step 4: Download the attached product-joomla-vb.xml project-addon and change:
  • joomla-menu-id-for-your-forum => Joomla! menu id for your forum (you can find this under Itemid in your Joomla! control panel menu manager)

  • your-joomla-path-goes-here => absolute path to your Joomla! installation

Installation:
  • Select Plugins & Products => Manage Products and click on the "Add/Import Product" link. And select the above xml from where ever you have stored it locally. This will install your product as well as your supporting plugin.

  • Select Plugins & Products => Plugin Manager and select Include the Joomla!VB template wrappers, then click save, to ensure the plugin refreshes.

  • Select vBulletin Options and scroll down to the end of the list. There should be a "Dynamic Joomla Options" in the list. Select that, and verify that your path and your joomla menu id are set correctly. If not, change them to the correct settings and click save.

  • Select Styles & Templates => Style Manager and create a brand new style with default (or a style you already have in place) as the parent style.
    NB: The above intermediate step provides a means to play around with a test template without trashing your existing template. And, it also makes it easier to sandbox without having to restore your database.
  • Select Common Templates from your dropdown menu of the style you just created.

    Common templates has three templates. These are header, headinclude, and footer.

    • Insert $myjoomladhead at the end of the headinclude template
    • Insert $myjoomladheader at the end of header template
    • Insert $myjoomladfooter at the end of footer template
    • Click save.

  • Click on your new style, which will launch your forum with the Dynamic Joomla!VB wrapper.

Demo: http://crimsonshadows.net (click on forum to see the seamless integration between the portal and vbulletin)


Notes, debugging, etcetera:
  • All php function calls, such as mosLoadModules should be made in the order they appear in your template. For example:
    Code:
    <?
      $myjoomlacontent   = array();
    
    	[...]
      $myjoomlacontent[] = '              <div id="horiz-menu" class="'.$mtype.'">';
      echo implode( "\n", $myjoomlacontent );
      mosShowListMenu($menu_name);
      $myjoomlacontent   = array();
      $myjoomlacontent[] = '                <div class="clr"></div>';
    	[...]
      
      echo implode( "\n", $myjoomlacontent );
    ?>

  • vBulletin seems to have problems parsing the raw Joomla! html w/embedded php. Hence the reason to use the $myjoomlacontent buffer variable, which you must dump ala the echo/implode when needing to make a function call that echoes the results as opposed to returning a string.

  • If you do not have embedded php code, you can simply include the raw code as reflected in the above footer.php example. Or, if you're a brave soul and have some time just import your raw templates and bypass the $myjoomlacontent buffer altogether. Good luck on this latter and if you figure out what the kink is, please let me know.

  • As far as debugging goes? Hopefully you have access to your php error log or you're displaying your php errors/warnings to the screen. This makes debuging much easier.

    The most common errors you can encounter when attempting this type of implementation are leaving off ending quotes, or using a semiquote on html code that already contain a semi quote. My general rule of thumb, if the html code is using quotes, then I use semi quotes to load the string into $myjoomlacontent buffer. Likewise, if it is using semi quotes, I use quotes.

    Other errors may be missing variables. I'm using the Rocket Theme templating system therefore my head.php contains the Rocket Theme includes.

As for swithching themes? You will need to create a vbulletin directory under each template directory you may wish to use. Then, create the three aforementioned files (head.php, header.php, footer.php) and upload them to their respective template directory. At which point, it is a matter of using your joomla control panel to switch between templates.
Excellent/Important user feedback/tips

Quote:
Originally Posted by Tiedgen
1.) I noticed on your site that when you go from your main page to your
vbulletin page, the navbar font is a different size and/or style. --- I
found a fix for this and the answer lies in the style manager in the VB
admincp. Edit your desired VB style and scroll down the CSS style boxes
until you come to <td>, <th>, <p>, <li>. This is where the problem lies.
Apparantly, implementing the joomla code (which includes the CSS code) is
screwing with the vb css code. The solution was simple; I just edited the
font size and font family under <td>, <th>, <p>, <li>. In my case, I
changed the font size to 9pt and re-arranged the first font style: verdana.
Once I changed these variables, the header and navbar text was identical to
the rest of the board.. No more little annoyance.. :-)

2.) And lastly, this deals more with the rockettheme template code. I
noticed that I couldn't get my board to center correctly in the main
content wrapper; it was a few pixels to the right. (I know.. petty stuff..)
To remedy this I deleted the last dozen or so lines of code from my
header.php file; the code dealing with the right or left nav section (in my
case, the right nav section) If you would like the specific code, don't
hesitate to ask. Your firenze template coding should be nearly identical to
my elemental template from rockettheme.com
Quote:
Originally Posted by cheesegrits View Post
One fairly important change though, for anyone even vaguely concerned about server load, you should probably wrap this around the plugin code:

PHP Code:
if (THIS_SCRIPT != 'cron')
{
   
blah blah

Otherwise you are loading the whole of Joomla twice on every page load, and it obviously doesn't need to happen the second time, just for the cron jobs.
Support
I will happily answer questions that are not addressed in the above instructions. Feedback is also welcomed.
Addendum
Please do not ask me to write and/or debug your php code! So far, all of the questions I have received are from people who (a) did not even bother to read the detailed instructions that I provided above, and/ or (b) haven't clue one wrt writing php code, much less debugging it.

While I have no problem supporting this product, I do not have time to teach people how to write and debug their own code. Esp considering that the errors encountered thus far could have been easily avoided by reading the instructions!


If you install this PLEASE
Click Install

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 03-19-2008, 09:55 AM
goyo goyo is offline
 
Join Date: Mar 2002
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Error in installation description ?

Original description:

* Insert $myjoomladhead at the end of the header template
* Insert $myjoomladheader at the end of headinclude template

Instead (my take):

* Insert $myjoomladheader at the end of the header template
* Insert $myjoomladhead at the end of headinclude template
Reply With Quote
  #23  
Old 03-19-2008, 05:54 PM
shadowraith shadowraith is offline
 
Join Date: Feb 2008
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by goyo View Post
Error in installation description ?

Original description:

* Insert $myjoomladhead at the end of the header template
* Insert $myjoomladheader at the end of headinclude template

Instead (my take):

* Insert $myjoomladheader at the end of the header template
* Insert $myjoomladhead at the end of headinclude template
Good catch! Thanks for the head's up. Instructions corrected.
Reply With Quote
  #24  
Old 03-22-2008, 01:16 AM
vau7 vau7 is offline
 
Join Date: Mar 2004
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really cant get it to work, since i dont understand php. Is there anyone who will do it for a few bucks?
Reply With Quote
  #25  
Old 03-22-2008, 06:16 AM
jeff21up's Avatar
jeff21up jeff21up is offline
 
Join Date: Nov 2006
Location: UK
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone noticed all the call to undefined errors when viewing in threaded mode?
Reply With Quote
  #26  
Old 03-23-2008, 06:36 AM
SOFTMASTER SOFTMASTER is offline
 
Join Date: Sep 2006
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ohhh no !!!

I've been working hard during 2 days to integrate manually my joomla template ! Haven't seen an addon could exist :'(

Gonna try it now !

Thank you very much shadowraith !!
Reply With Quote
  #27  
Old 03-25-2008, 05:05 AM
shadowraith shadowraith is offline
 
Join Date: Feb 2008
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jeff21up View Post
Has anyone noticed all the call to undefined errors when viewing in threaded mode?
Hadn't notice that and certainly did not see it before! Will need to track that bit down to see what is occurring. I obviously b0rked something though... :/
Reply With Quote
  #28  
Old 03-31-2008, 08:35 PM
Tigratrus's Avatar
Tigratrus Tigratrus is offline
 
Join Date: Nov 2006
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok... I took a whack at making this work in J! 1.5.1, but I think it may be beyond my shaky grasp of the differences between J! 1.0x and J! 1.5x and php in general . Basically we never messed with 1.0x after we decided that the vB bridges were too unstable, so I don't know that much about 1.0x at all.

The function call mosMainbody doesn't exist in 1.5, I took a stab at it but I'm not at all sure I've got it right.

I also had to modify the plugin a bit, so that it looks more like this:
Code:
define( '_JEXEC, 1 );
  $myjoomlapath = $vbulletin->options['dyn_joomla_path'];
 require_once( $myjoomlapath.'/configuration.php' );
 require_once( $myjoomlapath.'/includes/joomla.php' );
 require_once( JPATH_SITE .'/includes/frontend.php' );
 require_once( JPATH_SITE .'/includes/sef.php' );
 $mainframe = new mosMainFrame( $database, '', '.' );
 $mainframe->initSession();
 ob_start();
 include_once(JPATH_SITE . '/templates/' . $mainframe->getTemplate(). '/vbulletin/head.php');
 $myjoomladhead = ob_get_contents();
 ob_clean();
 include_once(JPATH_SITE . '/templates/' . $mainframe->getTemplate(). '/vbulletin/header.php');
 $myjoomladheader = ob_get_contents();
 ob_clean();
 include_once(JPATH_SITE . '/templates/' . $mainframe->getTemplate(). '/vbulletin/footer.php');
 $myjoomladfooter = ob_get_contents();
 ob_end_clean();
Not sure if that's right or not?

If you *do* play with it in 1.5, let us know? Given that we're working with media mogul too, it'd be a real easy implementation for us if you provide updated templates based on RT's MM.

I'll keep on banging away on it to see if I can figure out what's wrong... And post back if I make any headway.



James and Susan
Reply With Quote
  #29  
Old 04-02-2008, 04:17 PM
OneEyeSleepy OneEyeSleepy is offline
 
Join Date: Sep 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, I am very interested in your wrapper. Its the best I have ever seen at the moment. However, you also posted another file download in the rockettheme.com forum (http://www.rockettheme.com/option,co...697.msg156280/), if that is you, under post 11.

Is the file the same as the first post of this topic?
Reply With Quote
  #30  
Old 04-05-2008, 06:56 PM
shadowraith shadowraith is offline
 
Join Date: Feb 2008
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by OneEyeSleepy View Post
Hi, I am very interested in your wrapper. Its the best I have ever seen at the moment. However, you also posted another file download in the rockettheme.com forum (http://www.rockettheme.com/option,co...697.msg156280/), if that is you, under post 11.

Is the file the same as the first post of this topic?
Yes, I just added the instructions that I posted here to that file.
Reply With Quote
  #31  
Old 04-05-2008, 06:57 PM
shadowraith shadowraith is offline
 
Join Date: Feb 2008
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tigratrus View Post
Ok... I took a whack at making this work in J! 1.5.1, but I think it may be beyond my shaky grasp of the differences between J! 1.0x and J! 1.5x and php in general . Basically we never messed with 1.0x after we decided that the vB bridges were too unstable, so I don't know that much about 1.0x at all.

The function call mosMainbody doesn't exist in 1.5, I took a stab at it but I'm not at all sure I've got it right.

I also had to modify the plugin a bit, so that it looks more like this:
Code:
define( '_JEXEC, 1 );
  $myjoomlapath = $vbulletin->options['dyn_joomla_path'];
 require_once( $myjoomlapath.'/configuration.php' );
 require_once( $myjoomlapath.'/includes/joomla.php' );
 require_once( JPATH_SITE .'/includes/frontend.php' );
 require_once( JPATH_SITE .'/includes/sef.php' );
 $mainframe = new mosMainFrame( $database, '', '.' );
 $mainframe->initSession();
 ob_start();
 include_once(JPATH_SITE . '/templates/' . $mainframe->getTemplate(). '/vbulletin/head.php');
 $myjoomladhead = ob_get_contents();
 ob_clean();
 include_once(JPATH_SITE . '/templates/' . $mainframe->getTemplate(). '/vbulletin/header.php');
 $myjoomladheader = ob_get_contents();
 ob_clean();
 include_once(JPATH_SITE . '/templates/' . $mainframe->getTemplate(). '/vbulletin/footer.php');
 $myjoomladfooter = ob_get_contents();
 ob_end_clean();
Not sure if that's right or not?

If you *do* play with it in 1.5, let us know? Given that we're working with media mogul too, it'd be a real easy implementation for us if you provide updated templates based on RT's MM.

I'll keep on banging away on it to see if I can figure out what's wrong... And post back if I make any headway.



James and Susan
Hi, haven't had time to play with 1.5 yet, but this plugin also works with joomla 1.0.15 & vbulletin 3.6.9 (with no changes to the underlying plugin)
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:18 PM.


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.05087 seconds
  • Memory Usage 2,351KB
  • Queries Executed 25 (?)
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
  • (6)bbcode_code
  • (1)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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