wall.blade.php
22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
<?php
use App\Models\User;
$photosarr=array();
$usersarr=array();
function makesafe_data($data,$html=0,$hashtags=1,$newline=1)
{
//remove all script,style tags
$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
);
$data = preg_replace($search, '', $data);
//remove all html
if(!$html)
{
$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
);
$data = preg_replace($search, '', $data);
}
//convert hashtags to links
if($hashtags)
{
$regex = '/(#[A-Za-z-]+)/';
$data = preg_replace( $regex, "<a href='#' onclick='socialhashtagsearch(\"$1\");return false;'>$1</a>", $data);
}
//replace newlines
if($newline)$data=str_replace("\n","<br>",trim($data));
return $data;
}
if(isset($share_status) && $share_status == "n")echo "No Posts shared with you, Consider sending a friend request to the user, or you can also follow.";
if(isset($posts)&&!empty($posts))
{
foreach($posts as $key=>$post)
{
$dataarr=json_decode($post->data,true);
$posticon=array();
$posticon['personal']='pencil';
$posticon['photo']='picture';
$posticon['link']='link';
$posticon['notes']='align-justify';
$posticon['test']='list';
$posticon['question']='circle_question_mark';
$posticon['attachment']='paperclip';
$aclicons="";
if(strstr($post->acl,"Public"))$aclicons.="<i class='fa fa-globe text-link' title=Public></i> ";
if(strstr($post->acl,"Friends"))$aclicons.="<i class='fa fa-comments text-link' title=Friends></i> ";
if(strstr($post->acl,"Followers"))$aclicons.="<i class='fa fa-thumbs-up text-link' title=Followers></i> ";
if(strstr($post->acl,",c_"))
{
$commnmlist="";
if(!empty($dataarr['communityacl']))$commnmlist=implode(", ",$dataarr['communityacl']);
$aclicons.="<i class='fa fa-puzzle-piece text-link' title='Communities ( $commnmlist )'></i> ";
}
if(strstr($post->acl,"xs_"))$aclicons.="<i class='fa fa-bookmark' title='Content Discussion'></i> ";
if($aclicons=="")$aclicons="<i class='fa fa-user text-link' title=Users></i> ";
$shared_count="";
if($post->status=="shared" )
{
if(isset($dataarr["sharedata"]))
{
if(isset($dataarr["sharedata"]["shared_by"]))
{
$shares=explode(",",substr($dataarr["sharedata"]["shared_by"],1,-1));
$shared_count=count($shares);
$shared_by=array_unique($shares);
}
}
}
if(!isset($usersarr[$post->fromuser]))$usersarr[$post->fromuser]=User::find($post->fromuser);
if(!isset($photosarr[$post->fromuser]))$photosarr[$post->fromuser]=$usersarr[$post->fromuser]->fetchphotothumb();
$fromdispname=$usersarr[$post->fromuser]->dispname();
$fromimage=$photosarr[$post->fromuser];
if(isset($dataarr['context']))
{
$contextarr=explode("__",$dataarr["context"]);
if($post->status=="shared")
{
if($contextarr[0]=="xs"){$aclicons.=$contextarr[1];}
if($contextarr[0]=="xu"){$contxtprts=explode(" - ",$contextarr[1]);if(!isset($contxtprts[1]))$contxtprts[1]='';$aclicons.="<span title='$contxtprts[1]'>".$contxtprts[0]."</span>";}
}
else
{
if($contextarr[0]=="community"){$fromdispname=$contextarr[1];$fromimage="assets/images/community.jpg";}
if($contextarr[0]=="xs"){$aclicons.=$contextarr[1];}
if($contextarr[0]=="xu"){$contxtprts=explode(" - ",$contextarr[1]);if(!isset($contxtprts[1]))$contxtprts[1]='';$aclicons.="<span title='$contxtprts[1]'>".$contxtprts[0]."</span>";}
}
}
?>
<li>
<img src='{!!$fromimage!!}' alt='photo' class='media-object licon'>
<div class='block block-inline'>
<div class='caret'></div>
<div class='box-generic' id=postbox_{!!$post->id!!}>
<div class="timeline-top-info bg-gray" style='min-width:200px;max-width:100%'>
<i class="fa fa-user"></i>
<a data-toggle="image-preview" data-title="" data-content="" data-image-preview="{!!$fromimage!!}" href="#" class=textCapitialize onclick='popupProfileSocial({!!$post->fromuser!!});return false;'>
<i></i>{!!$fromdispname!!}</a>
@if(isset($dataarr["sharedata"]["OP_name"]))
shared <a href="javascript:void(0);" class="text-secondary"> {!!$dataarr["sharedata"]["OP_name"]!!} 's</a>
@else
posted a
@endif
<a href="javascript:void(0);" class="text-primary textCapitialize" style="margin-right:20px;margin-left:10px;"><i class="text-primary fa fa-{!!$posticon[$post->type]!!}"></i> {!!$post->type!='personal'?$post->type:''!!} Post</a> {!!$aclicons!!}
<div class="dropdown dropdown-icons dropdown-icons-xs pull-right" style='margin-top: -3px;'>
<a data-toggle="dropdown" href="#" class="btn btn-default btn-circle dropdown-toggle" style='color:#999'><i class="fa fa-edit" style='color:#999'></i> </a>
<ul class="dropdown-menu">
@if($post->fromuser == Auth::user()->id || $post->touser == Auth::user()->id)
<li data-toggle="tooltip" data-title="Delete Post" data-placement="left" data-container="body" style='padding:0'><a href="#delete_post_confirm" data-toggle="modal" onclick='$("#del_post").attr("delete",{!!$post->id!!});'><i class="text-primary fa fa-trash-o" id='del_post_{!!$post->id!!}' ></i></a></li>
@endif
@if($post->fromuser != Auth::user()->id && $post->touser != Auth::user()->id)
<li data-toggle="tooltip" data-title="Share Post ({!!$shared_count!!})" data-placement="left" data-container="body" style='padding:0'><a href="#share_modal" data-toggle="modal" onclick='$("#share_post_confirm").attr("share",{!!$post->id!!});'><i class="text-primary fa fa-share" id='share_post_{!!$post->id!!}'></i></a></li>
<li data-toggle="tooltip" data-title="Block Post" data-placement="left" data-container="body" style='padding:0'><a href="#spam_modal" data-toggle="modal" onclick='$("#spam_post_confirm").attr("spam",{!!$post->id!!});'><i class="text-primary fa fa-ban" id='spam_post_{!!$post->id!!}'></i></a></li>
@endif
</ul>
</div>
<div class="timeline-bottom InnerT half">
<i class="fa fa-clock-o"></i> {!!Auth::user()->post_date($post->created_at)!!}
<span class="innerL">
<?php $oldedupt=0; ?>
@if($post->fromuser != Auth::user()->id && $post->touser != Auth::user()->id)
<?php
$tc1="";$tc2="";$tc3="";
if(isset($dataarr["likesdata"])&&isset($dataarr["likesdata"][Auth::user()->id]))
{
if($dataarr["likesdata"][Auth::user()->id]>=1)$tc1="text-primary";
if($dataarr["likesdata"][Auth::user()->id]>=2)$tc2="text-primary";
if($dataarr["likesdata"][Auth::user()->id]>=3)$tc3="text-primary";
$oldedupt=$dataarr["likesdata"][Auth::user()->id];
}
?>
Rate -
<a href=# onclick="plusonpost(1,{!!$post->id!!});return false;" title="+1"><i class="fa fa-square {!!$tc1!!}" style='font-size:8px' id=post_t1_{!!$post->id!!}></i></a>
<a href=# onclick="plusonpost(2,{!!$post->id!!});return false;" title="+2"><i class="fa fa-square {!!$tc2!!}" style='font-size:12px' id=post_t2_{!!$post->id!!}></i></a>
<a href=# onclick="plusonpost(3,{!!$post->id!!});return false;" title="+3"><i class="fa fa-square {!!$tc3!!}" style='font-size:16px' id=post_t3_{!!$post->id!!}></i></a>
@endif
<span id=post_t1_{!!$post->id!!}_eps oldvalttl='{!!$post->edupoint!!}' oldmyval={!!$oldedupt!!}>{!!$post->edupoint!!}</span>
</span>
@if(isset($dataarr["sharedata"]["shared_by"]))
<!-- <span class="innerL">
<i class="fa fa-mail-forward fa-fw"></i>
Shared {!!$shared_count!!} times by {!!count($shared_by)!!} People
</span>-->
@endif
</div>
</div>
@if($post->type == "photo")
<div class="media margin-none">
<div class="row innerLR innerB">
<div class="" style="max-width:410px">
<div class="innerT">
<div class="text-center">
@if(isset($data['sharedata']['OP_uid']))
<a href="{!!url('/userfiles')!!}/{!!$dataarr["sharedata"]["OP_uid"]!!}/wallphotopost/{!!$dataarr["photourl"]!!}" data-toggle="prettyPhoto" target=_BLANK>
<img src='{!!url('/userfiles')!!}/{!!$dataarr["sharedata"]["OP_uid"]!!}/wallphotopost/{!!$dataarr["photourl"]!!}' alt='photo' style="width:100%;max-width:400px; max-height:400px;">
</a>
@else
<a href="{!!url('/userfiles')!!}/{!!$post->fromuser!!}/wallphotopost/{!!$dataarr["photourl"]!!}" data-toggle="prettyPhoto" target=_BLANK>
<img src='{!!url('/userfiles')!!}/{!!$post->fromuser!!}/wallphotopost/{!!$dataarr["photourl"]!!}' alt='photo' style="width:100%;max-width:400px; max-height:400px;">
</a>
@endif
</div>
<br><p>{!!makesafe_data($dataarr["data"])!!}</p>
</div>
</div>
</div>
</div>
@endif
@if($post->type == "attachment")
<div class="media margin-none">
<div class="row innerLR innerB">
<div class="" style="float:left;">
<div class="innerT">
<div class="text-center">
@if(isset($data['sharedata']['OP_uid']))
<a class="glyphicons-filetype {!!$dataarr["photourlext"]!!}" href='{!!url('/userfiles')!!}/{!!$dataarr["sharedata"]["OP_uid"]!!}/wallphotopost/{!!$dataarr["photourl"]!!}' target=_BLANK><i ></i></a>
@else
<a class="glyphicons-filetype {!!$dataarr["photourlext"]!!}" href='{!!url('/userfiles')!!}/{!!$post->fromuser!!}/wallphotopost/{!!$dataarr["photourl"]!!}' target=_BLANK><i ></i></a>
@endif
</div>
</div>
</div>
<div style="margin:10px;">
<div class="innerT">
@if(isset($data['sharedata']['OP_uid']))
<p><a class="" href='{!!url('/userfiles')!!}/{!!$dataarr["sharedata"]["OP_uid"]!!}/wallphotopost/{!!$dataarr["photourl"]!!}' target=_BLANK> {!!makesafe_data($dataarr["data"])!!} </a></p>
@else
<p><a class="" href='{!!url('/userfiles')!!}/{!!$post->fromuser!!}/wallphotopost/{!!$dataarr["photourl"]!!}' target=_BLANK> {!!makesafe_data($dataarr["data"])!!} </a></p>
@endif
</div>
</div>
</div>
</div>
@endif
@if($post->type == "link")
<div class="media margin-none">
<div class="row innerLR innerB">
<div>
<div class="innerT">
<p> {!!makesafe_data($dataarr["data"])!!} </p>
</div>
</div>
<div >
<?php
if(!empty($dataarr["preview"]))
{
$title=(isset($dataarr["preview"]["title"])?$dataarr["preview"]["title"]:"--");
$url=(isset($dataarr["preview"]["url"])?$dataarr["preview"]["url"]:"--");
$desc=(isset($dataarr["preview"]["description"])?$dataarr["preview"]["description"]:"--");
$imageurl=(isset($dataarr["preview"]["images"])?explode("|",$dataarr["preview"]["images"]):"--");
echo " <div class='linkpreview'>
<div class='linkpreviewImages'>
<div class='linkpreviewImage'><img src='$imageurl[0]' width=130px ></img>
</div>
</div>
<div class='linkpreviewContent'>
<div class='linkpreviewTitle'><a href='$url' target=_BLANK>$title</a></div>
<div class='linkpreviewUrl'>$url</div>
<div class='linkpreviewDescription'>$desc</div>
</div>
<div style='clear: both'></div>
</div>
<div style='clear: both'></div>";
}
//$answer = array("title" => $title, "titleEsc" => $title, "url" => $finalLink, "pageUrl" => $finalUrl, "cannonicalUrl" => cannonicalPage($pageUrl), "description" => strip_tags($description), "descriptionEsc" => strip_tags($description), "images" => $images, "video" => $video, "videoIframe" => $videoIframe);
?>
</div>
</div>
</div>
@endif
@if($post->type == "personal")
<div class='timeline-top-info border-bottom'>
{!!makesafe_data($dataarr["data"])!!}
</div>
@endif
@if($post->type == "notes")
<div class='timeline-top-info border-bottom timelinemaxheight' onclick='$(this).toggleClass("timelinemaxheight");'>
{!!makesafe_data(html_entity_decode($dataarr["data"]),1,1,0)!!}
</div>
@endif
@if($post->type == "question")
<?php
if(!isset($dataarr['result']))$dataarr['result']=array();
$maxscore=$dataarr['data']['score']/100;if($dataarr['data']['score']==0)$maxscore=1;
$totaltakers=sizeof($dataarr['result']);
$totalcorrect=0;$avgscore=0;$resslistbarscorrect="";$resslistbarswrong="";
$i=0;
foreach($dataarr['result'] as $uuid=>$resarr)
{
$i++;
if($i<=20)
{
if(!isset($usersarr[$uuid]))$usersarr[$uuid]=User::find($uuid);
if(!isset($photosarr[$uuid]))$photosarr[$uuid]=$usersarr[$uuid]->fetchphotothumb();
}
if($resarr['res']==1)
{
$totalcorrect++;
if($i<=20)$resslistbarscorrect.= "<img src='".$photosarr[$uuid]."' width=25px title='".$usersarr[$uuid]->dispname()."'> ";
}
else
{
if($i<=20)$resslistbarswrong.="<img src='".$photosarr[$uuid]."' width=25px title='".$usersarr[$uuid]->dispname()."'> ";
}
}
if($totaltakers>0)$avgscore=100*round($totalcorrect/$totaltakers,2);
?>
<div class='timeline-top-info border-bottom' id={!!$walltype!!}walltestpostqq_{!!$post->id!!}_{!!$dataarr['data']['id']!!}top style='width:500px;'>
<div class="innerAll bg-gray">
<div class="innerAll text-center"><!--text-center-->
<p class="lead margin-none">
<span class=" text-regular"><i class='fa fa-question'></i> Question - {!!$dataarr['data']['score']/100!!} Marks</span>
</p>
<p class="lead">
{!!$dataarr['data']['type']!!} - <span class="text-primary">{!!$dataarr['data']['category']!!}</span> {!!$dataarr['data']['subcategory']!!}</p>
<div class="progress progress-mini">
<div class="progress-bar progress-bar-primary" style="width: {!!$avgscore!!}%"></div>
</div>
<p class="margin-none"><b>{!!$totalcorrect!!}</b> Correct response among <b>{!!$totaltakers!!}</b> takers : <b>{!!$avgscore!!}</b> (%)</p>
</div>
</div>
<div id={!!$walltype!!}walltestpostqq_{!!$post->id!!}_{!!$dataarr['data']['id']!!}><center style='padding:10px'>
<?php
if(!isset($dataarr['result'][Auth::user()->id])){ ?>
<input type=button class="btn btn-primary" data-dismiss="modal" value='Attempt (1 Remaining)' onclick="doAjax('course/kunitedit?mid=0&type=question&posi={!!$post->id!!}&posj=0&posk=0&kunitid={!!$dataarr['data']['id']!!}&tgt={!!$walltype!!}walltestpostqq_{!!$post->id!!}_{!!$dataarr['data']['id']!!}&inlinequestion=1','','{!!$walltype!!}walltestpostqq_{!!$post->id!!}_{!!$dataarr['data']['id']!!}','ajax_author_editkunits','multiple','GET');return false;">
<?php }
else { ?><!--<input type=button class="btn btn-default" data-dismiss="modal" value='Review Answer' onclick="doAjax('course/kunitedit?mid=0&type=question&posi={!!$post->id!!}&posj=0&posk=0&kunitid={!!$dataarr['data']['id']!!}&tgt={!!$walltype!!}walltestpostqq_{!!$post->id!!}_{!!$dataarr['data']['id']!!}&inlinequestion=1&testrests=1','','{!!$walltype!!}walltestpostqq_{!!$post->id!!}_{!!$dataarr['data']['id']!!}','ajax_author_editkunits','multiple','GET');return false;">--><?php }
?>
</center></div>
</div><div class=clearfix style='margin-bottom:2px'></div>
<div class='col-md-6'>Correct<br>{!!$resslistbarscorrect!!}</div><div class='col-md-6'>Incorrect<br>{!!$resslistbarswrong!!}</div>
<div class=clearfix style='margin-bottom:2px'></div>
</div>
<script>if($("#wallsdiv").length)$("#{!!$walltype!!}walltestpostqq_{!!$post->id!!}_{!!$dataarr['data']['id']!!}top").width(($("#wallsdiv").width()-100>900?900:$("#wallsdiv").width()-100));</script>
@endif
@if($post->type == "test")
<div class='timeline-top-info border-bottom' id={!!$walltype!!}walltestpost_{!!$post->id!!}_{!!$dataarr['data']['id']!!}top style='width:500px;'>
<?php
if(!isset($dataarr['result']))$dataarr['result']=array();
$maxscore=$dataarr['data']['score']/100;if($dataarr['data']['score']==0)$maxscore=1;
$totaltakers=sizeof($dataarr['result']);
$totalscore=0;$avgscore=0;$resslistbars="";
$i=0;
foreach($dataarr['result'] as $uuid=>$resarr)
{
$i++;
if($i<=20)
{
if(!isset($usersarr[$uuid]))$usersarr[$uuid]=User::find($uuid);
if(!isset($photosarr[$uuid]))$photosarr[$uuid]=$usersarr[$uuid]->fetchphotothumb();
}
$testtotal=0;$scored=0;$testtime=0;$scoretime=0;
foreach($resarr as $tqq=>$qres)
{
if(sizeof($qres)>4)
{
$testtotal+=$qres[0];
$testtime+=$qres[1];
$scoretime+=($qres[3]-$qres[2]);
$scored+=$qres[4];
}
}
$scored=round($scored/100,2);
$testtotalef=round($testtotal/100,2);
if($testtotalef==0){$testtotalef=1;$scored=0;}
$totalscore+=$scored;
if($i<=20)$resslistbars.= "<div class='col-md-12'>
<div class='col-md-3'><img src='".$photosarr[$uuid]."' width=23px title='".$usersarr[$uuid]->dispname()."'> ".(round($scored/$testtotalef,4)*100)."% ($scored/$testtotalef)</div>
<div class='col-md-9 progress' style='margin-bottom:2px'><div class='progress-bar progress-bar-primary' style='width: ".(round($scored/$testtotalef,4)*100)."%;'></div></div>
</div><div class=clearfix></div>";
}
if($totaltakers>0)$avgscore=round($totalscore/$totaltakers,2);
?>
<div class="innerAll bg-gray">
<div class="innerAll text-center"><!--text-center-->
<p class="lead margin-none">
<span class=" text-regular"><i class='fa fa-list-ol'></i>Test - {!!$dataarr['data']['qcount']!!} Questions/{!!$dataarr['data']['score']/100!!} Marks</span>
</p>
<p class="lead">
<span class="text-primary">{!!$dataarr['data']['category']!!}</span> {!!$dataarr['data']['subcategory']!!}</p>
<div class="progress progress-mini">
<div class="progress-bar progress-bar-primary" style="width: {!!round($avgscore*100/$maxscore,2)!!}%"></div>
</div>
<p class="margin-none">Avg Score among <b>{!!$totaltakers!!}</b> takers : <b>{!!$avgscore!!}</b> ({!!round($avgscore*100/$maxscore,2)!!}%)</p>
</div>
</div>
<div id={!!$walltype!!}walltestpost_{!!$post->id!!}_{!!$dataarr['data']['id']!!}><center style='padding:10px'>
<?php
if(!isset($dataarr['result'][Auth::user()->id])){ ?>
<input type=button class="btn btn-primary" data-dismiss="modal" value='Take this {!!$post->type!!} (Single Attempt)' onclick="doAjax('course/starttest?qid={!!$dataarr['data']['id']!!}&mid=0&i={!!$post->id!!}&j={!!Auth::user()->id!!}&k=0&tgt={!!$walltype!!}walltestpost_{!!$post->id!!}_{!!$dataarr['data']['id']!!}&inlinequestion=1','','{!!$walltype!!}walltestpost_{!!$post->id!!}_{!!$dataarr['data']['id']!!}','ajax_course_testrun','singlefail','GET');return false;">
<?php }
else { ?><!--<input type=button class="btn btn-default" data-dismiss="modal" value='Review {!!$post->type!!}' onclick="doAjax('course/starttest?qid={!!$dataarr['data']['id']!!}&mid=0&i={!!$post->id!!}&j={!!Auth::user()->id!!}&k=0&tgt={!!$walltype!!}walltestpost_{!!$post->id!!}_{!!$dataarr['data']['id']!!}&inlinequestion=1','','{!!$walltype!!}walltestpost_{!!$post->id!!}_{!!$dataarr['data']['id']!!}','ajax_course_testrun','singlefail','GET');return false;">--><?php }
?>
</center></div>
</div><div class=clearfix style='margin-bottom:2px'></div>
{!!$resslistbars!!}
<script>if($("#wallsdiv").length)$("#{!!$walltype!!}walltestpost_{!!$post->id!!}_{!!$dataarr['data']['id']!!}top").width(($("#wallsdiv").width()-100>900?900:$("#wallsdiv").width()-100));</script>
@endif
<?php
if(isset($dataarr["comments"]))
{
$csize=sizeof($dataarr["comments"]);$ccount=0;
$start=0;if($csize>10)$start=$csize-10;
for($i=$start;$i<$csize;$i++)
{
$comment=$dataarr["comments"][$i];
//foreach($dataarr["comments"] as $i=>$comment)
//{
if(!isset($comment['deleted']))
{
$ccount++;
if(!isset($usersarr[$comment["fromid"]]))$usersarr[$comment["fromid"]]=User::find($comment["fromid"]);
if(!isset($photosarr[$comment["fromid"]]))$photosarr[$comment["fromid"]]=$usersarr[$comment["fromid"]]->fetchphotothumb();
$c_datetime=Auth::user()->post_date($comment["datetime"]);
?>
<div class="media innerAll margin-none <?php if($i%2==1) echo " bg-gray-light"; else echo " bg-gray-light2"; if($i>0) echo " border-top border-bottom"; else echo ""; ?>">
<img src='{!!$photosarr[$comment["fromid"]]!!}' alt='photo' class='media-object pull-left' width='35'>
<div class='media-body'>
<a href='#' class='strong' onclick='popupProfileSocial({!!$comment["fromid"]!!});return false;'>{!!$usersarr[$comment["fromid"]]->dispname()!!}</a> {!!makesafe_data($comment['data'])!!}
@if($comment["fromid"] == Auth::user()->id)
<a href="#delete_comm_confirm" data-toggle="modal"><i class='fa fa-trash-o pull-right' onclick='$("#del_comm").attr({"delete":{!!$post->id!!}, "time":"{!!$comment["datetime"]!!}"});' style='color:#DFDFDF'></i></a>
@endif
<div class='timeline-bottom'>
<i class='fa fa-clock-o'></i> {!!$c_datetime!!}
</div>
</div>
</div>
<?php
}
}
}
?>
<div class='innerAll postCommentBox'>
<input class='form-control' placeholder='Comment here...' onkeydown='return checkpostcomment(event,"{!!$post->id!!}",this.value,"{!!$id!!}");' id=commentbox_{!!$post->id!!} />
</div>
</div>
</div>
</li>
<?php
}
?>
<li id="<?php echo str_replace(array(" ",":","-"),"",$lastdate).$walltype."walldivul"; ?>" style="visibility:hidden;margin:0px;padding:0px">
<div style="margin-left:80%;height:0px;visibility:hidden;overflow:hidden">
<a href="javascript:void(0);" onclick='show_wall_feeds("{!!$walltype!!}",1);$("#{!!str_replace(array(" ",":","-"),"",$lastdate).$walltype."walldivul"!!}").css({"display":"none"});return false' class="btn btn-primary {!!$walltype!!}jscroll-next">Next page</a>
</div>
</li>
<script type="text/javascript">
$("#{!!$walltype!!}lastdate").val("{!!$lastdate!!}");
appscrollstate=1;
</script>
<div id=<?php echo str_replace(array(" ",":","-"),"",$lastdate).$walltype."wallul"; ?>></div>
<div class=clearfix style='margin-bottom:2px'></div>
<?php }else{ ?>
<script type="text/javascript">
$("#{!!$walltype!!}lastdate").val("");
</script>
<?php
}
?>