blob: a75caa8c47502f7d4dda8d744ade22d2df481e7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
<?php
/**
* @version $Header$
*
* FeedStatus class
*
* @version $Revision$
* @package feed
* @subpackage functions
*/
/**
* global defs
*/
namespace Bitweaver\Feed;
use Bitweaver\Liberty\LibertyComment;
global $gQueryUser,$gBitSmarty;
require_once FEED_PKG_INCLUDE_PATH . 'feed_lib.php';
if( !empty( $_REQUEST['feed_status'] ) ){
$pParamHash['status_message'] = $_REQUEST['feed_status'];
feed_set_status($pParamHash);
}
if( !empty( $moduleParams['module_params']['no_link_user'] ) ) {
$listHash['no_link_user'] = true;
}
if( !empty( $moduleParams['module_rows'] ) ) {
$listHash['max_records'] = $moduleParams['module_rows'];
}elseif (!empty($moduleParams['module_params']['max_records'])){
$listHash['max_records'] = $moduleParams['module_params']['max_records'];
}
$listHash['user_id'] = ( !empty( $moduleParams['module_params']['user_id'] ) ) ? $moduleParams['module_params']['user_id'] : $gQueryUser->mUserId;
$statuses = feed_get_status( $listHash );
$gBitSmarty->assign( 'statuses', $statuses);
foreach ($statuses as $status){
$commentContentId = 'comment_'.$status['content_id'];
if(!empty($_REQUEST[$commentContentId])){
//then there is a reply to this comment and break, we only handle one at a time
$reply = new LibertyComment();
$pParamHash['root_id'] = $status['content_id'];
$pParamHash['parent_id'] = $status['content_id'];
$pParamHash['comment_data'] = $_REQUEST[$commentContentId];
$pParamHash['title'] = substr($_REQUEST[$commentContentId],0,20);
$reply->storeComment($pParamHash);
$statuses = feed_get_status( $listHash );
$gBitSmarty->assign( 'statuses', $statuses);
break;
}
}
|