Halllo,
ich will einen Mambot für Komponentencontents schreiben.
Leider funktionieren meine Versuche nicht.
PHP-Code:<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall version="1.0.0" type="mambot" group="content">
<name>mosprivtemplate</name>
<author>Joomla! Project</author>
<creationDate>October 2007</creationDate>
<copyright>(C) 2005 Open Source Matters. All rights reserved.</copyright>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>1.0.0</version>
<description>Replaces {mosprivtemplate} tag in content with specified contents</description>
<files>
<filename mambot="mosprivtemplate">mosprivtemplate.php</filename>
</files>
</mosinstall>Was gibt es grundsätzlich hierbei zu beachten?PHP-Code:defined( '_VALID_MOS' ) or die( 'Restricted access' );
$_MAMBOTS->registerFunction( 'onPrepareContent', 'botPrivTemplate' );
/**
*/
function botPrivTemplate( $published, &$row ) {
global $database, $_MAMBOTS;
// define the regular expression for the bot
$regex = '/{josprivcontent}/i';
$repl = 'TEST-TEST-TEST';
$row->text = preg_replace($regex, $repl, $row->text);
return;
}
Wie bekomme ich {josprivcontent} im Komponentencontent ersetzt?
Kann mir jemand helfen?
Gruß Michael


LinkBack URL
About LinkBacks
Lesezeichen