|
Page 2 of 3 First, either download the mosbot_me.php file from here, or cut-and-paste from the following code. This file needs to be placed within the includes/ folder of your mambo server; <?php function mosbot( $field ) { global $mosConfig_absolute_path; $row->text = $field; /* include all mosbots into the script */ $bots = mosReadDirectory( "$mosConfig_absolute_path/mambots", ".php$" ); sort( $bots ); foreach( $bots as $bot ) { require "mambots/$bot"; } return $row->text; } Once created, you need to make sure it is available to all your components within Mambo by including the script. Edit /index.php on your Mambo server and include the following line, highlighted in yellow; <?php // $Id: index.php,v 1.51 2004/04/06 21:28:52 eddieajau Exp $ /** * Main index.php file * @package Mambo Open Source * @Copyright (C) 2000 - 2003 Miro International Pty Ltd * @ All rights reserved * @ Mambo Open Source is Free Software * @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html * @version $Revision: 1.51 $ **/ define( "_VALID_MOS", 1 ); if (!file_exists( "configuration.php" ) || filesize( "configuration.php") < 10) { header( "Location: installation/index.php" ); exit(); } include_once( "globals.php" ); require_once( "configuration.php" ); if ($mosConfig_offline == 1){ include( 'offline.php' ); exit(); } require_once( "classes/mambo.php" ); require_once( "includes/sef.php" ); require_once( "includes/frontend.php" ); require_once( "includes/mosbot_me.php" ); This was taken from a Mambo 4.5 (1.0.9) installation, but it should be similar for earlier versions. Once this has been completed, the hack is now available to be implemented. This is essentially done by wrapping the piece of code used to output the text, e.g. echo $text; within the mambot function, e.g. echo mosbot( $text );
|