#1 2013-10-05 11:41:28

ukyo
Community Manager
From: Marmaris - Turkey
Registered: 2010-05-19
Posts: 734
Website

Comments Module

This module allow you to use manage Comments.

Updated : 10.02.2014

  • Module Setting : Page drag & drop added for display module for wanted
    pages. Module -> Settings

  • Little corrections.

Updated : 19.10.2013

  • Times ago added (Comment posted * seconds ago, * weeks ago, etc...)

  • Gravatar corrected

  • Version Updated to 0.9.1

You can find usage of module on Github Page

Download Latest Version

NOTE : After copy Folders under files_for_your_template to your template. You can delete this folder,
After donwload file, remove version number from module folder.


<ion:ukyo from="Turkey" />
Ionize CMS Türkçe Dil Çeviri Dosyaları | My Github Repositories
Please send your first message to a forum section, not forum users or administration.

Offline

#2 2013-10-06 11:10:00

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: Comments Module

hmm Something is wrong:
Never mind, i downloadded wrong version smile

Last edited by adaliszk (2013-10-06 11:35:11)


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#3 2013-10-09 18:25:27

rmartinez
Member
Registered: 2013-01-16
Posts: 88

Re: Comments Module

Hi ukyo,

I've installed the new version of your module and I've noticed a couple of things:

  1. The option to send emails after submit a comment is disabled, the code exists but it's commented. Why?

  2. There is a bug in the function tag_gravatar in comments_tag.php. You have to get the email from $tag->locals->article_comment["email"] not from $tag->locals->comment["email"]

Furthermore, although everything works fine, it shows me on the bottom of the screen the following error in the public part:

Array
(
    [from] => article_comment
)
Tag error : <ion: from="article_comment">
PHP error : Declaration of Comments_model::save() should be compatible with that of Base_model::save()
in expression : 
file : /home/mydomain/www/modules/Comments/models/comments_model.php

Any idea to help me?

Thanks.

Regards.

Offline

#4 2013-10-09 19:54:24

ukyo
Community Manager
From: Marmaris - Turkey
Registered: 2010-05-19
Posts: 734
Website

Re: Comments Module

Answers :

1. Commented because i didn't test it.
2. I fixed it, i will update version
3. <ion: from="article_comment"> what is this tag? Can you paste your codes.


<ion:ukyo from="Turkey" />
Ionize CMS Türkçe Dil Çeviri Dosyaları | My Github Repositories
Please send your first message to a forum section, not forum users or administration.

Offline

#5 2013-10-19 16:18:39

ukyo
Community Manager
From: Marmaris - Turkey
Registered: 2010-05-19
Posts: 734
Website

Re: Comments Module

Module updated...


<ion:ukyo from="Turkey" />
Ionize CMS Türkçe Dil Çeviri Dosyaları | My Github Repositories
Please send your first message to a forum section, not forum users or administration.

Offline

#6 2013-10-24 10:26:03

rmartinez
Member
Registered: 2013-01-16
Posts: 88

Re: Comments Module

ukyo wrote:

Answers :

3. <ion: from="article_comment"> what is this tag? Can you paste your codes.

Hi again,

This problem only appears when I try to use the tag <ion:status expression='status==0'> or the tag <ion:admin expression="==1">. The error appears using your article_comments.php even. If I don´t use these tags, it don´t show me any error.

Like I said before, the problem only is visual because it always works fine with or without these tags. The last update didn't fix it.

Can this help you to fix it? Do you want more information?

Regards.

Offline

#7 2013-10-24 13:22:22

ukyo
Community Manager
From: Marmaris - Turkey
Registered: 2010-05-19
Posts: 734
Website

Re: Comments Module

Last update is not for this issue, on my side i don't have theese errors. If i see this issue i will check why we have?


<ion:ukyo from="Turkey" />
Ionize CMS Türkçe Dil Çeviri Dosyaları | My Github Repositories
Please send your first message to a forum section, not forum users or administration.

