XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
Wating.class.php
1<?php
10
11if (!defined('XOOPS_ROOT_PATH')) {
12 exit();
13}
14
16{
17 public function preBlockFilter()
18 {
19 $this->mController->mRoot->mDelegateManager->add('Legacyblock.Waiting.Show', [&$this, 'callbackWaitingShow']);
20 }
21
22 public function callbackWaitingShow(&$modules)
23 {
24 $xoopsDB =& Database::getInstance();
25 $module_handler =& xoops_gethandler('module');
26 // for News Module
27 if ($module_handler->getCount(new Criteria('dirname', 'news'))) {
28 $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('stories') . ' WHERE published=0');
29 if ($result) {
30 $blockVal = [];
31 $blockVal['adminlink'] = XOOPS_URL . '/modules/news/admin/index.php?op=newarticle';
32 [$blockVal['pendingnum']] = $xoopsDB->fetchRow($result);
33 $blockVal['lang_linkname'] = _MB_LEGACY_SUBMS;
34 $modules[] = $blockVal;
35 }
36 }
37 // for MyLinks Module
38 if ($module_handler->getCount(new Criteria('dirname', 'mylinks'))) {
39 $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_links') . ' WHERE status=0');
40 if ($result) {
41 $blockVal = [];
42 $blockVal['adminlink'] = XOOPS_URL . '/modules/mylinks/admin/index.php?op=listNewLinks';
43 [$blockVal['pendingnum']] = $xoopsDB->fetchRow($result);
44 $blockVal['lang_linkname'] = _MB_LEGACY_WLNKS;
45 $modules[] = $blockVal;
46 }
47 $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_broken'));
48 if ($result) {
49 $blockVal = [];
50 $blockVal['adminlink'] = XOOPS_URL . '/modules/mylinks/admin/index.php?op=listBrokenLinks';
51 [$blockVal['pendingnum']] = $xoopsDB->fetchRow($result);
52 $blockVal['lang_linkname'] = _MB_LEGACY_BLNK;
53 $modules[] = $blockVal;
54 }
55 $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_mod'));
56 if ($result) {
57 $blockVal = [];
58 $blockVal['adminlink'] = XOOPS_URL . '/modules/mylinks/admin/index.php?op=listModReq';
59 [$blockVal['pendingnum']] = $xoopsDB->fetchRow($result);
60 $blockVal['lang_linkname'] = _MB_LEGACY_MLNKS;
61 $modules[] = $blockVal;
62 }
63 }
64 // for MyDownloads Modules
65 if ($module_handler->getCount(new Criteria('dirname', 'mydownloads'))) {
66 $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mydownloads_downloads') . ' WHERE status=0');
67 if ($result) {
68 $blockVal = [];
69 $blockVal['adminlink'] = XOOPS_URL . '/modules/mydownloads/admin/index.php?op=listNewDownloads';
70 [$blockVal['pendingnum']] = $xoopsDB->fetchRow($result);
71 $blockVal['lang_linkname'] = _MB_LEGACY_WDLS;
72 $modules[] = $blockVal;
73 }
74 $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mydownloads_broken') . '');
75 if ($result) {
76 $blockVal = [];
77 $blockVal['adminlink'] = XOOPS_URL . '/modules/mydownloads/admin/index.php?op=listBrokenDownloads';
78 [$blockVal['pendingnum']] = $xoopsDB->fetchRow($result);
79 $blockVal['lang_linkname'] = _MB_LEGACY_BFLS;
80 $modules[] = $blockVal;
81 }
82 $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mydownloads_mod') . '');
83 if ($result) {
84 $blockVal = [];
85 $blockVal['adminlink'] = XOOPS_URL . '/modules/mydownloads/admin/index.php?op=listModReq';
86 [$blockVal['pendingnum']] = $xoopsDB->fetchRow($result);
87 $blockVal['lang_linkname'] = _MB_LEGACY_MFLS;
88 $modules[] = $blockVal;
89 }
90 }
91 // for Comments
92 $result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('xoopscomments') . ' WHERE com_status=1');
93 if ($result) {
94 $blockVal = [];
95 $blockVal['adminlink'] = XOOPS_URL . '/modules/legacy/admin/index.php?action=CommentList&amp;com_modid=0&amp;com_status=1';
96 [$blockVal['pendingnum']] = $xoopsDB->fetchRow($result);
97 $blockVal['lang_linkname'] =_MB_LEGACY_COMPEND;
98 $modules[] = $blockVal;
99 }
100 }
101}
preBlockFilter()
[Abstract] Executes the logic, when the controller executes preBlockFilter().