本文整理汇总了PHP中Groups::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Groups::getAll方法的具体用法?PHP Groups::getAll怎么用?PHP Groups::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Groups
的用法示例。
在下文中一共展示了Groups::getAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$this->view->Title = "Quản lý nhóm thành viên";
$this->view->headTitle($this->view->Title);
//Assign create form
$condition = array();
if ($this->getRequest()->getParam('keyword')) {
$condition['name LIKE ?'] = "%{$this->getRequest()->getParam('keyword')}%";
}
$this->view->Group = Groups::getAll($condition);
}
示例2: buildGroupTable
public function buildGroupTable()
{
if (!defined('SHOW_RPG') || SHOW_RPG != 'checked') {
return;
}
print '<div class="row-fluid">
<div class="box span12">
<div class="box-header well" data-original-title>
<h2><i class="icon-th"></i> Releases per Group</h2>
<div class="box-icon">
<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
</div>
</div>
<div class="box-content">';
echo '<table class="table table-striped table-bordered bootstrap-datatable datatable">
<thead>
<tr>
<th>Group</th>
<th>Releases</th>
</tr>
</thead>
<tbody>';
$group = new Groups();
# get all the groups
$allgroups = $group->getAll();
$pdo = new Settings();
foreach ($allgroups as $group) {
$sql = sprintf("select count(id) as num from releases where groupid = %s", $group['id']);
$res = $pdo->queryOneRow($sql);
if ($res["num"] > 0) {
echo '<tr>';
echo '<td>';
echo $group['name'];
echo '</td>';
echo '<td class="right">';
echo $res["num"];
echo '</td>';
echo '</tr>';
}
}
echo '</tbody>
</table> ';
print '</div></div></div>';
}
示例3: Groups
<?php
require_once WWW_DIR . "/lib/groups.php";
$groups = new Groups();
if (!$users->isLoggedIn()) {
$page->show403();
}
$grouplist = $groups->getAll();
$page->smarty->assign('results', $grouplist);
$page->meta_title = "Browse Groups";
$page->meta_keywords = "browse,groups,description,details";
$page->meta_description = "Browse groups";
$page->content = $page->smarty->fetch('browsegroup.tpl');
$page->render();
示例4: fetchTestBinaries
public function fetchTestBinaries($groupname, $numarticles, $clearexistingbins)
{
$db = new DB();
$nntp = new Nntp();
$binaries = new Binaries();
$groups = new Groups();
$ret = array();
if ($clearexistingbins == true) {
$db->exec('truncate releaseregextesting');
}
$nntp->doConnect();
$groupsToFetch = array();
if (preg_match('/^[a-z]{2,3}(\\.[a-z0-9\\-]+)+$/', $groupname)) {
$groupsToFetch[] = array('name' => $groupname);
} elseif ($groupname === 0) {
$groupsToFetch = $groups->getAll();
} else {
$newsgroups = $nntp->getGroups();
foreach ($newsgroups as $ngroup) {
if (preg_match('/' . $groupname . '/', $ngroup['group'])) {
$groupsToFetch[] = array('name' => $ngroup['group']);
}
}
}
foreach ($groupsToFetch as $groupArr) {
$group = $groupArr['name'];
$data = $nntp->selectGroup($group);
if ($nntp->isError($data)) {
$ret[] = "Could not select group (doesnt exist on USP): {$group}";
continue;
} else {
$rangeStart = $data['last'] - $numarticles;
$rangeEnd = $groupEnd = $data['last'];
$rangeTotal = $rangeEnd - $rangeStart;
$done = false;
while ($done === false) {
if ($rangeTotal > $binaries->messagebuffer) {
if ($rangeStart + $binaries->messagebuffer > $groupEnd) {
$rangeEnd = $groupEnd;
} else {
$rangeEnd = $rangeStart + $binaries->messagebuffer;
}
}
if ($binaries->compressedHeaders) {
$msgs = $nntp->getXOverview($rangeStart . "-" . $rangeEnd, true, false);
} else {
$msgs = $nntp->getOverview($rangeStart . "-" . $rangeEnd, true, false);
}
if ($nntp->isError($msgs)) {
$ret[] = "Error {$msgs->code}: {$msgs->message} on " . $group;
continue 2;
}
$headers = array();
if (is_array($msgs)) {
//loop headers, figure out parts
foreach ($msgs as $msg) {
if (!isset($msg['Number'])) {
continue;
}
$msgPart = $msgTotalParts = 0;
$pattern = '|\\((\\d+)[\\/](\\d+)\\)|i';
preg_match_all($pattern, $msg['Subject'], $matches, PREG_PATTERN_ORDER);
$matchcnt = sizeof($matches[0]);
for ($i = 0; $i < $matchcnt; $i++) {
//not (int)'d here because of the preg_replace later on
$msgPart = $matches[1][$i];
$msgTotalParts = $matches[2][$i];
}
if (!isset($msg['Subject']) || $matchcnt == 0) {
// not a binary post most likely.. continue
continue;
}
if ((int) $msgPart > 0 && (int) $msgTotalParts > 0) {
$subject = utf8_encode(trim(preg_replace('|\\(' . $msgPart . '[\\/]' . $msgTotalParts . '\\)|i', '', $msg['Subject'])));
if (!isset($headers[$subject])) {
$headers[$subject]['Subject'] = $subject;
$headers[$subject]['From'] = $msg['From'];
$headers[$subject]['Date'] = strtotime($msg['Date']);
$headers[$subject]['Message-ID'] = $msg['Message-ID'];
$headers[$subject]['Size'] = $msg['Bytes'];
} else {
$headers[$subject]['Size'] += $msg['Bytes'];
}
}
}
unset($msgs);
if (isset($headers) && count($headers)) {
$groupRegexes = $this->getForGroup($group);
$binSetData = array();
foreach ($headers as $subject => $data) {
$binData = array('name' => $subject, 'fromname' => $data['From'], 'date' => $data['Date'], 'binaryhash' => md5($subject . $data['From'] . $group), 'groupname' => $group, 'regexID' => "null", 'categoryID' => "null", 'reqID' => "null", 'blacklistID' => 0, 'size' => $data['Size'], 'relname' => "null", 'relpart' => "null", 'reltotalpart' => "null");
//Filter binaries based on black/white list
if ($binaries->isBlackListed($data, $group)) {
//binary is blacklisted
$binData['blacklistID'] = 1;
}
//Apply Regexes
$regexMatches = array();
foreach ($groupRegexes as $groupRegex) {
$regexCheck = $this->performMatch($groupRegex, $subject, $data['From']);
//.........这里部分代码省略.........
示例5: AdminPage
require_once "config.php";
require_once WWW_DIR . "/lib/adminpage.php";
require_once WWW_DIR . "/lib/releaseregex.php";
require_once WWW_DIR . "/lib/groups.php";
require_once WWW_DIR . "/lib/category.php";
require_once WWW_DIR . "/lib/nntp.php";
$page = new AdminPage();
$reg = new ReleaseRegex();
$groups = new Groups();
$cat = new Category();
$id = 0;
// set the current action
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
$numarticlesdefault = 20000;
$groupList = $groups->getAll();
array_unshift($groupList, array('ID' => 0, 'name' => 'All Groups'));
$gid = $gnames = array();
$groupname = isset($_REQUEST['groupname']) && !empty($_REQUEST['groupname']) ? $_REQUEST['groupname'] : '';
$groupID = isset($_REQUEST['groupID']) ? $_REQUEST['groupID'] : '0';
$regex = isset($_REQUEST['regex']) && !empty($_REQUEST['regex']) ? $_REQUEST['regex'] : '/^(?P<name>.*)$/i';
$poster = isset($_REQUEST['poster']) && !empty($_REQUEST['poster']) ? $_REQUEST['poster'] : '';
$unreleased = isset($_REQUEST['unreleased']) ? $_REQUEST['unreleased'] : '';
$matchagainstbins = isset($_REQUEST['matchagainstbins']) ? $_REQUEST['matchagainstbins'] : '';
$numarticles = isset($_REQUEST['numarticles']) && !empty($_REQUEST['numarticles']) ? $_REQUEST['numarticles'] : $numarticlesdefault;
$clearexistingbins = isset($_REQUEST['clearexistingbins']) ? true : false;
foreach ($groupList as $grp) {
$gid[$grp["ID"]] = $grp["ID"];
$gnames[$grp["ID"]] = $grp["name"];
}
$group = $groupname;
示例6: groups
/**
* List groups
*
* @access public
* @param void
* @return null
*/
function groups()
{
if (!logged_user()->isCompanyAdmin(owner_company())) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
// if
tpl_assign('groups', Groups::getAll());
}
示例7: Groups
<?php
require_once WWW_DIR . "/lib/groups.php";
$groups = new Groups();
if (!$users->isLoggedIn()) {
$page->show403();
}
$ordering = array('updated_desc', 'updated_asc', 'name_desc', 'name_asc', 'releases_desc', 'releases_asc', 'description_desc', 'description_asc');
foreach ($ordering as $ordertype) {
$page->smarty->assign('orderby' . $ordertype, WWW_TOP . "/browsegroup?ob=" . $ordertype);
}
$orderby = isset($_REQUEST["ob"]) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST["ob"] : '';
$grouplist = $groups->getAll($orderby);
$page->smarty->assign('results', $grouplist);
$page->meta_title = "Browse Groups";
$page->meta_keywords = "browse,groups,description,details";
$page->meta_description = "Browse groups";
$page->content = $page->smarty->fetch('browsegroup.tpl');
$page->render();