Пример #1
0
 function onsave($content)
 {
     if ($this->nosuchcomment) {
         return PANEL_REDIRECT_DEFAULT;
     }
     $comment = comment_parse($_REQUEST['entry'], $_REQUEST['comment']);
     if (isset($comment['loggedin'])) {
         $content['loggedin'] = $comment['loggedin'];
     }
     $content['ip-address'] = $comment['ip-address'];
     $content['date'] = $comment['date'];
     $success = comment_save($_REQUEST['entry'], $content);
     $this->smarty->assign('success', $success ? 1 : -1);
     return PANEL_REDIRECT_CURRENT;
 }
Пример #2
0
 function &getComment()
 {
     if (!$this->hasMore()) {
         return false;
     }
     list($k, $id) = each($this->list);
     $comment = comment_parse($this->entryid, $id);
     $couplet = array(&$id, &$comment);
     return $couplet;
 }
Пример #3
0
function plugin_lastcomments_rss()
{
    global $smarty;
    if (false === ($f = io_load_file(LASTCOMMENTS_CACHE_FILE))) {
        // no comments in cache
        $list = array();
    } else {
        // if file exists and its correctly read, we get the stored list
        // (it is stored in encoded form)
        $list = unserialize($f);
    }
    $newlist = array();
    foreach ($list as $c) {
        $newlist[] = comment_parse($list['entryid'], $list['id']);
    }
    $smarty->assign('lastcomments_list', $newlist);
}