| @@ 272-289 (lines=18) @@ | ||
| 269 | /** |
|
| 270 | * @return mixed |
|
| 271 | */ |
|
| 272 | public static function countWords() |
|
| 273 | { |
|
| 274 | global $xoopsUser, $xoopsDB; |
|
| 275 | $gpermHandler = xoops_getHandler('groupperm'); |
|
| 276 | $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; |
|
| 277 | /** @var XoopsModuleHandler $moduleHandler */ |
|
| 278 | $moduleHandler = xoops_getHandler('module'); |
|
| 279 | $module = $moduleHandler->getByDirname('lexikon'); |
|
| 280 | $module_id = $module->getVar('mid'); |
|
| 281 | $allowed_cats = $gpermHandler->getItemIds('lexikon_view', $groups, $module_id); |
|
| 282 | $catids = implode(',', $allowed_cats); |
|
| 283 | $catperms = " AND categoryID IN ($catids) "; |
|
| 284 | ||
| 285 | $pubwords = $xoopsDB->query('SELECT * FROM ' . $xoopsDB->prefix('lxentries') . " WHERE submit = '0' AND offline ='0' AND request = '0' " . $catperms . ' '); |
|
| 286 | $publishedwords = $xoopsDB->getRowsNum($pubwords); |
|
| 287 | ||
| 288 | return $publishedwords; |
|
| 289 | } |
|
| 290 | ||
| 291 | // To display the list of categories |
|
| 292 | /** |
|
| @@ 109-124 (lines=16) @@ | ||
| 106 | return count($totalcats); |
|
| 107 | } |
|
| 108 | ||
| 109 | function lx_countWords () { |
|
| 110 | global $xoopsUser, $xoopsDB; |
|
| 111 | $gperm_handler = xoops_gethandler('groupperm'); |
|
| 112 | $groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; |
|
| 113 | $module_handler = xoops_gethandler('module'); |
|
| 114 | $module = $module_handler->getByDirname('lexikon'); |
|
| 115 | $module_id = $module->getVar('mid'); |
|
| 116 | $allowed_cats = $gperm_handler->getItemIds("lexikon_view", $groups, $module_id); |
|
| 117 | $catids = implode(',', $allowed_cats); |
|
| 118 | $catperms = " AND categoryID IN ($catids) "; |
|
| 119 | ||
| 120 | $pubwords = $xoopsDB -> query( "SELECT * FROM " . $xoopsDB -> prefix( "lxentries" ) . " WHERE submit = '0' AND offline ='0' AND request = '0' ".$catperms." " ); |
|
| 121 | $publishedwords = $xoopsDB -> getRowsNum ( $pubwords ); |
|
| 122 | ||
| 123 | return $publishedwords; |
|
| 124 | } |
|
| 125 | ||
| 126 | // To display the list of categories |
|
| 127 | function lx_CatsArray(){ |
|