<?php
/**
* XS2:
*
* This file is developed by Solutecs, LLC for the purpose of the company
* and is provided together with XS2 Framework as and inherent part of the
* system. This file can be used on the terms of License Agreement.
*
* +7 (495) 585-0833 / 13 Rusakovskaya street, Moscow 107140 Russia
*
* @link http://www.solutecs.com
* @copyright ©1998-2007 Solutecs, LLC
* @package XS2-MODCOM
* @subpackage proc-blog
* @version 1.XX
*/
xs2Fetch(array('mod'=>'users','met'=>'lib'));
xs2Fetch(array('mod'=>'blog','met'=>'lib'));
$blog = xs2GetNode(array('NodId'=> $GLOBALS['myBlog']['NodId'],
'NType'=>'blog',
'fields'=> 'NodId, NName, Friends',
'lnkDetail'=> 'NodId,NName'));
$blog['Friends'] = XSCore_indexArray($blog['Friends'], 'NodId');
$_friends = join(',', array_map('_getNodId', array_filter($blog['Friends'])));
if (count($_friends)>0) {
$allFeed = xs2GetNodes(array('condition'=>'ParId IN ('.$_friends.')',
'NType'=>'message',
'fields'=>'NodId, NName, ParId, CDate, Text'));
}
if ($allFeed) {
foreach($allFeed as $key=> $msg) {
$allFeed[$key]['_comments'] = count(xs2GetChildren(array('ParId'=> $msg['NodId'])));
}
}
$_HTML->assign('blog', $blog);
$_HTML->assign('allFeed', $allFeed);
?>
|