Skip to content

Commit

Permalink
3.0.7.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
exstreme committed Apr 28, 2021
1 parent b7c6670 commit c00b2f6
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 77 deletions.
2 changes: 1 addition & 1 deletion administrator/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class JCommentsVersion
/** @var int Main Release Level */
var $RELEASE = '3.0';
/** @var int Sub Release Level */
var $DEV_LEVEL = '7.7';
var $DEV_LEVEL = '7.7.1';
/** @var string Development Status */
var $DEV_STATUS = '';
/** @var int Build Number */
Expand Down
Binary file added com_jcomments_v3.0.7.7.1.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion jcomments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<authorUrl>http://www.joomlatune.ru</authorUrl>
<copyright>Copyright 2006-2018 JoomlaTune.ru All rights reserved!</copyright>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<version>3.0.7.7</version>
<version>3.0.7.7.1</version>
<description><![CDATA[JComments lets your users comment on content items.]]></description>

<scriptfile>script.jcomments.php</scriptfile>
Expand Down
158 changes: 85 additions & 73 deletions site/tpl/default/tpl_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
if (version_compare(JVERSION, '3.4', 'ge')) {
JHtml::_('behavior.formvalidator');
} else {
JHtml::_('behavior.formvalidation'); }

JHtml::_('behavior.formvalidation');
}


