| Joomla! http://forum.joomla.org/ |
|
| php includes in category description? http://forum.joomla.org/viewtopic.php?f=32&t=3733 |
Page 1 of 1 |
| Author: | dcnine [ Mon Sep 05, 2005 1:23 am ] |
| Post subject: | php includes in category description? |
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? |
|
| Author: | PavlovaPete [ Mon Sep 12, 2005 6:41 am ] |
| Post subject: | Re: php includes in category description? |
I'm interested in this one as well. Anyone got an idea? Thanks |
|
| Author: | wildbill [ Sat Oct 01, 2005 3:38 pm ] |
| Post subject: | Re: php includes in category description? |
Me too...actually, the plugin you mentioned sounds like it might help me as well...could you point me to that? Thanks! |
|
| Author: | de [ Sat Oct 01, 2005 10:30 pm ] |
| Post subject: | Re: php includes in category description? |
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). |
|
| Author: | whiffer [ Thu Oct 06, 2005 5:49 pm ] |
| Post subject: | Re: php includes in category description? |
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. |
|
| Author: | de [ Thu Oct 06, 2005 6:23 pm ] |
| Post subject: | Re: php includes in category description? |
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 ;-) |
|
| Author: | whiffer [ Thu Oct 06, 2005 6:28 pm ] |
| Post subject: | Re: php includes in category description? |
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 |
|
| Author: | mambostoked [ Mon Nov 28, 2005 7:00 pm ] |
| Post subject: | Re: php includes in category description? |
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 |
|
| Author: | de [ Mon Nov 28, 2005 7:53 pm ] |
| Post subject: | Re: php includes in category description? |
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 |
|
| Author: | mambostoked [ Tue Dec 06, 2005 2:24 pm ] |
| Post subject: | Re: php includes in category description? |
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 |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|