Ejemplo n.º 1
0
/**
 * Feed message, used to apply filters
 * @param STRING $message
 * @return STRING $message
 */
function feed_message($feed)
{
    $message = $feed['message'];
    $message = apply_filters($message, 'feed_message');
    $message = nl2br(stripcslashes($message));
    $attr = $feed['message_attributes'];
    if (!is_array($attr)) {
        $attr = json_decode($attr, true);
    }
    //Replacing Names..
    $message = apply_mentions($message, $feed['message_attributes']);
    return $message;
}
Ejemplo n.º 2
0
/**
 * Function used to modify comment, if there is any plugin installed
 * @param : comment
 */
function comment($comment_arr)
{
    global $Cbucket;
    if (is_array($comment_arr)) {
        $the_comment = $comment_arr['comment'];
        $attributes = json_decode($comment_arr['comment_attributes'], true);
        $comment = apply_mentions($the_comment, $attributes);
    } else {
        $comment = $comment_arr;
    }
    $comment = nl2br($comment);
    //Getting List of comment functions
    $func_list = $Cbucket->getFunctionList('comment');
    //Applying Function
    if (count($func_list) > 0) {
        foreach ($func_list as $func) {
            $comment = $func($comment);
        }
    }
    return $comment;
}