Page 1 of 1

How to allow plugins/mambots to work inside of Section/Categories?

Posted: Sat Dec 08, 2007 4:45 pm
by FrostByghte
I am interested in finding a way to allow section and category descriptions to be parsed by mambots/plugins.  I found this code on the forums:

Code: Select all

//  HACK TO PARSE MAMBOTS IN SECTIONS AND CATEGORIES
// orginally written by John Cox
  if ( $descrip && $description->description ) {
    global $_MAMBOTS;   
    $_MAMBOTS->loadBotGroup( 'content' );
    $temp = new stdClass;
    $temp->text = $description->description;
    $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$temp, &$params, 0 ), true );
    echo $temp->text;
  }
//  HACK TO PARSE MAMBOTS IN SECTIONS AND CATEGORIES
But it does not appear to work.  Your supposed to replace lines 1237-1239 in content.php with this code.  So I was wondering if someone could help me get this working or point me in a better direction? 

Found this hack here: http://forum.joomla.org/index.php/topic ... #msg905805

Using joomla 1.0.13, thank you.

Re: How to allow plugins/mambots to work inside of Section/Categories?

Posted: Sat Dec 08, 2007 8:57 pm
by Toni Marie
Since the hack is written for 1.0.12 is it possible the line numbers are different in content.php for 1.0.13?  You get to look in the changelog, I'm too lazy, hehehe... if content.php was changed in the update from .12 to .13, you're looking for a different line.

Re: How to allow plugins/mambots to work inside of Section/Categories?

Posted: Mon Dec 10, 2007 4:35 pm
by FrostByghte
Comparing content.php from both installs I can see very few differences.  Can anyone offer some additional suggestions in order to get this to function?  Honestly it seems a bit odd that the core would place a restriction on where plugins/bots could be displayed anyway.

Re: How to allow plugins/mambots to work inside of Section/Categories?

Posted: Mon Dec 10, 2007 6:42 pm
by leolam
I have tested this on 1.0.13 and it does not work and i i am pretty sure it has to do with the item id issues but i coud not resolve it...the lines are btw 2473 in my version in ftp Cute pro 8.x

Re: How to allow plugins/mambots to work inside of Section/Categories?

Posted: Mon Dec 10, 2007 7:08 pm
by FrostByghte
Blarg...thanks for taking a peek.  Per pm, if you have any interest in tackling this further please let me know.

Re: How to allow plugins/mambots to work inside of Section/Categories?

Posted: Wed Jan 09, 2008 3:50 pm
by nomis
I am also interested in using mambots through the section / category description text.

I'm using the the excellent MgMedia2:
http://extensions.joomla.org/component/ ... Itemid,35/

to insert flash very effectively into articles and would be great to use this already installed (on my setup) component and mambot to insert flash (or what ever other media) into Section and Category description text.

I also think that the section and category descriptions are a much undervalued and unused area of joomla especially on larger sites with many sections and categories.

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Fri Mar 07, 2008 1:29 pm
by Sir_Sausage
Is there still no solution for that problem?
Please let us know!

:)

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Fri Mar 07, 2008 3:42 pm
by FrostByghte
I got it! Thanks to Joomlancers :) Was missing a bit of the hack. Here is what needs to be done to get this to work:

In content.php around row 1254 you need to comment OUT the following (all I had of the original hack):

Code: Select all

                    if ( $descrip && $description->description ) {
                                echo $description->description;
                        }
Now after you comment the above out add this right after it:

Code: Select all

//Edit the above out to enable HACK
//  HACK TO PARSE MAMBOTS IN SECTIONS AND CATEGORIES
// orginally written by John Cox
           if ( $descrip && $description->description ) {
           global $_MAMBOTS;   
           $_MAMBOTS->loadBotGroup( 'content' );
           $temp = new stdClass;
           $temp->text = $description->description;
           $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$temp, &$params, 0 ), true );
           echo $temp->text;
            }
//  HACK TO PARSE MAMBOTS IN SECTIONS AND CATEGORIES
Now in content.html.php (missing part to hack) around row 30-31 look for:

Code: Select all

