vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Integration with vBulletin - Dynamic Joomla!VB wrapper (https://vborg.vbsupport.ru/showthread.php?t=172308)

shadowraith 03-06-2008 10:00 PM

Dynamic Joomla!VB wrapper
 
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 (Post 1489923)
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

Magnumutz 03-07-2008 02:55 AM

Ok, with that skin, it looks pretty nice... i wonder how it would look like in the default skin or others :D

Good job so far.

shadowraith 03-07-2008 05:23 AM

Quote:

Originally Posted by Magnumutz (Post 1459014)
i wonder how it would look like in the default skin or others :D

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.

shadowraith 03-07-2008 03:01 PM

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.

goyo 03-07-2008 08:41 PM

I salute You shadowraith for this.

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

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

iogames 03-07-2008 09:16 PM

demo not working

vau7 03-07-2008 10:47 PM

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

/srv/www/htdocs/web69/html/rap
is the format right so?

Thank you much for your support.

shadowraith 03-08-2008 12:14 AM

Quote:

Originally Posted by vau7 (Post 1459687)
'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
Code:

/srv/www/htdocs/web69/html/rap
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.

ERuiz 03-08-2008 06:16 AM

Is there any chance of this working on Joomla 1.5.1?

tehtide 03-08-2008 05:22 PM

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?

shadowraith 03-08-2008 05:28 PM

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.

Sunsetdriver 03-10-2008 08:39 AM

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

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

shadowraith 03-10-2008 03:24 PM

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.

shadowraith 03-11-2008 03:45 PM

For those of you using Rocket Theme, I received some excellent input regarding the differing font size and alignment problem.

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

The above has been added to the basic instructions. Thanks again, Tiedgen!

Sunsetdriver 03-12-2008 08:01 AM

Quote:

Originally Posted by shadowraith (Post 1461565)
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. :cool:

Btw...do you think the same thing could be applied to phpbb3? :erm:

shadowraith 03-12-2008 04:18 PM

Quote:

Originally Posted by Sunsetdriver (Post 1462843)
Btw...do you think the same thing could be applied to phpbb3? :erm:

As with anything, if you know how to code, and have the time and patience, it could be done. I admittedly do not know the state of phpbb these daze. My last tinkering was phpbb2. Even so, imho, unless the've re-architected the infrastructure and cleaned up the interfaces, and oh... idunno... tightened up some of their code, the thing leaks like a sieve. Esp when it comes to security. Then again, "secure php-[whatever]" is somewhat of an oxymoron. lolol.

Panagioths 03-12-2008 05:45 PM

I have a question. Are we just copy the data in the boxes for the 3 files? Because i got a blank page after i applied the theme....

shadowraith 03-12-2008 07:26 PM

Quote:

Originally Posted by Panagioths (Post 1463183)
I have a question. Are we just copy the data in the boxes for the 3 files? Because i got a blank page after i applied the theme....

First off, what do you mean by "applied"? Secondly, if you read the detailed instructions (which, given your question about "copying the data in the boxes" causes me to believe that you did not even remotely do), you would not have asked the question you just did. And finally, had you read "up" you would also see that, surprise, surprise, the common problem people seem to be having with installing this very simple mod is not reading the instructions and/or having like, zero understanding of even the most rudimentary php concepts. In other words, just trying to cut/paste your "theme" into the three referent files without bothering to buffer the html (which I explicitly explained in the instructions) will ... surprise, suprise... fail. And, had you ever coded anything in php (even if it was a simple "hello world" script), you would know that a white screen means the php compiler encountered a fatal error in the code. At which point, you could, at the very least, examine the error log which, in fact, gives the file name and line number where the error occurred. And, if worse came to worse, you could at least stare at your code and pretend you even know what you're looking at, and then come here with, you know, a superficially real question?

As it stands now, I am going to disable the "will support" and will not answer any further "all I am getting is a white screen" questions. If you cannot help yourself by at least reading the instructions, then I do not have the time or patience to even remotely consider helping you.

Panagioths 03-12-2008 07:47 PM

Ok, sorry for not having English as my primary language and sorry for being an amateur in coding and not knowing how to "buffer the html". I humbly seize my existence in order to stop bothering you. Please don't disable the "will support" because others might actually need it.

nonamer69 03-17-2008 07:32 PM

anyone tested this with 3.7?

btw, thanks shadowraith for your contribution.

goyo 03-19-2008 09:55 AM

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

shadowraith 03-19-2008 05:54 PM

Quote:

Originally Posted by goyo (Post 1468574)
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.

vau7 03-22-2008 01:16 AM

I really cant get it to work, since i dont understand php. Is there anyone who will do it for a few bucks?

jeff21up 03-22-2008 06:16 AM

Has anyone noticed all the call to undefined errors when viewing in threaded mode?

SOFTMASTER 03-23-2008 06:36 AM

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

shadowraith 03-25-2008 05:05 AM

Quote:

Originally Posted by jeff21up (Post 1471374)
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... :/

Tigratrus 03-31-2008 08:35 PM

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 :o. 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.:D

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

OneEyeSleepy 04-02-2008 04:17 PM

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?

shadowraith 04-05-2008 06:56 PM

Quote:

Originally Posted by OneEyeSleepy (Post 1481066)
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.

shadowraith 04-05-2008 06:57 PM

Quote:

Originally Posted by Tigratrus (Post 1479415)
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 :o. 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.:D

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)