Offline

#8 2013-10-25 12:30:34

rmartinez
Member
Registered: 2013-01-16
Posts: 88

Re: Comments Module

Hi,

I've switched the tags <ion:status expression='status==0'> and <ion:admin expression="==1"> for <ion:status is="0"> and <ion:admin is="1"> and it works fine without any errors now.

Another thing that I would like to tell you is about the location of the files article_comment_error.php, article_comment_form.php and article_comments.php that they are included in the views folder of the module. Is a better idea include this files in the views folder of the module than in the views folder of the theme? Personally I think that the list and the style of the comments are related with the theme so, maybe, the views folder of the theme is the most suitable place where we would include these files. What do you think?

Finally, I would like to tell that I'm working with the send mail option of the comments enable and it works fine too.

Regards.

Offline

#9 2014-01-29 13:52:19

ukyo
Community Manager
From: Marmaris - Turkey
Registered: 2010-05-19
Posts: 734
Website

Re: Comments Module

@rmartinez

You can use your own view files inside your template, its just example view files..


<ion:ukyo from="Turkey" />
Ionize CMS Türkçe Dil Çeviri Dosyaları | My Github Repositories
Please send your first message to a forum section, not forum users or administration.

Offline

#10 2014-02-10 12:19:46

ukyo
Community Manager
From: Marmaris - Turkey
Registered: 2010-05-19
Posts: 734
Website

Re: Comments Module

Module updated...


<ion:ukyo from="Turkey" />
Ionize CMS Türkçe Dil Çeviri Dosyaları | My Github Repositories
Please send your first message to a forum section, not forum users or administration.

Offline

#11 2014-03-04 11:07:07

leonaze
Member
Registered: 2013-10-08
Posts: 17

Re: Comments Module

Hi,

I can't find where configure the module to accept comments on a page or article can you explain me ?

Thanks.

Offline

#12 2014-03-04 13:26:39

ukyo
Community Manager
From: Marmaris - Turkey
Registered: 2010-05-19
Posts: 734
Website

Re: Comments Module

Open : Modules -> Comments -> Settings

You will see drag a page here section! Just drag a page from left tree navigation, you want to use for comments.. After do this you will see comments options for sub articles for this page.


<ion:ukyo from="Turkey" />
Ionize CMS Türkçe Dil Çeviri Dosyaları | My Github Repositories
Please send your first message to a forum section, not forum users or administration.

Offline

#13 2014-03-04 17:23:08

leonaze
Member
Registered: 2013-10-08
Posts: 17

Re: Comments Module

I don't have "Drag a page", just "This Section Not Ready Yet.... " ...

I download the latest version 0.9.2 by the link you provide. I opened the config.php of your module and add an ID of a page and it's OK now I can see the Comment Module options.

Do you know why ?

Thanks.

Offline

#14 2014-05-16 18:11:47

Rel@
Member
Registered: 2013-12-12
Posts: 6

Re: Comments Module

@leonaze
For me it works smile
change: /modules/Comments/views/admin/setting/index.php

<div id="maincolumn">
    <h2 class="main comments-setting"><?php echo lang('module_comments_title_settings'); ?></h2>
    <div class="main subtitle">
        <p class="lite">
            <?php echo lang('module_comments_about_setting'); ?>
        </p>
    </div>
    <div class="mainTabs">
			<div class="droppable dropPage"'>
				<?php echo lang('module_comments_settings_drop'); ?>
			</div>
			<div id="commentsPagesContainer" class="sortable-container"></div>
		</div>
</div>

<script type="text/javascript">
	if ($('commentsPagesContainer')) {
		ION.HTML(
			admin_url + 'module/comments/setting/get_pages',
			{	'parent': 'comments',	'id_parent': '1' },
			{ 'update': 'commentsPagesContainer' }
		);
	}
	
	$$('#mainTree li').each(function(item, idx)	{
		var a = item.getElement('a.title');
		var b = a.getProperty('data-type');
		if ( b == 'page' ) {
			// Adds Drag'n'Drop behavior on each page of #mainTree
			ION.addDragDrop(
				a,						// DOM element to drag
				'.dropPage',		// Selector of the drop areas.
				'COMMENTS_MODUL.dropPageOnParent'
			);
		}
	});

</script>

new: /modules/Comments/views/admin/setting/pages.php

<?php
/**
 * Pages linked to comment
 * Called by : /modules/Comments/controllers/admin/setting.php
 *
 * This view receives :
 * - $pages : 	Array of pages linked to comment
 *
 */
?>

<?php if ( ! empty($pages)) :?>

	<ul id="commentsPagesList" class="commentsPagesList">

		<?php foreach($pages as $id) :?>

			<li class="sortme" id="id_page_<?php echo $id['id_page'] ;?>" data-id="<?php echo $id['id_page'] ;?>" >
				<a class="left ml15 title"><?php echo $id['languages'][Settings::get_lang('default')]['title'] ;?></a>
				<a class="icon unlink right" data-id="<?php echo $id['id_page'] ;?>"></a>
			</li>
			
		<?php endforeach; ?>

	</ul>

	<script type="text/javascript">
		$$('#commentsPagesList li').each(function(item) {
			var unlinkIcon = item.getElement('.unlink');
			ION.initRequestEvent(
				unlinkIcon,
				'<?= admin_url() ?>/module/comments/setting/remove_page',
				{'id_page': unlinkIcon.getProperty('data-id')	}
			);
		});
	</script>
	
<?php endif; ?>

new: /modules/Comments/assets/javascript/admin.js

/**
 * Declare and create the COMMENTS_MODUL object
 *
 */
var COMMENTS_MODUL = (COMMENTS_MODUL || {});

COMMENTS_MODUL.append = function(hash){
	Object.append(COMMENTS_MODUL, hash);
}.bind(COMMENTS_MODUL);

COMMENTS_MODUL.append(
{
	baseUrl: base_url,
	adminUrl: admin_url,
	moduleUrl: admin_url + 'module/comments/',

	/**
	 * Called when one page is dropped to allow comments
	 * This method receives :
	 *
	 * @param DOM element   Dragged clone of the element
	 * @param DOM element   DOM Element on which the element is dropped
	 * @param event         The event
	 *
	 */
	dropPageOnParent: function(element, droppable, event) {
		ION.JSON( this.moduleUrl + 'setting/add_page', { 'id_page': element.getProperty('data-id') } );
	}

});

The /modules/Comments/controllers/admin/setting.php controller is 'premade' for operations above. smile

That's all, you can see:
Screen_CommentsSettings

Last edited by Rel@ (2014-05-19 18:40:20)

Offline

#15 2014-05-19 17:50:06

leonaze
Member
Registered: 2013-10-08
Posts: 17

Re: Comments Module

@Rel@ :

Thanks for your help, but I don't understand, it don't works :

w7mst4.jpg

In the console of Chrome Developer Tools I have the request executing each 180ms : ../module/comments/setting/get_pages

Do you know why ?

Thanks.

Offline

#16 2014-05-19 18:48:06

Rel@
Member
Registered: 2013-12-12
Posts: 6

Re: Comments Module

@leonaze
Sorry, I have made a mistake... ctrl+c and ctrl+v, I must buy a glasses. smile
The pages.php above was same as index.php.

I corrected it.

Thx.
Rel@

Offline

#17 2014-05-20 15:58:20

leonaze
Member
Registered: 2013-10-08
Posts: 17

Re: Comments Module

@Rel@ :

Thanks for the correction. I also made a change to the pages.php because the page title didn't appear :

<a class="left ml15 title"><?php echo $id['title'] ;?> (<?php echo $id['path'] ; ?>)</a>

