PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.11.0
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.11.0
2.11.0 2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 All 78 releases
← All changes | app/Models/Feed.php +13 -1 2.8.02.11.0 View file →
@@ -105,8 +105,19 @@
105 105 ];
106 106
107 107 public static $scopeType = 'text';
108 108
109 + /**
110 + * The types a /post/{slug} URL can serve.
111 + *
112 + * fcom_posts is shared: it also holds course_lesson, course_section and
113 + * space_page rows, and each of those owns a different route. Any lookup that
114 + * drops the type global scope to reach image and article posts must narrow to
115 + * this list, or a feed URL can answer with a lesson or a page that happens to
116 + * share the slug. Add a new feed shape here when one is introduced.
117 + */
118 + public static $feedViewTypes = ['text', 'image', 'article'];
119 +
109 120 public static function boot()
110 121 {
111 122 parent::boot();
112 123
@@ -155,9 +166,9 @@
155 166 // get the first 40 char from the title
156 167 $title = mb_substr($title, 0, 40, 'UTF-8');
157 168 } else {
158 169 // get the first 25 char from the message
159 - $title = mb_substr($newModel->message, 0, 40, 'UTF-8');
170 + $title = mb_substr((string) $newModel->message, 0, 40, 'UTF-8');
160 171 }
161 172
162 173 $title = Helper::normalizeToAscii($title);
163 174 $title = remove_accents($title);
@@ -702,8 +713,9 @@
702 713 public function recountStats()
703 714 {
704 715 $this->comments_count = Comment::where('post_id', $this->id)
705 716 ->where('type', 'comment')
717 + ->where('status', 'published')
706 718 ->count();
707 719
708 720 $this->reactions_count = Reaction::where('object_type', 'feed')->where('type', 'like')
709 721 ->where('object_id', $this->id)