XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
function.xoInboxCount.php
Go to the documentation of this file.
1
<?php
2
3
function
smarty_function_xoInboxCount
($params, &$smarty)
4
{
5
$xoops
=
Xoops::getInstance
();
6
7
if
(!
$xoops
->isUser()) {
8
return
;
9
}
10
$time = time();
11
if
(isset(
$_SESSION
[
'xoops_inbox_count'
]) && @
$_SESSION
[
'xoops_inbox_count_expire'
] > $time) {
12
$count
= intval(
$_SESSION
[
'xoops_inbox_count'
]);
13
}
else
{
14
$pm_handler
=
$xoops
->getHandlerPrivmessage();
15
16
$xoopsPreload =
XoopsPreload::getInstance
();
17
$xoopsPreload->triggerEvent(
'core.class.smarty.xoops_plugins.xoinboxcount'
, array(
$pm_handler
));
18
19
$criteria
=
new
CriteriaCompo
(
new
Criteria
(
'read_msg'
, 0));
20
$criteria
->add(
new
Criteria
(
'to_userid'
,
$xoops
->user->getVar(
'uid'
)));
21
$count
= intval(
$pm_handler
->getCount(
$criteria
));
22
$_SESSION
[
'xoops_inbox_count'
] =
$count
;
23
$_SESSION[
'xoops_inbox_count_expire'
] = $time + 60;
24
}
25
if
(!@empty($params[
'assign'
])) {
26
$smarty->assign($params[
'assign'
],
$count
);
27
}
else
{
28
echo
$count
;
29
}
30
}
$count
$count
Definition:
page_tablesfill.php:45
$_SESSION
$_SESSION['RF']["verify"]
Definition:
dialog.php:4
Xoops\Core\Events\getInstance
static getInstance()
Definition:
Events.php:57
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
$xoops
$xoops
Definition:
admin.php:25
$criteria
$criteria
Definition:
page_configsite.php:52
smarty_function_xoInboxCount
smarty_function_xoInboxCount($params, &$smarty)
Definition:
function.xoInboxCount.php:3
CriteriaCompo
Definition:
criteria.php:22
$pm_handler
$pm_handler
Definition:
readpmsg.php:37
Criteria
Definition:
criteria.php:29
usr64
htdocs
xoops_lib
smarty
xoops_plugins
function.xoInboxCount.php
Generated on Fri May 22 2015 03:07:04 for XOOPS by
1.8.9.1