Changeset 1181

Show
Ignore:
Timestamp:
06/29/07 17:06:18 (1 year ago)
Author:
icewing
Message:

Marcus Povey <marcus@dushka.co.uk>
* RESOLVED - bug 82: Add action: Integrate river with old style comments
http://trac.elgg.org/show_bug.cgi?id=82

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/blog/lib/weblogs_actions.php

    r1152 r1181  
    176176                                $messages[] = __gettext("Your comment has been added."); // gettext variable 
    177177                            } 
     178                             
     179                                // If river plugin installed then note comment 
     180                                                        if (function_exists('river_save_event')) 
     181                                                        { 
     182                                                                $un = user_info("username", $comment->owner); 
     183                                                                 
     184                                                                $commenturl = $CFG->wwwroot."$un/weblog/{$comment->post_id}.html#cmt{$comment->ident}"; 
     185                                                                $username = "<a href=\"" . river_get_userurl($comment->owner) . "\">$un</a>"; 
     186                                                                if (!isset($comment->owner))  
     187                                                                { 
     188                                                                        $comment->owner = -1; 
     189                                                                        $username = __gettext("Anonymous user"); 
     190                                                                } 
     191                                         
     192                                                                river_save_event($comment->owner, $comment->ident, $comment->owner, "weblog_post::post", $username . " <a href=\"$commenturl\">" . __gettext("commented on") . "</a> " . river_get_friendly_id("weblog_post::post", $comment->post_id)); 
     193                                                                 
     194                                                        } 
    178195                        } 
    179196                    }