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

General questions relating to Joomla! There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
FrostByghte
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sat Sep 10, 2005 12:55 pm

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

Postby FrostByghte » Sat Dec 08, 2007 4:45 pm

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.

User avatar
Toni Marie
Joomla! Ace
Joomla! Ace
Posts: 1506
Joined: Tue May 09, 2006 5:37 am
Location: Arid-Zona
Contact:

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

Postby Toni Marie » Sat Dec 08, 2007 8:57 pm

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.

FrostByghte
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sat Sep 10, 2005 12:55 pm

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

Postby FrostByghte » Mon Dec 10, 2007 4:35 pm

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.

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 16083
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

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

Postby leolam » Mon Dec 10, 2007 6:42 pm

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
-- Joomla Professional Support Services : https://gws-desk.com --
-- Joomla Specialized Hosting Solutions: https://gws-host.com --
-- Joomla Professional Web Development & Design :www.gws-studio.com
-- Member Joomla Bug Squad --

FrostByghte
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sat Sep 10, 2005 12:55 pm

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

Postby FrostByghte » Mon Dec 10, 2007 7:08 pm

Blarg...thanks for taking a peek.  Per pm, if you have any interest in tackling this further please let me know.

User avatar
nomis
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Thu Oct 13, 2005 9:12 am
Location: UK

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

Postby nomis » Wed Jan 09, 2008 3:50 pm

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.

Sir_Sausage
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Apr 02, 2007 7:21 pm

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

Postby Sir_Sausage » Fri Mar 07, 2008 1:29 pm

Is there still no solution for that problem?
Please let us know!

:)

FrostByghte
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sat Sep 10, 2005 12:55 pm

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

Postby FrostByghte » Fri Mar 07, 2008 3:42 pm

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.

Sir_Sausage
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Apr 02, 2007 7:21 pm

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

Postby Sir_Sausage » Fri Mar 07, 2008 4:08 pm

Oh Lord!

THANK YOU! :D

FrostByghte
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sat Sep 10, 2005 12:55 pm

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

Postby FrostByghte » Fri Mar 07, 2008 4:22 pm

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.

FrostByghte
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Sat Sep 10, 2005 12:55 pm

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

Postby FrostByghte » Fri Mar 14, 2008 2:22 pm

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.

efiplus
Joomla! Apprentice
Joomla! Apprentice
Posts: 45
Joined: Fri Jun 22, 2007 5:44 pm
Contact:

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

Postby efiplus » Wed Mar 19, 2008 12:42 am

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.
Professional Opensource Services
http://www.efiplus.com

User avatar
filipetorres
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Mon Sep 25, 2006 1:21 pm
Location: Recife, Brazil.
Contact:

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

Postby filipetorres » Sun Apr 20, 2008 6:32 pm

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.

kksou
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Mar 30, 2008 10:34 am

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

Postby kksou » Tue Apr 29, 2008 2:48 pm

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)

User avatar
jackbremer
Joomla! Explorer
Joomla! Explorer
Posts: 265
Joined: Wed Jul 12, 2006 5:37 pm
Location: London, UK

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

Postby jackbremer » Fri May 02, 2008 4:02 pm

Works beautifully

kksou
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Mar 30, 2008 10:34 am

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

Postby kksou » Mon May 12, 2008 2:15 pm

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?

emagin
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 136
Joined: Sun Sep 11, 2005 7:46 pm
Location: san francisco, ca usa

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

Postby emagin » Mon Jun 30, 2008 10:20 pm

This works for me too.
Thank you so much!

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


Return to “General Questions - 1.0.x”

Who is online

Users browsing this forum: No registered users and 14 guests