| @@ 42-48 (lines=7) @@ | ||
| 39 | ||
| 40 | list($numrows) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(entryID) FROM ' . $xoopsDB->prefix('lxentries') . " WHERE offline= '0' AND block = '1' " . $catperms . ' ')); |
|
| 41 | ||
| 42 | if ($numrows > 1) { |
|
| 43 | --$numrows; |
|
| 44 | mt_srand((double)microtime() * 1000000); |
|
| 45 | $entrynumber = mt_rand(0, $numrows); |
|
| 46 | } else { |
|
| 47 | $entrynumber = 0; |
|
| 48 | } |
|
| 49 | ||
| 50 | $result = $xoopsDB->query('SELECT entryID, categoryID, term, definition FROM ' . $xoopsDB->prefix('lxentries') . " WHERE offline = '0' AND block = '1' " . $catperms . " LIMIT $entrynumber, 1"); |
|
| 51 | ||
| @@ 42-48 (lines=7) @@ | ||
| 39 | WHERE a.categoryID = b.gperm_itemid AND b.gperm_modid = $module_id AND b.gperm_name = \"lexikon_view\" AND b.gperm_groupid = $groups[0] AND offline = '0' AND submit = '0' "); |
|
| 40 | $numrows = $xoopsDB->getRowsNum($resultX); |
|
| 41 | ||
| 42 | if ($numrows > 1) { |
|
| 43 | --$numrows; |
|
| 44 | mt_srand((double)microtime() * 1000000); |
|
| 45 | $entrynumber = mt_rand(0, $numrows); |
|
| 46 | } else { |
|
| 47 | $entrynumber = 0; |
|
| 48 | } |
|
| 49 | //$resultZ = $xoopsDB -> query ( " SELECT entryID, categoryID, term, definition FROM ".$xoopsDB->prefix("lxentries")." WHERE offline = '0' AND submit = '0' AND request = '0' LIMIT $entrynumber, 1"); |
|
| 50 | $resultZ = $xoopsDB->query('SELECT a.entryID, a.categoryID, a.term, a.definition, a.offline, b.* FROM ' |
|
| 51 | . $xoopsDB->prefix('lxentries') |
|
| @@ 135-141 (lines=7) @@ | ||
| 132 | ||
| 133 | // To display the random term block |
|
| 134 | list($numrows) = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('lxentries') . " WHERE submit = 'O' AND offline = '0' " . $catperms . ' ')); |
|
| 135 | if ($numrows > 1) { |
|
| 136 | --$numrows; |
|
| 137 | mt_srand((double)microtime() * 1000000); |
|
| 138 | $entrynumber = mt_rand(0, $numrows); |
|
| 139 | } else { |
|
| 140 | $entrynumber = 0; |
|
| 141 | } |
|
| 142 | ||
| 143 | $resultZ = $xoopsDB->query('SELECT entryID, categoryID, term, definition, html, smiley, xcodes, breaks FROM ' |
|
| 144 | . $xoopsDB->prefix('lxentries') |
|