function b_mysearch_last_search_show() { include_once XOOPS_ROOT_PATH . '/modules/mysearch/include/functions.php'; $mysearch_handler =& xoops_getmodulehandler('searches', 'mysearch'); $visiblekeywords = 0; $block = array(); $visiblekeywords = mysearch_getmoduleoption('showindex'); if ($visiblekeywords > 0) { $block['visiblekeywords'] = $visiblekeywords; $totalcount = $mysearch_handler->getCount(); $start = 0; $critere = new Criteria('mysearchid', 0, '<>'); $critere->setSort('datesearch'); $critere->setLimit($visiblekeywords); $critere->setStart($start); $critere->setOrder('DESC'); $tmpmysearch = new searches(); $elements = $mysearch_handler->getObjects($critere); foreach ($elements as $oneelement) { $search = array(); $search['keyword'] = $oneelement->getVar('keyword'); $search['date'] = formatTimestamp(strtotime($oneelement->getVar('datesearch'))); $search['uid'] = $oneelement->getVar('keyword'); $search['uname'] = $tmpmysearch->uname($oneelement->getVar('uid')); $search['link'] = "<a href='" . XOOPS_URL . '/search.php?query=' . $oneelement->getVar('keyword') . "&action=results' target='_blank'>"; $block['searches'][] = $search; unset($search); } } return $block; }
function b_mysearch_big_user_show() { include_once XOOPS_ROOT_PATH . "/modules/mysearch/include/functions.php"; $mysearch_handler =& xoops_getmodulehandler('searches', 'mysearch'); $block = array(); $visiblekeywords = mysearch_getmoduleoption('showindex'); if ($visiblekeywords > 0) { $tmpmysearch = new searches(); $keywords_count = mysearch_getmoduleoption('admincount'); // Total keywords count $block['total_keywords'] = $mysearch_handler->getCount(); // Biggest users $elements = $mysearch_handler->getBiggestContributors(0, $keywords_count); foreach ($elements as $oneuser => $onecount) { $block['biggesusers'][] = array('uid' => $oneuser, 'uname' => $tmpmysearch->uname($oneuser), 'count' => $onecount); } } return $block; }
} elseif (isset($_SESSION['start3'])) { $start = intval($_SESSION['start3']); } $_SESSION['start3'] = $start; $pagenav = new XoopsPageNav($mysearch_handler->getBiggestContributorsCount(), $keywords_count, $start, 'start3', 'op=stats'); $elements = $mysearch_handler->getBiggestContributors($start, $keywords_count); mysearch_collapsableBar('bigcontribut', 'bigcontributicon'); echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='bigcontributicon' name='bigcontributicon' src=" . XOOPS_URL . "/modules/mysearch/images/close12.gif alt='' /></a> " . _AM_MYSEARCH_BIGGEST_USERS . "</h4>"; echo "<div id='bigcontribut'>"; echo '<br />'; echo "<table width='100%' cellspacing='1' cellpadding='3' border='0' class='outer'>"; echo "<tr><th align='center'>" . _AM_MYSEARCH_USER . "</th><th align='center'>" . _AM_MYSEARCH_HITS . "</th></tr>"; $class = ''; foreach ($elements as $oneuser => $onecount) { $class = $class == 'even' ? 'odd' : 'even'; $link1 = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $oneuser . "'>" . $tmpmysearch->uname($oneuser) . "</a>"; echo "<tr class='" . $class . "'><td align='center'>" . $link1 . "</td><td align='center'>" . $onecount . "</td></tr>"; } echo "</table><div align='right'>" . $pagenav->renderNav() . '</div></div><br />'; // daily stats **************************************************************************************************************************************** $start = 0; if (isset($_GET['start4'])) { $start = intval($_GET['start4']); } elseif (isset($_SESSION['start4'])) { $start = intval($_SESSION['start4']); } $_SESSION['start4'] = $start; $pagenav = new XoopsPageNav($mysearch_handler->getUniqueDaysCount(), $keywords_count, $start, 'start4', 'op=stats'); $elements = $mysearch_handler->GetCountPerDay($start, $keywords_count); mysearch_collapsableBar('daystat', 'daystaticon'); echo "<img onclick=\"toggle('toptable'); toggleIcon('toptableicon');\" id='daystaticon' name='daystaticon' src=" . XOOPS_URL . "/modules/mysearch/images/close12.gif alt='' /></a> " . _AM_MYSEARCH_DAY_STATS . "</h4>";