Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Dynamic Joomla!VB wrapper Details »
Dynamic Joomla!VB wrapper
Mod Version: 1.00, by shadowraith (Member) shadowraith is offline
Developer Last Online: Apr 2011 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.8 Rating: (4 votes - 5.00 average) Installs: 55
Released: 07 Mar 2008 Last Update: Never Downloads: 219
Not Supported Uses Plugins Re-usable Code Translations Is in Beta Stage  

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 ...


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:

    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.


  • 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

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
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 07 Mar 2008, 04:55
Magnumutz's Avatar
Magnumutz Magnumutz is offline
 
Join Date: Feb 2006
Real name: Alex
Ok, with that skin, it looks pretty nice... i wonder how it would look like in the default skin or others

Good job so far.
__________________

Reply With Quote
  #3  
Old 07 Mar 2008, 07:23
shadowraith shadowraith is offline
 
Join Date: Feb 2008
Originally Posted by Magnumutz View Post
i wonder how it would look like in the default skin or others
Well, blue & purple are complimentary colors to yellow and orange, so you could squeeze by... Overall, however, I would say changing the color scheme (as opposed to the icon designs) is pertinent to an integrated look.
Reply With Quote
  #4  
Old 07 Mar 2008, 17:01
shadowraith shadowraith is offline
 
Join Date: Feb 2008
Btw, for anyone who is interested in seeing what the default vb skin looks like in the wrapped Joomla! I've turned on the vb style switcher. Just scroll down to the very bottom of the page and select "default" from the drop down menu. I'll add a switcher interface to the portal skin later, so you can see the wrapper skin switching as well.
Reply With Quote
  #5  
Old 07 Mar 2008, 22:41
goyo goyo is offline
 
Join Date: Mar 2002
I salute You shadowraith for this.

A little complicated for a non-programmer but if it works...

I'll try this with a Yootheme template. I think it's going to be harder compared to Rockettheme as from January they've switched to a new on-the-fly method gzip javascript files and combine (and gzip) css files in to one (more info here)...

I'll definitely coming back with my results.

Thanks again for this much needed wrapper idea/solution.
Reply With Quote
  #6  
Old 07 Mar 2008, 23:16
iogames's Avatar
iogames iogames is offline
 
Join Date: Jan 2007
Real name: Josh Arcadia
demo not working
__________________
. █│║▌│█│║▌║│█║▌│║║█║
Reply With Quote
  #7  
Old 08 Mar 2008, 00:47
vau7 vau7 is offline
 
Join Date: Mar 2004
'Hi there,

i really made a big joyjump on my desk when i saw this product. Unfortunatly i dont get it to work.

As Result of doing your steps, double-checked of course, i only get a white page.

As MenuID i gave the id to the normal wrapperlink of joomla, which i use to get the board into the rest of the site.

As absolute Path i gave
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

is the format right so?

Thank you much for your support.
Reply With Quote
  #8  
Old 08 Mar 2008, 02:14
shadowraith shadowraith is offline
 
Join Date: Feb 2008
Originally Posted by vau7 View Post
'Hi there,

i really made a big joyjump on my desk when i saw this product. Unfortunatly i dont get it to work.

As Result of doing your steps, double-checked of course, i only get a white page.

As MenuID i gave the id to the normal wrapperlink of joomla, which i use to get the board into the rest of the site.

As absolute Path i gave
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

is the format right so?

Thank you much for your support.
Hi, the blank page is from a fatal php error. The most common error I'm seeing from others who are experiencing the white page is
parse error, unexpected '<'
This is due to the fact that they are not using the $myjoomlacontent buffer. In other words if you just cut/pasted your index into your files, you will run into probs such as you are seeing. And, as I stated above, vbulletin has a prob w/html that has imbeded php.
Reply With Quote
  #9  
Old 08 Mar 2008, 08:16
ERuiz ERuiz is offline
 
Join Date: Feb 2005
Is there any chance of this working on Joomla 1.5.1?
Reply With Quote
  #10  
Old 08 Mar 2008, 19:22
tehtide tehtide is offline
 