class HTML_content {
        /**
        * Draws a Content List
        * Used by Content Category & Content Section
        */
        function showContentList( $title, &$items, &$access, $id=0, $sectionid=NULL, $gid, &$params, &$pageNav, $other_categories,
                global $Itemid, $mosConfig_live_site;
Right after this section insert:

Code: Select all

                 //  HACK TO PARSE MAMBOTS IN SECTIONS AND CATEGORIES
                // orginally written by John Cox
                if ( $title && $title->description ) {
                        global $_MAMBOTS;
                        $_MAMBOTS->loadBotGroup( 'content' );
                        $temp = new stdClass;
                $temp->text = $title->description;
                $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$temp, &$params, 0 ), true );
                $title->description = $temp->text;
            }
                //  HACK TO PARSE MAMBOTS IN SECTIONS AND CATEGORIES
Somewhere around row 147 look for this (another missing part):

Code: Select all

                $width = 'width="'. intval( $col_with ) .'%"';
                echo '<table width="100%"  cellpadding="0" cellspacing="0">';
                $z = 0;
                $total = count($other_categories);   
                foreach ( $other_categories as $row ) {
After insert this:

Code: Select all

                //  HACK TO PARSE MAMBOTS IN SECTIONS AND CATEGORIES
                // orginally written by John Cox
                if ( $row && $row->description ) {
                        global $_MAMBOTS;
                        $_MAMBOTS->loadBotGroup( 'content' );
                        $temp = new stdClass;
                $temp->text = $row->description;  
                $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$temp, &$params, 0 ), true );
                $row->description = $temp->text;  
            }
                //  HACK TO PARSE MAMBOTS IN SECTIONS AND CATEGORIES    
And I _think_ that is everything. I do have the original files I was sent as part of the contract someplace in my email...so if that doesn't get it I can look for those and just post them directly somehow.

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Fri Mar 07, 2008 4:08 pm
by Sir_Sausage
Oh Lord!

THANK YOU! :D

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Fri Mar 07, 2008 4:22 pm
by FrostByghte
lol..no problem. You let me know if that doesn't work out, I for _sure_ have it working on this end. I know exactly what you are feeling. I finally just broke down and started hiring contract help. I tried searching all over for this completed hack and I never could find anymore reference to it online other than what I originally posted at the top of the thread.

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Fri Mar 14, 2008 2:22 pm
by FrostByghte
In the newer 1.0.15 on that last patch I listed, look for this line:

Code: Select all

 foreach ( $other_categories as $row ) {
The code above it has changed, so just look for that one line in content.html.php and paste right after it. Works fine.

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Wed Mar 19, 2008 12:42 am
by efiplus
Now it just takes to solve this on Joomla 1.5.
I understand the performance concerns expressed in other threads, but still... in some cases it would be much useful.

Nuno.

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Sun Apr 20, 2008 6:32 pm
by filipetorres
Hi all,
Great job FrostByghte.
I tested this solution and works very well.
This i's a important modifification and it could be sugested to development team to include in future versions of Joomla! 1.0.x.
I writed a tutorial in portuguese about this solution for Joomla! community in Brasil.
Still missing a solution to Joomla! 1.5.x.

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Tue Apr 29, 2008 2:48 pm
by kksou
filipetorres wrote:Hi all,
Still missing a solution to Joomla! 1.5.x.
Here's the solution for joomla 1.5:

How to make plugins process Section/Category descriptions (for Joomla 1.5.x)

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Fri May 02, 2008 4:02 pm
by jackbremer
Works beautifully

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Mon May 12, 2008 2:15 pm
by kksou
Hi,

I've been using Joomla 1.5.1 all these while.

I just installed Joomla 1.5.3 and give it a try. To my surprise, it seems that in v1.5.3, the section/category description now gets processed by the content plugins by default! You no longer need to modify the joomla core to achieve this.

Was wondering if those with Joomla 1.5.3 could try and see if this is the case?

Re: How to allow plugins/mambots to work inside of Section/Categ

Posted: Mon Jun 30, 2008 10:20 pm
by emagin
This works for me too.
Thank you so much!

I saw someone post about performance issues, can you elaborate?
Thanks