36 mt_srand((
double)microtime()*1000000);
38 if (mt_rand(1, 100) < 11) {
39 $online_handler->gc(300);
41 if (is_object($xoopsUser)) {
42 $uid = $xoopsUser->getVar(
'uid');
43 $uname = $xoopsUser->getVar(
'uname');
48 if (is_object($xoopsModule)) {
49 $online_handler->write(
$uid,
$uname, time(), $xoopsModule->getVar(
'mid'),
$_SERVER[
'REMOTE_ADDR']);
53 $onlines = $online_handler->getAll();
54 if (
false != $onlines) {
55 $total = count($onlines);
59 for (
$i = 0;
$i < $total;
$i++) {
60 if ($onlines[
$i][
'online_uid'] > 0) {
61 $members .=
' <a href="' . XOOPS_URL .
'/userinfo.php?uid=' . $onlines[
$i][
'online_uid'] .
'" title="' . $onlines[
$i][
'online_uname'] .
'">' . $onlines[
$i][
'online_uname'] .
'</a>,';
67 if (is_object($xoopsModule)) {
68 $mytotal = $online_handler->getCount(
new Criteria(
'online_module', $xoopsModule->getVar(
'mid')));
69 $block[
'online_total'] .=
' ('.sprintf(
_ONLINEPHRASEX, $mytotal, $xoopsModule->getVar(
'name')).
')';
72 $block[
'lang_guests'] =
_GUESTS;
73 $block[
'online_names'] = $members;
74 $block[
'online_members'] = $total - $guests;
75 $block[
'online_guests'] = $guests;
76 $block[
'lang_more'] =
_MORE;
89 $block[
'unamevalue'] =
"";
91 $block[
'lang_login'] =
_LOGIN;
95 if ($xoopsConfig[
'use_ssl'] == 1 && $xoopsConfig[
'sslloginlink'] !=
'') {
96 $block[
'sslloginlink'] =
"<a href=\"javascript:openWithSelfMain('".$xoopsConfig[
'sslloginlink'].
"', 'ssllogin', 300, 200);\">".
_MB_SYSTEM_SECURE.
"</a>";
97 } elseif ($xoopsConfig[
'usercookie']) {
110 $block[
'lang_close'] =
_CLOSE;
117 $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
119 foreach (array_keys($modules) as
$i) {
120 if (in_array($i, $read_allowed)) {
121 $block[
'modules'][
$i][
'name'] = $modules[
$i]->getVar(
'name');
122 $block[
'modules'][
$i][
'directory'] = $modules[
$i]->getVar(
'dirname');
123 $sublinks = $modules[
$i]->subLink();
124 if ((!empty($xoopsModule)) && ($i == $xoopsModule->getVar(
'mid'))) {
125 $block[
'modules'][
$i][
'highlight'] =
true;
126 $block[
'nothome'] =
true;
127 }
if ((!empty($xoopsModule)) && ($i == $xoopsModule->getVar(
'mid'))) {
128 $block[
'modules'][
$i][
'highlight'] =
true;
129 $block[
'nothome'] =
true;
131 if ((count($sublinks) > 0) && (!empty($xoopsModule)) && ($i == $xoopsModule->getVar(
'mid'))) {
132 foreach($sublinks as $sublink){
133 $block[
'modules'][
$i][
'sublinks'][] = array(
'name' => $sublink[
'name'],
'url' => XOOPS_URL.
'/modules/'.$modules[$i]->getVar(
'dirname').
'/'.$sublink[
'url']);
136 $block[
'modules'][
$i][
'sublinks'] = array();
154 if (!is_object($xoopsUser)) {
161 $block[
'uid'] = $xoopsUser->getVar(
'uid');
189 $block[
'modules'][0][
'adminlink'] = XOOPS_URL.
"/modules/news/admin/index.php?op=newarticle";
190 list($block[
'modules'][0][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
199 $block[
'modules'][1][
'adminlink'] = XOOPS_URL.
"/modules/mylinks/admin/index.php?op=listNewLinks";
200 list($block[
'modules'][1][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
205 $block[
'modules'][2][
'adminlink'] = XOOPS_URL.
"/modules/mylinks/admin/index.php?op=listBrokenLinks";
206 list($block[
'modules'][2][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
211 $block[
'modules'][3][
'adminlink'] = XOOPS_URL.
"/modules/mylinks/admin/index.php?op=listModReq";
212 list($block[
'modules'][3][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
219 $result =
$xoopsDB->query(
"SELECT COUNT(*) FROM ".
$xoopsDB->prefix(
"mydownloads_downloads").
" WHERE status=0");
221 $block[
'modules'][4][
'adminlink'] = XOOPS_URL.
"/modules/mydownloads/admin/index.php?op=listNewDownloads";
222 list($block[
'modules'][4][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
227 $block[
'modules'][5][
'adminlink'] = XOOPS_URL.
"/modules/mydownloads/admin/index.php?op=listBrokenDownloads";
228 list($block[
'modules'][5][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
233 $block[
'modules'][6][
'adminlink'] = XOOPS_URL.
"/modules/mydownloads/admin/index.php?op=listModReq";
234 list($block[
'modules'][6][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
242 $block[
'modules'][7][
'adminlink'] = XOOPS_URL.
"/modules/system/admin.php?module=0&status=1&fct=comments";
243 list($block[
'modules'][7][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
249 $result =
$xoopsDB->query(
"SELECT COUNT(*) FROM ".
$xoopsDB->prefix(
"tdmdownloads_downloads").
" WHERE status=0");
251 $block[
'modules'][8][
'adminlink'] = XOOPS_URL.
"/modules/TDMDownloads/admin/downloads.php?op=list&statut_display=0";
252 list($block[
'modules'][8][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
259 $result =
$xoopsDB->query(
"SELECT COUNT(*) FROM ".
$xoopsDB->prefix(
"extgallery_publicphoto").
" WHERE photo_approved=0");
261 $block[
'modules'][9][
'adminlink'] = XOOPS_URL.
"/modules/extgallery/admin/photo.php#pending-photo";
262 list($block[
'modules'][9][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
271 $block[
'modules'][10][
'adminlink'] = XOOPS_URL.
"/modules/smartsection/admin/item.php";
272 list($block[
'modules'][10][
'pendingnum']) =
$xoopsDB->fetchRow(
$result);
287 $block[
'showgroups'] =
true;
288 $result =
$xoopsDB->query(
"SELECT u.uid, u.uname, u.email, u.user_viewemail, u.user_avatar, g.name AS groupname FROM ".
$xoopsDB->prefix(
"groups_users_link").
" l LEFT JOIN ".
$xoopsDB->prefix(
"users").
" u ON l.uid=u.uid LEFT JOIN ".
$xoopsDB->prefix(
"groups").
" g ON l.groupid=g.groupid WHERE g.group_type='Admin' ORDER BY l.groupid, u.uid");
293 if ($prev_caption != $userinfo[
'groupname']) {
294 $prev_caption = $userinfo[
'groupname'];
295 $block[
'groups'][
$i][
'name'] =
$myts->htmlSpecialChars($userinfo[
'groupname']);
297 if (isset($xoopsUser) && is_object($xoopsUser)) {
298 $block[
'groups'][
$i][
'users'][] = array(
'id' => $userinfo[
'uid'],
'name' =>
$myts->htmlspecialchars($userinfo[
'uname']),
'msglink' =>
"<a href=\"javascript:openWithSelfMain('".XOOPS_URL.
"/pmlite.php?send2=1&to_userid=".$userinfo[
'uid'].
"','pmlite',450,370);\"><img src=\"".XOOPS_URL.
"/images/icons/pm_small.gif\" border=\"0\" width=\"27\" height=\"17\" alt=\"\" /></a>",
'avatar' =>
XOOPS_UPLOAD_URL.
'/'.$userinfo[
'user_avatar']);
300 if ($userinfo[
'user_viewemail']) {
301 $block[
'groups'][
$i][
'users'][] = array(
'id' => $userinfo[
'uid'],
'name' =>
$myts->htmlspecialchars($userinfo[
'uname']),
'msglink' =>
'<a href="mailto:'.$userinfo[
'email'].
'"><img src="'.XOOPS_URL.
'/images/icons/em_small.gif" border="0" width="16" height="14" alt="" /></a>',
'avatar' =>
XOOPS_UPLOAD_URL.
'/'.$userinfo[
'user_avatar']);
303 $block[
'groups'][
$i][
'users'][] = array(
'id' => $userinfo[
'uid'],
'name' =>
$myts->htmlspecialchars($userinfo[
'uname']),
'msglink' =>
' ',
'avatar' =>
XOOPS_UPLOAD_URL.
'/'.$userinfo[
'user_avatar']);
310 $block[
'showgroups'] =
false;
312 $block[
'logourl'] = XOOPS_URL.
'/images/'.
$options[2];
313 $block[
'recommendlink'] =
"<a href=\"javascript:openWithSelfMain('".XOOPS_URL.
"/misc.php?action=showpopups&type=friend&op=sendform&t=".time().
"','friend',".
$options[0].
",".
$options[1].
")\">".
_MB_SYSTEM_RECO.
"</a>";
327 $count = count($newmembers);
328 for (
$i = 0;
$i < $count;
$i++) {
330 $block[
'users'][
$i][
'avatar'] = $newmembers[
$i]->getVar(
'user_avatar') !=
'blank.gif' ?
XOOPS_UPLOAD_URL.
'/'.$newmembers[
$i]->getVar(
'user_avatar') :
'';
332 $block[
'users'][
$i][
'avatar'] =
'';
334 $block[
'users'][
$i][
'id'] = $newmembers[
$i]->getVar(
'uid');
335 $block[
'users'][
$i][
'name'] = $newmembers[
$i]->getVar(
'uname');
336 $block[
'users'][
$i][
'joindate'] =
formatTimestamp($newmembers[
$i]->getVar(
'user_regdate'),
's');
347 for (
$i = 2;
$i < $size;
$i++) {
355 $count = count($topposters);
356 for (
$i = 0;
$i < $count;
$i++) {
357 $block[
'users'][
$i][
'rank'] =
$i+1;
359 $block[
'users'][
$i][
'avatar'] = $topposters[
$i]->getVar(
'user_avatar') !=
'blank.gif' ?
XOOPS_UPLOAD_URL.
'/'.$topposters[
$i]->getVar(
'user_avatar') :
'';
361 $block[
'users'][
$i][
'avatar'] =
'';
363 $block[
'users'][
$i][
'id'] = $topposters[
$i]->getVar(
'uid');
364 $block[
'users'][
$i][
'name'] = $topposters[
$i]->getVar(
'uname');
365 $block[
'users'][
$i][
'posts'] = $topposters[
$i]->getVar(
'posts');
374 include_once XOOPS_ROOT_PATH.
'/include/comment_constants.php';
384 $gperm_groupid = is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
386 $criteria1->add(
new Criteria(
'gperm_groupid',
'('.implode(
',', $gperm_groupid).
')',
'IN'));
389 foreach($perms as $item) {
390 $modIds[] = $item->getVar(
'gperm_itemid');
392 if(count($modIds) > 0 ) {
393 $modIds = array_unique($modIds);
405 $com[
'module'] =
'<a href="'.XOOPS_URL.
'/modules/'.$modules[
$mid]->getVar(
'dirname').
'/">'.$modules[
$mid]->getVar(
'name').
'</a>';
411 $com[
'icon'] = htmlspecialchars(
$comments[$i]->getVar(
'com_icon'), ENT_QUOTES );
412 $com[
'icon'] = ($com[
'icon'] !=
'') ? $com[
'icon'] :
'icon1.gif';
414 if (
$comments[$i]->getVar(
'com_uid') > 0) {
417 $com[
'poster'] =
'<a href="'.XOOPS_URL.
'/userinfo.php?uid='.
$comments[
$i]->getVar(
'com_uid').
'">'.
$poster->getVar(
'uname').
'</a>';
419 $com[
'poster'] =
$GLOBALS[
'xoopsConfig'][
'anonymous'];
422 $com[
'poster'] =
$GLOBALS[
'xoopsConfig'][
'anonymous'];
424 $block[
'comments'][] =& $com;
434 include_once XOOPS_ROOT_PATH .
'/include/notification_functions.php';
435 include_once XOOPS_ROOT_PATH .
'/language/' . $xoopsConfig[
'language'] .
'/notification.php';
445 if (empty($categories)) {
448 foreach ($categories as $category) {
449 $section[
'name'] = $category[
'name'];
450 $section[
'title'] = $category[
'title'];
451 $section[
'description'] = $category[
'description'];
452 $section[
'itemid'] = $category[
'item_id'];
453 $section[
'events'] = array();
454 $subscribed_events =
$notification_handler->getSubscribedEvents ($category[
'name'], $category[
'item_id'], $xoopsModule->getVar(
'mid'), $xoopsUser->getVar(
'uid'));
456 if (!empty($event[
'admin_only']) && !$xoopsUser->isAdmin($xoopsModule->getVar(
'mid'))) {
459 $subscribed = in_array($event[
'name'], $subscribed_events) ? 1 : 0;
460 $section[
'events'][$event[
'name']] = array (
'name'=>$event[
'name'],
'title'=>$event[
'title'],
'caption'=>$event[
'caption'],
'description'=>$event[
'description'],
'subscribed'=>$subscribed);
462 $block[
'categories'][$category[
'name']] = $section;
465 $block[
'target_page'] =
"notification_update.php";
467 $script_url = explode(
'/',
$_SERVER[
'PHP_SELF']);
468 $script_name = $script_url[count($script_url)-1];
469 $block[
'redirect_script'] = $script_name;
471 $block[
'notification_token'] =
$GLOBALS[
'xoopsSecurity']->createToken();
477 $inputtag =
"<input type='text' name='options[]' value='".intval(
$options[0]).
"' />";
484 include_once XOOPS_ROOT_PATH.
'/class/xoopslists.php';
485 $inputtag =
"<input type='text' name='options[]' value='".intval(
$options[0]).
"' />";
487 $form .=
"<br />"._MB_SYSTEM_DISPLAYA.
" <input type='radio' id='options[]' name='options[]' value='1'";
489 $form .=
" checked='checked'";
491 $form .=
" /> "._YES.
"<input type='radio' id='options[]' name='options[]' value='0'";
493 $form .=
" checked='checked'";
495 $form .=
" /> "._NO.
"";
496 $form .=
"<br />"._MB_SYSTEM_NODISPGR.
"<br /><select id='options[]' name='options[]' multiple='multiple'>";
497 $ranks = XoopsLists::getUserRankList();
499 foreach ($ranks as $k => $v) {
501 for (
$i = 2;
$i < $size;
$i++ ) {
503 $sel =
" selected='selected'";
506 $form .=
"<option value='$k'$sel>$v</option>";
508 $form .=
"</select>";
514 $inputtag =
"<input type='text' name='options[]' value='".$options[0].
"' />";
516 $form .=
"<br />"._MB_SYSTEM_DISPLAYA.
" <input type='radio' id='options[]' name='options[]' value='1'";
518 $form .=
" checked='checked'";
520 $form .=
" /> "._YES.
"<input type='radio' id='options[]' name='options[]' value='0'";
522 $form .=
" checked='checked'";
524 $form .=
" /> "._NO.
"";
531 $form .=
"<input type='text' name='options[]' value='".$options[0].
"' />";
532 $form .=
"<br />"._MB_SYSTEM_PWHEIGHT.
" ";
533 $form .=
"<input type='text' name='options[]' value='".$options[1].
"' />";
535 $form .=
"<input type='text' name='options[]' value='".$options[2].
"' />";
537 $form .=
"<br />"._MB_SYSTEM_SADMIN.
" ";
539 $chk =
" checked='checked'";
541 $form .=
"<input type='radio' name='options[3]' value='1'".$chk.
" /> ".
_YES.
"";
544 $chk =
" checked=\"checked\"";
546 $form .=
" <input type='radio' name='options[3]' value='0'".$chk.
" />".
_NO.
"";
554 foreach ($xoopsConfig[
'theme_set_allowed'] as $theme) {
555 $theme_options .=
'<option value="'.$theme.
'"';
556 if ($theme == $xoopsConfig[
'theme_set']) {
557 $theme_options .=
' selected="selected"';
559 $theme_options .=
'>'.$theme.
'</option>';
563 $block[
'theme_select'] =
"<img vspace=\"2\" id=\"xoops_theme_img\" src=\"".XOOPS_THEME_URL.
"/".$xoopsConfig[
'theme_set'].
"/shot.gif\" alt=\"screenshot\" width=\"".intval(
$options[1]).
"\" /><br /><select id=\"xoops_theme_select\" name=\"xoops_theme_select\" onchange=\"showImgSelected('xoops_theme_img', 'xoops_theme_select', 'themes', '/shot.gif', '".XOOPS_URL.
"');\">".$theme_options.
"</select><input type=\"submit\" value=\"".
_GO.
"\" />";
565 $block[
'theme_select'] =
'<select name="xoops_theme_select" onchange="submit();" size="3">'.$theme_options.
'</select>';
568 $block[
'theme_select'] .=
'<br />('.sprintf(
_MB_SYSTEM_NUMTHEME,
'<strong>'.count($xoopsConfig[
'theme_set_allowed']).
'</strong>').
')<br />';
578 $chk =
" checked='checked'";
580 $form .=
"<input type='radio' name='options[0]' value='1'".$chk.
" /> ".
_YES;
583 $chk =
' checked="checked"';
585 $form .=
' <input type="radio" name="options[0]" value="0"'.$chk.
' />'.
_NO;
586 $form .=
'<br />'._MB_SYSTEM_THWIDTH.
' ';
587 $form .=
"<input type='text' name='options[1]' value='".$options[1].
"' />";