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