Login     Sign up
Comment, Like, Dislike on comments
Craig Hopson (@craighopson)
Join date: Mar 24th 2011
Community posts: 26
View Profile
Send Message

Hi guys how do i get Comment, Like, Dislike on comments thanks in advance

157 months ago
Pusilkom UI (@educial)
Join date: Mar 25th 2011
Community posts: 5
View Profile
Send Message

I've done this once. I hope this helps.

First you query from streams and accounts table. For example:
[code]
select
s.id,
s.message,
s.wall_id,
s.uid,
s.attachment,
s.created,
a.username
from
jcow_streams s,
jcow_accounts a
where
a.id=s.uid [and other clauses]
[/code]

and then you compose an array, for example:
[code]
$arr = array();
while($row = sql_fetch_array($res)){
$arr['id'] = $row['id'];
$arr['uid'] = $row['uid'];
$arr['wall_id'] = $row['wall_id'];
$arr['message'] = $row['message'];
$arr['username'] = $row['username'];
$arr['attachment'] = $row['attachment'];
$arr['created'] = $row['created'];
c(stream_display($arr, 'row'));
}[/code]

The last step is to invoke stream_display function. Make sure the second argument is 'row' so that it will render the comment section. The other argument is 'simple' and 'mobile'. I've never tested it though.

157 months ago