Hallo,
ich habe meinen ersten Mambot geschrieben. Momentan macht der nichts anderes als einen Text in H1 auszugeben; einfach zum testen. Ich konnte den Mabot auch installieren. Allerdings geschieht folgendes, wenn ich ihn publiziere. Die H1 wir als aller erstes ausgegeben, noch vor der eigentlichen Seitenüberschrift. Und das auf jeder Seite. Eigentlich wollte ich, dass der Text nur dort erscheint, wo ich den Mambot mit {mosimmolist} einbinde.
Hier der Code
Un hier die XML Datei:PHP-Code:<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this script is not allowed');
$_MAMBOTS->registerFunction( 'onPrepareContent', 'botMosImmoList' );
function botMosImmoList( $published, &$row )
{
if( !$published )
{
$row->text = preg_replace( '/{moshotlink[^}]*}/s', '', $row->text ) ;
return true ;
}
echo "<h1>Das ist H1</h1>" ;
echo "<h2>Das ist H1</h2>" ;
echo "<h3>Das ist H1</h3>" ;
echo "<h4>Das ist H1</h4>" ;
echo "<h5>Das ist H1</h5>" ;
echo "<h6>Das ist H1</h6>" ;
return true ;
}
?>
Danke schon mal im voraus für die Hilfe.PHP-Code:<?xml version="1.0" encoding="iso-8859-1"?>
<mosinstall type="mambot" group="content" version="1.0">
<name>IS24 Object List</name>
<author>Thomas Grasse</author>
<creationDate>November 15, 2006</creationDate>
<copyright>(C) 2006 Thomas Grasse</copyright>
<license>GNU GPL</license>
<version>0.1</version>
<description>Lists Immobilienscout24 objects</description>
<files>
<filename mambot="mosimmolist">mosimmolist.php</filename>
</files>
<params/>
</mosinstall>
Thomas


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen