#51 2013-08-10 20:38:19

adamos42
Ionize Friend
From: Hungary
Registered: 2010-09-20
Posts: 390
Website

Re: "Blog comments" module

Thanks, the next development suggestion big_smile If i have logged in then  show just the comment textarea and if I comment then the program connect my post to my user account. Oh an other thing, here would be helpfull that in the admin set the minimum userlevel to comment.

One problem have I now. It could be solved when I edit the view files, see here: http://cwlclan.hu/hirek/allando-etpro-szerver-indulas

Last edited by adamos42 (2013-08-10 20:38:40)


Webdeveloper, Programmer, Application developer, Ionize friend
@adamos42

Offline

#52 2013-08-10 21:26:14

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

Re: "Blog comments" module

OK, i saw your problem, but i didn't develop and tested the frontoffice. So i can't help you at this time for this problem.
Adamos, you can help me for this section, fork on github big_smile


Webmaster / OUF!WEB

Offline

#53 2013-08-10 22:26:40

adamos42
Ionize Friend
From: Hungary
Registered: 2010-09-20
Posts: 390
Website

Re: "Blog comments" module

I forked big_smile I'am new on github smile but i uploadded one litte module: Ajax online visitors counter.


Webdeveloper, Programmer, Application developer, Ionize friend
@adamos42

Offline

#54 2013-08-11 11:47:08

adamos42
Ionize Friend
From: Hungary
Registered: 2010-09-20
Posts: 390
Website

Re: "Blog comments" module

Kink, something is wrong:

Source:

<?php if("<ion:comments:comments_allowed></ion:comments:comments_allowed>" == 1): ?>
  <ion:lang key="Comments" />: <ion:comments:comment_count verbose="true" from="parent" />
<?php endif; ?>

Output:

Tag missing: comment_count, scope: page:articles:article:comments

Webdeveloper, Programmer, Application developer, Ionize friend
@adamos42

Offline

#55 2013-08-11 20:26:57

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

Re: "Blog comments" module

Yes because it's "comments_count", not "comment_count" tongue
Heeeey, now you understand why i changed the <comments_allowed> method ? wink
Because <ion:comments:comments_allowed></ion:comments:comments_allowed> is so beurrrrk.

Well, Adamos. I take a week of hollydays. See ya.


Webmaster / OUF!WEB

Offline

#56 2013-08-11 21:23:53

adamos42
Ionize Friend
From: Hungary
Registered: 2010-09-20
Posts: 390
Website

Re: "Blog comments" module

I realize it and I write it back smile Tomorrow I will make several things in this module smile Follow on Github, I started writing one documentation too smile


Webdeveloper, Programmer, Application developer, Ionize friend
@adamos42

Offline

#57 2013-09-17 23:45:19

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

Re: "Blog comments" module

Kink wrote:

Hey, i made a fork on github with your release Xtro.
I have a surprise for adamos42 : i made a panel for article. You can now list/add comments inside the article, and also checking the 'Allow Comments' button.

Removed Images

But there are many bug. We have many ideas. So, could we work together on this project ?

@kink

This isn't good idea for viewing comments. I need a comment module. I am thinking to write new one. For now i downloaded your repo, checking what you did and what can i make?

I have some screenshot about what i am planning to do..

First Module Icon smile :
Removed Images

Draggable article to comment module :
Removed Images

Draggin Article :
Removed Images

Viewing Comments for Dragged Articles :
Removed Images

for now i am working on admin panel..


<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

#58 2013-09-20 12:13:53

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

Re: "Blog comments" module

Mmmh... if i understand, you must drag/drop each article to display comments ?
It's a good idea to create a comment, but... to read all comments, in think it's not  good idea too.

Instead, i'm dreaming on alert in the dashboard for new comments.

So, drag/drop article to create comment seems a good idea. Just under, display the list of all comments with 2 tabs : "Pended" and "Published".

In the panel of article, keap the button "allow comments" and display a link to "module>display-comments-of-the-article> with the number of comments ?
I'm agree with you, if there are more comments, it will slow down the page to edit the article.


Webmaster / OUF!WEB

Offline

#59 2013-09-23 21:56:39

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

Re: "Blog comments" module

Removed drag & drop specification added a button for manage comments. I am updating github repo for changes.


<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

#60 2013-09-24 19:20:25

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

Re: "Blog comments" module

Here is last updated repo : https://github.com/trk/Comments


<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

#61 2013-09-25 11:04:22

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

Re: "Blog comments" module

Great work ukyo!!!

I've already tested your last version and I've notice a little bug. This function:

public static function tag_comments_allowed(FTL_Binding $tag) {
        return $tag->locals->article['comment_allow'];
}

returns a literal valor, 1 or 0 and this value appears when you use the tag comments:comments_allowed

I think is better this way

public static function tag_comments_allowed(FTL_Binding $tag) {
        $result = $tag->locals->article['comment_allow'] == "1" ? $result = $tag->expand() : $result = "";
        return $result;
}

What do you think?

Offline

#62 2013-09-25 11:24:30

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

Re: "Blog comments" module

I didn't check module tags yet, i updated repo for last admin panel updates. I will start work for tags now. Thanks!


<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

#63 2013-09-25 13:58:02

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

Re: "Blog comments" module

Hi again,

