22.4.08

Joomla 1.0 :: Conditional mosMainBody()

After some research, I have found a way to "properly" call mosMainBody() in Joomla! 1.0.

In this code:

<?php if(!eregi( "no items", $GLOBALS['_MOS_OPTION']['buffer'] )) {mosMainBody();}?>


I am checking if "no items" occurs in the $GLOBALS['_MOS_OPTION']['buffer'] variable where the main body resides. If you check the function declaration for mosMainBody in $joomlainstallation/includes/frontend.php file, you can see that this function echoes the variable above. I could hack this one (yet again) to test before display. But I need a fast way of doing things. This may not be the cleanest way to do it, but hey, it works for me.

!!! I modified the code to reflect other languages as well.... This is the new code:

<?php if(!eregi( _EMPTY_BLOG, $GLOBALS['_MOS_OPTION']['buffer'] ) AND !mb_eregi( _EMPTY_BLOG, $GLOBALS['_MOS_OPTION']['buffer'] ) ) {mosMainBody();}?>