After some frustrating hours today looking for a Joomla 1.5 plugin to give content access depending on login status I found out that all plugins to do this are either commercial or only for Joomla 1.0.
So I found this page
http://www.nik-it.de/joomla/development/joomla-1.0-extensions-zu-joomla-1.5-kompatibel-machen.html
that really helped me to change the 5 lines in the source code to make
MosIf work with Joomla 1.5
The steps are:
first get the MosIf plugin
http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,2298/Itemid,35/,
then go to the plugins/content directory and apply the patch given below.
--- mosif_orig.php 2008-03-17 13:24:36.332004848 +0100 +++ mosif.php 2008-03-17 13:44:54.080561784 +0100 @@ -7,14 +7,19 @@ * See readme.txt and homepage for details * http://www.kreacom.dk/mambots/mosif.html * +* patched by Torsten Ziegler info@ziegi.de to work with joomla 1.5 +* all changes marked with //ziegi **/ -defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); +//ziegi defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); +defined( '_JEXEC' ) or die( 'Restricted access' ); -$_MAMBOTS->registerFunction( 'onPrepareContent', 'mosIf' ); +//ziegi $_MAMBOTS->registerFunction( 'onPrepareContent', 'mosIf' ); +$mainframe->registerEvent( 'onPrepareContent', 'mosIf' ); -function mosIf( $published, &$row, &$params, $page ) { - if(!$published) return true; +//ziegi function mosIf( $published, &$row, &$params, $page ) { +function mosIf( &$row, &$params, $page=0 ) { +//ziegi if(!$published) return true; //print_r($row); global $mosif_author; $mosif_author = $row->author;
Keine Einträge
Keine Einträge im Gästebuch gefunden.