The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 17 posts ] 
Author Message
PostPosted: Sat Dec 08, 2007 4:45 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Sep 10, 2005 12:55 pm
Posts: 26
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:
//  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.


Top
 Profile  
 
PostPosted: Sat Dec 08, 2007 8:57 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Tue May 09, 2006 5:37 am
Posts: 1506
Location: Arid-Zona
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.

_________________
http://www.motherroaddesigns.com


Top
 Profile  
 
PostPosted: Mon Dec 10, 2007 4:35 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Sep 10, 2005 12:55 pm
Posts: 26
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.


Top
 Profile  
 
PostPosted: Mon Dec 10, 2007 6:42 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Mon Aug 29, 2005 10:17 am
Posts: 13496
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
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 : http://gws-desk.com --
-- Good & Cheap Joomla Sites Ready To Roll : http://gws-deals.today --
-- Joomla Specialized Hosting Solutions : www.gws-host.com --
-- Member Joomla Bug Squad --


Top
 Profile  
 
PostPosted: Mon Dec 10, 2007 7:08 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Sep 10, 2005 12:55 pm
Posts: 26
Blarg...thanks for taking a peek.  Per pm, if you have any interest in tackling this further please let me know.


Top
 Profile  
 
PostPosted: Wed Jan 09, 2008 3:50 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Oct 13, 2005 9:12 am
Posts: 21
Location: UK
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.


Top
 Profile  
 
PostPosted: Fri Mar 07, 2008 1:29 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Apr 02, 2007 7:21 pm
Posts: 6
Is there still no solution for that problem?
Please let us know!

:)


Top
 Profile  
 
PostPosted: Fri Mar 07, 2008 3:42 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Sep 10, 2005 12:55 pm
Posts: 26
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:
                    if ( $descrip && $description->description ) {
                                echo $description->description;
                        }


Now after you comment the above out add this right after it:

Code:
//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:
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:
                 //  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:
                $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:
                //  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.


Top
 Profile  
 
PostPosted: Fri Mar 07, 2008 4:08 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Apr 02, 2007 7:21 pm
Posts: 6
Oh Lord!

THANK YOU! :D


Top
 Profile  
 
PostPosted: Fri Mar 07, 2008 4:22 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Sep 10, 2005 12:55 pm
Posts: 26
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.


Top
 Profile  
 
PostPosted: Fri Mar 14, 2008 2:22 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Sep 10, 2005 12:55 pm
Posts: 26
In the newer 1.0.15 on that last patch I listed, look for this line:

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


Top
 Profile  
 
PostPosted: Wed Mar 19, 2008 12:42 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Jun 22, 2007 5:44 pm
Posts: 45
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


Top
 Profile  
 
PostPosted: Sun Apr 20, 2008 6:32 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Mon Sep 25, 2006 1:21 pm
Posts: 64
Location: Recife, Brazil.
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.


Top
 Profile  
 
PostPosted: Tue Apr 29, 2008 2:48 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 30, 2008 10:34 am
Posts: 20
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)

_________________
Regards,
/kksou
http://www.kksou.com/php-gtk2/Joomla/Di ... plugin.php


Top
 Profile  
 
PostPosted: Fri May 02, 2008 4:02 pm 
User avatar
Joomla! Explorer
Joomla! Explorer

Joined: Wed Jul 12, 2006 5:37 pm
Posts: 265
Location: London, UK
Works beautifully


Top
 Profile  
 
PostPosted: Mon May 12, 2008 2:15 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Mar 30, 2008 10:34 am
Posts: 20
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?

_________________
Regards,
/kksou
http://www.kksou.com/php-gtk2/Joomla/Di ... plugin.php


Top
 Profile  
 
PostPosted: Mon Jun 30, 2008 10:20 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Sep 11, 2005 7:46 pm
Posts: 136
Location: san francisco, ca usa
This works for me too.
Thank you so much!

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 



Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group