cheesegrits 04-13-2008 08:08 PM

@shadowraith

Nice idea, and thanks for contributing this.

Total time it took me to get it working on two Joomla templates was about 30 minutes - 10 mins reading the notes and installing the XML, and about 10 minutes each chomping up the index.php.

Just FYI, with the two templates I've tried (Rhuk, and JoomlArt's Xenia), the raw chopped up index.php code works just fine as-is without having to use the $myjoomlacontent[] technique. What version of PHP are you running?

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.

The issue I'm working on at the moment is to see if I can get rid of the re-draws of things like CSS styled menus that use re-styling of UL elements, etc. It's particularly noticeable on the JA Xenia template, where the 'top' (main) menu draws three times - once as a plain UL, once with the text styling applied, and finally as the horizontal menu. I noticed something similar on your demo site.

Not sure if it'll be possible without some template-specific surgery though.

@nonamer69

Quote:

Originally Posted by nonamer69 (Post 1467315)
anyone tested this with 3.7?

Seems to work OK on 3.7 Beta 5. I've only been testing it for an hour or so though.

-- hugh

cheesegrits 04-15-2008 08:44 PM

Also need to add this to the plugin:

PHP Code:

    if ($mosConfig_lang=='') {
        
$mosConfig_lang 'english';
    }
    include_once( 
$mosConfig_absolute_path .'/language/' $mosConfig_lang '.php' ); 

... otherwise Joomla's language file isn't loaded.

FYI, I tracked that CSS menu styling redraw thing to a template specific bug. Nothing to do with this mod.

-- hugh

cheesegrits 04-16-2008 04:05 PM

An obvious drawback with embedding vB within J! is that you will very probably run into CSS conflicts. We have two radically different systems trying to share the same sandbox, and they end up stomping on each others CSS toes. I thought I'd document how I resolved these issues on my J! template (JA Xenia), but the same techniques will apply to most styles.

The main issue is obviously that vB's main stylesheet is overriding J! styling, and vice versa. It occurred to me that the first problem (vB stomping on J!) could be solved if all of vB's style selectors were specified as 'descendents' of the J! container wrapper div. In my case, using JA Xenia, this has the ID #ja-containerwrap. By the nature of the way this mod works, all of vB is contained within that div. The ID will vary depending on the J! template you are using, but there should be a 'wrapper' div which obviously surrounds vB.

