Code Duplication    Length = 24-26 lines in 2 locations

mod/cp_notifications/start.php 2 locations

@@ 862-887 (lines=26) @@
859
860
	    		break;
861
862
	    	case 'comment':
863
864
	    		$content_title_en = gc_explode_translation($content_title, 'en');
865
	    		$content_title_fr = gc_explode_translation($content_title, 'fr');
866
867
	    		$subject = elgg_echo('cp_notify:subject:likes_comment', array($liked_by->name, $content_title_en),'en');
868
	    		$subject .= ' | '.elgg_echo('cp_notify:subject:likes_comment',array($liked_by->name, $content_title_fr),'fr');
869
870
	    		$message = array(
871
	    			'cp_liked_by' => $liked_by->name,
872
	    			'cp_comment_from' => $content_title,
873
	    			'content_url' => $content->getURL(),
874
					'cp_msg_type' => 'cp_likes_comments',
875
				);
876
877
	    		$author = $liked_by;
878
	    		$action_type = "like_comment";
879
880
	    		if (strcmp(elgg_get_plugin_user_setting('cpn_likes_email', $comment_author->getGUID(),'cp_notifications'),'likes_email') == 0)
881
					$to_recipients[$comment_author->getGUID()] = $comment_author;
882
					$get_error_info = 'comment';
883
884
    			if (strcmp(elgg_get_plugin_user_setting('cpn_likes_site', $comment_author->getGUID(),'cp_notifications'),'likes_site') == 0)
885
					$to_recipients_site[$comment_author->getGUID()] = $comment_author;
886
					$get_error_info = 'comment';
887
	    		break;
888
889
	    	case 'discussion_reply':
890
@@ 889-912 (lines=24) @@
886
					$get_error_info = 'comment';
887
	    		break;
888
889
	    	case 'discussion_reply':
890
891
	    		$content_title_en = gc_explode_translation($content_title, 'en');
892
	    		$content_title_fr = gc_explode_translation($content_title, 'fr');
893
894
	    		$subject = elgg_echo('cp_notify:subject:likes_discussion',array($liked_by->name, $content_title_en),'en');
895
	    		$subject .= ' | '.elgg_echo('cp_notify:subject:likes_discussion',array($liked_by->name, $content_title_fr),'fr');
896
897
				$message = array(
898
					'cp_liked_by' => $liked_by->name,
899
					'cp_comment_from' => $content_title,
900
					'content_url' => $content->getURL(),
901
					'cp_msg_type' => 'cp_likes_topic_replies',
902
				);
903
				$author = $liked_by;
904
				$action_type = "like_reply";
905
906
	    		if (strcmp(elgg_get_plugin_user_setting('cpn_likes_email', $comment_author->getGUID(),'cp_notifications'),'likes_email') == 0)
907
					$to_recipients[$comment_author->getGUID()] = $comment_author;
908
					$get_error_info = 'discussion_reply';
909
    			if (strcmp(elgg_get_plugin_user_setting('cpn_likes_site', $comment_author->getGUID(),'cp_notifications'),'likes_site') == 0)
910
					$to_recipients_site[$comment_author->getGUID()] = $comment_author;
911
					$get_error_info = 'discussion_reply';
912
	    		break;
913
914
915
	    	default: