Skip to content

Commit

Permalink
permalink conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed Aug 30, 2009
1 parent f7f6319 commit 8e4d53b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/omb/plugins/ping.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function send_ping( &$model, &$rec ) {
$par = $db->get_record( 'posts',$rec->parent_id );
$tweet = render_comment($rec,$o,$par);
$payload['html'] = $tweet;
if ($par->parent_id > 0)
if ($rec->parent_id > 0)
$payload['in_reply_to'] = "#commentcontent-".$rec->parent_id;
else
$payload['in_reply_to'] = "#content-".$rec->parent_id;
Expand Down
41 changes: 40 additions & 1 deletion app/omb/views/posts/_entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,38 @@
$post = strtolower(classify($request->resource));

?>

<?php if (REALTIME_HOST) : ?>

<?php
global $db;
if (!empty($db->prefix))
$chan = $db->prefix;
else
$chan = "chan";
?>

<script type="text/javascript">
// <![CDATA[
Meteor.hostid = '<?php echo get_profile_id(); ?>';
Meteor.host = "<?php echo REALTIME_HOST; ?>";
Meteor.registerEventCallback("process", test);
Meteor.joinChannel("<?php echo $chan; ?>", 0);
Meteor.mode = 'stream';
Meteor.connect();
function test(data) {
data = data.substring(0,(data.length - 10));
eval( "data = " + data );
if (data['in_reply_to']) {
var selectr = data['in_reply_to'];
$(selectr).append(data['html']);
} else {
$("#postlist").prepend(data['html']);
}
$('a.oembed').oembed();
};
// ]]>
</script>
<?php endif; ?>
<?php $author = get_profile($Member->profile_id); ?>
<div class='entry-author'><?php echo $txt['entry_entry_by']; ?><a href="<?php url_for(array('resource'=>$author->nickname)); ?>"><?php print $author->nickname."</a> ".time_of($Member->created); ?><?php echo in_reply_to($Member); ?></div>

Expand Down Expand Up @@ -89,6 +120,14 @@


<br />


<div id="commentcontent-<?php echo $Member->id; ?>" class="commentlist"></div>

<?php $ccrurl = 'JavaScript:inline_comment('.$Member->id.','.$Member->id.');'; ?>

<a rel=\'nofollow\' class=\'comment-reply-link\' href="<?php echo $ccrurl; ?>">Comment</a>

<br />

<?php global $request; ?>
Expand Down

0 comments on commit 8e4d53b

Please sign in to comment.