Skip to content

Commit f35055d

Browse files
committed
comments WIP
1 parent 0a0b72f commit f35055d

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

easyblog/easyblog/comments.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
defined('_JEXEC') or die( 'Restricted access' );
3+
//error_reporting(E_ALL);
4+
//ini_set('display_errors', 1);
5+
6+
jimport('joomla.user.user');
7+
jimport( 'simpleschema.category' );
8+
jimport( 'simpleschema.person' );
9+
jimport( 'simpleschema.blog.post' );
10+
jimport( 'simpleschema.blog.comment' );
11+
12+
require_once( EBLOG_HELPERS . '/date.php' );
13+
require_once( EBLOG_HELPERS . '/string.php' );
14+
require_once( EBLOG_CLASSES . '/adsense.php' );
15+
16+
class EasyblogApiResourceComments extends ApiResource
17+
{
18+
19+
public function __construct( &$ubject, $config = array()) {
20+
parent::__construct( $ubject, $config = array() );
21+
22+
}
23+
24+
public function get() {
25+
$input = JFactory::getApplication()->input;
26+
$model = EasyBlogHelper::getModel( 'Blog' );
27+
$id = $input->get('id', null, 'INT');
28+
$comments = array();
29+
30+
$rows = $model->getBlogComment($id);
31+
32+
foreach ($rows as $row) {
33+
$item = new CommentSchema;
34+
$item->commentid = $row->;
35+
$item->postid = $id;
36+
37+
$comments[] = $item;
38+
}
39+
40+
$this->plugin->setResponse( $comments );
41+
42+
}
43+
44+
public static function getName() {
45+
46+
}
47+
48+
public static function describe() {
49+
50+
}
51+
52+
}

easyblog/libraries/simpleschema/blog/comment.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
class CommentSchema {
3+
class CommentSimpleSchema {
44

55
public $commentid;
66

@@ -16,6 +16,6 @@ class CommentSchema {
1616

1717
public $updated_date;
1818

19-
public $author
19+
public $author;
2020

2121
}

0 commit comments

Comments
 (0)