Joomla! Discussion Forums



It is currently Wed Nov 25, 2009 5:09 am (All times are UTC )

 


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  [ 10 posts ] 
Author Message
Posted: Mon Sep 05, 2005 1:23 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Aug 30, 2005 10:09 pm
Posts: 23
I'm using the kl_php plug-in in order to use php includes in static content pages.  I tried to do the same in the categeory "description" page, but it's not working.

Does anyone know how to use a php include in the category description content?


Top
   
 
Posted: Mon Sep 12, 2005 6:41 am 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Fri Aug 19, 2005 5:30 am
Posts: 473
I'm interested in this one as well. Anyone got an idea?

Thanks

_________________
Forum Post Assistant - If you are serious about wanting help, you will use this tool when you post.


Top
  E-mail  
 
Posted: Sat Oct 01, 2005 3:38 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Sat Sep 24, 2005 7:09 pm
Posts: 3
Me too...actually, the plugin you mentioned sounds like it might help me as well...could you point me to that?

Thanks!


Top
  E-mail  
 
Posted: Sat Oct 01, 2005 10:30 pm 
Joomla! Ace
Joomla! Ace
Offline

Joined: Thu Aug 18, 2005 9:06 am
Posts: 1465
When I once tested the Mambo 4.5.3 CVS (its beens some time ago) I recognized that Mambots seem to get executed even for the descriptions of sections or categories (or both... don't remember).
But a Core Developer may enlight us about the plans (or whether it was just temporary).

_________________
http://de.siteof.de/


Top
   
 
Posted: Thu Oct 06, 2005 5:49 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Sep 22, 2005 6:27 am
Posts: 20
Location: Orange County, CA
i too am looking to execute PHP in the category/section description field.  in my previous install (Mambo 4.5 Stable 1.0.9 [Spider]) i used mosaddphp to include php pages.  i am looking for a Joomla! solution now.

i have had great success (and support) with moslate in my content.  i have also used Imbed PHP (kl_php) to write code directly inside content.  however, both of these solutions publish code without processing the PHP when put in the description field.

Code:
this is where i will put my php.
<p>
{moslate} {c:import url="https://*****.com/Proposals/4409%20-%20Close/index.php"/} {/moslate}
<p>
{kl_php}
$test = "this was written in php";
$test2 = "if you can read this then PHP is being rendered correctly";
echo $test . '.  ' . $test2 . '.';
{/kl_php}


publishes to look like:

Code:
this is where i will put my php.

{moslate} {c:import url="https://*****.com/Proposals/4409%20-%20Close/index.php"/} {/moslate}

{kl_php}
$test = "this was written in php";
$test2 = "if you can read this then PHP is being rendered correctly";
echo $test . '. ' . $test2 . '.'; {/kl_php}

i am going to do some hunting to see what i can find.  i found this thread while searching and though that i would add my thoughts and findings to it.


Top
  E-mail  
 
Posted: Thu Oct 06, 2005 6:23 pm 
Joomla! Ace
Joomla! Ace
Offline

Joined: Thu Aug 18, 2005 9:06 am
Posts: 1465
Ok guys... if you are so desperately looking for this... here is the way to hack it... based on Joomla 1.0.2:
/components/com_content/content.html.php line 59 (function showContentList):
Code:
         echo $title->description;

change to:
Code:
         echo parseContentMambots($title->description);


/components/com_content/content.html.php line 126 (function showCategories):
Code:
                  echo $row->description;

change to:
Code:
                  echo parseContentMambots($row->description);


/components/com_content/content.html.php line 702 (function Section):
Code:
            echo $row->section;

change to:
Code:
            echo parseContentMambots($row->section);


/components/com_content/content.html.php line 721 (function Category):
Code:
         echo $row->category;

change to:
Code:
         echo parseContentMambots($row->category);


And then in the end (before "?>")of content.html.php or content.php past the following:
Code:
function parseContentMambots($text, $userId = '') {
   global $_MAMBOTS, $database;
   $_MAMBOTS->loadBotGroup('content');
   $row            = new mosContent($database);
   $params            = new mosParameters('');
   $page            = 0;
   if ($userId != '') {
      $row->created_by   = intval($userId);
   }
   $row->text         = $text;
   $results         = $_MAMBOTS->trigger('onPrepareContent', array(&$row, &$params, $page), TRUE);
   $results         = $_MAMBOTS->trigger('onBeforeDisplayContent', array( &$row, &$params, $page ));
   $text            = trim(implode("\n", $results));
   $text            .= $row->text;
   $results         = $_MAMBOTS->trigger('onAfterDisplayContent', array( &$row, &$params, $page ));
   $text            .= trim(implode("\n", $results));
   return $text;
}


This should give the best compatibility with Mambots (the onPrepareContent is the important one)...
Note regarding Moslate: if you do not give the $userId (or set $row->created_by) you may have problems running the Moslates if they are not set to "public".

Have fun with it ;-)

_________________
http://de.siteof.de/


Top
   
 
Posted: Thu Oct 06, 2005 6:28 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Sep 22, 2005 6:27 am
Posts: 20
Location: Orange County, CA
wow, thats a lot of code!  thanks for all the effort  :)

looks easy enough.  i'll give it a go and see what we get.

thanks


Top
  E-mail  
 
Posted: Mon Nov 28, 2005 7:00 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 24, 2005 3:35 pm
Posts: 264
Location: Cape Town, South Africa
hi de,
just to check - will the code below allow mambots to work within a non content item? Reason i ask, is i am trying to get the smf discuss bot to work with mosets tree, by hardcoding the following into the display tip page:
Code:
{mos_smf_discuss:<?php echo $this->_MT_LANG->CURRENT_CATEGORY ?>; }


the general idea is to get the discussbot to show up on the listing page and automatically pull the category that the listing is saved under.  the end result would be a button saying "discuss this tip".

i dont know if any of that makes sense, but the response i have gotten from mosets is that it should be possible, but i would first have to get over the fact that mambots dont work out of the box in non content items...

any ideas/suggestions would be very much appreciated!
regards,
chris

_________________
http://www.joomlajunkie.com - Bringing Color to the Joomla! Community.
http://www.webmonkeys.co.za - Joomla Design and Development Services.


Top
   
 
Posted: Mon Nov 28, 2005 7:53 pm 
Joomla! Ace
Joomla! Ace
Offline

Joined: Thu Aug 18, 2005 9:06 am
Posts: 1465
Hi Chris,
I don't know much about SMF but in general it should work with most content Mambots that are only interested in the text part.
However, how would SMF know the current category? So far you seem to give a localised title or localisation of "current category" which should not be used to identify anything. But this is just guessing.
But maybe try it out.
Daniel

_________________
http://de.siteof.de/


Top
   
 
Posted: Tue Dec 06, 2005 2:24 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Wed Aug 24, 2005 3:35 pm
Posts: 264
Location: Cape Town, South Africa
Hi Daniel,
Yeah that was a bit of a boo boo on my part - didnt look at what i was posting properly ;) I got the mambot showing up on mosets in the end (turns out that they have mambots enabled in mosets). Anywho, i have decided to go with Punbo for the forum, which is perfectly integrated :) We just have to wait for the discussbot to be released for punbo. We have officially launched the site today, so safe to say i am pretty stoked! Check it out at http://www.joomlatips.com
Cheers
Chris

_________________
http://www.joomlajunkie.com - Bringing Color to the Joomla! Community.
http://www.webmonkeys.co.za - Joomla Design and Development Services.


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

Quick reply

 



Who is online

Users browsing this forum: princegen, zantetzuken and 29 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 © 2000, 2002, 2005, 2007 phpBB Group