So, I made a small code mod (much as I hate code mods, but there is no hook available in that location, I've requested one but am not holding my breath!) to vB, in ./includes/adminfunctions_template.php. At the end of the construct_css(), just before the 'return', I added this code:

PHP Code:

/*
    cheesegrits - joomlawrap CSS hack.  For use with shadowraith's Joomla!vB
    wrapper hack:
    
    https://vborg.vbsupport.ru/showthread.php?t=172308
    
    Place this code immediately before the 'return' at the end of
    the construct_css() function in includes/adminfunctions_template.php
    
    Set $jstyles to the vB style ID's you want to modify, and the CSS ID of the
    div in the coresponding J! template which 'wraps' the main body content.
    
    Go to Style Manager, edit and save the vB style(s) you want to modify.
*/
    
$jstyles = array(
        
=> '#ja-containerwrap',
        
=> '#wrapper-inner'
    
);
    
// test to see if this is one of our J! integration styles
    
if ($jstyles[$styleid])
    {
        
// grab the wrapper DIV ID
        
$jcontainer $jstyles[$styleid];
        
// loop through vB's $cssarray
        
foreach ($cssarray as $key => $val)
        {
            
// extract the selectors, i.e. everying before the opening {
            
if (preg_match('#(.*)\s*\{#',$val,$matches))
            {
                
$oldval $matches[1];
                
$newval '';
                if (
preg_match('#^body#',$oldval))
                {
                    
// if this is vB's 'body', change it to just the wrapper ID
                    
$newval "$jcontainer ";
                }
                else
                {
                    
// if it's anything but 'body', bust it up ...
                    
foreach (explode(',',$oldval) as $thisval)
                    {
                        
// ... and prepend the container ID to each selector
                        
$newval .= "$jcontainer $thisval, ";
                    }
                }
                
// chop any extranous trailing comma/space
                
$newval rtrim($newval,', ');
                
// replace the original selector list with ours
                
$cssarray[$key] = str_replace($oldval,$newval,$val);
            }
        }
    } 

After making this mod and saving the style(s), the main vB CSS on your wrapped vB will now look like this:

Code:

#ja-containerwrap .page
{
  background: #FFFFFF;
  color: #000000;
}
#ja-containerwrap td, #ja-containerwrap th, #ja-containerwrap p, #ja-containerwrap li
{
  font: 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
... etc etc ..

NOTE that this only takes care of the standard vB defined style tags. If you have "extra CSS" defined in your style, you may need to manually prepend the wrapper div ID to the custom CSS definitions.

This goes most of the way to solving the "vB stomping on J!" issue..

This has already gotten rather long, so I'll follow up in another post with the other stuff I had to do to get everything playing nicely together.

-- hugh

cheesegrits 04-17-2008 12:35 AM

Another quickie ... need to add ...

PHP Code:

    $my $mainframe->getUser(); 

... right after the call to mosMainFrame() in the plugin. Lots of J! widgets need $my defined, it's like J!'s version of vB's $userinfo. Took me a while to work out why several of my J! modules on my vB page were behaving rather strangely!

-- hugh

Sunsetdriver 05-15-2008 08:31 PM

Has anyone tested it with vb 3.7.0? :confused:
Thanks.

Sunsetdriver 05-16-2008 10:37 AM

I'm testing the hack wit RT's populus template. It works BUT there's an error displayed at the top of the page:
Code:

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Joomla\templates\rt_populus\rt_styleloader.php on line 11
Then if I click on forums titles or reply to a topic, another error appears:
Code:

Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\xampp\htdocs\Joomla\templates\rt_populus\rt_styleloader.php on line 28
Btw, I've moved $myjoomladhead at the beginning of the headinclude template.

See attachment.


Quote:

Originally Posted by cheesegrits (Post 1489923)
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.

Where do I have to put that code? In xml file? And Do I have to oaste only
Code:


       
PHP Code:

       

               

               
               

                       
if (THIS_SCRIPT != 'cron'){   blah blah



               

               

               

       


?

Thanks

cheesegrits 05-17-2008 07:10 PM

I'd have to see the three 'chunks' of template to work out why you are getting those errors.

For the 'cron' thing, edit the global_start plugin, and just wrap that if statement around all the code, so it's ...

if (THIS_SCRIPT != 'cron')
{
... original code ...
}

-- hugh

Sunsetdriver 05-18-2008 12:37 PM

I've fixed it! :D
Rockettheme slightly modified their templates' index.php since firenzie, so some code was left out of the <head></head> section. :D

NOW...I still have some questions:
1) if I change the default style in Joomla's backend (same template but different style), it doesn't change in forum page. Of course it happens 'cause I have to manually change parameters in /vbulletin/head.php. Is there a way to let head.php read parameters directly from template's index.php?
2) How can I display correctly modules in forum page? I tried it but they didn't got displayed well;
3) There's a bug with vb's dropdown menus. As I click on them, they got displayed away from menu (see pic).

Sorry for too many questions :p. Btw, any chance for an updated version with you CSS tips included? (to have Joomla and vbulletin working with own CSS styles).

https://vborg.vbsupport.ru/external/2008/05/11.png

Sunsetdriver 05-18-2008 01:01 PM

Could someone also explain this?
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.
I think that's why nothing got displayed in modules enabled in VB page :p:o.

Thanks.

Sunsetdriver 05-18-2008 02:14 PM

Ugh...I've just tried to install the product on my live website and the forum doesn't load.
I've got this error message displayed:

Quote:

Restricted access
Warning: Unknown: failed to open stream: No such file or directory in [path]/global.php(384) : eval()'d code on line 232

Fatal error: Unknown: Failed opening required '/includes/frontend.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*******/public_html/forum/global.php(384) : eval()'d code on line 232
my config:

Joomla --> www.mydomain.com
vbulletin --> www.mydomain.com/vbulletin

My plugin's settings:
Enter the full path to your joomla directory: www.mydomain.com

Same error with 'www.mydomain.com/'

But if I type '../' a blank page loads.

Any hint? :erm:

How should I type the url of my joomla installation?
Thanks.


All times are GMT. The time now is 04:09 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01900 seconds
  • Memory Usage 1,985KB
  • 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
  • (13)bbcode_code_printable
  • (7)bbcode_php_printable
  • (15)bbcode_quote_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
  • (40)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