Hi guys,
I have several times used the CF and CC to create different forms in pages on websites and I am extremely pleased with these components. So first I want to express my sincere gratitude to the authors🙂.
Recently I had to use CF and CC to create a form for registering participants in various courses through one website.
Especially in this case was that "call" to the registration form, done by PHP code added to the page content for registration in a course by another plugin (JIncludes). That part of the "calling" code:
The code is executed correctly according to the logical condition, but the page content to the course rather than the form itself "CVO_ISO_14001_reg" appears "{chronocontact} CVO_ISO_14001_reg {/ chronocontact}"?!?
After much digging and searching in the files of CC, I came across the following code in .../plugins/content/chronocontact.php :
Be doubted that the above problem is due to the fact that CC is "activated" and showing the form at the moment "onPrepareContent" page, if present string "{chronocontact} CVO_ISO_14001_reg {/ chronocontact}". But in my case does not trigger the code, because the plugin that adds "{chronocontact} CVO_ISO_14001_reg {/ chronocontact}" in the page content is executed after an event "onPrepareContent". Therefore, CC does not match the content of the page and not "called" form "CVO_ISO_14001_reg".
So I changed the event '[b] onPrepareContent [/ b]' in line 7 with 'onBeforeDisplayContent' ie (modification of line7):
After this "modification" of the code, the form "CVO_ISO_14001_reg" appears successful in the page content with the course (Hooray Hooray !!!)...
only that the top (in the first line) of the content of each page of the site began to appear digit "1" 🙄 .
Then I changed the event from the '[b] onBeforeDisplayContent [/ b]' to '[b] onAfterDisplayContent [/ b]' in line 7. Form "CVO_ISO_14001_reg" continues to appear in the content of the course page ... but this "1" began to appear at the bottom of the content...
Not that this "1" something prevented the functionality of the site ... but it is frustrating to appear at the bottom of each page of the site.
I guess this problem is not caused by CC, but unfortunately I'm not so familiar with the operation of other components of Joomla to find out what causes it??
Please if anyone can give advice - how to remove this number "1" from the content, let us help.
Thanks in advance!
I have several times used the CF and CC to create different forms in pages on websites and I am extremely pleased with these components. So first I want to express my sincere gratitude to the authors🙂.
Recently I had to use CF and CC to create a form for registering participants in various courses through one website.
Especially in this case was that "call" to the registration form, done by PHP code added to the page content for registration in a course by another plugin (JIncludes). That part of the "calling" code:
.....
if ($rest>0) {
echo "<span style=\"color: rgb(0, 139, 69); \"><strong>You can register for the course through the form::</strong></span>";
echo "{chronocontact}CVO_ISO_14001_reg{/chronocontact}";
}
else
echo "<span style=\"color: rgb(204, 0, 0); \"><strong>Atention:</strong></span>".'Further registrations are forbidden';
...
The code is executed correctly according to the logical condition, but the page content to the course rather than the form itself "CVO_ISO_14001_reg" appears "{chronocontact} CVO_ISO_14001_reg {/ chronocontact}"?!?
After much digging and searching in the files of CC, I came across the following code in .../plugins/content/chronocontact.php :
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$mainframe->registerEvent( 'onPrepareContent', 'plgContentChronocontact' );
....
Be doubted that the above problem is due to the fact that CC is "activated" and showing the form at the moment "onPrepareContent" page, if present string "{chronocontact} CVO_ISO_14001_reg {/ chronocontact}". But in my case does not trigger the code, because the plugin that adds "{chronocontact} CVO_ISO_14001_reg {/ chronocontact}" in the page content is executed after an event "onPrepareContent". Therefore, CC does not match the content of the page and not "called" form "CVO_ISO_14001_reg".
So I changed the event '[b] onPrepareContent [/ b]' in line 7 with 'onBeforeDisplayContent' ie (modification of line7):
$mainframe->registerEvent( 'onBeforeDisplayContent', 'plgContentChronocontact' );
After this "modification" of the code, the form "CVO_ISO_14001_reg" appears successful in the page content with the course (Hooray Hooray !!!)...
only that the top (in the first line) of the content of each page of the site began to appear digit "1" 🙄 .
Then I changed the event from the '[b] onBeforeDisplayContent [/ b]' to '[b] onAfterDisplayContent [/ b]' in line 7. Form "CVO_ISO_14001_reg" continues to appear in the content of the course page ... but this "1" began to appear at the bottom of the content...
Not that this "1" something prevented the functionality of the site ... but it is frustrating to appear at the bottom of each page of the site.
I guess this problem is not caused by CC, but unfortunately I'm not so familiar with the operation of other components of Joomla to find out what causes it??
Please if anyone can give advice - how to remove this number "1" from the content, let us help.
Thanks in advance!