@@ -69,10 +69,10 @@ class PMF_Comment
69
69
*/
70
70
public function __construct (PMF_Configuration $ config )
71
71
{
72
- global $ pmfStr ;
72
+ global $ pmfStr ;
73
73
74
- $ this ->config = $ config ;
75
- $ this ->pmfStr = $ pmfStr ;
74
+ $ this ->config = $ config ;
75
+ $ this ->pmfStr = $ pmfStr ;
76
76
}
77
77
78
78
//
@@ -99,8 +99,8 @@ public function getCommentDataById($id)
99
99
PMF_Db::getTablePrefix (),
100
100
$ id );
101
101
102
- $ result = $ this ->config ->getDb ()->query ($ query );
103
- if (($ this ->config ->getDb ()->numRows ($ result ) > 0 ) && ($ row = $ this ->config ->getDb ()->fetchObject ($ result ))) {
102
+ $ result = $ this ->config ->getDb ()->query ($ query );
103
+ if (($ this ->config ->getDb ()->numRows ($ result ) > 0 ) && ($ row = $ this ->config ->getDb ()->fetchObject ($ result ))) {
104
104
$ item = array (
105
105
'id ' => $ row ->id_comment ,
106
106
'recordId ' => $ row ->id ,
@@ -140,9 +140,9 @@ public function getCommentsData($id, $type)
140
140
$ type ,
141
141
$ id );
142
142
143
- $ result = $ this ->config ->getDb ()->query ($ query );
144
- if ($ this ->config ->getDb ()->numRows ($ result ) > 0 ) {
145
- while ($ row = $ this ->config ->getDb ()->fetchObject ($ result )) {
143
+ $ result = $ this ->config ->getDb ()->query ($ query );
144
+ if ($ this ->config ->getDb ()->numRows ($ result ) > 0 ) {
145
+ while ($ row = $ this ->config ->getDb ()->fetchObject ($ result )) {
146
146
$ comments [] = array (
147
147
'id ' => $ row ->id_comment ,
148
148
'content ' => $ row ->comment ,
@@ -169,20 +169,20 @@ public function getCommentsData($id, $type)
169
169
public function getComments ($ id , $ type )
170
170
{
171
171
$ comments = $ this ->getCommentsData ($ id , $ type );
172
- $ date = new PMF_Date ($ this ->config );
173
- $ mail = new PMF_Mail ($ this ->config );
172
+ $ date = new PMF_Date ($ this ->config );
173
+ $ mail = new PMF_Mail ($ this ->config );
174
174
175
175
$ output = '' ;
176
176
foreach ($ comments as $ item ) {
177
177
$ output .= '<p class="comment"> ' ;
178
178
$ output .= '<img src="assets/img/bubbles.gif" /> ' ;
179
- $ output .= sprintf (
180
- '<strong>%s<a href="mailto:%s">%s</a>:</strong><br />%s<br />%s</p> ' ,
181
- $ this ->pmfStr ['msgCommentBy ' ],
179
+ $ output .= sprintf (
180
+ '<strong>%s<a href="mailto:%s">%s</a>:</strong><br />%s<br />%s</p> ' ,
181
+ $ this ->pmfStr ['msgCommentBy ' ],
182
182
$ mail ->safeEmail ($ item ['email ' ]),
183
183
$ item ['user ' ],
184
- $ this ->showShortComment ($ id , $ item ['content ' ]),
185
- $ this ->pmfStr ['newsCommentDate ' ] .
184
+ $ this ->showShortComment ($ id , $ item ['content ' ]),
185
+ $ this ->pmfStr ['newsCommentDate ' ] .
186
186
$ date ->format (
187
187
PMF_Date::createIsoDate ($ item ['date ' ], 'Y-m-d H:i ' , false )
188
188
)
@@ -206,7 +206,7 @@ function addComment(Array $commentData)
206
206
VALUES
207
207
(%d, %d, '%s', '%s', '%s', '%s', %d, '%s') " ,
208
208
PMF_Db::getTablePrefix (),
209
- $ this ->config ->getDb ()->nextId (PMF_Db::getTablePrefix ().'faqcomments ' , 'id_comment ' ),
209
+ $ this ->config ->getDb ()->nextId (PMF_Db::getTablePrefix ().'faqcomments ' , 'id_comment ' ),
210
210
$ commentData ['record_id ' ],
211
211
$ commentData ['type ' ],
212
212
$ commentData ['username ' ],
@@ -216,7 +216,7 @@ function addComment(Array $commentData)
216
216
$ commentData ['helped ' ]
217
217
);
218
218
219
- if (!$ this ->config ->getDb ()->query ($ query )) {
219
+ if (!$ this ->config ->getDb ()->query ($ query )) {
220
220
return false ;
221
221
}
222
222
@@ -248,7 +248,7 @@ public function deleteComment($recordId, $commentId)
248
248
$ commentId
249
249
);
250
250
251
- if (!$ this ->config ->getDb ()->query ($ query )) {
251
+ if (!$ this ->config ->getDb ()->query ($ query )) {
252
252
return false ;
253
253
}
254
254
@@ -279,9 +279,9 @@ public function getNumberOfComments($type = self::COMMENT_TYPE_FAQ)
279
279
$ type
280
280
);
281
281
282
- $ result = $ this ->config ->getDb ()->query ($ query );
283
- if ($ this ->config ->getDb ()->numRows ($ result ) > 0 ) {
284
- while ($ row = $ this ->config ->getDb ()->fetchObject ($ result )) {
282
+ $ result = $ this ->config ->getDb ()->query ($ query );
283
+ if ($ this ->config ->getDb ()->numRows ($ result ) > 0 ) {
284
+ while ($ row = $ this ->config ->getDb ()->fetchObject ($ result )) {
285
285
$ num [$ row ->id ] = $ row ->anz ;
286
286
}
287
287
}
@@ -322,9 +322,9 @@ public function getAllComments($type = self::COMMENT_TYPE_FAQ)
322
322
$ type
323
323
);
324
324
325
- $ result = $ this ->config ->getDb ()->query ($ query );
326
- if ($ this ->config ->getDb ()->numRows ($ result ) > 0 ) {
327
- while ($ row = $ this ->config ->getDb ()->fetchObject ($ result )) {
325
+ $ result = $ this ->config ->getDb ()->query ($ query );
326
+ if ($ this ->config ->getDb ()->numRows ($ result ) > 0 ) {
327
+ while ($ row = $ this ->config ->getDb ()->fetchObject ($ result )) {
328
328
$ comments [] = array (
329
329
'comment_id ' => $ row ->comment_id ,
330
330
'record_id ' => $ row ->record_id ,
@@ -350,20 +350,20 @@ public function getAllComments($type = self::COMMENT_TYPE_FAQ)
350
350
*/
351
351
public function showShortComment ($ id , $ comment )
352
352
{
353
- $ words = explode (' ' , nl2br ($ comment ));
354
- $ numWords = 0 ;
355
-
356
- $ comment = '' ;
357
- foreach ($ words as $ word ) {
358
- $ comment .= $ word . ' ' ;
359
- if (15 === $ numWords ) {
360
- $ comment .= '<span class="comment-dots- ' . $ id . '">... </span> ' .
361
- '<a onclick="showLongComment( ' . $ id . ')" class="comment-show-more- ' . $ id . '">show more</a> ' .
362
- '<span class="comment-more- ' . $ id . ' hide"> ' ;
363
- }
364
- $ numWords ++;
365
- }
366
-
367
- return $ comment . '</span> ' ;
353
+ $ words = explode (' ' , nl2br ($ comment ));
354
+ $ numWords = 0 ;
355
+
356
+ $ comment = '' ;
357
+ foreach ($ words as $ word ) {
358
+ $ comment .= $ word . ' ' ;
359
+ if (15 === $ numWords ) {
360
+ $ comment .= '<span class="comment-dots- ' . $ id . '">... </span> ' .
361
+ '<a onclick="showLongComment( ' . $ id . ')" class="comment-show-more- ' . $ id . '">show more</a> ' .
362
+ '<span class="comment-more- ' . $ id . ' hide"> ' ;
363
+ }
364
+ $ numWords ++;
365
+ }
366
+
367
+ return $ comment . '</span> ' ;
368
368
}
369
369
}
0 commit comments