I think I have some interesting ideas for your module:

  1. Notify new comments by email
    For example:

    /*     * *********************************************************************
     * Save the new entry, if "POST" detected
     *
     */
    
    public static function tag_comment_save(FTL_Binding $tag) {
    	// get CodeIgniter instance
    	$CI = & get_instance();
    
    	// Comment was posted, saving it
    	if ($content = $CI->input->post('content')) {
    		// Loads the comments module model
    		if (!isset($CI->comment_model))
    			$CI->load->model('comments_comment_model', 'comment_model', true);
    
    		// Save comment 
    		if ($CI->comment_model->insert_comment($tag->locals->article['id_article']))
    		{
    			$CI->locals->showSuccessFlashMessage = true;
    			
    			/** NEW CODE:BEGIN **/
    			// Send email to notify the new comment
    			$email = (Settings::get('site_email') != '') ? Settings::get('site_email') : NULL;
    			
    			if ( $email )
    			{
    				// Get the 'sender' email : Must be set in Ionize : Settings > Advanced settings > Email
    				$website_email = Settings::get('site_email') ? Settings::get('site_email') : NULL;
    	
    				// Email Lib
    				if ( ! isset(self::$ci->email)) self::$ci->load->library('email');
    				self::$ci->email->clear();
    
    				// Subject / From / To
    				$subject = 'New comment';
    				self::$ci->email->subject($subject);
    				self::$ci->email->from($website_email, Settings::get("site_title"));
    				self::$ci->email->to($email);
    
    				// View & Message content
    				$content = 'There is a new comment [...]';
    
    				self::$ci->email->message($content);
    
    				// Send silently
    				$result = @self::$ci->email->send();
    
    				if ( ! $result)
    				{
    					log_message('error', 'Error : Tagmanager/Email->send_form_emails() : Email was not sent.');
    				}
    			}
    			/** NEW CODE:END **/
    		}
    		else
    			$CI->locals->showErrorFlashMessage = true;
    	}
    
    
    	return;
    }
  2. Set the ip address of the author's comment automatically
    Also, you can publish every new comment automatically. For example:

    /**
     * Saving one blog comment 
     *
     * @param		id		article id
     * @returns		int		created id
     */
    public function insert_comment($id_article)
    {
    	
    	// Retrieve data // Получение данных
    	$email 		= $this->input->post("email");
    	$content 	= nl2br($this->input->post("content"));
    	$author 	= $this->input->post("author");
    	$site           = $this->input->post("site");
    	$status_publ    = $this->input->post("status");
    	$ip = $this->input->ip_address($this->input->post("ip"));
    	
    	/** NEW CODE:BEGIN **/
    	// Set ip automatically if empty
    	if(empty($ip))
    		$ip = $_SERVER['REMOTE_ADDR'];
    	
    	// Publish comment automatically
    	if(empty($status_publ))
    		$status_publ = 1;
    	/** NEW CODE:END **/
    
    	// Checking data
    	if (empty($email)||empty($author)||empty($content))
    		return false; 
    	
    	// Defining record
    	$data = array( 
    						"content"       =>	$content,
    						"author"        =>	$author,
    						"email"         =>	$email,
    						"created"       =>	date('Y-m-d H:i:s'),
    						"id_article"    =>	$id_article,
    						"site"          =>  $site,
    						"status"        =>  $status_publ,
    						"ip"            =>  $ip
    				);
    				
    				
    	// Saving record
    	$this->db->insert( $this->table, $data );
    	
    	// Returns created id 
    	//return $this->db->insert_id();
    	return true;
    }

What do you think?

Offline

#64 2013-09-25 14:21:12

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

Re: "Blog comments" module

I am working on tags. Added new methods removed some not need things. Email notification is a good idea. i will add this specification also.


<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

#65 2013-09-25 21:56:31

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

Re: "Blog comments" module

I updated repo, added example view files under Comments/views/ folder. New comment form and comments list. You can call view files by using <ion:partial view="article_comment_form" /> and <ion:partial view="article_comments />.

Note : I used bootstrap 3 in example views.


<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

#66 2017-03-01 03:10:39

fredericomarinho.com
Member
From: Juiz de Fora / Brazil
Registered: 2015-06-08
Posts: 47
Website

Re: "Blog comments" module

Not working in 1.0.8 version. Is there some comments module that it is working?
Thanks!


Frederico Marinho - Social Media and Web Developer
contato@fredericomarinho.com
fredericomarinho.com

Offline

#67 2017-03-01 05:18:50

fredericomarinho.com
Member
From: Juiz de Fora / Brazil
Registered: 2015-06-08
Posts: 47
Website

Re: "Blog comments" module

rmartinez wrote:

Great work ukyo!!!

I've already tested your last version and I've notice a little bug. This function:

public static function tag_comments_allowed(FTL_Binding $tag) {
        return $tag->locals->article['comment_allow'];
}

returns a literal valor, 1 or 0 and this value appears when you use the tag comments:comments_allowed

I think is better this way

public static function tag_comments_allowed(FTL_Binding $tag) {
        $result = $tag->locals->article['comment_allow'] == "1" ? $result = $tag->expand() : $result = "";
        return $result;
}

What do you think?


Great tip!!! Thanks


Frederico Marinho - Social Media and Web Developer
contato@fredericomarinho.com
fredericomarinho.com

Offline

#68 2017-03-01 05:22:13

fredericomarinho.com
Member
From: Juiz de Fora / Brazil
Registered: 2015-06-08
Posts: 47
Website

Re: "Blog comments" module

Made it! Now it is working, but I had to change the line 1390 in application/core/My_Controller.php.

From:

$output = $this->load->module_view($this->config->item('folder'), $view, $this->template, true);

To:

$output = $this->load->view($view, $this->template, true);

Last edited by fredericomarinho.com (2017-03-01 05:22:32)


Frederico Marinho - Social Media and Web Developer
contato@fredericomarinho.com
fredericomarinho.com

Offline

#69 2017-03-01 05:28:22

fredericomarinho.com
Member
From: Juiz de Fora / Brazil
Registered: 2015-06-08
Posts: 47
Website

Re: "Blog comments" module


Frederico Marinho - Social Media and Web Developer
contato@fredericomarinho.com
fredericomarinho.com

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