<?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
*/
if ($GLOBALS['currentUser']['NodId']>0) {
$myBlog = xs2GetLinks(array('NodId'=> $GLOBALS['currentUser']['NodId'],
'NType'=>'blog', 'lnkField'=>'User', 'linkDetail'=>3));
if (count($myBlog) > 0) {
$GLOBALS['myBlog'] = $myBlog[0];
}
else { //Если блог не найден, а пользователь авторизован, создаем ему новый блог
$blogId = xs2InsertNode(array('NType' => 'blog',
'ParId' => 1,
'NFlag' => 1,
'NName' => $GLOBALS['currentUser']['NName'],
'User' => array('NodId'=> $GLOBALS['currentUser']['NodId'])));
if ($blogId) {
$GLOBALS['myBlog'] = xs2GetNode(array('NodId'=> $blogId));
}
}
$_HTML->assign('myBlog', $GLOBALS['myBlog']);
}
function _getNodId($node) {
return $node['NodId'];
}
?>
|
|