11 private $canRead =
null;
12 private $canEdit =
null;
13 private static $permissions =
array();
14 private static $posts =
array();
16 private static function getPostData(
$entityId)
18 if (array_key_exists(
$entityId, self::$posts))
21 $cacheId =
'blog_post_socnet_general_' .
$entityId .
'_' . LANGUAGE_ID .
'_voteconnector';
22 $timezoneOffset = \CTimeZone::getOffset();
23 if($timezoneOffset != 0)
25 $cacheId .=
"_" . $timezoneOffset;
29 $cache = new \CPHPCache;
30 if ($cache->initCache($cacheTtl, $cacheId, $cacheDir))
32 $post = $cache->getVars();
36 $cache->startDataCache();
59 if (!empty(
$post[
'DETAIL_TEXT']))
64 $cache->endDataCache(
$post);
70 private function getPermission(
$userId)
78 || \CSocNetUser::isCurrentUserModuleAdmin()
83 else if (!array_key_exists($this->entityId, self::$permissions))
86 $post = self::getPostData($this->entityId);
89 $p = \CBlogPost::getSocNetPostPerms($this->entityId,
true,
$userId,
$post[
"AUTHOR_ID"]);
105 $post = self::getPostData($this->entityId);
109 $data[
"URL"] = str_replace(
110 array(
"#user_id#",
"#post_id#"),
112 \COption::GetOptionString(
"socialnetwork",
"userblogpost_page")
123 if ($this->entityId ===
null)
137 if ($this->entityId ===
null)
142 return $this->canEdit;
const BLOG_PERMS_MODERATE
static includeModule($moduleName)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)