代码转换Joomla 1.5到Joomla 1.7 / 2.5(Code Conversion Joomla 1.5 to Joomla 1.7/2.5)

202 IT屋

am trying to convert this plugin to Joomla 1.7, as I don have extensive understanding of PHP I am not getting anywhere. Any kind of help is appreciated.

URL of the plugin: http://extensions.joomla.org/extensions/content-sharing/mailing-a-newsletter-bridges/10400

<?php
    // no direct access
    defined( '_JEXEC' ) or die( 'Restricted access' );

    jimport( 'joomla.plugin.plugin' );

    class plgSystemAutoresponder extends JPlugin{

        function onUserAfterSave($user, $isnew, $succes, $msg){
            //$mainframe->redirect("index.php?option=com_contact");//Put your new page URL here
            global $mainframe;

            // convert the user parameters passed to the event
            // to a format the external application
            $args = array();
            $args['username']   = $user['username'];
            $args['email']      = $user['email'];
            $args['fullname']   = $user['name'];
            $args['password']   = $user['password'];

            $email1 = $user['email'];
            $name1 = $args['username'];
            $email = $args['email'];
            $name = $args['username'];

            //load plugin parameters
            $plugin=&JPluginHelper::getPlugin('autoresponder');
            $pluginParams = new JParameter( $plugin->params );

            $responderUrl         = $this->params->get( 'responder_url' );
            $MetaWebFormId        = $this->params->get( 'meta_web_form_id');
            $MetaSplitId          = $this->params->get( 'meta_split_id' );
            $Unit                 = $this->params->get( 'unit' );
            $Redirect             = $this->params->get( 'redirect' );
            $MetaRedirectOnlist   = $this->params->get( 'meta_redirect_onlist' );
            $MetaAdtracking       = $this->params->get( 'meta_adtracking' );
            $MetaMessage          = $this->params->get( 'meta_message' );
            $MetaRequired         = $this->params->get( 'meta_required' );
            $MetaForwardVars      = $this->params->get( 'meta_forward_vars' );

            $mainframe->redirect($responderUrl."?from=".$email."&name=".$name."&meta_web_form_id=".$MetaWebFormId."&meta_split_id="."&unit=".$Unit."&redirect=".$Redirect."&meta_redirect_onlist=".$MetaRedirectOnlist."&meta_adtracking=".$MetaAdtracking."&meta_message=".$MetaMessage."&meta_required=".$MetaRequired."&meta_forward_vars=".$MetaForwardVars);

        }
    }
?>

I have updated the XML to Joomla 1.7. But Joomla 1.7 is giving error is line 38 and 54

Line 38:  `$pluginParams = new JParameter( $plugin->params );`
Line 54:  ` $mainframe->redirect($responderUrl."?from=".$email."&name=".$name."&meta_web_form_id=".$MetaWebFormId."&meta_split_id="."&unit=".$Unit."&redirect=".$Redirect."&meta_redirect_onlist=".$MetaRedirectOnlist."&meta_adtracking=".$MetaAdtracking."&meta_message=".$MetaMessage."&meta_required=".$MetaRequired."&meta_forward_vars=".$MetaForwardVars);`
解决方案

Take a look at http://docs.joomla.org/Adapting_a_Joomla_1.5_extension_to_Joomla_1.6 ... It says for extensions, but it includes what to do for plugins too.

我正在尝试将此插件转换为Joomla 1.7,因为我对PHP没有广泛的了解,但我无处可去。任何形式的帮助表示赞赏。



插件的网址: http://extensions.joomla.org/extensions/content-sharing/mailing-a-newsletter-bridges/10400



 <?php 
//没有直接访问
定义('_JEXEC')或死('限制访问');

jimport('joomla.plugin.plugin');

class plgSystemAutoresponder扩展JPlugin {

函数onUserAfterSave($ user,$ isnew,$ succes,$ msg){
// $ mainframe-> redirect( index.php?option = com_contact); //将您的新页面网址放在此处
global $ mainframe;

//将传递给事件
//的用户参数转换为外部应用程序的格式
$ args = array();
$ args ['username'] = $ user ['username'];
$ args ['email'] = $ user ['email'];
$ args ['fullname'] = $ user ['name'];
$ args ['password'] = $ user ['password'];

$ email1 = $ user ['email'];
$ name1 = $ args ['username'];
$ email = $ args ['email'];
$ name = $ args ['username'];

//加载插件参数
$ plugin =& JPluginHelper :: getPlugin('autoresponder');
$ pluginParams = new JParameter($ plugin-> params);

$ responderUrl = $ this-> params-> get('responder_url');
$ MetaWebFormId = $ this-> params-> get('meta_web_form_id');
$ MetaSplitId = $ this-> params-> get('meta_split_id');
$单位= $ this-> params-> get('unit');
$ Redirect = $ this-> params-> get('redirect');
$ MetaRedirectOnlist = $ this-> params-> get('meta_redirect_onlist');
$ MetaAdtracking = $ this-> params-> get('meta_adtracking');
$ MetaMessage = $ this-> params-> get('meta_message');
$ MetaRequired = $ this-> params-> get('meta_required');
$ MetaForwardVars = $ this-> params-> get('meta_forward_vars');

$ mainframe-> redirect($ responderUrl。?from =。$ email。& name =。$ name。& meta_web_form_id =。$ MetaWebFormId。& 。 meta_split_id =安培;单元= $单位。 &安培;重定向= $重定向。 &安培; meta_redirect_onlist = $ MetaRedirectOnlist。 &安培; meta_adtracking = $ MetaAdtracking。 &安培; meta_message = 。$ MetaMessage的与 & meta_required =。$ MetaRequired &安培; meta_forward_vars =。$ MetaForwardVars)。

}
}
?>


我已将XML更新为Joomla 1.7。但Joomla 1.7给出错误是第38行和第54行



 第38行:`$ pluginParams = new JParameter($ plugin-> params);`
第54行:`$ mainframe-> redirect($ responderUrl。?from =。$ email。& name =。$ name。& meta_web_form_id =。$ MetaWebFormId 。 &安培; meta_split_id = &安培;单元=。$单位 &安培;重定向=。$重定向 &安培; meta_redirect_onlist =。$ MetaRedirectOnlist &安培; meta_adtracking =。$ MetaAdtracking&安培。 ; meta_message =。$ MetaMessage。& meta_required =。$ MetaRequired。& meta_forward_vars =。$ MetaForwardVars);`

解决方案

查看 http://docs.joomla.org/Adapting_a_Joomla_1.5_extension_to_Joomla_1.6
...它表示扩展名,但它也包括插件的内容。


本文地址:IT屋 » 代码转换Joomla 1.5到Joomla 1.7 / 2.5