I add the path because I have some pages with the same title.

All works. Thanks.

Last edited by leonaze (2014-05-20 15:58:36)

Offline

#18 2014-07-28 18:20:34

elmigo
Member
Registered: 2014-06-17
Posts: 7

Re: Comments Module

install module on 1.0.6 and added Rel@'s code - not working

can anyone help me?

Offline

#19 2014-07-29 14:27:42

Rel@
Member
Registered: 2013-12-12
Posts: 6

Re: Comments Module

@elmigo
I have 1.0.6 and the admin is working.
What is not working on your system?
Install? - Settings? - Articles? - Comments? or...

Rel@

Offline

#20 2014-07-29 14:57:12

elmigo
Member
Registered: 2014-06-17
Posts: 7

Re: Comments Module

i am sorry, dropping article instead of dropping page

Offline

#21 2014-09-14 16:16:32

microtp
Member
Registered: 2014-09-14
Posts: 4

Re: Comments Module

Merhaba Modülü Nasıl kullanıldığını Anlamadım modül dizinine attım yönetim panelinden aktif ettim fakat  Page.php temasına yorum gönderenleri ve yorum gönderme formunu çekemiyorum modülün \views klasöründe bulunan kodları kullanmayı denedim sonuç
Fatal error: Call to a member function getValue() on a non-object in F:\webroot\application\libraries\Tagmanager.php on line 1797

yardımcı olabilirmisiniz.

Offline

#22 2014-09-14 23:06:53

ukyo
Community Manager
From: Marmaris - Turkey
Registered: 2010-05-19
Posts: 734
Website

Re: Comments Module

microtp wrote:

Merhaba Modülü Nasıl kullanıldığını Anlamadım modül dizinine attım yönetim panelinden aktif ettim fakat  Page.php temasına yorum gönderenleri ve yorum gönderme formunu çekemiyorum modülün \views klasöründe bulunan kodları kullanmayı denedim sonuç
Fatal error: Call to a member function getValue() on a non-object in F:\webroot\application\libraries\Tagmanager.php on line 1797

yardımcı olabilirmisiniz.

Modülü Ionize 1.0.4 kullandığım zaman içerisinde yazmıştım güncel versiyonda 1.0.7 için problemler yaşanabilir. Yoğum iş temposundan dolayı modülün güncel ionize versiyonları için tepkisi nedir bilemiyorum, eğer tekrar ihtiyaç duyarsam modüle tekrar incelemeye alabilirim şuan için alınan hatalar için yapabileceğim birşey yok malesef.


<ion:ukyo from="Turkey" />
Ionize CMS Türkçe Dil Çeviri Dosyaları | My Github Repositories
Please send your first message to a forum section, not forum users or administration.

Offline

#23 2015-02-05 03:59:49

Tichu
Member
Registered: 2015-02-01
Posts: 21

Re: Comments Module

tried it but get 2 errors on ionize 1.07


A PHP Error was encountered

Severity: Notice

Message: Undefined index: en

Filename: comments/comments.php

Line Number: 2
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: name

Filename: comments/comments.php

Line Number: 3

here is line 2 and 3 from errors:
<?php
    $title = $article[Settings::get_lang('default')]['title'];
    if ($title == '') $title = $name;




any1 has any advice to fix it?


thanks

Offline

#24 2015-02-06 10:50:23

Kink
Ion Tester
From: France
Registered: 2010-06-04
Posts: 581

Re: Comments Module

Perhaps it's because you have not english language ?


Webmaster / OUF!WEB

Offline

#25 2015-02-06 14:40:28

Tichu
Member
Registered: 2015-02-01
Posts: 21

Re: Comments Module

lang is there:

modules/Comments/languages/en/comments_lang.php


seems something else the issue,

i am stucked, and module is not funtional yet.

advice is welcome

thanks

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations