Joomla 1.0 Articles
- How to create a module with DirectPHP plugin?
- How to include modules in Content item?
- How to include modules in Section/Content Description
- How to include PHP commands in Section/Content Description
- How to make plugins process Section/Category descriptions
- Include Code Listing plugin - More Tips and Techniques
- How to have DirectPHP plugin process RSS feed?
Joomla 1.5 Articles
- How to create a module with DirectPHP plugin?
- How to include modules in Content item?
- How to include modules in Section/Content Description
- How to include PHP commands in Section/Content Description
- How to make plugins process Section/Category descriptions
- Include Code Listing plugin - More Tips and Techniques
- How to have DirectPHP plugin process RSS feed?
|
How to include PHP commands in Section/Content Description (for Joomla 1.0.x)? |
| Written by kksou | ||
| Tuesday, 22 April 2008 | ||
|
The DirectPHP plugin which I released in March 2008 allows you to include PHP commands in content items only. This article shows you how to include PHP commands right inside Section/Category description. You can see a live example here. Solutions
Note: If you've already installed the plugin loadmodule for Section/Category Description, you can skip this step.
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, &$lists, $order,
$categories_exist ) {
global $_MAMBOTS;
$_MAMBOTS->loadBotGroup( 'content' );
$results = $_MAMBOTS->trigger( 'onBeforeDisplayTitle', array( &$title) );
global $Itemid, $mosConfig_live_site;
if ( $sectionid ) {
$id = $sectionid;
}
Current date and time is: <?php echo date('Y-m-d H:i:s');?>
You should see the current date and time displayed in the section or category description. Very Important Note about the Editor!!!If you're using the default TinyMCE WYSIWYG Editor, you will face one problem. When you first enter PHP commands into the editor, encapsulated in <?php ... ?>, everything's ok. But as soon as you click the save button, all your PHP commands will disappear! Don't worry. They are all still there. But the problem is, unlike content items, the default TinyMCE WYSIWYG Editor refuses to display anything in tags. There are two solutions to this.
User reviews There are no user reviews yet. Note: You have to be a registered member to leave a comment. Free registration here. |
||
| < Prev | Next > |
|---|

