I have gotten plugins to load correctly in joomla 1.5 contacts by adding some code to the template override:
this way i can have onPrepareContent trigger run on Joomla 1.5 contacts. However, when the chronocontact plugin is enabled, i get the following error on all contact page:
any ideas?
templates/[template]/html/com_contact/contact/default_address.php
<?php
$dispatcher =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$results = $dispatcher->trigger('onPrepareContent',
array (&$this->contact->misc, $this->contact->params, 0));
echo $this->contact->misc;
?>
this way i can have onPrepareContent trigger run on Joomla 1.5 contacts. However, when the chronocontact plugin is enabled, i get the following error on all contact page:
Warning: Attempt to assign property of non-object in /home/mysite/public_html/plugins/content/chronocontact.php on line 18
any ideas?
Hi yourmanstan,
That's a bit esoteric. Line 18 is
However, it's a PHP Warning and not an error so you can probably suppress it by setting Error Reporting in your site Global Config to System Default or lower.
Bob
That's a bit esoteric. Line 18 is
$row->text = preg_replace_callback( $regex, 'showform2', $row->text )
so my guess is that $row isn't defined when this is called.
However, it's a PHP Warning and not an error so you can probably suppress it by setting Error Reporting in your site Global Config to System Default or lower.
Bob
thank you for the response.
i am showing line 18 as:
or actually, line 18 is immediately after that code...
also, this warning stops the bot from processing and the form does not display. {chronocontact}myform{/chronocontact} still shows
i am showing line 18 as:
$plugin =& JPluginHelper::getPlugin('content', 'chronocontact');
or actually, line 18 is immediately after that code...
also, this warning stops the bot from processing and the form does not display. {chronocontact}myform{/chronocontact} still shows
Hi Yourmanstan,
I just re-downloaded the mambot to check. Here are the first 21 lines:
What are you trying to do here? Is it not simpler just to replace the contacts page with a form? Or do you have many contacts that you need to list?
I'm afraid that it just isn't possible for me to debug quite such unusual hacks on the forum here.
Bob
I just re-downloaded the mambot to check. Here are the first 21 lines:
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$mainframe->registerEvent( 'onPrepareContent', 'botchronocontact' );
function botchronocontact( &$row, &$params, $page=0 ) {
//global $mosConfig_absolute_path;
$plugin =& JPluginHelper::getPlugin('content', 'chronocontact');
// define the regular expression for the bot
$regex = "#{chronocontact}(.*?){/chronocontact}#s";
/*if (!$published) {
$row->text = preg_replace( $regex, '', $row->text );
return;
}*/
$GLOBALS['_MAMBOT_CHRONOCONTACT_PARAMS'] =& $params;
$row->text = preg_replace_callback( $regex, 'showform2', $row->text );
// ^^^^ the line above is line 18 ^^^^
return true;
}
so I'm still with my previous reply.
What are you trying to do here? Is it not simpler just to replace the contacts page with a form? Or do you have many contacts that you need to list?
I'm afraid that it just isn't possible for me to debug quite such unusual hacks on the forum here.
Bob
for some reason, mine is showing several additional empty lines in dreamweaver.
i did this change to the contacts, but i also would like to do the same in other places that do not have the 'onPrepareContent' trigger...ex: modules so that we can have forms showing in modules without needing the content item module.
I'm surprised that I can't find other posts on this for joomla 1.5, i think it would be something alot of people would want to be able to do.
i did this change to the contacts, but i also would like to do the same in other places that do not have the 'onPrepareContent' trigger...ex: modules so that we can have forms showing in modules without needing the content item module.
I'm surprised that I can't find other posts on this for joomla 1.5, i think it would be something alot of people would want to be able to do.
Hi yourmanstan,
I don't have Dreamweaver but maybe it folds long lines and still counts them - happens with one of my editors but not the other.
This is on the edge of my knowledge - I've so far almost avoided digging around the Joomla PlugIn code. But I do recall that there are two similar triggers 'onPrepareContent' and 'onBeforeDisplayContent'. I recently had to switch the calls for a PlugIn to get it to work where I wanted it to.
Perhaps the same kind of thing would work with CF??
Bob
I don't have Dreamweaver but maybe it folds long lines and still counts them - happens with one of my editors but not the other.
This is on the edge of my knowledge - I've so far almost avoided digging around the Joomla PlugIn code. But I do recall that there are two similar triggers 'onPrepareContent' and 'onBeforeDisplayContent'. I recently had to switch the calls for a PlugIn to get it to work where I wanted it to.
Perhaps the same kind of thing would work with CF??
Bob
Hi yourmanstan,
Regarding the line breaks issue, i think you downloaded the file through FTP, try getting it from the package directly!
I can't understand, you have the bot working but this error is annoying you or this error appears and the bot doesn't work completely ?
Cheers
Max
Regarding the line breaks issue, i think you downloaded the file through FTP, try getting it from the package directly!
I can't understand, you have the bot working but this error is annoying you or this error appears and the bot doesn't work completely ?
Cheers
Max
Hi Max,
If I understand correctly, he's hacked his template code to get the ChronoForms bot to run in the Contacts Component (which doesn't support content bots).
Bob
If I understand correctly, he's hacked his template code to get the ChronoForms bot to run in the Contacts Component (which doesn't support content bots).
Bob
Here is a solution in response to the orginal message posted on this thread by yourmanstan
I have replaced the use of $this->contact->misc with a JView object which satisfies the requirements of the plugin. Therefore no more warning messages.
I must say, I would have thought this would be a common request to replace the standard contact form, with a Chronoform without having duplicate contact details (contact details outside the contacts component)
templates/[template]/html/com_contact/contact/default_address.php
<?php
$dispatcher =& JDispatcher::getInstance();
JPluginHelper::importPlugin('content');
$article = new JView();
$article->text = $this->contact->misc;
$results = $dispatcher->trigger('onPrepareContent',
array (&$article, $this->contact->params, 0));
echo $article->text;
?>
I have replaced the use of $this->contact->misc with a JView object which satisfies the requirements of the plugin. Therefore no more warning messages.
I must say, I would have thought this would be a common request to replace the standard contact form, with a Chronoform without having duplicate contact details (contact details outside the contacts component)
This topic is locked and no more replies can be posted.