/**
Expand All @@ -27,7 +27,7 @@ class jtt_tpl_form extends JoomlaTuneTemplate
function render()
{
if ($this->getVar('comments-form-message', 0) == 1) {
$this->getMessage( $this->getVar('comments-form-message-text') );
$this->getMessage($this->getVar('comments-form-message-text'));
return;
}

Expand Down Expand Up @@ -58,9 +58,9 @@ function getCommentsFormFull()
?>
<span><?php echo JText::_('FORM_HEADER'); ?></span>
<?php
if ($this->getVar( 'comments-form-policy', 0) == 1) {
if ($this->getVar('comments-form-policy', 0) == 1) {
?>
<div class="comments-policy"><?php echo $this->getVar( 'comments-policy' ); ?></div>
<div class="comments-policy"><?php echo $this->getVar('comments-policy'); ?></div>
<?php
}
?>
Expand All @@ -71,23 +71,24 @@ function getCommentsFormFull()
$this->getFormFields($htmlFormPrepend);
?>
<?php
if ($this->getVar( 'comments-form-user-name', 1) == 1) {
if ($this->getVar('comments-form-user-name', 1) == 1) {
$text = ($this->getVar('comments-form-user-name-required', 1) == 0) ? JText::_('FORM_NAME') : JText::_('FORM_NAME_REQUIRED');
?>
<p>
<span>
<input id="comments-form-name" type="text" name="name" value="" maxlength="<?php echo $this->getVar('comment-name-maxlength');?>" size="22" tabindex="1" />
<input id="comments-form-name" type="text" name="name" value=""
maxlength="<?php echo $this->getVar('comment-name-maxlength'); ?>" size="22" tabindex="1"/>
<label for="comments-form-name"><?php echo $text; ?></label>
</span>
</p>
<?php
}
if ($this->getVar( 'comments-form-user-email', 1) == 1) {
if ($this->getVar('comments-form-user-email', 1) == 1) {
$text = ($this->getVar('comments-form-email-required', 1) == 0) ? JText::_('FORM_EMAIL') : JText::_('FORM_EMAIL_REQUIRED');
?>
<p>
<span>
<input id="comments-form-email" type="text" name="email" value="" size="22" tabindex="2" />
<input id="comments-form-email" type="text" name="email" value="" size="22" tabindex="2"/>
<label for="comments-form-email"><?php echo $text; ?></label>
</span>
</p>
Expand All @@ -98,7 +99,7 @@ function getCommentsFormFull()
?>
<p>
<span>
<input id="comments-form-homepage" type="text" name="homepage" value="" size="22" tabindex="3" />
<input id="comments-form-homepage" type="text" name="homepage" value="" size="22" tabindex="3"/>
<label for="comments-form-homepage"><?php echo $text; ?></label>
</span>
</p>
Expand All @@ -109,7 +110,7 @@ function getCommentsFormFull()
?>
<p>
<span>
<input id="comments-form-title" type="text" name="title" value="" size="22" tabindex="4" />
<input id="comments-form-title" type="text" name="title" value="" size="22" tabindex="4"/>
<label for="comments-form-title"><?php echo $text; ?></label>
</span>
</p>
Expand All @@ -126,38 +127,41 @@ function getCommentsFormFull()
?>
<p>
<span>
<input class="checkbox" id="comments-form-subscribe" type="checkbox" name="subscribe" value="1" tabindex="5" />
<label for="comments-form-subscribe"><?php echo JText::_('FORM_SUBSCRIBE'); ?></label><br />
<input class="checkbox" id="comments-form-subscribe" type="checkbox" name="subscribe" value="1" tabindex="5"/>
<label for="comments-form-subscribe"><?php echo JText::_('FORM_SUBSCRIBE'); ?></label><br/>
</span>
</p>
<?php
}
if ($this->getVar('var_show_checkbox_terms_of_use',0) == 1) {
?>
<p id="checkbox_terms_of_use_css">
</p>
<?php
}
if ($this->getVar('var_show_checkbox_terms_of_use', 0) == 1) {
?>
<p id="checkbox_terms_of_use_css">
<span>
<input class="checkbox" id="show_checkbox_terms_of_use" type="checkbox" name="name_checkbox_terms_of_use" value="1" tabindex="5" />
<label for="show_checkbox_terms_of_use"><?php echo JText::_('FORM_ACCEPT_TERMS_OF_USE'); ?></label><br />
<input class="checkbox" id="show_checkbox_terms_of_use" type="checkbox" name="name_checkbox_terms_of_use"
value="1" tabindex="5"/>
<label for="show_checkbox_terms_of_use"><?php echo JText::_('FORM_ACCEPT_TERMS_OF_USE'); ?></label><br/>
</span>
</p>
<?php
}
if ($this->getVar('comments-form-captcha', 0) == 1) {
$html = $this->getVar('comments-form-captcha-html');
if ($html == 'kcaptcha') {
$link = JCommentsFactory::getLink('captcha');
?>
<p>
</p>
<?php
}
if ($this->getVar('comments-form-captcha', 0) == 1) {
$html = $this->getVar('comments-form-captcha-html');
if ($html == 'kcaptcha') {
$link = JCommentsFactory::getLink('captcha');
?>
<p>
<span>
<img class="captcha" id="comments-form-captcha-image" src="<?php echo $link; ?>" width="121" height="60" alt="<?php echo JText::_('FORM_CAPTCHA'); ?>" /><br />
<span class="captcha" id="captcha-span-jc" ><?php echo JText::_('FORM_CAPTCHA_REFRESH'); ?></span><br />
<input class="captcha" id="comments-form-captcha" type="text" name="captcha_refid" value="" size="5" tabindex="6" /><br />
<img class="captcha" id="comments-form-captcha-image" src="<?php echo $link; ?>" width="121" height="60"
alt="<?php echo JText::_('FORM_CAPTCHA'); ?>"/><br/>
<span class="captcha" id="captcha-span-jc"><?php echo JText::_('FORM_CAPTCHA_REFRESH'); ?></span><br/>
<input class="captcha" id="comments-form-captcha" type="text" name="captcha_refid" value="" size="5"
tabindex="6"/><br/>
</span>
</p>
<?php
} else {
$recaptcha = JCaptcha::getInstance($html, array('namespace' => 'jcomments'));
echo $recaptcha->display('recaptcha', 'dynamic_recaptcha_1','g-recaptcha');
echo $recaptcha->display('recaptcha', 'dynamic_recaptcha_1', 'g-recaptcha');
?>
<?php
}
Expand All @@ -167,39 +171,47 @@ function getCommentsFormFull()
$this->getFormFields($htmlFormAppend);
?>
<div id="comments-form-buttons">
<div class="btn" id="comments-form-send"><div><a href="#" tabindex="7" title="<?php echo JText::_('FORM_SEND_HINT'); ?>"><?php echo JText::_('FORM_SEND'); ?></a></div></div>
<div class="btn" id="comments-form-cancel" style="display:none;"><div><a href="#" tabindex="8" title="<?php echo JText::_('FORM_CANCEL'); ?>"><?php echo JText::_('FORM_CANCEL'); ?></a></div></div>
<div class="btn" id="comments-form-send">
<div><a href="#" tabindex="7"
title="<?php echo JText::_('FORM_SEND_HINT'); ?>"><?php echo JText::_('FORM_SEND'); ?></a>
</div>
</div>
<div class="btn" id="comments-form-cancel" style="display:none;">
<div><a href="#" tabindex="8"
title="<?php echo JText::_('FORM_CANCEL'); ?>"><?php echo JText::_('FORM_CANCEL'); ?></a>
</div>
</div>
<div style="clear:both;"></div>
</div>
<div>
<input type="hidden" name="object_id" value="<?php echo $object_id; ?>" />
<input type="hidden" name="object_group" value="<?php echo $object_group; ?>" />
<input type="hidden" name="object_id" value="<?php echo $object_id; ?>"/>
<input type="hidden" name="object_group" value="<?php echo $object_group; ?>"/>
</div>
</form>
<!--<script type="text/javascript">-->
<?php
$script="
$script = "
function JCommentsInitializeForm()
{
var jcEditor = new JCommentsEditor('comments-form-comment', true);
";
if ($this->getVar('comments-form-bbcode', 0) == 1) {
$bbcodes = array( 'b'=> array(0 => JText::_('FORM_BBCODE_B'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT'))
, 'i'=> array(0 => JText::_('FORM_BBCODE_I'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT'))
, 'u'=> array(0 => JText::_('FORM_BBCODE_U'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT'))
, 's'=> array(0 => JText::_('FORM_BBCODE_S'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT'))
, 'img'=> array(0 => JText::_('FORM_BBCODE_IMG'), 1 => JText::_('BBCODE_HINT_ENTER_FULL_URL_TO_THE_IMAGE'))
, 'url'=> array(0 => JText::_('FORM_BBCODE_URL'), 1 => JText::_('BBCODE_HINT_ENTER_FULL_URL'))
, 'hide'=> array(0 => JText::_('FORM_BBCODE_HIDE'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT_TO_HIDE_IT_FROM_UNREGISTERED'))
, 'quote'=> array(0 => JText::_('FORM_BBCODE_QUOTE'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT_TO_QUOTE'))
, 'list'=> array(0 => JText::_('FORM_BBCODE_LIST'), 1 => JText::_('BBCODE_HINT_ENTER_LIST_ITEM_TEXT'))
$bbcodes = array('b' => array(0 => JText::_('FORM_BBCODE_B'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT'))
, 'i' => array(0 => JText::_('FORM_BBCODE_I'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT'))
, 'u' => array(0 => JText::_('FORM_BBCODE_U'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT'))
, 's' => array(0 => JText::_('FORM_BBCODE_S'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT'))
, 'img' => array(0 => JText::_('FORM_BBCODE_IMG'), 1 => JText::_('BBCODE_HINT_ENTER_FULL_URL_TO_THE_IMAGE'))
, 'url' => array(0 => JText::_('FORM_BBCODE_URL'), 1 => JText::_('BBCODE_HINT_ENTER_FULL_URL'))
, 'hide' => array(0 => JText::_('FORM_BBCODE_HIDE'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT_TO_HIDE_IT_FROM_UNREGISTERED'))
, 'quote' => array(0 => JText::_('FORM_BBCODE_QUOTE'), 1 => JText::_('BBCODE_HINT_ENTER_TEXT_TO_QUOTE'))
, 'list' => array(0 => JText::_('FORM_BBCODE_LIST'), 1 => JText::_('BBCODE_HINT_ENTER_LIST_ITEM_TEXT'))
);

foreach($bbcodes as $k=>$v) {
if ($this->getVar('comments-form-bbcode-' . $k , 0) == 1) {
foreach ($bbcodes as $k => $v) {
if ($this->getVar('comments-form-bbcode-' . $k, 0) == 1) {
$title = trim(JCommentsText::jsEscape($v[0]));
$text = trim(JCommentsText::jsEscape($v[1]));
$script.="
$script .= "
jcEditor.addButton('$k','$title','$text');
";
}
Expand All @@ -208,7 +220,7 @@ function JCommentsInitializeForm()

$customBBCodes = $this->getVar('comments-form-custombbcodes');
if (!empty($customBBCodes)) {
foreach($customBBCodes as $code) {
foreach ($customBBCodes as $code) {
if ($code->button_enabled) {
$k = 'custombbcode' . $code->id;
$title = trim(JCommentsText::jsEscape($code->button_title));
Expand All @@ -217,51 +229,49 @@ function JCommentsInitializeForm()
$close_tag = $code->button_close_tag;
$icon = $code->button_image;
$css = $code->button_css;
$script.="
$script .= "
jcEditor.addButton('$k','$title','$text','$open_tag','$close_tag','$css','$icon');
";
}
}
}

$smiles = $this->getVar( 'comment-form-smiles' );
$smiles = $this->getVar('comment-form-smiles');

if (isset($smiles)) {
if (!empty($smiles) > 0) {
$script.="
jcEditor.initSmiles('".$this->getVar( "smilesurl" )."');
if (!empty($smiles)) {
$script .= "
jcEditor.initSmiles('" . $this->getVar("smilesurl") . "');
";
foreach ($smiles as $code => $icon) {
$code = trim(JCommentsText::jsEscape($code));
$icon = trim(JCommentsText::jsEscape($icon));
$script.="
foreach ($smiles as $code => $icon) {
$code = trim(JCommentsText::jsEscape($code));
$icon = trim(JCommentsText::jsEscape($icon));
$script .= "
jcEditor.addSmile('$code','$icon');
";
}
}
}
if ($this->getVar( 'comments-form-showlength-counter', 0) == 1) {
$script.="
jcEditor.addCounter(".$this->getVar('comment-maxlength').", '".JText::_('FORM_CHARSLEFT_PREFIX')."', '".JText::_('FORM_CHARSLEFT_SUFFIX')."', 'counter');
if ($this->getVar('comments-form-showlength-counter', 0) == 1) {
$script .= "
jcEditor.addCounter(" . $this->getVar('comment-maxlength') . ", '" . JText::_('FORM_CHARSLEFT_PREFIX') . "', '" . JText::_('FORM_CHARSLEFT_SUFFIX') . "', 'counter');
";
}
$script.=" jcomments.setForm(new JCommentsForm('comments-form', jcEditor));
$script .= " jcomments.setForm(new JCommentsForm('comments-form', jcEditor));
}
";
if ($this->getVar('comments-form-ajax', 0) == 1) {
$script.="
$script .= "
setTimeout(JCommentsInitializeForm, 100);
";
} else {
$script.="
$script .= "
if (window.addEventListener) {window.addEventListener('load',JCommentsInitializeForm,false);}
else if (document.addEventListener){document.addEventListener('load',JCommentsInitializeForm,false);}
else if (window.attachEvent){window.attachEvent('onload',JCommentsInitializeForm);}
else {if (typeof window.onload=='function'){var oldload=window.onload;window.onload=function(){oldload();JCommentsInitializeForm();}} else window.onload=JCommentsInitializeForm;}
";
}
$script.="
$script .= "
//-->";
//</script>
JFactory::getDocument()->addScriptDeclaration($script);
Expand All @@ -281,7 +291,9 @@ function getCommentsFormLink()
$object_group = $this->getVar('comment-object_group');
?>
<div id="comments-form-link">
<a id="addcomments" href="#addcomments" class="showform" data-object_id="<?php echo $object_id; ?>" data-object_group"<?php echo $object_group; ?>" href="#addcomments" ><?php echo JText::_('FORM_HEADER'); ?></a>
<a id="addcomments" href="#addcomments" class="showform" data-object_id="<?php echo $object_id; ?>"
data-object_group"<?php echo $object_group; ?>" href="#addcomments"
><?php echo JText::_('FORM_HEADER'); ?></a>
</div>
<?php
}
Expand All @@ -291,7 +303,7 @@ function getCommentsFormLink()
* Displays service message
*
*/
function getMessage( $text )
function getMessage($text)
{
$htmlBeforeForm = $this->getVar('comments-html-before-form');
$htmlAfterForm = $this->getVar('comments-html-after-form');
Expand All @@ -312,7 +324,7 @@ function getFormFields($fields)
if (!empty($fields)) {
$fields = is_array($fields) ? $fields : array($fields);

foreach($fields as $field) {
foreach ($fields as $field) {

$labelElement = '';
$inputElement = '';
Expand Down
4 changes: 2 additions & 2 deletions update-jcomments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
<description>JComments lets your users comment on content items</description>
<element>com_jcomments</element>
<type>component</type>
<version>3.0.7.7</version>
<version>3.0.7.7.1</version>
<infourl title="JComments">https://github.com/exstreme/Jcomments-Recaptcha2</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/exstreme/Jcomments-Recaptcha2/raw/Develop/com_jcomments_v3.0.7.6.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/exstreme/Jcomments-Recaptcha2/raw/Develop/com_jcomments_v3.0.7.7.1.zip</downloadurl>
</downloads>
<tags>
<tag>Stable</tag>
Expand Down

0 comments on commit c00b2f6

Please sign in to comment.