Join Date: Dec 2007
I'm with ERuiz... what do we need to do to get this working with 1.5.1?

Also... any chance of having the private message box popping up on joomla when you have a PM?
Reply With Quote
  #11  
Old 08 Mar 2008, 19:28
shadowraith shadowraith is offline
 
Join Date: Feb 2008
I wrote the initial add-on for Joomla! 1.5 however since I needed to roll back to 1.0.15 to support the numerous modules/bots, I no longer have those files.

As far as making such a wrapper? You can generate a wrapper by defining your absolute joomla path ($myjoomlapath), template name ($myjoomlatemplate), and, for say, rocket themes, style name ($myjoomlastyle). I would also add these as parameters so that you can easily change them in the vBulletin settings, should you decide to switch themes/styles.

Then, it is a matter of removing the joomla calls in the add-on xml, adding the code to fetch the parameters, and replacing $this->baseurl, $this->template, and $tstyle, respectively, in your head, header, & footer php files. In addtion, you would need to replace the "menu code" with your own home-grown menu function.

Since the concept of this add-on is fairly straight forward, it is simply a matter of hacking this add-on to work with Joomla! 1.5. Or otherwise put, if you are comfortable with Joomla! 1.5 and vbulletin, and have solid php coding knowledge, a 1.5 hack such as the above, while tedious, should be quite simple. Ymmv, of course.

The down side is that a hacked implementation, such as the above is not dynamic. In other words, if/when you switch Joomla! styles, you would also need to change them in the vBulletin settings area. You would also need to upgrade your menu function anytime you changed the main menu. If I went this route, I would create a sharable menu include file, so that regardless the template, that menu function would always be included into the wrapper.

And finally, I have no doubt there is a better approach than the aforementioned for 1.5. However, migrating to 1.5 is not on my "to do" list atm, so unless that changes, I will not have time to investigate it further.

If you have other questions, feel free to pm me.
Reply With Quote
  #12  
Old 10 Mar 2008, 10:39
Sunsetdriver Sunsetdriver is offline
 
Join Date: Mar 2007
Thumbs up

This is what I was exactly looking for!
Thank you so much for sharing!

Does it work also if J and VB don't share the same database? Otherwise do I have to add some code to make it working?

Thanks
Reply With Quote
  #13  
Old 10 Mar 2008, 17:24
shadowraith shadowraith is offline
 
Join Date: Feb 2008
In theory, it should work regardless of whether they are in separate databases or not. In reality, it depends upon how they implemented their db classes. For example, are they using a thread resource pool? If not, any real loading will likely result in some odd behavior.

That said, I would first try to ensure it works with an integrated db. Then, once things are working smoothly, repoint vb to it's original seperate db by exporting the integrated db, and loading it into the seperate db.

By doing this, you limit potential sources for error during your trouble shooting phase. Ymmv, of course.
Reply With Quote
  #14  
Old 11 Mar 2008, 17:45
shadowraith shadowraith is offline
 
Join Date: Feb 2008
For those of you using Rocket Theme, I received some excellent input regarding the differing font size and alignment problem.

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
The above has been added to the basic instructions. Thanks again, Tiedgen!
Reply With Quote
  #15  
Old 12 Mar 2008, 10:01
Sunsetdriver Sunsetdriver is offline
 
Join Date: Mar 2007
Originally Posted by shadowraith View Post
In theory, it should work regardless of whether they are in separate databases or not. In reality, it depends upon how they implemented their db classes. For example, are they using a thread resource pool? If not, any real loading will likely result in some odd behavior.

That said, I would first try to ensure it works with an integrated db. Then, once things are working smoothly, repoint vb to it's original seperate db by exporting the integrated db, and loading it into the seperate db.

By doing this, you limit potential sources for error during your trouble shooting phase. Ymmv, of course.
Thanks for your reply
Actually I have Joomla and vBulletin in different databases. I'll start doing some tests with your hack and I'll let you know.

Btw...do you think the same thing could be applied to phpbb3?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 20:16.

Layout Options | Width: Wide Color: